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 * Provides a button component. 23 * 24 * @enum { number } 25 * @syscap SystemCapability.ArkUI.ArkUI.Full 26 * @since 7 27 */ 28/** 29 * Provides a button component. 30 * 31 * @enum { number } 32 * @syscap SystemCapability.ArkUI.ArkUI.Full 33 * @form 34 * @since 9 35 */ 36/** 37 * Provides a button component. 38 * 39 * @enum { number } 40 * @syscap SystemCapability.ArkUI.ArkUI.Full 41 * @crossplatform 42 * @form 43 * @since 10 44 */ 45/** 46 * Provides a button component. 47 * 48 * @enum { number } 49 * @syscap SystemCapability.ArkUI.ArkUI.Full 50 * @crossplatform 51 * @form 52 * @atomicservice 53 * @since 11 54 */ 55declare enum ButtonType { 56 /** 57 * Capsule button (rounded corners default to half the height). 58 * 59 * @syscap SystemCapability.ArkUI.ArkUI.Full 60 * @since 7 61 */ 62 /** 63 * Capsule button (rounded corners default to half the height). 64 * 65 * @syscap SystemCapability.ArkUI.ArkUI.Full 66 * @form 67 * @since 9 68 */ 69 /** 70 * Capsule button (rounded corners default to half the height). 71 * 72 * @syscap SystemCapability.ArkUI.ArkUI.Full 73 * @crossplatform 74 * @form 75 * @since 10 76 */ 77 /** 78 * Capsule button (rounded corners default to half the height). 79 * 80 * @syscap SystemCapability.ArkUI.ArkUI.Full 81 * @crossplatform 82 * @form 83 * @atomicservice 84 * @since 11 85 */ 86 Capsule, 87 88 /** 89 * Round buttons. 90 * 91 * @syscap SystemCapability.ArkUI.ArkUI.Full 92 * @since 7 93 */ 94 /** 95 * Round buttons. 96 * 97 * @syscap SystemCapability.ArkUI.ArkUI.Full 98 * @form 99 * @since 9 100 */ 101 /** 102 * Round buttons. 103 * 104 * @syscap SystemCapability.ArkUI.ArkUI.Full 105 * @crossplatform 106 * @form 107 * @since 10 108 */ 109 /** 110 * Round buttons. 111 * 112 * @syscap SystemCapability.ArkUI.ArkUI.Full 113 * @crossplatform 114 * @form 115 * @atomicservice 116 * @since 11 117 */ 118 Circle, 119 120 /** 121 * Common button (no rounded corners by default). 122 * 123 * @syscap SystemCapability.ArkUI.ArkUI.Full 124 * @since 7 125 */ 126 /** 127 * Common button (no rounded corners by default). 128 * 129 * @syscap SystemCapability.ArkUI.ArkUI.Full 130 * @form 131 * @since 9 132 */ 133 /** 134 * Common button (no rounded corners by default). 135 * 136 * @syscap SystemCapability.ArkUI.ArkUI.Full 137 * @crossplatform 138 * @form 139 * @since 10 140 */ 141 /** 142 * Common button (no rounded corners by default). 143 * 144 * @syscap SystemCapability.ArkUI.ArkUI.Full 145 * @crossplatform 146 * @form 147 * @atomicservice 148 * @since 11 149 */ 150 Normal, 151 152 /** 153 * Rounded rectangle button. 154 * 155 * @syscap SystemCapability.ArkUI.ArkUI.Full 156 * @crossplatform 157 * @form 158 * @atomicservice 159 * @since 13 160 */ 161 ROUNDED_RECTANGLE = 3, 162} 163 164/** 165 * Enum for button style type. 166 * 167 * @enum { number } 168 * @syscap SystemCapability.ArkUI.ArkUI.Full 169 * @crossplatform 170 * @form 171 * @since 11 172 */ 173/** 174 * Enum for button style type. 175 * 176 * @enum { number } 177 * @syscap SystemCapability.ArkUI.ArkUI.Full 178 * @crossplatform 179 * @form 180 * @atomicservice 181 * @since 12 182 */ 183declare enum ButtonStyleMode { 184 /** 185 * Normal button (with normal background color). 186 * 187 * @syscap SystemCapability.ArkUI.ArkUI.Full 188 * @crossplatform 189 * @form 190 * @since 11 191 */ 192 /** 193 * Normal button (with normal background color). 194 * 195 * @syscap SystemCapability.ArkUI.ArkUI.Full 196 * @crossplatform 197 * @form 198 * @atomicservice 199 * @since 12 200 */ 201 NORMAL = 0, 202 203 /** 204 * Emphasized button (with emphasized background color). 205 * 206 * @syscap SystemCapability.ArkUI.ArkUI.Full 207 * @crossplatform 208 * @form 209 * @since 11 210 */ 211 /** 212 * Emphasized button (with emphasized background color). 213 * 214 * @syscap SystemCapability.ArkUI.ArkUI.Full 215 * @crossplatform 216 * @form 217 * @atomicservice 218 * @since 12 219 */ 220 EMPHASIZED = 1, 221 222 /** 223 * Textual button (with none background color). 224 * 225 * @syscap SystemCapability.ArkUI.ArkUI.Full 226 * @crossplatform 227 * @form 228 * @since 11 229 */ 230 /** 231 * Textual button (with none background color). 232 * 233 * @syscap SystemCapability.ArkUI.ArkUI.Full 234 * @crossplatform 235 * @form 236 * @atomicservice 237 * @since 12 238 */ 239 TEXTUAL = 2, 240} 241 242/** 243 * Enum for button role. 244 * 245 * @enum { number } 246 * @syscap SystemCapability.ArkUI.ArkUI.Full 247 * @crossplatform 248 * @form 249 * @atomicservice 250 * @since 12 251 */ 252declare enum ButtonRole { 253 /** 254 * Normal button. 255 * 256 * @syscap SystemCapability.ArkUI.ArkUI.Full 257 * @crossplatform 258 * @form 259 * @atomicservice 260 * @since 12 261 */ 262 NORMAL = 0, 263 264 /** 265 * Error button. 266 * 267 * @syscap SystemCapability.ArkUI.ArkUI.Full 268 * @crossplatform 269 * @form 270 * @atomicservice 271 * @since 12 272 */ 273 ERROR = 1, 274} 275 276/** 277 * Defines the callback type used in ButtonConfiguration. 278 * 279 * @typedef {function} ButtonTriggerClickCallback 280 * @param { number } xPos - The value of xPos is x coordinate. 281 * @param { number } yPos - The value of yPos is y coordinate. 282 * @syscap SystemCapability.ArkUI.ArkUI.Full 283 * @crossplatform 284 * @atomicservice 285 * @since 12 286 */ 287declare type ButtonTriggerClickCallback = (xPos: number, yPos: number) => void; 288 289/** 290 * ButtonConfiguration used by button content modifier. 291 * 292 * @interface ButtonConfiguration 293 * @syscap SystemCapability.ArkUI.ArkUI.Full 294 * @crossplatform 295 * @atomicservice 296 * @since 12 297 */ 298 299declare interface ButtonConfiguration extends CommonConfiguration<ButtonConfiguration> { 300 /** 301 * Button with inner text label. 302 * 303 * @type { string } 304 * @syscap SystemCapability.ArkUI.ArkUI.Full 305 * @crossplatform 306 * @atomicservice 307 * @since 12 308 */ 309 label: string; 310 311 /** 312 * Indicates whether the button is pressed. 313 * 314 * @type { boolean } 315 * @syscap SystemCapability.ArkUI.ArkUI.Full 316 * @crossplatform 317 * @atomicservice 318 * @since 12 319 */ 320 pressed: boolean; 321 322 /** 323 * Trigger button click x coordinate and y coordinate. 324 * 325 * @type { ButtonTriggerClickCallback } 326 * @syscap SystemCapability.ArkUI.ArkUI.Full 327 * @crossplatform 328 * @atomicservice 329 * @since 12 330 */ 331 triggerClick: ButtonTriggerClickCallback; 332} 333 334/** 335 * Enum for Control Size. 336 * 337 * @enum { string } 338 * @syscap SystemCapability.ArkUI.ArkUI.Full 339 * @crossplatform 340 * @form 341 * @since 11 342 */ 343/** 344 * Enum for Control Size. 345 * 346 * @enum { string } 347 * @syscap SystemCapability.ArkUI.ArkUI.Full 348 * @crossplatform 349 * @form 350 * @atomicservice 351 * @since 12 352 */ 353declare enum ControlSize { 354 /** 355 * The component size is small. 356 * 357 * @syscap SystemCapability.ArkUI.ArkUI.Full 358 * @crossplatform 359 * @form 360 * @since 11 361 */ 362 /** 363 * The component size is small. 364 * 365 * @syscap SystemCapability.ArkUI.ArkUI.Full 366 * @crossplatform 367 * @form 368 * @atomicservice 369 * @since 12 370 */ 371 SMALL = 'small', 372 373 /** 374 * The component size is normal. 375 * 376 * @syscap SystemCapability.ArkUI.ArkUI.Full 377 * @crossplatform 378 * @form 379 * @since 11 380 */ 381 /** 382 * The component size is normal. 383 * 384 * @syscap SystemCapability.ArkUI.ArkUI.Full 385 * @crossplatform 386 * @form 387 * @atomicservice 388 * @since 12 389 */ 390 NORMAL = 'normal', 391} 392 393/** 394 * Defines the button options. 395 * 396 * @interface ButtonOptions 397 * @syscap SystemCapability.ArkUI.ArkUI.Full 398 * @since 7 399 */ 400/** 401 * Defines the button options. 402 * 403 * @interface ButtonOptions 404 * @syscap SystemCapability.ArkUI.ArkUI.Full 405 * @form 406 * @since 9 407 */ 408/** 409 * Defines the button options. 410 * 411 * @interface ButtonOptions 412 * @syscap SystemCapability.ArkUI.ArkUI.Full 413 * @crossplatform 414 * @form 415 * @since 10 416 */ 417/** 418 * Defines the button options. 419 * 420 * @interface ButtonOptions 421 * @syscap SystemCapability.ArkUI.ArkUI.Full 422 * @crossplatform 423 * @form 424 * @atomicservice 425 * @since 11 426 */ 427declare interface ButtonOptions { 428 /** 429 * Describes the button style. 430 * 431 * @type { ?ButtonType } 432 * @syscap SystemCapability.ArkUI.ArkUI.Full 433 * @since 7 434 */ 435 /** 436 * Describes the button style. 437 * 438 * @type { ?ButtonType } 439 * @syscap SystemCapability.ArkUI.ArkUI.Full 440 * @form 441 * @since 9 442 */ 443 /** 444 * Describes the button style. 445 * 446 * @type { ?ButtonType } 447 * @syscap SystemCapability.ArkUI.ArkUI.Full 448 * @crossplatform 449 * @form 450 * @since 10 451 */ 452 /** 453 * Describes the button style. 454 * 455 * @type { ?ButtonType } 456 * @syscap SystemCapability.ArkUI.ArkUI.Full 457 * @crossplatform 458 * @form 459 * @atomicservice 460 * @since 11 461 */ 462 type?: ButtonType; 463 464 /** 465 * Indicates whether to enable the switchover effect when the button is pressed. When the status is set to false, the switchover effect is disabled. 466 * 467 * @type { ?boolean } 468 * @syscap SystemCapability.ArkUI.ArkUI.Full 469 * @since 7 470 */ 471 /** 472 * Indicates whether to enable the switchover effect when the button is pressed. When the status is set to false, the switchover effect is disabled. 473 * 474 * @type { ?boolean } 475 * @syscap SystemCapability.ArkUI.ArkUI.Full 476 * @form 477 * @since 9 478 */ 479 /** 480 * Indicates whether to enable the switchover effect when the button is pressed. When the status is set to false, the switchover effect is disabled. 481 * 482 * @type { ?boolean } 483 * @syscap SystemCapability.ArkUI.ArkUI.Full 484 * @crossplatform 485 * @form 486 * @since 10 487 */ 488 /** 489 * Indicates whether to enable the switchover effect when the button is pressed. When the status is set to false, the switchover effect is disabled. 490 * 491 * @type { ?boolean } 492 * @syscap SystemCapability.ArkUI.ArkUI.Full 493 * @crossplatform 494 * @form 495 * @atomicservice 496 * @since 11 497 */ 498 stateEffect?: boolean; 499 500 /** 501 * Describes the button style. 502 * 503 * @type { ?ButtonStyleMode } 504 * @default ButtonStyleMode.EMPHASIZED 505 * @syscap SystemCapability.ArkUI.ArkUI.Full 506 * @crossplatform 507 * @form 508 * @since 11 509 */ 510 /** 511 * Describes the button style. 512 * 513 * @type { ?ButtonStyleMode } 514 * @default ButtonStyleMode.EMPHASIZED 515 * @syscap SystemCapability.ArkUI.ArkUI.Full 516 * @crossplatform 517 * @form 518 * @atomicservice 519 * @since 12 520 */ 521 buttonStyle?: ButtonStyleMode; 522 523 /** 524 * Describes the button size. 525 * 526 * @type { ?ControlSize } 527 * @default ControlSize.NORMAL 528 * @syscap SystemCapability.ArkUI.ArkUI.Full 529 * @crossplatform 530 * @form 531 * @since 11 532 */ 533 /** 534 * Describes the button size. 535 * 536 * @type { ?ControlSize } 537 * @default ControlSize.NORMAL 538 * @syscap SystemCapability.ArkUI.ArkUI.Full 539 * @crossplatform 540 * @form 541 * @atomicservice 542 * @since 12 543 */ 544 controlSize?: ControlSize; 545 546 /** 547 * Describes the button role. 548 * 549 * @type { ?ButtonRole } 550 * @default ButtonRole.NORMAL 551 * @syscap SystemCapability.ArkUI.ArkUI.Full 552 * @crossplatform 553 * @form 554 * @atomicservice 555 * @since 12 556 */ 557 role?: ButtonRole; 558} 559 560/** 561 * Defines the Button Component. 562 * 563 * @interface ButtonInterface 564 * @syscap SystemCapability.ArkUI.ArkUI.Full 565 * @since 7 566 */ 567/** 568 * Defines the Button Component. 569 * 570 * @interface ButtonInterface 571 * @syscap SystemCapability.ArkUI.ArkUI.Full 572 * @form 573 * @since 9 574 */ 575/** 576 * Defines the Button Component. 577 * 578 * @interface ButtonInterface 579 * @syscap SystemCapability.ArkUI.ArkUI.Full 580 * @crossplatform 581 * @form 582 * @since 10 583 */ 584/** 585 * Defines the Button Component. 586 * 587 * @interface ButtonInterface 588 * @syscap SystemCapability.ArkUI.ArkUI.Full 589 * @crossplatform 590 * @form 591 * @atomicservice 592 * @since 11 593 */ 594interface ButtonInterface { 595 /** 596 * Button object 597 * 598 * @returns { ButtonAttribute } 599 * @syscap SystemCapability.ArkUI.ArkUI.Full 600 * @since 7 601 */ 602 /** 603 * Button object 604 * 605 * @returns { ButtonAttribute } 606 * @syscap SystemCapability.ArkUI.ArkUI.Full 607 * @form 608 * @since 9 609 */ 610 /** 611 * Button object 612 * 613 * @returns { ButtonAttribute } 614 * @syscap SystemCapability.ArkUI.ArkUI.Full 615 * @crossplatform 616 * @form 617 * @since 10 618 */ 619 /** 620 * Button object 621 * 622 * @returns { ButtonAttribute } 623 * @syscap SystemCapability.ArkUI.ArkUI.Full 624 * @crossplatform 625 * @form 626 * @atomicservice 627 * @since 11 628 */ 629 (): ButtonAttribute; 630 631 /** 632 * Create Button with Text child. 633 * 634 * @param { ButtonOptions } options 635 * @returns { ButtonAttribute } 636 * @syscap SystemCapability.ArkUI.ArkUI.Full 637 * @since 7 638 */ 639 /** 640 * Create Button with Text child. 641 * 642 * @param { ButtonOptions } options 643 * @returns { ButtonAttribute } 644 * @syscap SystemCapability.ArkUI.ArkUI.Full 645 * @form 646 * @since 9 647 */ 648 /** 649 * Create Button with Text child. 650 * 651 * @param { ButtonOptions } options 652 * @returns { ButtonAttribute } 653 * @syscap SystemCapability.ArkUI.ArkUI.Full 654 * @crossplatform 655 * @form 656 * @since 10 657 */ 658 /** 659 * Create Button with Text child. 660 * 661 * @param { ButtonOptions } options 662 * @returns { ButtonAttribute } 663 * @syscap SystemCapability.ArkUI.ArkUI.Full 664 * @crossplatform 665 * @form 666 * @atomicservice 667 * @since 11 668 */ 669 (options: ButtonOptions): ButtonAttribute; 670 671 /** 672 * Create Button with inner text label. 673 * 674 * @param { ResourceStr } label 675 * @param { ButtonOptions } options 676 * @returns { ButtonAttribute } 677 * @syscap SystemCapability.ArkUI.ArkUI.Full 678 * @since 7 679 */ 680 /** 681 * Create Button with inner text label. 682 * 683 * @param { ResourceStr } label 684 * @param { ButtonOptions } options 685 * @returns { ButtonAttribute } 686 * @syscap SystemCapability.ArkUI.ArkUI.Full 687 * @form 688 * @since 9 689 */ 690 /** 691 * Create Button with inner text label. 692 * 693 * @param { ResourceStr } label 694 * @param { ButtonOptions } options 695 * @returns { ButtonAttribute } 696 * @syscap SystemCapability.ArkUI.ArkUI.Full 697 * @crossplatform 698 * @form 699 * @since 10 700 */ 701 /** 702 * Create Button with inner text label. 703 * 704 * @param { ResourceStr } label 705 * @param { ButtonOptions } options 706 * @returns { ButtonAttribute } 707 * @syscap SystemCapability.ArkUI.ArkUI.Full 708 * @crossplatform 709 * @form 710 * @atomicservice 711 * @since 11 712 */ 713 (label: ResourceStr, options?: ButtonOptions): ButtonAttribute; 714} 715 716/** 717 * LabelStyle object. 718 * 719 * @interface LabelStyle 720 * @syscap SystemCapability.ArkUI.ArkUI.Full 721 * @crossplatform 722 * @since 10 723 */ 724/** 725 * LabelStyle object. 726 * 727 * @interface LabelStyle 728 * @syscap SystemCapability.ArkUI.ArkUI.Full 729 * @crossplatform 730 * @atomicservice 731 * @since 11 732 */ 733declare interface LabelStyle { 734 /** 735 * overflow mode. 736 * 737 * @type { ?TextOverflow } 738 * @syscap SystemCapability.ArkUI.ArkUI.Full 739 * @crossplatform 740 * @since 10 741 */ 742 /** 743 * overflow mode. 744 * 745 * @type { ?TextOverflow } 746 * @syscap SystemCapability.ArkUI.ArkUI.Full 747 * @crossplatform 748 * @atomicservice 749 * @since 11 750 */ 751 overflow?: TextOverflow; 752 753 /** 754 * Label max lines. 755 * 756 * @type { ?number } 757 * @syscap SystemCapability.ArkUI.ArkUI.Full 758 * @crossplatform 759 * @since 10 760 */ 761 /** 762 * Label max lines. 763 * 764 * @type { ?number } 765 * @syscap SystemCapability.ArkUI.ArkUI.Full 766 * @crossplatform 767 * @atomicservice 768 * @since 11 769 */ 770 maxLines?: number; 771 772 /** 773 * Min font size for adapted height. 774 * 775 * @type { ?(number | ResourceStr) } 776 * @syscap SystemCapability.ArkUI.ArkUI.Full 777 * @crossplatform 778 * @since 10 779 */ 780 /** 781 * Min font size for adapted height. 782 * 783 * @type { ?(number | ResourceStr) } 784 * @syscap SystemCapability.ArkUI.ArkUI.Full 785 * @crossplatform 786 * @atomicservice 787 * @since 11 788 */ 789 minFontSize?: number | ResourceStr; 790 791 /** 792 * Max font size for adapted height. 793 * 794 * @type { ?(number | ResourceStr) } 795 * @syscap SystemCapability.ArkUI.ArkUI.Full 796 * @crossplatform 797 * @since 10 798 */ 799 /** 800 * Max font size for adapted height. 801 * 802 * @type { ?(number | ResourceStr) } 803 * @syscap SystemCapability.ArkUI.ArkUI.Full 804 * @crossplatform 805 * @atomicservice 806 * @since 11 807 */ 808 maxFontSize?: number | ResourceStr; 809 810 /** 811 * Adapt text height option. 812 * 813 * @type { ?TextHeightAdaptivePolicy } 814 * @syscap SystemCapability.ArkUI.ArkUI.Full 815 * @crossplatform 816 * @since 10 817 */ 818 /** 819 * Adapt text height option. 820 * 821 * @type { ?TextHeightAdaptivePolicy } 822 * @syscap SystemCapability.ArkUI.ArkUI.Full 823 * @crossplatform 824 * @atomicservice 825 * @since 11 826 */ 827 heightAdaptivePolicy?: TextHeightAdaptivePolicy; 828 829 /** 830 * Font style. 831 * 832 * @type { ?Font } 833 * @syscap SystemCapability.ArkUI.ArkUI.Full 834 * @crossplatform 835 * @since 10 836 */ 837 /** 838 * Font style. 839 * 840 * @type { ?Font } 841 * @syscap SystemCapability.ArkUI.ArkUI.Full 842 * @crossplatform 843 * @atomicservice 844 * @since 11 845 */ 846 font?: Font; 847} 848 849/** 850 * Defines the button attribute functions. 851 * 852 * @extends CommonMethod<ButtonAttribute> 853 * @syscap SystemCapability.ArkUI.ArkUI.Full 854 * @since 7 855 */ 856/** 857 * Defines the button attribute functions. 858 * 859 * @extends CommonMethod<ButtonAttribute> 860 * @syscap SystemCapability.ArkUI.ArkUI.Full 861 * @form 862 * @since 9 863 */ 864/** 865 * Defines the button attribute functions. 866 * 867 * @extends CommonMethod<ButtonAttribute> 868 * @syscap SystemCapability.ArkUI.ArkUI.Full 869 * @crossplatform 870 * @form 871 * @since 10 872 */ 873/** 874 * Defines the button attribute functions. 875 * 876 * @extends CommonMethod<ButtonAttribute> 877 * @syscap SystemCapability.ArkUI.ArkUI.Full 878 * @crossplatform 879 * @form 880 * @atomicservice 881 * @since 11 882 */ 883declare class ButtonAttribute extends CommonMethod<ButtonAttribute> { 884 /** 885 * Describes the button style. 886 * 887 * @param { ButtonType } value 888 * @returns { ButtonAttribute } 889 * @syscap SystemCapability.ArkUI.ArkUI.Full 890 * @since 7 891 */ 892 /** 893 * Describes the button style. 894 * 895 * @param { ButtonType } value 896 * @returns { ButtonAttribute } 897 * @syscap SystemCapability.ArkUI.ArkUI.Full 898 * @form 899 * @since 9 900 */ 901 /** 902 * Describes the button style. 903 * 904 * @param { ButtonType } value 905 * @returns { ButtonAttribute } 906 * @syscap SystemCapability.ArkUI.ArkUI.Full 907 * @crossplatform 908 * @form 909 * @since 10 910 */ 911 /** 912 * Describes the button style. 913 * 914 * @param { ButtonType } value 915 * @returns { ButtonAttribute } 916 * @syscap SystemCapability.ArkUI.ArkUI.Full 917 * @crossplatform 918 * @form 919 * @atomicservice 920 * @since 11 921 */ 922 type(value: ButtonType): ButtonAttribute; 923 924 /** 925 * Indicates whether to enable the switchover effect when the button is pressed. When the status is set to false, the switchover effect is disabled. 926 * 927 * @param { boolean } value 928 * @returns { ButtonAttribute } 929 * @syscap SystemCapability.ArkUI.ArkUI.Full 930 * @since 7 931 */ 932 /** 933 * Indicates whether to enable the switchover effect when the button is pressed. When the status is set to false, the switchover effect is disabled. 934 * 935 * @param { boolean } value 936 * @returns { ButtonAttribute } 937 * @syscap SystemCapability.ArkUI.ArkUI.Full 938 * @form 939 * @since 9 940 */ 941 /** 942 * Indicates whether to enable the switchover effect when the button is pressed. When the status is set to false, the switchover effect is disabled. 943 * 944 * @param { boolean } value 945 * @returns { ButtonAttribute } 946 * @syscap SystemCapability.ArkUI.ArkUI.Full 947 * @crossplatform 948 * @form 949 * @since 10 950 */ 951 /** 952 * Indicates whether to enable the switchover effect when the button is pressed. When the status is set to false, the switchover effect is disabled. 953 * 954 * @param { boolean } value 955 * @returns { ButtonAttribute } 956 * @syscap SystemCapability.ArkUI.ArkUI.Full 957 * @crossplatform 958 * @form 959 * @atomicservice 960 * @since 11 961 */ 962 stateEffect(value: boolean): ButtonAttribute; 963 964 /** 965 * Describes the button style. 966 * 967 * @param { ButtonStyleMode } value - button style mode 968 * @returns { ButtonAttribute } 969 * @syscap SystemCapability.ArkUI.ArkUI.Full 970 * @crossplatform 971 * @form 972 * @since 11 973 */ 974 /** 975 * Describes the button style. 976 * 977 * @param { ButtonStyleMode } value - button style mode 978 * @returns { ButtonAttribute } 979 * @syscap SystemCapability.ArkUI.ArkUI.Full 980 * @crossplatform 981 * @form 982 * @atomicservice 983 * @since 12 984 */ 985 buttonStyle(value: ButtonStyleMode): ButtonAttribute; 986 987 /** 988 * Set the Button size. 989 * 990 * @param { ControlSize } value - control size 991 * @returns { ButtonAttribute } 992 * @syscap SystemCapability.ArkUI.ArkUI.Full 993 * @crossplatform 994 * @form 995 * @since 11 996 */ 997 /** 998 * Set the Button size. 999 * 1000 * @param { ControlSize } value - control size 1001 * @returns { ButtonAttribute } 1002 * @syscap SystemCapability.ArkUI.ArkUI.Full 1003 * @crossplatform 1004 * @form 1005 * @atomicservice 1006 * @since 12 1007 */ 1008 controlSize(value: ControlSize): ButtonAttribute; 1009 1010 /** 1011 * Set the Button role. 1012 * 1013 * @param { ButtonRole } value - button role 1014 * @returns { ButtonAttribute } 1015 * @syscap SystemCapability.ArkUI.ArkUI.Full 1016 * @crossplatform 1017 * @form 1018 * @atomicservice 1019 * @since 12 1020 */ 1021 role(value: ButtonRole): ButtonAttribute; 1022 1023 /** 1024 * Text color. 1025 * 1026 * @param { ResourceColor } value 1027 * @returns { ButtonAttribute } 1028 * @syscap SystemCapability.ArkUI.ArkUI.Full 1029 * @since 7 1030 */ 1031 /** 1032 * Text color. 1033 * 1034 * @param { ResourceColor } value 1035 * @returns { ButtonAttribute } 1036 * @syscap SystemCapability.ArkUI.ArkUI.Full 1037 * @form 1038 * @since 9 1039 */ 1040 /** 1041 * Text color. 1042 * 1043 * @param { ResourceColor } value 1044 * @returns { ButtonAttribute } 1045 * @syscap SystemCapability.ArkUI.ArkUI.Full 1046 * @crossplatform 1047 * @form 1048 * @since 10 1049 */ 1050 /** 1051 * Text color. 1052 * 1053 * @param { ResourceColor } value 1054 * @returns { ButtonAttribute } 1055 * @syscap SystemCapability.ArkUI.ArkUI.Full 1056 * @crossplatform 1057 * @form 1058 * @atomicservice 1059 * @since 11 1060 */ 1061 fontColor(value: ResourceColor): ButtonAttribute; 1062 1063 /** 1064 * Text size. 1065 * 1066 * @param { Length } value 1067 * @returns { ButtonAttribute } 1068 * @syscap SystemCapability.ArkUI.ArkUI.Full 1069 * @since 7 1070 */ 1071 /** 1072 * Text size. 1073 * 1074 * @param { Length } value 1075 * @returns { ButtonAttribute } 1076 * @syscap SystemCapability.ArkUI.ArkUI.Full 1077 * @form 1078 * @since 9 1079 */ 1080 /** 1081 * Text size. 1082 * 1083 * @param { Length } value 1084 * @returns { ButtonAttribute } 1085 * @syscap SystemCapability.ArkUI.ArkUI.Full 1086 * @crossplatform 1087 * @form 1088 * @since 10 1089 */ 1090 /** 1091 * Text size. 1092 * 1093 * @param { Length } value 1094 * @returns { ButtonAttribute } 1095 * @syscap SystemCapability.ArkUI.ArkUI.Full 1096 * @crossplatform 1097 * @form 1098 * @atomicservice 1099 * @since 11 1100 */ 1101 fontSize(value: Length): ButtonAttribute; 1102 1103 /** 1104 * Font weight. 1105 * 1106 * @param { number | FontWeight | string } value 1107 * @returns { ButtonAttribute } 1108 * @syscap SystemCapability.ArkUI.ArkUI.Full 1109 * @since 7 1110 */ 1111 /** 1112 * Font weight. 1113 * 1114 * @param { number | FontWeight | string } value 1115 * @returns { ButtonAttribute } 1116 * @syscap SystemCapability.ArkUI.ArkUI.Full 1117 * @form 1118 * @since 9 1119 */ 1120 /** 1121 * Font weight. 1122 * 1123 * @param { number | FontWeight | string } value 1124 * @returns { ButtonAttribute } 1125 * @syscap SystemCapability.ArkUI.ArkUI.Full 1126 * @crossplatform 1127 * @form 1128 * @since 10 1129 */ 1130 /** 1131 * Font weight. 1132 * 1133 * @param { number | FontWeight | string } value 1134 * @returns { ButtonAttribute } 1135 * @syscap SystemCapability.ArkUI.ArkUI.Full 1136 * @crossplatform 1137 * @form 1138 * @atomicservice 1139 * @since 11 1140 */ 1141 fontWeight(value: number | FontWeight | string): ButtonAttribute; 1142 1143 /** 1144 * Font style. 1145 * 1146 * @param { FontStyle } value 1147 * @returns { ButtonAttribute } 1148 * @syscap SystemCapability.ArkUI.ArkUI.Full 1149 * @since 8 1150 */ 1151 /** 1152 * Font style. 1153 * 1154 * @param { FontStyle } value 1155 * @returns { ButtonAttribute } 1156 * @syscap SystemCapability.ArkUI.ArkUI.Full 1157 * @form 1158 * @since 9 1159 */ 1160 /** 1161 * Font style. 1162 * 1163 * @param { FontStyle } value 1164 * @returns { ButtonAttribute } 1165 * @syscap SystemCapability.ArkUI.ArkUI.Full 1166 * @crossplatform 1167 * @form 1168 * @since 10 1169 */ 1170 /** 1171 * Font style. 1172 * 1173 * @param { FontStyle } value 1174 * @returns { ButtonAttribute } 1175 * @syscap SystemCapability.ArkUI.ArkUI.Full 1176 * @crossplatform 1177 * @form 1178 * @atomicservice 1179 * @since 11 1180 */ 1181 fontStyle(value: FontStyle): ButtonAttribute; 1182 1183 /** 1184 * Font family. 1185 * 1186 * @param { string | Resource } value 1187 * @returns { ButtonAttribute } 1188 * @syscap SystemCapability.ArkUI.ArkUI.Full 1189 * @since 8 1190 */ 1191 /** 1192 * Font family. 1193 * 1194 * @param { string | Resource } value 1195 * @returns { ButtonAttribute } 1196 * @syscap SystemCapability.ArkUI.ArkUI.Full 1197 * @form 1198 * @since 9 1199 */ 1200 /** 1201 * Font family. 1202 * 1203 * @param { string | Resource } value 1204 * @returns { ButtonAttribute } 1205 * @syscap SystemCapability.ArkUI.ArkUI.Full 1206 * @crossplatform 1207 * @form 1208 * @since 10 1209 */ 1210 /** 1211 * Font family. 1212 * 1213 * @param { string | Resource } value 1214 * @returns { ButtonAttribute } 1215 * @syscap SystemCapability.ArkUI.ArkUI.Full 1216 * @crossplatform 1217 * @form 1218 * @atomicservice 1219 * @since 11 1220 */ 1221 fontFamily(value: string | Resource): ButtonAttribute; 1222 1223 /** 1224 * Set the content modifier of button. 1225 * 1226 * @param { ContentModifier<ButtonConfiguration> } modifier - The content modifier of button. 1227 * @returns { ButtonAttribute } 1228 * @syscap SystemCapability.ArkUI.ArkUI.Full 1229 * @crossplatform 1230 * @atomicservice 1231 * @since 12 1232 */ 1233 contentModifier(modifier: ContentModifier<ButtonConfiguration>): ButtonAttribute; 1234 1235 /** 1236 * Set button label style. 1237 * 1238 * @param { LabelStyle } value - The label style configuration on button. 1239 * @returns { ButtonAttribute } 1240 * @syscap SystemCapability.ArkUI.ArkUI.Full 1241 * @crossplatform 1242 * @since 10 1243 */ 1244 /** 1245 * Set button label style. 1246 * 1247 * @param { LabelStyle } value - The label style configuration on button. 1248 * @returns { ButtonAttribute } 1249 * @syscap SystemCapability.ArkUI.ArkUI.Full 1250 * @crossplatform 1251 * @atomicservice 1252 * @since 11 1253 */ 1254 labelStyle(value: LabelStyle): ButtonAttribute; 1255} 1256 1257/** 1258 * Defines Button Component. 1259 * 1260 * @syscap SystemCapability.ArkUI.ArkUI.Full 1261 * @since 7 1262 */ 1263/** 1264 * Defines Button Component. 1265 * 1266 * @syscap SystemCapability.ArkUI.ArkUI.Full 1267 * @form 1268 * @since 9 1269 */ 1270/** 1271 * Defines Button Component. 1272 * 1273 * @syscap SystemCapability.ArkUI.ArkUI.Full 1274 * @crossplatform 1275 * @form 1276 * @since 10 1277 */ 1278/** 1279 * Defines Button Component. 1280 * 1281 * @syscap SystemCapability.ArkUI.ArkUI.Full 1282 * @crossplatform 1283 * @form 1284 * @atomicservice 1285 * @since 11 1286 */ 1287declare const Button: ButtonInterface; 1288 1289/** 1290 * Defines Button Component instance. 1291 * 1292 * @syscap SystemCapability.ArkUI.ArkUI.Full 1293 * @since 7 1294 */ 1295/** 1296 * Defines Button Component instance. 1297 * 1298 * @syscap SystemCapability.ArkUI.ArkUI.Full 1299 * @form 1300 * @since 9 1301 */ 1302/** 1303 * Defines Button Component instance. 1304 * 1305 * @syscap SystemCapability.ArkUI.ArkUI.Full 1306 * @crossplatform 1307 * @form 1308 * @since 10 1309 */ 1310/** 1311 * Defines Button Component instance. 1312 * 1313 * @syscap SystemCapability.ArkUI.ArkUI.Full 1314 * @crossplatform 1315 * @form 1316 * @atomicservice 1317 * @since 11 1318 */ 1319declare const ButtonInstance: ButtonAttribute; 1320