1/* 2 * Copyright (c) 2022-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 * Defines the navigation destination common title. 23 * 24 * @interface NavDestinationCommonTitle 25 * @syscap SystemCapability.ArkUI.ArkUI.Full 26 * @since 9 27 */ 28/** 29 * Defines the navigation destination common title. 30 * 31 * @interface NavDestinationCommonTitle 32 * @syscap SystemCapability.ArkUI.ArkUI.Full 33 * @crossplatform 34 * @since 10 35 */ 36/** 37 * Defines the navigation destination common title. 38 * 39 * @interface NavDestinationCommonTitle 40 * @syscap SystemCapability.ArkUI.ArkUI.Full 41 * @crossplatform 42 * @atomicservice 43 * @since 11 44 */ 45declare interface NavDestinationCommonTitle { 46 /** 47 * Sets the main title. 48 * 49 * @type { string } 50 * @syscap SystemCapability.ArkUI.ArkUI.Full 51 * @since 9 52 */ 53 /** 54 * Sets the main title. 55 * 56 * @type { string } 57 * @syscap SystemCapability.ArkUI.ArkUI.Full 58 * @crossplatform 59 * @since 10 60 */ 61 /** 62 * Sets the main title. 63 * 64 * @type { string } 65 * @syscap SystemCapability.ArkUI.ArkUI.Full 66 * @crossplatform 67 * @atomicservice 68 * @since 11 69 */ 70 /** 71 * Sets the main title. 72 * 73 * @type { string | Resource } 74 * @syscap SystemCapability.ArkUI.ArkUI.Full 75 * @crossplatform 76 * @atomicservice 77 * @since 14 78 */ 79 main: string | Resource; 80 81 /** 82 * Sets the sub title. 83 * 84 * @type { string } 85 * @syscap SystemCapability.ArkUI.ArkUI.Full 86 * @since 9 87 */ 88 /** 89 * Sets the sub title. 90 * 91 * @type { string } 92 * @syscap SystemCapability.ArkUI.ArkUI.Full 93 * @crossplatform 94 * @since 10 95 */ 96 /** 97 * Sets the sub title. 98 * 99 * @type { string } 100 * @syscap SystemCapability.ArkUI.ArkUI.Full 101 * @crossplatform 102 * @atomicservice 103 * @since 11 104 */ 105 /** 106 * Sets the sub title. 107 * 108 * @type { string | Resource } 109 * @syscap SystemCapability.ArkUI.ArkUI.Full 110 * @crossplatform 111 * @atomicservice 112 * @since 14 113 */ 114 sub: string | Resource; 115} 116 117/** 118 * Defines the navigation destination custom title. 119 * 120 * @interface NavDestinationCustomTitle 121 * @syscap SystemCapability.ArkUI.ArkUI.Full 122 * @since 9 123 */ 124/** 125 * Defines the navigation destination custom title. 126 * 127 * @interface NavDestinationCustomTitle 128 * @syscap SystemCapability.ArkUI.ArkUI.Full 129 * @crossplatform 130 * @since 10 131 */ 132/** 133 * Defines the navigation destination custom title. 134 * 135 * @interface NavDestinationCustomTitle 136 * @syscap SystemCapability.ArkUI.ArkUI.Full 137 * @crossplatform 138 * @atomicservice 139 * @since 11 140 */ 141declare interface NavDestinationCustomTitle { 142 /** 143 * Sets the custom title builder. 144 * 145 * @type { CustomBuilder } 146 * @syscap SystemCapability.ArkUI.ArkUI.Full 147 * @since 9 148 */ 149 /** 150 * Sets the custom title builder. 151 * 152 * @type { CustomBuilder } 153 * @syscap SystemCapability.ArkUI.ArkUI.Full 154 * @crossplatform 155 * @since 10 156 */ 157 /** 158 * Sets the custom title builder. 159 * 160 * @type { CustomBuilder } 161 * @syscap SystemCapability.ArkUI.ArkUI.Full 162 * @crossplatform 163 * @atomicservice 164 * @since 11 165 */ 166 builder: CustomBuilder; 167 168 /** 169 * Sets the custom title height. 170 * 171 * @type { TitleHeight | Length } 172 * @syscap SystemCapability.ArkUI.ArkUI.Full 173 * @since 9 174 */ 175 /** 176 * Sets the custom title height. 177 * 178 * @type { TitleHeight | Length } 179 * @syscap SystemCapability.ArkUI.ArkUI.Full 180 * @crossplatform 181 * @since 10 182 */ 183 /** 184 * Sets the custom title height. 185 * 186 * @type { TitleHeight | Length } 187 * @syscap SystemCapability.ArkUI.ArkUI.Full 188 * @crossplatform 189 * @atomicservice 190 * @since 11 191 */ 192 height: TitleHeight | Length; 193} 194 195/** 196 * Types of system Transition. 197 * 198 * @enum { number } 199 * @syscap SystemCapability.ArkUI.ArkUI.Full 200 * @crossplatform 201 * @atomicservice 202 * @since 14 203 */ 204declare enum NavigationSystemTransitionType { 205 /** 206 * Default system transition. 207 * 208 * @syscap SystemCapability.ArkUI.ArkUI.Full 209 * @crossplatform 210 * @atomicservice 211 * @since 14 212 */ 213 DEFAULT = 0, 214 /** 215 * None system transition. 216 * 217 * @syscap SystemCapability.ArkUI.ArkUI.Full 218 * @crossplatform 219 * @atomicservice 220 * @since 14 221 */ 222 NONE = 1, 223 /** 224 * Configure only titlebar transition. 225 * 226 * @syscap SystemCapability.ArkUI.ArkUI.Full 227 * @crossplatform 228 * @atomicservice 229 * @since 14 230 */ 231 TITLE = 2, 232 /** 233 * Configure only content transition. 234 * 235 * @syscap SystemCapability.ArkUI.ArkUI.Full 236 * @crossplatform 237 * @atomicservice 238 * @since 14 239 */ 240 CONTENT = 3, 241 /** 242 * Configure fade style system transition. 243 * 244 * @syscap SystemCapability.ArkUI.ArkUI.Full 245 * @crossplatform 246 * @atomicservice 247 * @since 15 248 */ 249 FADE = 4, 250 /** 251 * Configure explode style system transition. 252 * 253 * @syscap SystemCapability.ArkUI.ArkUI.Full 254 * @crossplatform 255 * @atomicservice 256 * @since 15 257 */ 258 EXPLODE = 5, 259 /** 260 * Configure right-side slide style system transition. 261 * 262 * @syscap SystemCapability.ArkUI.ArkUI.Full 263 * @crossplatform 264 * @atomicservice 265 * @since 15 266 */ 267 SLIDE_RIGHT = 6, 268 /** 269 * Configure bottom-side slide style system transition. 270 * 271 * @syscap SystemCapability.ArkUI.ArkUI.Full 272 * @crossplatform 273 * @atomicservice 274 * @since 15 275 */ 276 SLIDE_BOTTOM = 7, 277} 278 279/** 280 * NavDestination mode. 281 * 282 * @enum { number } 283 * @syscap SystemCapability.ArkUI.ArkUI.Full 284 * @crossplatform 285 * @since 11 286 */ 287/** 288 * NavDestination mode. 289 * 290 * @enum { number } 291 * @syscap SystemCapability.ArkUI.ArkUI.Full 292 * @crossplatform 293 * @atomicservice 294 * @since 12 295 */ 296declare enum NavDestinationMode { 297 /** 298 * Standard mode is default mode of NavDestination. 299 * 300 * @syscap SystemCapability.ArkUI.ArkUI.Full 301 * @crossplatform 302 * @since 11 303 */ 304 /** 305 * Standard mode is default mode of NavDestination. 306 * 307 * @syscap SystemCapability.ArkUI.ArkUI.Full 308 * @crossplatform 309 * @atomicservice 310 * @since 12 311 */ 312 STANDARD = 0, 313 314 /** 315 * Dialog mode is transparent by default and does not affect the life cycle of other NavDestination. 316 * 317 * @syscap SystemCapability.ArkUI.ArkUI.Full 318 * @crossplatform 319 * @since 11 320 */ 321 /** 322 * Dialog mode is transparent by default and does not affect the life cycle of other NavDestination. 323 * 324 * @syscap SystemCapability.ArkUI.ArkUI.Full 325 * @crossplatform 326 * @atomicservice 327 * @since 12 328 */ 329 DIALOG = 1, 330} 331 332/** 333 * Reason of navDestination be active or inactive. 334 * 335 * @enum { number } 336 * @syscap SystemCapability.ArkUI.ArkUI.Full 337 * @crossplatform 338 * @atomicservice 339 * @since 17 340 */ 341declare enum NavDestinationActiveReason { 342 /** 343 * NavDestination become active or inactive because of page transition. 344 * 345 * @syscap SystemCapability.ArkUI.ArkUI.Full 346 * @crossplatform 347 * @atomicservice 348 * @since 17 349 */ 350 TRANSITION = 0, 351 352 /** 353 * NavDestination become active or inactive because content cover changes. 354 * 355 * @syscap SystemCapability.ArkUI.ArkUI.Full 356 * @crossplatform 357 * @atomicservice 358 * @since 17 359 */ 360 CONTENT_COVER = 1, 361 362 /** 363 * NavDestination become active or inactive because sheet changes. 364 * 365 * @syscap SystemCapability.ArkUI.ArkUI.Full 366 * @crossplatform 367 * @atomicservice 368 * @since 17 369 */ 370 SHEET = 2, 371 372 /** 373 * NavDestination become active or inactive because dialog changes. 374 * 375 * @syscap SystemCapability.ArkUI.ArkUI.Full 376 * @crossplatform 377 * @atomicservice 378 * @since 17 379 */ 380 DIALOG = 3, 381 382 /** 383 * NavDestination become active or inactive because overlay changes. 384 * 385 * @syscap SystemCapability.ArkUI.ArkUI.Full 386 * @crossplatform 387 * @atomicservice 388 * @since 17 389 */ 390 OVERLAY = 4, 391 392 /** 393 * NavDestination become active or inactive because app state changes. 394 * 395 * @syscap SystemCapability.ArkUI.ArkUI.Full 396 * @crossplatform 397 * @atomicservice 398 * @since 17 399 */ 400 APP_STATE = 5, 401} 402 403/** 404 * The construct function of NavDestination. 405 * 406 * @interface NavDestinationInterface 407 * @syscap SystemCapability.ArkUI.ArkUI.Full 408 * @since 9 409 */ 410/** 411 * The construct function of NavDestination. 412 * 413 * @interface NavDestinationInterface 414 * @syscap SystemCapability.ArkUI.ArkUI.Full 415 * @crossplatform 416 * @since 10 417 */ 418/** 419 * The construct function of NavDestination. 420 * 421 * @interface NavDestinationInterface 422 * @syscap SystemCapability.ArkUI.ArkUI.Full 423 * @crossplatform 424 * @atomicservice 425 * @since 11 426 */ 427declare interface NavDestinationInterface { 428 /** 429 * Constructor. 430 * 431 * @returns { NavDestinationAttribute } 432 * @syscap SystemCapability.ArkUI.ArkUI.Full 433 * @since 9 434 */ 435 /** 436 * Constructor. 437 * 438 * @returns { NavDestinationAttribute } 439 * @syscap SystemCapability.ArkUI.ArkUI.Full 440 * @crossplatform 441 * @since 10 442 */ 443 /** 444 * Constructor. 445 * 446 * @returns { NavDestinationAttribute } 447 * @syscap SystemCapability.ArkUI.ArkUI.Full 448 * @crossplatform 449 * @atomicservice 450 * @since 11 451 */ 452 (): NavDestinationAttribute; 453} 454 455/** 456 * Indicates configuration info of destination. 457 * 458 * @interface RouteMapConfig 459 * @syscap SystemCapability.ArkUI.ArkUI.Full 460 * @crossplatform 461 * @atomicservice 462 * @since 12 463 */ 464declare interface RouteMapConfig { 465 /** 466 * Get destination name. 467 * 468 * @type { string } 469 * @syscap SystemCapability.ArkUI.ArkUI.Full 470 * @crossplatform 471 * @atomicservice 472 * @since 12 473 */ 474 name: string; 475 476 /** 477 * Get destination builder file position 478 * 479 * @type { string } 480 * @syscap SystemCapability.ArkUI.ArkUI.Full 481 * @crossplatform 482 * @atomicservice 483 * @since 12 484 */ 485 pageSourceFile: string; 486 487 /** 488 * Indicate the custom data of current destination. 489 * 490 * @type { Object } 491 * @syscap SystemCapability.ArkUI.ArkUI.Full 492 * @crossplatform 493 * @atomicservice 494 * @since 12 495 */ 496 data: Object 497} 498 499/** 500 * Indicates the context of NavDestination. 501 * 502 * @interface NavDestinationContext 503 * @syscap SystemCapability.ArkUI.ArkUI.Full 504 * @crossplatform 505 * @atomicservice 506 * @since 11 507 */ 508declare interface NavDestinationContext { 509 /** 510 * Get path info. 511 * 512 * @type { NavPathInfo } 513 * @syscap SystemCapability.ArkUI.ArkUI.Full 514 * @crossplatform 515 * @atomicservice 516 * @since 11 517 */ 518 pathInfo: NavPathInfo; 519 520 /** 521 * Get stack of the Navigation where the NavDestination is located. 522 * 523 * @type { NavPathStack } 524 * @syscap SystemCapability.ArkUI.ArkUI.Full 525 * @crossplatform 526 * @atomicservice 527 * @since 11 528 */ 529 pathStack: NavPathStack; 530 531 /** 532 * Get the unique id of NavDestination, which is different from common property id of Component. 533 * 534 * @type { ?string } 535 * @syscap SystemCapability.ArkUI.ArkUI.Full 536 * @crossplatform 537 * @atomicservice 538 * @since 12 539 */ 540 navDestinationId?: string; 541 542 /** 543 * Get configuration of current Destination in module.json 544 * 545 * @returns {RouteMapConfig | undefined} 546 * 547 * @syscap SystemCapability.ArkUI.ArkUI.Full 548 * @crossplatform 549 * @atomicservice 550 * @since 12 551 */ 552 getConfigInRouteMap(): RouteMapConfig | undefined; 553} 554 555/** 556 * Indicates the nested scrollable container components. 557 * 558 * @interface NestedScrollInfo 559 * @syscap SystemCapability.ArkUI.ArkUI.Full 560 * @crossplatform 561 * @atomicservice 562 * @since 14 563 */ 564declare interface NestedScrollInfo { 565 /** 566 * The controller of parent scrollable container component. 567 * 568 * @type { Scroller } 569 * @syscap SystemCapability.ArkUI.ArkUI.Full 570 * @crossplatform 571 * @atomicservice 572 * @since 14 573 */ 574 parent: Scroller; 575 576 /** 577 * The controller of child scrollable container component. 578 * 579 * @type { Scroller } 580 * @syscap SystemCapability.ArkUI.ArkUI.Full 581 * @crossplatform 582 * @atomicservice 583 * @since 14 584 */ 585 child: Scroller; 586} 587 588/** 589* NavDestination animation protocol. 590* 591* @interface NavDestinationTransition 592* @syscap SystemCapability.ArkUI.ArkUI.Full 593* @crossplatform 594* @atomicservice 595* @since 15 596*/ 597declare interface NavDestinationTransition { 598 /** 599 * This method is called after the transition ends to notify whether the transition was successful. 600 * 601 * @type { ?Callback<void> } 602 * @syscap SystemCapability.ArkUI.ArkUI.Full 603 * @crossplatform 604 * @atomicservice 605 * @since 15 606 */ 607 onTransitionEnd?: Callback<void>; 608 609 /** 610 * Define the limit duration of the transition animation. 611 * 612 * @type { ?number } 613 * @syscap SystemCapability.ArkUI.ArkUI.Full 614 * @crossplatform 615 * @atomicservice 616 * @since 15 617 */ 618 duration?: number; 619 620 /** 621 * Define the curve of the transition animation. 622 * 623 * @type { ?Curve } 624 * @syscap SystemCapability.ArkUI.ArkUI.Full 625 * @crossplatform 626 * @atomicservice 627 * @since 15 628 */ 629 curve?: Curve; 630 631 /** 632 * Define the delay of the transition animation. 633 * 634 * @type { ?number } 635 * @syscap SystemCapability.ArkUI.ArkUI.Full 636 * @crossplatform 637 * @atomicservice 638 * @since 15 639 */ 640 delay?: number; 641 642 /** 643 * Configure the custom transition event. 644 * 645 * @type { Callback<void> } 646 * @syscap SystemCapability.ArkUI.ArkUI.Full 647 * @crossplatform 648 * @atomicservice 649 * @since 15 650 */ 651 event: Callback<void>; 652} 653 654/** 655 * The attribute function of NavDestination 656 * 657 * @extends CommonMethod<NavDestinationAttribute> 658 * @syscap SystemCapability.ArkUI.ArkUI.Full 659 * @since 9 660 */ 661/** 662 * The attribute function of NavDestination 663 * 664 * @extends CommonMethod<NavDestinationAttribute> 665 * @syscap SystemCapability.ArkUI.ArkUI.Full 666 * @crossplatform 667 * @since 10 668 */ 669/** 670 * The attribute function of NavDestination 671 * 672 * @extends CommonMethod<NavDestinationAttribute> 673 * @syscap SystemCapability.ArkUI.ArkUI.Full 674 * @crossplatform 675 * @atomicservice 676 * @since 11 677 */ 678declare class NavDestinationAttribute extends CommonMethod<NavDestinationAttribute> { 679 /** 680 * Navigation title bar 681 * 682 * @param { string | CustomBuilder | NavDestinationCommonTitle | NavDestinationCustomTitle } value 683 * @returns { NavDestinationAttribute } 684 * @syscap SystemCapability.ArkUI.ArkUI.Full 685 * @since 9 686 */ 687 /** 688 * Navigation title bar 689 * 690 * @param { string | CustomBuilder | NavDestinationCommonTitle | NavDestinationCustomTitle } value 691 * @returns { NavDestinationAttribute } 692 * @syscap SystemCapability.ArkUI.ArkUI.Full 693 * @crossplatform 694 * @since 10 695 */ 696 /** 697 * Navigation title bar 698 * 699 * @param { string | CustomBuilder | NavDestinationCommonTitle | NavDestinationCustomTitle } value 700 * @returns { NavDestinationAttribute } 701 * @syscap SystemCapability.ArkUI.ArkUI.Full 702 * @crossplatform 703 * @atomicservice 704 * @since 11 705 */ 706 /** 707 * NavDestination title bar 708 * 709 * @param { string | CustomBuilder | NavDestinationCommonTitle | NavDestinationCustomTitle } value 710 * @param { NavigationTitleOptions } [options] - Indicates the options of titlebar. 711 * @returns { NavDestinationAttribute } 712 * @syscap SystemCapability.ArkUI.ArkUI.Full 713 * @crossplatform 714 * @atomicservice 715 * @since 12 716 */ 717 /** 718 * NavDestination title bar 719 * 720 * @param { string | CustomBuilder | NavDestinationCommonTitle | NavDestinationCustomTitle | Resource } value 721 * @param { NavigationTitleOptions } [options] - Indicates the options of titlebar. 722 * @returns { NavDestinationAttribute } 723 * @syscap SystemCapability.ArkUI.ArkUI.Full 724 * @crossplatform 725 * @atomicservice 726 * @since 14 727 */ 728 title(value: string | CustomBuilder | NavDestinationCommonTitle | NavDestinationCustomTitle | Resource, 729 options?: NavigationTitleOptions): NavDestinationAttribute; 730 731 /** 732 * Hide navigation title bar 733 * 734 * @param { boolean } value 735 * @returns { NavDestinationAttribute } 736 * @syscap SystemCapability.ArkUI.ArkUI.Full 737 * @since 9 738 */ 739 /** 740 * Hide navigation title bar 741 * 742 * @param { boolean } value 743 * @returns { NavDestinationAttribute } 744 * @syscap SystemCapability.ArkUI.ArkUI.Full 745 * @crossplatform 746 * @since 10 747 */ 748 /** 749 * Hide navigation title bar 750 * 751 * @param { boolean } value 752 * @returns { NavDestinationAttribute } 753 * @syscap SystemCapability.ArkUI.ArkUI.Full 754 * @crossplatform 755 * @atomicservice 756 * @since 11 757 */ 758 hideTitleBar(value: boolean): NavDestinationAttribute; 759 760 /** 761 * Hide navigation title bar 762 * 763 * @param { boolean } hide 764 * @param { boolean } animated 765 * @returns { NavDestinationAttribute } 766 * @syscap SystemCapability.ArkUI.ArkUI.Full 767 * @crossplatform 768 * @atomicservice 769 * @since 13 770 */ 771 hideTitleBar(hide: boolean, animated: boolean): NavDestinationAttribute; 772 773 /** 774 * Hide navDestination back button 775 * 776 * @param { Optional<boolean> } hide 777 * @returns { NavDestinationAttribute } 778 * @syscap SystemCapability.ArkUI.ArkUI.Full 779 * @crossplatform 780 * @atomicservice 781 * @since 15 782 */ 783 hideBackButton(hide: Optional<boolean>): NavDestinationAttribute; 784 785 /** 786 * Invoked when the navDestination page is displayed. 787 * 788 * @param { function } callback - Indicates callback when the navDestination page is displayed. 789 * @returns { NavDestinationAttribute } 790 * @syscap SystemCapability.ArkUI.ArkUI.Full 791 * @crossplatform 792 * @since 10 793 */ 794 /** 795 * Invoked when the navDestination page is displayed. 796 * 797 * @param { function } callback - Indicates callback when the navDestination page is displayed. 798 * @returns { NavDestinationAttribute } 799 * @syscap SystemCapability.ArkUI.ArkUI.Full 800 * @crossplatform 801 * @atomicservice 802 * @since 11 803 */ 804 onShown(callback: () => void): NavDestinationAttribute; 805 806 /** 807 * Invoked when the navDestination is hidden. 808 * 809 * @param { function } callback - Indicates callback when the navDestination is hidden. 810 * @returns { NavDestinationAttribute } 811 * @syscap SystemCapability.ArkUI.ArkUI.Full 812 * @crossplatform 813 * @since 10 814 */ 815 /** 816 * Invoked when the navDestination is hidden. 817 * 818 * @param { function } callback - Indicates callback when the navDestination is hidden. 819 * @returns { NavDestinationAttribute } 820 * @syscap SystemCapability.ArkUI.ArkUI.Full 821 * @crossplatform 822 * @atomicservice 823 * @since 11 824 */ 825 onHidden(callback: () => void): NavDestinationAttribute; 826 827 /** 828 * Invoked when the backButton is pressed. 829 * 830 * @param { function } callback - Indicates callback when the backButton is pressed. 831 * @returns { NavDestinationAttribute } 832 * @syscap SystemCapability.ArkUI.ArkUI.Full 833 * @crossplatform 834 * @since 10 835 */ 836 /** 837 * Invoked when the backButton is pressed. 838 * 839 * @param { function } callback - Indicates callback when the backButton is pressed. 840 * @returns { NavDestinationAttribute } 841 * @syscap SystemCapability.ArkUI.ArkUI.Full 842 * @crossplatform 843 * @atomicservice 844 * @since 11 845 */ 846 onBackPressed(callback: () => boolean): NavDestinationAttribute; 847 848 /** 849 * Invoked when pop to the navDestination with result. 850 * 851 * @param {Optional<Callback<ESObject>>} callback - Indicates callback when pop to the navDestination with result. 852 * @returns {NavDestinationAttribute} 853 * @syscap SystemCapability.ArkUI.ArkUI.Full 854 * @crossplatform 855 * @atomicservice 856 * @since 15 857 */ 858 onResult(callback: Optional<Callback<ESObject>>): NavDestinationAttribute; 859 860 /** 861 * Sets the different mode of NavDestination. 862 * 863 * @param { NavDestinationMode } value - NavDestinationMode 864 * @returns { NavDestinationAttribute } 865 * @syscap SystemCapability.ArkUI.ArkUI.Full 866 * @crossplatform 867 * @since 11 868 */ 869 /** 870 * Sets the different mode of NavDestination. 871 * 872 * @param { NavDestinationMode } value - NavDestinationMode 873 * @returns { NavDestinationAttribute } 874 * @syscap SystemCapability.ArkUI.ArkUI.Full 875 * @crossplatform 876 * @atomicservice 877 * @since 12 878 */ 879 mode(value: NavDestinationMode): NavDestinationAttribute; 880 881 /** 882 * Set back button icon. 883 * 884 * @param { ResourceStr | PixelMap } value - Indicates icon of back button. 885 * @returns { NavDestinationAttribute } 886 * @syscap SystemCapability.ArkUI.ArkUI.Full 887 * @crossplatform 888 * @since 11 889 */ 890 /** 891 * Set back button icon. 892 * 893 * @param { ResourceStr | PixelMap | SymbolGlyphModifier } value - Indicates icon of back button. 894 * @returns { NavDestinationAttribute } 895 * @syscap SystemCapability.ArkUI.ArkUI.Full 896 * @crossplatform 897 * @atomicservice 898 * @since 12 899 */ 900 backButtonIcon(value: ResourceStr | PixelMap | SymbolGlyphModifier): NavDestinationAttribute; 901 902 /** 903 * NavDestination title bar's menus 904 * 905 * @param { Array<NavigationMenuItem> | CustomBuilder } value 906 * @returns { NavDestinationAttribute } 907 * @syscap SystemCapability.ArkUI.ArkUI.Full 908 * @crossplatform 909 * @atomicservice 910 * @since 12 911 */ 912 menus(value: Array<NavigationMenuItem> | CustomBuilder): NavDestinationAttribute; 913 914 /** 915 * Configure toolbar with default style parameter or custom parameter. 916 * 917 * @param { Array<ToolbarItem> | CustomBuilder } toolbarParam - Toolbar configuration parameters. 918 * @param { NavigationToolbarOptions } [options] - Indicates the options of toolbar. 919 * @returns { NavDestinationAttribute } 920 * @syscap SystemCapability.ArkUI.ArkUI.Full 921 * @crossplatform 922 * @atomicservice 923 * @since 13 924 */ 925 toolbarConfiguration(toolbarParam: Array<ToolbarItem> | CustomBuilder, options?: NavigationToolbarOptions): NavDestinationAttribute; 926 927 /** 928 * Hide tool bar 929 * 930 * @param { boolean } hide 931 * @param { boolean } [animated] 932 * @returns { NavDestinationAttribute } 933 * @syscap SystemCapability.ArkUI.ArkUI.Full 934 * @crossplatform 935 * @atomicservice 936 * @since 13 937 */ 938 hideToolBar(hide: boolean, animated?: boolean): NavDestinationAttribute; 939 940 /** 941 * Invoked before sub-components of NavDestination are created. 942 * 943 * @param { import('../api/@ohos.base').Callback<NavDestinationContext> } callback 944 * - Indicates callback that invoked before sub-components of NavDestination are created. 945 * @returns { NavDestinationAttribute } 946 * @syscap SystemCapability.ArkUI.ArkUI.Full 947 * @crossplatform 948 * @atomicservice 949 * @since 11 950 */ 951 onReady(callback: import('../api/@ohos.base').Callback<NavDestinationContext>): NavDestinationAttribute; 952 953 /** 954 * Invoked before the navDestination is appeared. 955 * 956 * @param { Callback<void> } callback - Indicates callback before the navDestination is appeared. 957 * @returns { NavDestinationAttribute } 958 * @syscap SystemCapability.ArkUI.ArkUI.Full 959 * @crossplatform 960 * @atomicservice 961 * @since 12 962 */ 963 onWillAppear(callback: Callback<void>): NavDestinationAttribute; 964 965 /** 966 * Invoked before the navDestination is disappeared. 967 * 968 * @param { Callback<void> } callback - Indicates callback before the navDestination is disappeared. 969 * @returns { NavDestinationAttribute } 970 * @syscap SystemCapability.ArkUI.ArkUI.Full 971 * @crossplatform 972 * @atomicservice 973 * @since 12 974 */ 975 onWillDisappear(callback: Callback<void>): NavDestinationAttribute; 976 977 /** 978 * Invoked before the navDestination is displayed. 979 * 980 * @param { Callback<void> } callback - Indicates callback before the navDestination is displayed. 981 * @returns { NavDestinationAttribute } 982 * @syscap SystemCapability.ArkUI.ArkUI.Full 983 * @crossplatform 984 * @atomicservice 985 * @since 12 986 */ 987 onWillShow(callback: Callback<void>): NavDestinationAttribute; 988 989 /** 990 * Invoked before the navDestination is hidden. 991 * 992 * @param { Callback<void> } callback - Indicates callback before the navDestination is hidden. 993 * @returns { NavDestinationAttribute } 994 * @syscap SystemCapability.ArkUI.ArkUI.Full 995 * @crossplatform 996 * @atomicservice 997 * @since 12 998 */ 999 onWillHide(callback: Callback<void>): NavDestinationAttribute; 1000 1001 /** 1002 * Set navDestination content expand types and edges. 1003 * 1004 * @param { Array<LayoutSafeAreaType> } [types] - Indicates the types of the safe area. 1005 * @param { Array<LayoutSafeAreaEdge> } [edges] - Indicates the edges of the safe area. 1006 * @returns { NavDestinationAttribute } 1007 * @syscap SystemCapability.ArkUI.ArkUI.Full 1008 * @crossplatform 1009 * @atomicservice 1010 * @since 12 1011 */ 1012 ignoreLayoutSafeArea(types?: Array<LayoutSafeAreaType>, edges?: Array<LayoutSafeAreaEdge>): NavDestinationAttribute; 1013 1014 /** 1015 * Set the style of system bar 1016 * 1017 * @param { Optional<SystemBarStyle> } style - The properties of system bar 1018 * @returns { NavDestinationAttribute } 1019 * @syscap SystemCapability.ArkUI.ArkUI.Full 1020 * @atomicservice 1021 * @since 12 1022 */ 1023 systemBarStyle(style: Optional<SystemBarStyle>): NavDestinationAttribute; 1024 1025 /** 1026 * Set the NavDestination can be restored after the application is terminated. 1027 * To enable this attribute, recoverable and id of Navigation must be set. 1028 * 1029 * @param { boolean } recoverable - set navdestination can be recovered. 1030 * @returns { NavDestinationAttribute } 1031 * @syscap SystemCapability.ArkUI.ArkUI.Full 1032 * @since 14 1033 */ 1034 recoverable(recoverable: Optional<boolean>): NavDestinationAttribute; 1035 1036 /** 1037 * Configuration of system transition 1038 * 1039 * @param { NavigationSystemTransitionType } type - Types of system Transition 1040 * @returns { NavDestinationAttribute } 1041 * @syscap SystemCapability.ArkUI.ArkUI.Full 1042 * @crossplatform 1043 * @atomicservice 1044 * @since 14 1045 */ 1046 systemTransition(type: NavigationSystemTransitionType): NavDestinationAttribute; 1047 1048 /** 1049 * Bind NavDestination to scrollable container components to automatically hide titlebar and toolbar. 1050 * 1051 * @param { Array<Scroller> } scrollers - The controllers of the scrollable container components. 1052 * @returns { NavDestinationAttribute } Returns the instance of the NavDestinationAttribute. 1053 * @syscap SystemCapability.ArkUI.ArkUI.Full 1054 * @crossplatform 1055 * @atomicservice 1056 * @since 14 1057 */ 1058 bindToScrollable(scrollers: Array<Scroller>): NavDestinationAttribute; 1059 1060 /** 1061 * Bind NavDestination to nested scrollable container components to automatically hide titlebar and toolbar. 1062 * 1063 * @param { Array<NestedScrollInfo> } scrollInfos - The controllers of the nested scrollable container components. 1064 * @returns { NavDestinationAttribute } Returns the instance of the NavDestinationAttribute. 1065 * @syscap SystemCapability.ArkUI.ArkUI.Full 1066 * @crossplatform 1067 * @atomicservice 1068 * @since 14 1069 */ 1070 bindToNestedScrollable(scrollInfos: Array<NestedScrollInfo>): NavDestinationAttribute; 1071 1072 /** 1073 * Invoked when destination is active. 1074 * 1075 * @param { Optional<Callback<NavDestinationActiveReason>> } callback - Indicates callback when destination is active. 1076 * @returns { NavDestinationAttribute } 1077 * @syscap SystemCapability.ArkUI.ArkUI.Full 1078 * @crossplatform 1079 * @atomicservice 1080 * @since 17 1081 */ 1082 onActive(callback: Optional<Callback<NavDestinationActiveReason>>): NavDestinationAttribute; 1083 1084 /** 1085 * Invoked when destination is inactive. 1086 * 1087 * @param { Optional<Callback<NavDestinationActiveReason>> } callback - Indicates callback when destination is inactive. 1088 * @returns { NavDestinationAttribute } 1089 * @syscap SystemCapability.ArkUI.ArkUI.Full 1090 * @crossplatform 1091 * @atomicservice 1092 * @since 17 1093 */ 1094 onInactive(callback: Optional<Callback<NavDestinationActiveReason>>): NavDestinationAttribute; 1095 1096 /** 1097 * Set NavDestination custom animation. 1098 * 1099 * @param { NavDestinationTransitionDelegate } delegate - The delegate of NavDestination custom animation. 1100 * @returns { NavDestinationAttribute } Returns the instance of the NavDestinationAttribute. 1101 * @syscap SystemCapability.ArkUI.ArkUI.Full 1102 * @crossplatform 1103 * @atomicservice 1104 * @since 15 1105 */ 1106 customTransition(delegate: NavDestinationTransitionDelegate): NavDestinationAttribute; 1107} 1108 1109/** 1110 * Defines NavDestination Component. 1111 * 1112 * @syscap SystemCapability.ArkUI.ArkUI.Full 1113 * @since 9 1114 */ 1115/** 1116 * Defines NavDestination Component. 1117 * 1118 * @syscap SystemCapability.ArkUI.ArkUI.Full 1119 * @crossplatform 1120 * @since 10 1121 */ 1122/** 1123 * Defines NavDestination Component. 1124 * 1125 * @syscap SystemCapability.ArkUI.ArkUI.Full 1126 * @crossplatform 1127 * @atomicservice 1128 * @since 11 1129 */ 1130declare const NavDestination: NavDestinationInterface; 1131 1132/** 1133 * Defines NavDestination Component instance. 1134 * 1135 * @syscap SystemCapability.ArkUI.ArkUI.Full 1136 * @since 9 1137 */ 1138/** 1139 * Defines NavDestination Component instance. 1140 * 1141 * @syscap SystemCapability.ArkUI.ArkUI.Full 1142 * @crossplatform 1143 * @since 10 1144 */ 1145/** 1146 * Defines NavDestination Component instance. 1147 * 1148 * @syscap SystemCapability.ArkUI.ArkUI.Full 1149 * @crossplatform 1150 * @atomicservice 1151 * @since 11 1152 */ 1153declare const NavDestinationInstance: NavDestinationAttribute; 1154 1155/** 1156 * Delegate function for NavDestination custom animation. 1157 * 1158 * @typedef { function } NavDestinationTransitionDelegate 1159 * @param { NavigationOperation } operation - the operation type of current Navigation animation. 1160 * @param { boolean } isEnter - whether current NavDestination will do enter-type transition. 1161 * @returns { Array<NavDestinationTransition> | undefined } user-set custom navDestination transitions. 1162 * @syscap SystemCapability.ArkUI.ArkUI.Full 1163 * @crossplatform 1164 * @atomicservice 1165 * @since 15 1166 */ 1167declare type NavDestinationTransitionDelegate = 1168 (operation: NavigationOperation, isEnter: boolean) => Array<NavDestinationTransition> | undefined;