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 * @file 18 * @kit ArkUI 19 */ 20 21/** 22 * Declare the jump method. 23 * 24 * @enum { number } 25 * @syscap SystemCapability.ArkUI.ArkUI.Full 26 * @since 7 27 */ 28/** 29 * Declare the jump method. 30 * 31 * @enum { number } 32 * @syscap SystemCapability.ArkUI.ArkUI.Full 33 * @crossplatform 34 * @since 10 35 */ 36/** 37 * Declare the jump method. 38 * 39 * @enum { number } 40 * @syscap SystemCapability.ArkUI.ArkUI.Full 41 * @crossplatform 42 * @atomicservice 43 * @since 11 44 */ 45declare enum RouteType { 46 /** 47 * The page is not redirected. 48 * 49 * @syscap SystemCapability.ArkUI.ArkUI.Full 50 * @since 7 51 */ 52 /** 53 * The page is not redirected. 54 * 55 * @syscap SystemCapability.ArkUI.ArkUI.Full 56 * @crossplatform 57 * @since 10 58 */ 59 /** 60 * The page is not redirected. 61 * 62 * @syscap SystemCapability.ArkUI.ArkUI.Full 63 * @crossplatform 64 * @atomicservice 65 * @since 11 66 */ 67 None, 68 69 /** 70 * Go to the next page. 71 * 72 * @syscap SystemCapability.ArkUI.ArkUI.Full 73 * @since 7 74 */ 75 /** 76 * Go to the next page. 77 * 78 * @syscap SystemCapability.ArkUI.ArkUI.Full 79 * @crossplatform 80 * @since 10 81 */ 82 /** 83 * Go to the next page. 84 * 85 * @syscap SystemCapability.ArkUI.ArkUI.Full 86 * @crossplatform 87 * @atomicservice 88 * @since 11 89 */ 90 Push, 91 92 /** 93 * Redirect to a specified page. 94 * 95 * @syscap SystemCapability.ArkUI.ArkUI.Full 96 * @since 7 97 */ 98 /** 99 * Redirect to a specified page. 100 * 101 * @syscap SystemCapability.ArkUI.ArkUI.Full 102 * @crossplatform 103 * @since 10 104 */ 105 /** 106 * Redirect to a specified page. 107 * 108 * @syscap SystemCapability.ArkUI.ArkUI.Full 109 * @crossplatform 110 * @atomicservice 111 * @since 11 112 */ 113 Pop, 114} 115 116/** 117 * Declare the sliding effect of transition. 118 * 119 * @enum { number } 120 * @syscap SystemCapability.ArkUI.ArkUI.Full 121 * @since 7 122 */ 123/** 124 * Declare the sliding effect of transition. 125 * 126 * @enum { number } 127 * @syscap SystemCapability.ArkUI.ArkUI.Full 128 * @crossplatform 129 * @since 10 130 */ 131/** 132 * Declare the sliding effect of transition. 133 * 134 * @enum { number } 135 * @syscap SystemCapability.ArkUI.ArkUI.Full 136 * @crossplatform 137 * @atomicservice 138 * @since 11 139 */ 140declare enum SlideEffect { 141 /** 142 * Swipe left. 143 * 144 * @syscap SystemCapability.ArkUI.ArkUI.Full 145 * @since 7 146 */ 147 /** 148 * Swipe left. 149 * 150 * @syscap SystemCapability.ArkUI.ArkUI.Full 151 * @crossplatform 152 * @since 10 153 */ 154 /** 155 * Swipe left. 156 * 157 * @syscap SystemCapability.ArkUI.ArkUI.Full 158 * @crossplatform 159 * @atomicservice 160 * @since 11 161 */ 162 Left, 163 164 /** 165 * Swipe right. 166 * 167 * @syscap SystemCapability.ArkUI.ArkUI.Full 168 * @since 7 169 */ 170 /** 171 * Swipe right. 172 * 173 * @syscap SystemCapability.ArkUI.ArkUI.Full 174 * @crossplatform 175 * @since 10 176 */ 177 /** 178 * Swipe right. 179 * 180 * @syscap SystemCapability.ArkUI.ArkUI.Full 181 * @crossplatform 182 * @atomicservice 183 * @since 11 184 */ 185 Right, 186 187 /** 188 * Swipe top. 189 * 190 * @syscap SystemCapability.ArkUI.ArkUI.Full 191 * @since 7 192 */ 193 /** 194 * Swipe top. 195 * 196 * @syscap SystemCapability.ArkUI.ArkUI.Full 197 * @crossplatform 198 * @since 10 199 */ 200 /** 201 * Swipe top. 202 * 203 * @syscap SystemCapability.ArkUI.ArkUI.Full 204 * @crossplatform 205 * @atomicservice 206 * @since 11 207 */ 208 Top, 209 210 /** 211 * Swipe bottom. 212 * 213 * @syscap SystemCapability.ArkUI.ArkUI.Full 214 * @since 7 215 */ 216 /** 217 * Swipe bottom. 218 * 219 * @syscap SystemCapability.ArkUI.ArkUI.Full 220 * @crossplatform 221 * @since 10 222 */ 223 /** 224 * Swipe bottom. 225 * 226 * @syscap SystemCapability.ArkUI.ArkUI.Full 227 * @crossplatform 228 * @atomicservice 229 * @since 11 230 */ 231 Bottom, 232 233 /** 234 * Swipe start. 235 * 236 * @syscap SystemCapability.ArkUI.ArkUI.Full 237 * @crossplatform 238 * @atomicservice 239 * @since 12 240 */ 241 START = 5, 242 243 /** 244 * Swipe end. 245 * 246 * @syscap SystemCapability.ArkUI.ArkUI.Full 247 * @crossplatform 248 * @atomicservice 249 * @since 12 250 */ 251 END = 6, 252} 253 254/** 255 * Provides interfaces for common transitions. 256 * 257 * @syscap SystemCapability.ArkUI.ArkUI.Full 258 * @since 7 259 */ 260/** 261 * Provides interfaces for common transitions. 262 * 263 * @syscap SystemCapability.ArkUI.ArkUI.Full 264 * @crossplatform 265 * @since 10 266 */ 267/** 268 * Provides interfaces for common transitions. 269 * 270 * @syscap SystemCapability.ArkUI.ArkUI.Full 271 * @crossplatform 272 * @atomicservice 273 * @since 11 274 */ 275declare class CommonTransition<T> { 276 /** 277 * Called when a transition method is required. 278 * 279 * @syscap SystemCapability.ArkUI.ArkUI.Full 280 * @since 7 281 */ 282 /** 283 * Called when a transition method is required. 284 * 285 * @syscap SystemCapability.ArkUI.ArkUI.Full 286 * @crossplatform 287 * @since 10 288 */ 289 /** 290 * Called when a transition method is required. 291 * 292 * @syscap SystemCapability.ArkUI.ArkUI.Full 293 * @crossplatform 294 * @atomicservice 295 * @since 11 296 */ 297 constructor(); 298 299 /** 300 * Called when the slide in effect of the transition is set. 301 * 302 * @param { SlideEffect } value 303 * @returns { T } 304 * @syscap SystemCapability.ArkUI.ArkUI.Full 305 * @since 7 306 */ 307 /** 308 * Called when the slide in effect of the transition is set. 309 * 310 * @param { SlideEffect } value 311 * @returns { T } 312 * @syscap SystemCapability.ArkUI.ArkUI.Full 313 * @crossplatform 314 * @since 10 315 */ 316 /** 317 * Called when the slide in effect of the transition is set. 318 * 319 * @param { SlideEffect } value 320 * @returns { T } 321 * @syscap SystemCapability.ArkUI.ArkUI.Full 322 * @crossplatform 323 * @atomicservice 324 * @since 11 325 */ 326 slide(value: SlideEffect): T; 327 328 /** 329 * Called when the translation effect of page transition is set. 330 * 331 * @param { object } value 332 * @returns { T } 333 * @syscap SystemCapability.ArkUI.ArkUI.Full 334 * @since 7 335 */ 336 /** 337 * Called when the translation effect of page transition is set. 338 * 339 * @param { object } value 340 * @returns { T } 341 * @syscap SystemCapability.ArkUI.ArkUI.Full 342 * @crossplatform 343 * @since 10 344 */ 345 /** 346 * Called when the translation effect of page transition is set. 347 * 348 * @param { object } value 349 * @returns { T } 350 * @syscap SystemCapability.ArkUI.ArkUI.Full 351 * @crossplatform 352 * @atomicservice 353 * @since 11 354 */ 355 translate(value: { x?: number | string; y?: number | string; z?: number | string }): T; 356 357 /** 358 * Called when setting the zoom effect of page transition. 359 * 360 * @param { object } value 361 * @returns { T } 362 * @syscap SystemCapability.ArkUI.ArkUI.Full 363 * @since 7 364 */ 365 /** 366 * Called when setting the zoom effect of page transition. 367 * 368 * @param { object } value 369 * @returns { T } 370 * @syscap SystemCapability.ArkUI.ArkUI.Full 371 * @crossplatform 372 * @since 10 373 */ 374 /** 375 * Called when setting the zoom effect of page transition. 376 * 377 * @param { object } value 378 * @returns { T } 379 * @syscap SystemCapability.ArkUI.ArkUI.Full 380 * @crossplatform 381 * @atomicservice 382 * @since 11 383 */ 384 scale(value: { x?: number; y?: number; z?: number; centerX?: number | string; centerY?: number | string }): T; 385 386 /** 387 * Called when the transparency value of the starting point of entry or the ending point of exit is set. 388 * 389 * @param { number } value 390 * @returns { T } 391 * @syscap SystemCapability.ArkUI.ArkUI.Full 392 * @since 7 393 */ 394 /** 395 * Called when the transparency value of the starting point of entry or the ending point of exit is set. 396 * 397 * @param { number } value 398 * @returns { T } 399 * @syscap SystemCapability.ArkUI.ArkUI.Full 400 * @crossplatform 401 * @since 10 402 */ 403 /** 404 * Called when the transparency value of the starting point of entry or the ending point of exit is set. 405 * 406 * @param { number } value 407 * @returns { T } 408 * @syscap SystemCapability.ArkUI.ArkUI.Full 409 * @crossplatform 410 * @atomicservice 411 * @since 11 412 */ 413 opacity(value: number): T; 414} 415 416/** 417 * Defines pageTransition constructor parameters. 418 * 419 * @interface PageTransitionOptions 420 * @syscap SystemCapability.ArkUI.ArkUI.Full 421 * @since 7 422 */ 423/** 424 * Defines pageTransition constructor parameters. 425 * 426 * @interface PageTransitionOptions 427 * @syscap SystemCapability.ArkUI.ArkUI.Full 428 * @crossplatform 429 * @since 10 430 */ 431/** 432 * Defines pageTransition constructor parameters. 433 * 434 * @interface PageTransitionOptions 435 * @syscap SystemCapability.ArkUI.ArkUI.Full 436 * @crossplatform 437 * @atomicservice 438 * @since 11 439 */ 440declare interface PageTransitionOptions { 441 /** 442 * RouteType in which the pageTransition can work. 443 * @type { ?RouteType } 444 * @syscap SystemCapability.ArkUI.ArkUI.Full 445 * @since 7 446 */ 447 /** 448 * RouteType in which the pageTransition can work. 449 * @type { ?RouteType } 450 * @syscap SystemCapability.ArkUI.ArkUI.Full 451 * @crossplatform 452 * @since 10 453 */ 454 /** 455 * RouteType in which the pageTransition can work. 456 * @type { ?RouteType } 457 * @syscap SystemCapability.ArkUI.ArkUI.Full 458 * @crossplatform 459 * @atomicservice 460 * @since 11 461 */ 462 type?: RouteType; 463 /** 464 * PageTransition animation duration, in ms. 465 * @type { ?number } 466 * @syscap SystemCapability.ArkUI.ArkUI.Full 467 * @since 7 468 */ 469 /** 470 * PageTransition animation duration, in ms. 471 * @type { ?number } 472 * @syscap SystemCapability.ArkUI.ArkUI.Full 473 * @crossplatform 474 * @since 10 475 */ 476 /** 477 * PageTransition animation duration, in ms. 478 * @type { ?number } 479 * @syscap SystemCapability.ArkUI.ArkUI.Full 480 * @crossplatform 481 * @atomicservice 482 * @since 11 483 */ 484 duration?: number; 485 /** 486 * PageTransition animation curve. 487 * @type { ?(Curve | string) } 488 * @default Curve.Linear 489 * @syscap SystemCapability.ArkUI.ArkUI.Full 490 * @since 7 491 */ 492 /** 493 * PageTransition animation curve. 494 * @type { ?(Curve | string | ICurve) } 495 * @default Curve.Linear 496 * @syscap SystemCapability.ArkUI.ArkUI.Full 497 * @crossplatform 498 * @since 10 499 */ 500 /** 501 * PageTransition animation curve. 502 * @type { ?(Curve | string | ICurve) } 503 * @default Curve.Linear 504 * @syscap SystemCapability.ArkUI.ArkUI.Full 505 * @crossplatform 506 * @atomicservice 507 * @since 11 508 */ 509 curve?: Curve | string | ICurve; 510 /** 511 * PageTransition animation delay time, in ms. 512 * @type { ?number } 513 * @default 0 514 * @syscap SystemCapability.ArkUI.ArkUI.Full 515 * @since 7 516 */ 517 /** 518 * PageTransition animation delay time, in ms. 519 * @type { ?number } 520 * @default 0 521 * @syscap SystemCapability.ArkUI.ArkUI.Full 522 * @crossplatform 523 * @since 10 524 */ 525 /** 526 * PageTransition animation delay time, in ms. 527 * @type { ?number } 528 * @default 0 529 * @syscap SystemCapability.ArkUI.ArkUI.Full 530 * @crossplatform 531 * @atomicservice 532 * @since 11 533 */ 534 delay?: number; 535} 536 537/** 538 * Provides an interface for page rotation mode. 539 * 540 * @interface PageTransitionEnterInterface 541 * @syscap SystemCapability.ArkUI.ArkUI.Full 542 * @since 7 543 */ 544/** 545 * Provides an interface to set transition style when a page enters. 546 * 547 * @interface PageTransitionEnterInterface 548 * @syscap SystemCapability.ArkUI.ArkUI.Full 549 * @crossplatform 550 * @since 10 551 */ 552/** 553 * Provides an interface to set transition style when a page enters. 554 * 555 * @interface PageTransitionEnterInterface 556 * @syscap SystemCapability.ArkUI.ArkUI.Full 557 * @crossplatform 558 * @atomicservice 559 * @since 11 560 */ 561interface PageTransitionEnterInterface extends CommonTransition<PageTransitionEnterInterface> { 562 /** 563 * Called when page Jump animation is used. 564 * 565 * @param { PageTransitionOptions } value 566 * @returns { PageTransitionEnterInterface } 567 * @syscap SystemCapability.ArkUI.ArkUI.Full 568 * @since 7 569 */ 570 /** 571 * Called when page Jump animation is used. 572 * 573 * @param { PageTransitionOptions } value - pageTransition options 574 * @returns { PageTransitionEnterInterface } 575 * @syscap SystemCapability.ArkUI.ArkUI.Full 576 * @crossplatform 577 * @since 10 578 */ 579 /** 580 * Called when page Jump animation is used. 581 * 582 * @param { PageTransitionOptions } value - pageTransition options 583 * @returns { PageTransitionEnterInterface } 584 * @syscap SystemCapability.ArkUI.ArkUI.Full 585 * @crossplatform 586 * @atomicservice 587 * @since 11 588 */ 589 (value: PageTransitionOptions): PageTransitionEnterInterface; 590 591 /** 592 * Called when the incoming parameter is the normalized progress of the current incoming animation. 593 * 594 * @param { function } event 595 * @returns { PageTransitionEnterInterface } 596 * @syscap SystemCapability.ArkUI.ArkUI.Full 597 * @since 7 598 */ 599 /** 600 * Called frame by frame to customize pageTransition animation when the page enters. 601 * The incoming parameter is the normalized progress of the current incoming animation. 602 * 603 * @param { function } event - animation callback frame by frame 604 * @returns { PageTransitionEnterInterface } 605 * @syscap SystemCapability.ArkUI.ArkUI.Full 606 * @crossplatform 607 * @since 10 608 */ 609 /** 610 * Called frame by frame to customize pageTransition animation when the page enters. 611 * The incoming parameter is the normalized progress of the current incoming animation. 612 * 613 * @param { function } event - animation callback frame by frame 614 * @returns { PageTransitionEnterInterface } 615 * @syscap SystemCapability.ArkUI.ArkUI.Full 616 * @crossplatform 617 * @atomicservice 618 * @since 11 619 */ 620 onEnter(event: (type: RouteType, progress: number) => void): PageTransitionEnterInterface; 621} 622 623/** 624 * Provide an interface to exit the transition. 625 * 626 * @interface PageTransitionExitInterface 627 * @syscap SystemCapability.ArkUI.ArkUI.Full 628 * @since 7 629 */ 630/** 631 * Provide an interface to set transition style when a page exits. 632 * 633 * @interface PageTransitionExitInterface 634 * @syscap SystemCapability.ArkUI.ArkUI.Full 635 * @crossplatform 636 * @since 10 637 */ 638/** 639 * Provide an interface to set transition style when a page exits. 640 * 641 * @interface PageTransitionExitInterface 642 * @syscap SystemCapability.ArkUI.ArkUI.Full 643 * @crossplatform 644 * @atomicservice 645 * @since 11 646 */ 647interface PageTransitionExitInterface extends CommonTransition<PageTransitionExitInterface> { 648 /** 649 * Called when the transition is delayed. 650 * 651 * @param { PageTransitionOptions } value 652 * @returns { PageTransitionExitInterface } 653 * @syscap SystemCapability.ArkUI.ArkUI.Full 654 * @since 7 655 */ 656 /** 657 * Called when page Jump animation is used. 658 * 659 * @param { PageTransitionOptions } value - pageTransition options 660 * @returns { PageTransitionExitInterface } 661 * @syscap SystemCapability.ArkUI.ArkUI.Full 662 * @crossplatform 663 * @since 10 664 */ 665 /** 666 * Called when page Jump animation is used. 667 * 668 * @param { PageTransitionOptions } value - pageTransition options 669 * @returns { PageTransitionExitInterface } 670 * @syscap SystemCapability.ArkUI.ArkUI.Full 671 * @crossplatform 672 * @atomicservice 673 * @since 11 674 */ 675 (value: PageTransitionOptions): PageTransitionExitInterface; 676 677 /** 678 * Called when the input parameter is the normalized progress of the current exit animation. 679 * 680 * @param { function } event 681 * @returns { PageTransitionExitInterface } 682 * @syscap SystemCapability.ArkUI.ArkUI.Full 683 * @since 7 684 */ 685 /** 686 * Called frame by frame to customize pageTransition animation when the page exits. 687 * The input parameter is the normalized progress of the current exit animation. 688 * 689 * @param { function } event 690 * @returns { PageTransitionExitInterface } 691 * @syscap SystemCapability.ArkUI.ArkUI.Full 692 * @crossplatform 693 * @since 10 694 */ 695 /** 696 * Called frame by frame to customize pageTransition animation when the page exits. 697 * The input parameter is the normalized progress of the current exit animation. 698 * 699 * @param { function } event 700 * @returns { PageTransitionExitInterface } 701 * @syscap SystemCapability.ArkUI.ArkUI.Full 702 * @crossplatform 703 * @atomicservice 704 * @since 11 705 */ 706 onExit(event: (type: RouteType, progress: number) => void): PageTransitionExitInterface; 707} 708 709/** 710 * Defines PageTransitionEnter Component. 711 * 712 * @syscap SystemCapability.ArkUI.ArkUI.Full 713 * @since 7 714 */ 715/** 716 * Defines PageTransitionEnter Component. 717 * 718 * @syscap SystemCapability.ArkUI.ArkUI.Full 719 * @crossplatform 720 * @since 10 721 */ 722/** 723 * Defines PageTransitionEnter Component. 724 * 725 * @syscap SystemCapability.ArkUI.ArkUI.Full 726 * @crossplatform 727 * @atomicservice 728 * @since 11 729 */ 730declare const PageTransitionEnter: PageTransitionEnterInterface; 731 732/** 733 * Defines PageTransitionExit Component. 734 * 735 * @syscap SystemCapability.ArkUI.ArkUI.Full 736 * @since 7 737 */ 738/** 739 * Defines PageTransitionExit Component. 740 * 741 * @syscap SystemCapability.ArkUI.ArkUI.Full 742 * @crossplatform 743 * @since 10 744 */ 745/** 746 * Defines PageTransitionExit Component. 747 * 748 * @syscap SystemCapability.ArkUI.ArkUI.Full 749 * @crossplatform 750 * @atomicservice 751 * @since 11 752 */ 753declare const PageTransitionExit: PageTransitionExitInterface; 754