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 * Creating an Object 18 * 19 * @enum { number } 20 * @syscap SystemCapability.ArkUI.ArkUI.Full 21 * @since 7 22 */ 23/** 24 * Creating an Object 25 * 26 * @enum { number } 27 * @syscap SystemCapability.ArkUI.ArkUI.Full 28 * @crossplatform 29 * @since 10 30 */ 31declare enum PanDirection { 32 /** 33 * Default. 34 * 35 * @syscap SystemCapability.ArkUI.ArkUI.Full 36 * @since 7 37 */ 38 /** 39 * Default. 40 * 41 * @syscap SystemCapability.ArkUI.ArkUI.Full 42 * @crossplatform 43 * @since 10 44 */ 45 None, 46 47 /** 48 * Sliding horizontally. 49 * 50 * @syscap SystemCapability.ArkUI.ArkUI.Full 51 * @since 7 52 */ 53 /** 54 * Sliding horizontally. 55 * 56 * @syscap SystemCapability.ArkUI.ArkUI.Full 57 * @crossplatform 58 * @since 10 59 */ 60 Horizontal, 61 62 /** 63 * Sliding left. 64 * 65 * @syscap SystemCapability.ArkUI.ArkUI.Full 66 * @since 7 67 */ 68 /** 69 * Sliding left. 70 * 71 * @syscap SystemCapability.ArkUI.ArkUI.Full 72 * @crossplatform 73 * @since 10 74 */ 75 Left, 76 77 /** 78 * Sliding right. 79 * 80 * @syscap SystemCapability.ArkUI.ArkUI.Full 81 * @since 7 82 */ 83 /** 84 * Sliding right. 85 * 86 * @syscap SystemCapability.ArkUI.ArkUI.Full 87 * @crossplatform 88 * @since 10 89 */ 90 Right, 91 92 /** 93 * Sliding Vertical 94 * 95 * @syscap SystemCapability.ArkUI.ArkUI.Full 96 * @since 7 97 */ 98 /** 99 * Sliding Vertical 100 * 101 * @syscap SystemCapability.ArkUI.ArkUI.Full 102 * @crossplatform 103 * @since 10 104 */ 105 Vertical, 106 107 /** 108 * Sliding up. 109 * 110 * @syscap SystemCapability.ArkUI.ArkUI.Full 111 * @since 7 112 */ 113 /** 114 * Sliding up. 115 * 116 * @syscap SystemCapability.ArkUI.ArkUI.Full 117 * @crossplatform 118 * @since 10 119 */ 120 Up, 121 122 /** 123 * Sliding Down. 124 * 125 * @syscap SystemCapability.ArkUI.ArkUI.Full 126 * @since 7 127 */ 128 /** 129 * Sliding Down. 130 * 131 * @syscap SystemCapability.ArkUI.ArkUI.Full 132 * @crossplatform 133 * @since 10 134 */ 135 Down, 136 137 /** 138 * Sliding in all directions. 139 * 140 * @syscap SystemCapability.ArkUI.ArkUI.Full 141 * @since 7 142 */ 143 /** 144 * Sliding in all directions. 145 * 146 * @syscap SystemCapability.ArkUI.ArkUI.Full 147 * @crossplatform 148 * @since 10 149 */ 150 All, 151} 152 153/** 154 * Creating an Object 155 * 156 * @enum { number } 157 * @syscap SystemCapability.ArkUI.ArkUI.Full 158 * @since 8 159 */ 160/** 161 * Creating an Object 162 * 163 * @enum { number } 164 * @syscap SystemCapability.ArkUI.ArkUI.Full 165 * @crossplatform 166 * @since 10 167 */ 168declare enum SwipeDirection { 169 /** 170 * Default. 171 * 172 * @syscap SystemCapability.ArkUI.ArkUI.Full 173 * @since 8 174 */ 175 /** 176 * Default. 177 * 178 * @syscap SystemCapability.ArkUI.ArkUI.Full 179 * @crossplatform 180 * @since 10 181 */ 182 None, 183 184 /** 185 * Sliding horizontally. 186 * 187 * @syscap SystemCapability.ArkUI.ArkUI.Full 188 * @since 8 189 */ 190 /** 191 * Sliding horizontally. 192 * 193 * @syscap SystemCapability.ArkUI.ArkUI.Full 194 * @crossplatform 195 * @since 10 196 */ 197 Horizontal, 198 199 /** 200 * Sliding Vertical 201 * 202 * @syscap SystemCapability.ArkUI.ArkUI.Full 203 * @since 8 204 */ 205 /** 206 * Sliding Vertical 207 * 208 * @syscap SystemCapability.ArkUI.ArkUI.Full 209 * @crossplatform 210 * @since 10 211 */ 212 Vertical, 213 214 /** 215 * Sliding in all directions. 216 * 217 * @syscap SystemCapability.ArkUI.ArkUI.Full 218 * @since 8 219 */ 220 /** 221 * Sliding in all directions. 222 * 223 * @syscap SystemCapability.ArkUI.ArkUI.Full 224 * @crossplatform 225 * @since 10 226 */ 227 All, 228} 229 230/** 231 * Creating an Object 232 * 233 * @enum { number } 234 * @syscap SystemCapability.ArkUI.ArkUI.Full 235 * @since 7 236 */ 237/** 238 * Creating an Object 239 * 240 * @enum { number } 241 * @syscap SystemCapability.ArkUI.ArkUI.Full 242 * @crossplatform 243 * @since 10 244 */ 245declare enum GestureMode { 246 /** 247 * Sequential gesture recognition is performed in sequence according to the gesture registration sequence. 248 * 249 * @syscap SystemCapability.ArkUI.ArkUI.Full 250 * @since 7 251 */ 252 /** 253 * Sequential gesture recognition is performed in sequence according to the gesture registration sequence. 254 * 255 * @syscap SystemCapability.ArkUI.ArkUI.Full 256 * @crossplatform 257 * @since 10 258 */ 259 Sequence, 260 261 /** 262 * Simultaneous recognition. Registration gestures participate in recognition. Everything can be triggered. 263 * 264 * @syscap SystemCapability.ArkUI.ArkUI.Full 265 * @since 7 266 */ 267 /** 268 * Simultaneous recognition. Registration gestures participate in recognition. Everything can be triggered. 269 * 270 * @syscap SystemCapability.ArkUI.ArkUI.Full 271 * @crossplatform 272 * @since 10 273 */ 274 Parallel, 275 276 /** 277 * Mutually exclusive recognition. Only one gesture is successfully recognized. 278 * 279 * @syscap SystemCapability.ArkUI.ArkUI.Full 280 * @since 7 281 */ 282 /** 283 * Mutually exclusive recognition. Only one gesture is successfully recognized. 284 * 285 * @syscap SystemCapability.ArkUI.ArkUI.Full 286 * @crossplatform 287 * @since 10 288 */ 289 Exclusive, 290} 291 292/** 293 * Creating an Object 294 * 295 * @enum { number } 296 * @syscap SystemCapability.ArkUI.ArkUI.Full 297 * @since 7 298 */ 299/** 300 * Creating an Object 301 * 302 * @enum { number } 303 * @syscap SystemCapability.ArkUI.ArkUI.Full 304 * @crossplatform 305 * @since 10 306 */ 307declare enum GestureMask { 308 /** 309 * High-priority response to the current gesture.When the current gesture fails to be recognized, other gesture responses are triggered.For gestures with the same priority, responses are performed based on the recognition sequence. 310 * 311 * @syscap SystemCapability.ArkUI.ArkUI.Full 312 * @since 7 313 */ 314 /** 315 * High-priority response to the current gesture.When the current gesture fails to be recognized, other gesture responses are triggered.For gestures with the same priority, responses are performed based on the recognition sequence. 316 * 317 * @syscap SystemCapability.ArkUI.ArkUI.Full 318 * @crossplatform 319 * @since 10 320 */ 321 Normal, 322 323 /** 324 * Ignore internal gestures and recognize the current gesture first. 325 * 326 * @syscap SystemCapability.ArkUI.ArkUI.Full 327 * @since 7 328 */ 329 /** 330 * Ignore internal gestures and recognize the current gesture first. 331 * 332 * @syscap SystemCapability.ArkUI.ArkUI.Full 333 * @crossplatform 334 * @since 10 335 */ 336 IgnoreInternal, 337} 338 339/** 340 * Type of the finger information. 341 * 342 * @interface FingerInfo 343 * @syscap SystemCapability.ArkUI.ArkUI.Full 344 * @since 8 345 */ 346/** 347 * Type of the finger information. 348 * 349 * @interface FingerInfo 350 * @syscap SystemCapability.ArkUI.ArkUI.Full 351 * @crossplatform 352 * @since 10 353 */ 354interface FingerInfo { 355 /** 356 * Finger unique identifier. 357 * 358 * @type { number } 359 * @syscap SystemCapability.ArkUI.ArkUI.Full 360 * @since 8 361 */ 362 /** 363 * Finger unique identifier. 364 * 365 * @type { number } 366 * @syscap SystemCapability.ArkUI.ArkUI.Full 367 * @crossplatform 368 * @since 10 369 */ 370 id: number; 371 372 /** 373 * X coordinate of the touch point relative to the left edge of the device screen. 374 * 375 * @type { number } 376 * @syscap SystemCapability.ArkUI.ArkUI.Full 377 * @since 8 378 */ 379 /** 380 * X coordinate of the touch point relative to the left edge of the device screen. 381 * 382 * @type { number } 383 * @syscap SystemCapability.ArkUI.ArkUI.Full 384 * @crossplatform 385 * @since 10 386 */ 387 globalX: number; 388 389 /** 390 * The Y coordinate of the touch point relative to the upper edge of the device screen. 391 * 392 * @type { number } 393 * @syscap SystemCapability.ArkUI.ArkUI.Full 394 * @since 8 395 */ 396 /** 397 * The Y coordinate of the touch point relative to the upper edge of the device screen. 398 * 399 * @type { number } 400 * @syscap SystemCapability.ArkUI.ArkUI.Full 401 * @crossplatform 402 * @since 10 403 */ 404 globalY: number; 405 406 /** 407 * X coordinate of the touch point relative to the left edge of the touched element. 408 * 409 * @type { number } 410 * @syscap SystemCapability.ArkUI.ArkUI.Full 411 * @since 8 412 */ 413 /** 414 * X coordinate of the touch point relative to the left edge of the touched element. 415 * 416 * @type { number } 417 * @syscap SystemCapability.ArkUI.ArkUI.Full 418 * @crossplatform 419 * @since 10 420 */ 421 localX: number; 422 423 /** 424 * Y coordinate of the touch point relative to the upper edge of the touched element. 425 * 426 * @type { number } 427 * @syscap SystemCapability.ArkUI.ArkUI.Full 428 * @since 8 429 */ 430 /** 431 * Y coordinate of the touch point relative to the upper edge of the touched element. 432 * 433 * @type { number } 434 * @syscap SystemCapability.ArkUI.ArkUI.Full 435 * @crossplatform 436 * @since 10 437 */ 438 localY: number; 439} 440 441/** 442 * Defines the Gesture Type. 443 * 444 * @syscap SystemCapability.ArkUI.ArkUI.Full 445 * @since 7 446 */ 447/** 448 * Defines the Gesture Type. 449 * 450 * @syscap SystemCapability.ArkUI.ArkUI.Full 451 * @crossplatform 452 * @since 10 453 */ 454declare type GestureType = 455 TapGestureInterface 456 | LongPressGestureInterface 457 | PanGestureInterface 458 | PinchGestureInterface 459 | SwipeGestureInterface 460 | RotationGestureInterface 461 | GestureGroupInterface; 462 463/** 464 * Defines event info for gesture. 465 * 466 * @interface GestureEvent 467 * @syscap SystemCapability.ArkUI.ArkUI.Full 468 * @since 7 469 */ 470/** 471 * Defines event info for gesture. 472 * 473 * @interface GestureEvent 474 * @syscap SystemCapability.ArkUI.ArkUI.Full 475 * @crossplatform 476 * @since 10 477 */ 478interface GestureEvent extends BaseEvent { 479 /** 480 * Indicates whether an event is triggered repeatedly. 481 * Used in LongPressGesture. 482 * 483 * @type { boolean } 484 * @syscap SystemCapability.ArkUI.ArkUI.Full 485 * @since 7 486 */ 487 /** 488 * Indicates whether an event is triggered repeatedly. 489 * Used in LongPressGesture. 490 * 491 * @type { boolean } 492 * @syscap SystemCapability.ArkUI.ArkUI.Full 493 * @crossplatform 494 * @since 10 495 */ 496 repeat: boolean; 497 498 /** 499 * All finger information. 500 * Used in LongPressGesture and TapGesture. 501 * 502 * @type { FingerInfo[] } 503 * @syscap SystemCapability.ArkUI.ArkUI.Full 504 * @since 8 505 */ 506 /** 507 * All finger information. 508 * Used in LongPressGesture and TapGesture. 509 * 510 * @type { FingerInfo[] } 511 * @syscap SystemCapability.ArkUI.ArkUI.Full 512 * @crossplatform 513 * @since 10 514 */ 515 fingerList: FingerInfo[]; 516 517 /** 518 * Gesture event offset X. 519 * The unit is vp. 520 * Used in PanGesture. 521 * 522 * @type { number } 523 * @syscap SystemCapability.ArkUI.ArkUI.Full 524 * @since 7 525 */ 526 /** 527 * Gesture event offset X. 528 * The unit is vp. 529 * Used in PanGesture. 530 * 531 * @type { number } 532 * @syscap SystemCapability.ArkUI.ArkUI.Full 533 * @crossplatform 534 * @since 10 535 */ 536 offsetX: number; 537 538 /** 539 * Gesture event offset Y. 540 * The unit is vp. 541 * Used in PanGesture. 542 * 543 * @type { number } 544 * @syscap SystemCapability.ArkUI.ArkUI.Full 545 * @since 7 546 */ 547 /** 548 * Gesture event offset Y. 549 * The unit is vp. 550 * Used in PanGesture. 551 * 552 * @type { number } 553 * @syscap SystemCapability.ArkUI.ArkUI.Full 554 * @crossplatform 555 * @since 10 556 */ 557 offsetY: number; 558 559 /** 560 * Gesture event direction angle. 561 * The unit is deg. 562 * Used in RotationGesture and SwipeGesture. 563 * 564 * @type { number } 565 * @syscap SystemCapability.ArkUI.ArkUI.Full 566 * @since 7 567 */ 568 /** 569 * Gesture event direction angle. 570 * The unit is deg. 571 * Used in RotationGesture and SwipeGesture. 572 * 573 * @type { number } 574 * @syscap SystemCapability.ArkUI.ArkUI.Full 575 * @crossplatform 576 * @since 10 577 */ 578 angle: number; 579 580 /** 581 * Gesture event slide speed. 582 * The unit is vp. 583 * Used in SwipeGesture. 584 * 585 * @type { number } 586 * @syscap SystemCapability.ArkUI.ArkUI.Full 587 * @since 8 588 */ 589 /** 590 * Gesture event slide speed. 591 * The unit is vp. 592 * Used in SwipeGesture. 593 * 594 * @type { number } 595 * @syscap SystemCapability.ArkUI.ArkUI.Full 596 * @crossplatform 597 * @since 10 598 */ 599 speed: number; 600 601 /** 602 * Scaling ratio. 603 * Used in PinchGesture. 604 * 605 * @type { number } 606 * @syscap SystemCapability.ArkUI.ArkUI.Full 607 * @since 7 608 */ 609 /** 610 * Scaling ratio. 611 * Used in PinchGesture. 612 * 613 * @type { number } 614 * @syscap SystemCapability.ArkUI.ArkUI.Full 615 * @crossplatform 616 * @since 10 617 */ 618 scale: number; 619 620 /** 621 * X-axis coordinate of the kneading center point. 622 * The unit is vp. 623 * Used in PinchGesture. 624 * 625 * @type { number } 626 * @syscap SystemCapability.ArkUI.ArkUI.Full 627 * @since 7 628 */ 629 /** 630 * X-axis coordinate of the kneading center point. 631 * The unit is vp. 632 * Used in PinchGesture. 633 * 634 * @type { number } 635 * @syscap SystemCapability.ArkUI.ArkUI.Full 636 * @crossplatform 637 * @since 10 638 */ 639 pinchCenterX: number; 640 641 /** 642 * Y-axis coordinate of the kneading center point. 643 * The unit is vp. 644 * Used in PinchGesture. 645 * 646 * @type { number } 647 * @syscap SystemCapability.ArkUI.ArkUI.Full 648 * @since 7 649 */ 650 /** 651 * Y-axis coordinate of the kneading center point. 652 * The unit is vp. 653 * Used in PinchGesture. 654 * 655 * @type { number } 656 * @syscap SystemCapability.ArkUI.ArkUI.Full 657 * @crossplatform 658 * @since 10 659 */ 660 pinchCenterY: number; 661 662 /** 663 * X-axis velocity of the gesture. 664 * @type {number} 665 * @syscap SystemCapability.ArkUI.ArkUI.Full 666 * @crossplatform 667 * @since 10 668 */ 669 velocityX: number; 670 671 /** 672 * Y-axis velocity of the gesture. 673 * @type {number} 674 * @syscap SystemCapability.ArkUI.ArkUI.Full 675 * @crossplatform 676 * @since 10 677 */ 678 velocityY: number; 679 680 /** 681 * velocity of the gesture. 682 * @type {number} 683 * @syscap SystemCapability.ArkUI.ArkUI.Full 684 * @crossplatform 685 * @since 10 686 */ 687 velocity: number; 688} 689 690/** 691 * Defines TapGesture interface. 692 * 693 * @interface TapGestureInterface 694 * @syscap SystemCapability.ArkUI.ArkUI.Full 695 * @since 7 696 */ 697/** 698 * Defines TapGesture interface. 699 * 700 * @interface TapGestureInterface 701 * @syscap SystemCapability.ArkUI.ArkUI.Full 702 * @crossplatform 703 * @since 10 704 */ 705interface TapGestureInterface { 706 /** 707 * Set the value. 708 * count:Number of consecutive clicks recognized. If the value is less than 1, the default value is used. 709 * fingers:The hand index that triggers the click. If the value is less than 1, the default value is used. 710 * 711 * @param { object } value 712 * @returns { TapGestureInterface } 713 * @syscap SystemCapability.ArkUI.ArkUI.Full 714 * @since 7 715 */ 716 /** 717 * Set the value. 718 * count:Number of consecutive clicks recognized. If the value is less than 1, the default value is used. 719 * fingers:The hand index that triggers the click. If the value is less than 1, the default value is used. 720 * 721 * @param { object } value 722 * @returns { TapGestureInterface } 723 * @syscap SystemCapability.ArkUI.ArkUI.Full 724 * @crossplatform 725 * @since 10 726 */ 727 (value?: { count?: number; fingers?: number }): TapGestureInterface; 728 729 /** 730 * Tap gesture recognition success callback. 731 * 732 * @param { function } event 733 * @returns { TapGestureInterface } 734 * @syscap SystemCapability.ArkUI.ArkUI.Full 735 * @since 7 736 */ 737 /** 738 * Tap gesture recognition success callback. 739 * 740 * @param { function } event 741 * @returns { TapGestureInterface } 742 * @syscap SystemCapability.ArkUI.ArkUI.Full 743 * @crossplatform 744 * @since 10 745 */ 746 onAction(event: (event: GestureEvent) => void): TapGestureInterface; 747} 748 749/** 750 * Defines LongPressGesture interface. 751 * 752 * @interface LongPressGestureInterface 753 * @syscap SystemCapability.ArkUI.ArkUI.Full 754 * @since 7 755 */ 756/** 757 * Defines LongPressGesture interface. 758 * 759 * @interface LongPressGestureInterface 760 * @syscap SystemCapability.ArkUI.ArkUI.Full 761 * @crossplatform 762 * @since 10 763 */ 764interface LongPressGestureInterface { 765 /** 766 * Set the value. 767 * fingers: Indicates the hand index that triggers the long press. 768 * repeat: Indicates whether to trigger event callback continuously. 769 * duration: Minimum press and hold time, in milliseconds. 770 * 771 * @param { object } value 772 * @returns { LongPressGestureInterface } 773 * @syscap SystemCapability.ArkUI.ArkUI.Full 774 * @since 7 775 */ 776 /** 777 * Set the value. 778 * fingers: Indicates the hand index that triggers the long press. 779 * repeat: Indicates whether to trigger event callback continuously. 780 * duration: Minimum press and hold time, in milliseconds. 781 * 782 * @param { object } value 783 * @returns { LongPressGestureInterface } 784 * @syscap SystemCapability.ArkUI.ArkUI.Full 785 * @crossplatform 786 * @since 10 787 */ 788 (value?: { fingers?: number; repeat?: boolean; duration?: number }): LongPressGestureInterface; 789 790 /** 791 * LongPress gesture recognition success callback. 792 * 793 * @param { function } event 794 * @returns { LongPressGestureInterface } 795 * @syscap SystemCapability.ArkUI.ArkUI.Full 796 * @since 7 797 */ 798 /** 799 * LongPress gesture recognition success callback. 800 * 801 * @param { function } event 802 * @returns { LongPressGestureInterface } 803 * @syscap SystemCapability.ArkUI.ArkUI.Full 804 * @crossplatform 805 * @since 10 806 */ 807 onAction(event: (event: GestureEvent) => void): LongPressGestureInterface; 808 809 /** 810 * The LongPress gesture is successfully recognized. When the finger is lifted, the callback is triggered. 811 * 812 * @param { function } event 813 * @returns { LongPressGestureInterface } 814 * @syscap SystemCapability.ArkUI.ArkUI.Full 815 * @since 7 816 */ 817 /** 818 * The LongPress gesture is successfully recognized. When the finger is lifted, the callback is triggered. 819 * 820 * @param { function } event 821 * @returns { LongPressGestureInterface } 822 * @syscap SystemCapability.ArkUI.ArkUI.Full 823 * @crossplatform 824 * @since 10 825 */ 826 onActionEnd(event: (event: GestureEvent) => void): LongPressGestureInterface; 827 828 /** 829 * The LongPress gesture is successfully recognized and a callback is triggered when the touch cancel event is received. 830 * 831 * @param { function } event 832 * @returns { LongPressGestureInterface } 833 * @syscap SystemCapability.ArkUI.ArkUI.Full 834 * @since 7 835 */ 836 /** 837 * The LongPress gesture is successfully recognized and a callback is triggered when the touch cancel event is received. 838 * 839 * @param { function } event 840 * @returns { LongPressGestureInterface } 841 * @syscap SystemCapability.ArkUI.ArkUI.Full 842 * @crossplatform 843 * @since 10 844 */ 845 onActionCancel(event: () => void): LongPressGestureInterface; 846} 847 848/** 849 * Defines the PanGesture options. 850 * 851 * @syscap SystemCapability.ArkUI.ArkUI.Full 852 * @since 7 853 */ 854/** 855 * Defines the PanGesture options. 856 * 857 * @syscap SystemCapability.ArkUI.ArkUI.Full 858 * @crossplatform 859 * @since 10 860 */ 861declare class PanGestureOptions { 862 /** 863 * Constructor parameters. 864 * 865 * @param { object } value 866 * @syscap SystemCapability.ArkUI.ArkUI.Full 867 * @since 7 868 */ 869 /** 870 * Constructor parameters. 871 * 872 * @param { object } value 873 * @syscap SystemCapability.ArkUI.ArkUI.Full 874 * @crossplatform 875 * @since 10 876 */ 877 constructor(value?: { fingers?: number; direction?: PanDirection; distance?: number }); 878 879 /** 880 * Sets the direction attribute. 881 * 882 * @param { PanDirection } value 883 * @syscap SystemCapability.ArkUI.ArkUI.Full 884 * @since 7 885 */ 886 /** 887 * Sets the direction attribute. 888 * 889 * @param { PanDirection } value 890 * @syscap SystemCapability.ArkUI.ArkUI.Full 891 * @crossplatform 892 * @since 10 893 */ 894 setDirection(value: PanDirection); 895 896 /** 897 * Sets the setDistance attribute. 898 * 899 * @param { number } value 900 * @syscap SystemCapability.ArkUI.ArkUI.Full 901 * @since 7 902 */ 903 /** 904 * Sets the setDistance attribute. 905 * 906 * @param { number } value 907 * @syscap SystemCapability.ArkUI.ArkUI.Full 908 * @crossplatform 909 * @since 10 910 */ 911 setDistance(value: number); 912 913 /** 914 * Sets the setFingers attribute. 915 * 916 * @param { number } value 917 * @syscap SystemCapability.ArkUI.ArkUI.Full 918 * @since 7 919 */ 920 /** 921 * Sets the setFingers attribute. 922 * 923 * @param { number } value 924 * @syscap SystemCapability.ArkUI.ArkUI.Full 925 * @crossplatform 926 * @since 10 927 */ 928 setFingers(value: number); 929} 930 931/** 932 * Defines the PanGesture interface. 933 * 934 * @interface PanGestureInterface 935 * @syscap SystemCapability.ArkUI.ArkUI.Full 936 * @since 7 937 */ 938/** 939 * Defines the PanGesture interface. 940 * 941 * @interface PanGestureInterface 942 * @syscap SystemCapability.ArkUI.ArkUI.Full 943 * @crossplatform 944 * @since 10 945 */ 946interface PanGestureInterface { 947 /** 948 * Set the value. 949 * 950 * @param { { fingers?: number; direction?: PanDirection; distance?: number } | PanGestureOptions } value 951 * @returns { PanGestureInterface } 952 * @syscap SystemCapability.ArkUI.ArkUI.Full 953 * @since 7 954 */ 955 /** 956 * Set the value. 957 * 958 * @param { { fingers?: number; direction?: PanDirection; distance?: number } | PanGestureOptions } value 959 * @returns { PanGestureInterface } 960 * @syscap SystemCapability.ArkUI.ArkUI.Full 961 * @crossplatform 962 * @since 10 963 */ 964 (value?: { fingers?: number; direction?: PanDirection; distance?: number } | PanGestureOptions): PanGestureInterface; 965 966 /** 967 * Pan gesture recognition success callback. 968 * 969 * @param { function } event 970 * @returns { PanGestureInterface } 971 * @syscap SystemCapability.ArkUI.ArkUI.Full 972 * @since 7 973 */ 974 /** 975 * Pan gesture recognition success callback. 976 * 977 * @param { function } event 978 * @returns { PanGestureInterface } 979 * @syscap SystemCapability.ArkUI.ArkUI.Full 980 * @crossplatform 981 * @since 10 982 */ 983 onActionStart(event: (event: GestureEvent) => void): PanGestureInterface; 984 985 /** 986 * Callback when the Pan gesture is moving. 987 * 988 * @param { function } event 989 * @returns { PanGestureInterface } 990 * @syscap SystemCapability.ArkUI.ArkUI.Full 991 * @since 7 992 */ 993 /** 994 * Callback when the Pan gesture is moving. 995 * 996 * @param { function } event 997 * @returns { PanGestureInterface } 998 * @syscap SystemCapability.ArkUI.ArkUI.Full 999 * @crossplatform 1000 * @since 10 1001 */ 1002 onActionUpdate(event: (event: GestureEvent) => void): PanGestureInterface; 1003 1004 /** 1005 * The Pan gesture is successfully recognized. When the finger is lifted, the callback is triggered. 1006 * 1007 * @param { function } event 1008 * @returns { PanGestureInterface } 1009 * @syscap SystemCapability.ArkUI.ArkUI.Full 1010 * @since 7 1011 */ 1012 /** 1013 * The Pan gesture is successfully recognized. When the finger is lifted, the callback is triggered. 1014 * 1015 * @param { function } event 1016 * @returns { PanGestureInterface } 1017 * @syscap SystemCapability.ArkUI.ArkUI.Full 1018 * @crossplatform 1019 * @since 10 1020 */ 1021 onActionEnd(event: (event: GestureEvent) => void): PanGestureInterface; 1022 1023 /** 1024 * The Pan gesture is successfully recognized and a callback is triggered when the touch cancel event is received. 1025 * 1026 * @param { function } event 1027 * @returns { PanGestureInterface } 1028 * @syscap SystemCapability.ArkUI.ArkUI.Full 1029 * @since 7 1030 */ 1031 /** 1032 * The Pan gesture is successfully recognized and a callback is triggered when the touch cancel event is received. 1033 * 1034 * @param { function } event 1035 * @returns { PanGestureInterface } 1036 * @syscap SystemCapability.ArkUI.ArkUI.Full 1037 * @crossplatform 1038 * @since 10 1039 */ 1040 onActionCancel(event: () => void): PanGestureInterface; 1041} 1042 1043/** 1044 * Defines the SwipeGesture interface. 1045 * 1046 * @interface SwipeGestureInterface 1047 * @syscap SystemCapability.ArkUI.ArkUI.Full 1048 * @since 8 1049 */ 1050/** 1051 * Defines the SwipeGesture interface. 1052 * 1053 * @interface SwipeGestureInterface 1054 * @syscap SystemCapability.ArkUI.ArkUI.Full 1055 * @crossplatform 1056 * @since 10 1057 */ 1058interface SwipeGestureInterface { 1059 /** 1060 * Set the value. 1061 * 1062 * @param { object } value 1063 * @returns { SwipeGestureInterface } 1064 * @syscap SystemCapability.ArkUI.ArkUI.Full 1065 * @since 8 1066 */ 1067 /** 1068 * Set the value. 1069 * 1070 * @param { object } value 1071 * @returns { SwipeGestureInterface } 1072 * @syscap SystemCapability.ArkUI.ArkUI.Full 1073 * @crossplatform 1074 * @since 10 1075 */ 1076 (value?: { fingers?: number; direction?: SwipeDirection; speed?: number }): SwipeGestureInterface; 1077 1078 /** 1079 * Slide gesture recognition success callback. 1080 * 1081 * @param { function } event 1082 * @returns { SwipeGestureInterface } 1083 * @syscap SystemCapability.ArkUI.ArkUI.Full 1084 * @since 8 1085 */ 1086 /** 1087 * Slide gesture recognition success callback. 1088 * 1089 * @param { function } event 1090 * @returns { SwipeGestureInterface } 1091 * @syscap SystemCapability.ArkUI.ArkUI.Full 1092 * @crossplatform 1093 * @since 10 1094 */ 1095 onAction(event: (event: GestureEvent) => void): SwipeGestureInterface; 1096} 1097 1098/** 1099 * Defines the PinchGesture interface. 1100 * 1101 * @interface PinchGestureInterface 1102 * @syscap SystemCapability.ArkUI.ArkUI.Full 1103 * @since 7 1104 */ 1105/** 1106 * Defines the PinchGesture interface. 1107 * 1108 * @interface PinchGestureInterface 1109 * @syscap SystemCapability.ArkUI.ArkUI.Full 1110 * @crossplatform 1111 * @since 10 1112 */ 1113interface PinchGestureInterface { 1114 /** 1115 * Set the value. 1116 * 1117 * @param { object } value 1118 * @returns { PinchGestureInterface } 1119 * @syscap SystemCapability.ArkUI.ArkUI.Full 1120 * @since 7 1121 */ 1122 /** 1123 * Set the value. 1124 * 1125 * @param { object } value 1126 * @returns { PinchGestureInterface } 1127 * @syscap SystemCapability.ArkUI.ArkUI.Full 1128 * @crossplatform 1129 * @since 10 1130 */ 1131 (value?: { fingers?: number; distance?: number }): PinchGestureInterface; 1132 1133 /** 1134 * Pan gesture recognition success callback. 1135 * 1136 * @param { function } event 1137 * @returns { PinchGestureInterface } 1138 * @syscap SystemCapability.ArkUI.ArkUI.Full 1139 * @since 7 1140 */ 1141 /** 1142 * Pan gesture recognition success callback. 1143 * 1144 * @param { function } event 1145 * @returns { PinchGestureInterface } 1146 * @syscap SystemCapability.ArkUI.ArkUI.Full 1147 * @crossplatform 1148 * @since 10 1149 */ 1150 onActionStart(event: (event: GestureEvent) => void): PinchGestureInterface; 1151 1152 /** 1153 * Callback when the Pan gesture is moving. 1154 * 1155 * @param { function } event 1156 * @returns { PinchGestureInterface } 1157 * @syscap SystemCapability.ArkUI.ArkUI.Full 1158 * @since 7 1159 */ 1160 /** 1161 * Callback when the Pan gesture is moving. 1162 * 1163 * @param { function } event 1164 * @returns { PinchGestureInterface } 1165 * @syscap SystemCapability.ArkUI.ArkUI.Full 1166 * @crossplatform 1167 * @since 10 1168 */ 1169 onActionUpdate(event: (event: GestureEvent) => void): PinchGestureInterface; 1170 1171 /** 1172 * The Pan gesture is successfully recognized. When the finger is lifted, the callback is triggered. 1173 * 1174 * @param { function } event 1175 * @returns { PinchGestureInterface } 1176 * @syscap SystemCapability.ArkUI.ArkUI.Full 1177 * @since 7 1178 */ 1179 /** 1180 * The Pan gesture is successfully recognized. When the finger is lifted, the callback is triggered. 1181 * 1182 * @param { function } event 1183 * @returns { PinchGestureInterface } 1184 * @syscap SystemCapability.ArkUI.ArkUI.Full 1185 * @crossplatform 1186 * @since 10 1187 */ 1188 onActionEnd(event: (event: GestureEvent) => void): PinchGestureInterface; 1189 1190 /** 1191 * The Pan gesture is successfully recognized and a callback is triggered when the touch cancel event is received. 1192 * 1193 * @param { function } event 1194 * @returns { PinchGestureInterface } 1195 * @syscap SystemCapability.ArkUI.ArkUI.Full 1196 * @since 7 1197 */ 1198 /** 1199 * The Pan gesture is successfully recognized and a callback is triggered when the touch cancel event is received. 1200 * 1201 * @param { function } event 1202 * @returns { PinchGestureInterface } 1203 * @syscap SystemCapability.ArkUI.ArkUI.Full 1204 * @crossplatform 1205 * @since 10 1206 */ 1207 onActionCancel(event: () => void): PinchGestureInterface; 1208} 1209 1210/** 1211 * Defines the RotationGesture interface. 1212 * 1213 * @interface RotationGestureInterface 1214 * @syscap SystemCapability.ArkUI.ArkUI.Full 1215 * @since 7 1216 */ 1217/** 1218 * Defines the RotationGesture interface. 1219 * 1220 * @interface RotationGestureInterface 1221 * @syscap SystemCapability.ArkUI.ArkUI.Full 1222 * @crossplatform 1223 * @since 10 1224 */ 1225interface RotationGestureInterface { 1226 /** 1227 * Set the value. 1228 * 1229 * @param { object } value 1230 * @returns { RotationGestureInterface } 1231 * @syscap SystemCapability.ArkUI.ArkUI.Full 1232 * @since 7 1233 */ 1234 /** 1235 * Set the value. 1236 * 1237 * @param { object } value 1238 * @returns { RotationGestureInterface } 1239 * @syscap SystemCapability.ArkUI.ArkUI.Full 1240 * @crossplatform 1241 * @since 10 1242 */ 1243 (value?: { fingers?: number; angle?: number }): RotationGestureInterface; 1244 1245 /** 1246 * Pan gesture recognition success callback. 1247 * 1248 * @param { function } event 1249 * @returns { RotationGestureInterface } 1250 * @syscap SystemCapability.ArkUI.ArkUI.Full 1251 * @since 7 1252 */ 1253 /** 1254 * Pan gesture recognition success callback. 1255 * 1256 * @param { function } event 1257 * @returns { RotationGestureInterface } 1258 * @syscap SystemCapability.ArkUI.ArkUI.Full 1259 * @crossplatform 1260 * @since 10 1261 */ 1262 onActionStart(event: (event: GestureEvent) => void): RotationGestureInterface; 1263 1264 /** 1265 * Callback when the Pan gesture is moving. 1266 * 1267 * @param { function } event 1268 * @returns { RotationGestureInterface } 1269 * @syscap SystemCapability.ArkUI.ArkUI.Full 1270 * @since 7 1271 */ 1272 /** 1273 * Callback when the Pan gesture is moving. 1274 * 1275 * @param { function } event 1276 * @returns { RotationGestureInterface } 1277 * @syscap SystemCapability.ArkUI.ArkUI.Full 1278 * @crossplatform 1279 * @since 10 1280 */ 1281 onActionUpdate(event: (event: GestureEvent) => void): RotationGestureInterface; 1282 1283 /** 1284 * The Pan gesture is successfully recognized. When the finger is lifted, the callback is triggered. 1285 * 1286 * @param { function } event 1287 * @returns { RotationGestureInterface } 1288 * @syscap SystemCapability.ArkUI.ArkUI.Full 1289 * @since 7 1290 */ 1291 /** 1292 * The Pan gesture is successfully recognized. When the finger is lifted, the callback is triggered. 1293 * 1294 * @param { function } event 1295 * @returns { RotationGestureInterface } 1296 * @syscap SystemCapability.ArkUI.ArkUI.Full 1297 * @crossplatform 1298 * @since 10 1299 */ 1300 onActionEnd(event: (event: GestureEvent) => void): RotationGestureInterface; 1301 1302 /** 1303 * The Pan gesture is successfully recognized and a callback is triggered when the touch cancel event is received. 1304 * 1305 * @param { function } event 1306 * @returns { RotationGestureInterface } 1307 * @syscap SystemCapability.ArkUI.ArkUI.Full 1308 * @since 7 1309 */ 1310 /** 1311 * The Pan gesture is successfully recognized and a callback is triggered when the touch cancel event is received. 1312 * 1313 * @param { function } event 1314 * @returns { RotationGestureInterface } 1315 * @syscap SystemCapability.ArkUI.ArkUI.Full 1316 * @crossplatform 1317 * @since 10 1318 */ 1319 onActionCancel(event: () => void): RotationGestureInterface; 1320} 1321 1322/** 1323 * Defines the GestureGroup interface. 1324 * 1325 * @interface GestureGroupInterface 1326 * @syscap SystemCapability.ArkUI.ArkUI.Full 1327 * @since 7 1328 */ 1329/** 1330 * Defines the GestureGroup interface. 1331 * 1332 * @interface GestureGroupInterface 1333 * @syscap SystemCapability.ArkUI.ArkUI.Full 1334 * @crossplatform 1335 * @since 10 1336 */ 1337interface GestureGroupInterface { 1338 /** 1339 * Return to Obtain GestureGroup. 1340 * 1341 * @param { GestureMode } mode 1342 * @param { GestureType[] } gesture 1343 * @returns { GestureGroupInterface } 1344 * @syscap SystemCapability.ArkUI.ArkUI.Full 1345 * @since 7 1346 */ 1347 /** 1348 * Return to Obtain GestureGroup. 1349 * 1350 * @param { GestureMode } mode 1351 * @param { GestureType[] } gesture 1352 * @returns { GestureGroupInterface } 1353 * @syscap SystemCapability.ArkUI.ArkUI.Full 1354 * @crossplatform 1355 * @since 10 1356 */ 1357 (mode: GestureMode, ...gesture: GestureType[]): GestureGroupInterface; 1358 1359 /** 1360 * The Pan gesture is successfully recognized and a callback is triggered when the touch cancel event is received. 1361 * 1362 * @param { function } event 1363 * @returns { GestureGroupInterface } 1364 * @syscap SystemCapability.ArkUI.ArkUI.Full 1365 * @since 7 1366 */ 1367 /** 1368 * The Pan gesture is successfully recognized and a callback is triggered when the touch cancel event is received. 1369 * 1370 * @param { function } event 1371 * @returns { GestureGroupInterface } 1372 * @syscap SystemCapability.ArkUI.ArkUI.Full 1373 * @crossplatform 1374 * @since 10 1375 */ 1376 onCancel(event: () => void): GestureGroupInterface; 1377} 1378 1379/** 1380 * Defines TapGesture Component. 1381 * 1382 * @syscap SystemCapability.ArkUI.ArkUI.Full 1383 * @since 7 1384 */ 1385/** 1386 * Defines TapGesture Component. 1387 * 1388 * @syscap SystemCapability.ArkUI.ArkUI.Full 1389 * @crossplatform 1390 * @since 10 1391 */ 1392declare const TapGesture: TapGestureInterface; 1393 1394/** 1395 * Defines LongPressGesture Component. 1396 * 1397 * @syscap SystemCapability.ArkUI.ArkUI.Full 1398 * @since 7 1399 */ 1400/** 1401 * Defines LongPressGesture Component. 1402 * 1403 * @syscap SystemCapability.ArkUI.ArkUI.Full 1404 * @crossplatform 1405 * @since 10 1406 */ 1407declare const LongPressGesture: LongPressGestureInterface; 1408 1409/** 1410 * Defines PanGesture Component. 1411 * 1412 * @syscap SystemCapability.ArkUI.ArkUI.Full 1413 * @since 7 1414 */ 1415/** 1416 * Defines PanGesture Component. 1417 * 1418 * @syscap SystemCapability.ArkUI.ArkUI.Full 1419 * @crossplatform 1420 * @since 10 1421 */ 1422declare const PanGesture: PanGestureInterface; 1423 1424/** 1425 * Defines SwipeGesture Component. 1426 * 1427 * @syscap SystemCapability.ArkUI.ArkUI.Full 1428 * @since 7 1429 */ 1430/** 1431 * Defines SwipeGesture Component. 1432 * 1433 * @syscap SystemCapability.ArkUI.ArkUI.Full 1434 * @crossplatform 1435 * @since 10 1436 */ 1437declare const SwipeGesture: SwipeGestureInterface; 1438 1439/** 1440 * Defines PinchGesture Component. 1441 * 1442 * @syscap SystemCapability.ArkUI.ArkUI.Full 1443 * @since 7 1444 */ 1445/** 1446 * Defines PinchGesture Component. 1447 * 1448 * @syscap SystemCapability.ArkUI.ArkUI.Full 1449 * @crossplatform 1450 * @since 10 1451 */ 1452declare const PinchGesture: PinchGestureInterface; 1453 1454/** 1455 * Defines RotationGesture Component. 1456 * 1457 * @syscap SystemCapability.ArkUI.ArkUI.Full 1458 * @since 7 1459 */ 1460/** 1461 * Defines RotationGesture Component. 1462 * 1463 * @syscap SystemCapability.ArkUI.ArkUI.Full 1464 * @crossplatform 1465 * @since 10 1466 */ 1467declare const RotationGesture: RotationGestureInterface; 1468 1469/** 1470 * Defines GestureGroup Component. 1471 * 1472 * @syscap SystemCapability.ArkUI.ArkUI.Full 1473 * @since 7 1474 */ 1475/** 1476 * Defines GestureGroup Component. 1477 * 1478 * @syscap SystemCapability.ArkUI.ArkUI.Full 1479 * @crossplatform 1480 * @since 10 1481 */ 1482declare const GestureGroup: GestureGroupInterface; 1483 1484