/*
* Copyright (c) 2022-2024 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* @file
* @kit ArkUI
*/
/*** if arkts 1.2 */
import { Resource } from '../../global/resource'
import { CommonMethod, Callback, LayoutSafeAreaType, LayoutSafeAreaEdge, Optional, PixelMap } from './common'
import { CustomBuilder } from './builder'
import { Length, ResourceStr } from './units'
import { TitleHeight, Curve } from './enums'
import {
NavPathInfo, NavPathStack, NavigationTitleOptions, NavigationMenuItem, NavigationToolbarOptions,
ToolbarItem, NavigationMenuOptions, NavigationOperation, SystemBarStyle
} from './navigation'
import { SymbolGlyphModifier } from '../../arkui/SymbolGlyphModifier'
import window from '../../@ohos.window'
import image from '../../@ohos.multimedia.image'
import { Scroller } from './scroll'
/*** endif */
/**
* Import the Orientation type from @ohos.window.
*
* @typedef { import('../api/@ohos.window').default.Orientation } Orientation
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since 19
*/
declare type Orientation = import('../api/@ohos.window').default.Orientation;
/**
* Import the Orientation type from @ohos.window.
*
* @typedef { import('../api/@ohos.window').default.Orientation } Orientation
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since 20
* @arkts 1.2
*/
declare type Orientation = window.Orientation;
/**
* Defines the navigation destination common title.
*
* @interface NavDestinationCommonTitle
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 9
*/
/**
* Defines the navigation destination common title.
*
* @interface NavDestinationCommonTitle
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 10
*/
/**
* Defines the navigation destination common title.
*
* @interface NavDestinationCommonTitle
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'11','1.2':'20'}
* @arkts 1.1&1.2
*/
declare interface NavDestinationCommonTitle {
/**
* Sets the main title.
*
* @type { string }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 9
*/
/**
* Sets the main title.
*
* @type { string }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 10
*/
/**
* Sets the main title.
*
* @type { string }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since 11
*/
/**
* Sets the main title.
*
* @type { string | Resource }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'14','1.2':'20'}
* @arkts 1.1&1.2
*/
main: string | Resource;
/**
* Sets the sub title.
*
* @type { string }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 9
*/
/**
* Sets the sub title.
*
* @type { string }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 10
*/
/**
* Sets the sub title.
*
* @type { string }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since 11
*/
/**
* Sets the sub title.
*
* @type { string | Resource }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'14','1.2':'20'}
* @arkts 1.1&1.2
*/
sub: string | Resource;
}
/**
* Defines the navigation destination custom title.
*
* @interface NavDestinationCustomTitle
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 9
*/
/**
* Defines the navigation destination custom title.
*
* @interface NavDestinationCustomTitle
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 10
*/
/**
* Defines the navigation destination custom title.
*
* @interface NavDestinationCustomTitle
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'11','1.2':'20'}
* @arkts 1.1&1.2
*/
declare interface NavDestinationCustomTitle {
/**
* Sets the custom title builder.
*
* @type { CustomBuilder }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 9
*/
/**
* Sets the custom title builder.
*
* @type { CustomBuilder }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 10
*/
/**
* Sets the custom title builder.
*
* @type { CustomBuilder }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'11','1.2':'20'}
* @arkts 1.1&1.2
*/
builder: CustomBuilder;
/**
* Sets the custom title height.
*
* @type { TitleHeight | Length }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 9
*/
/**
* Sets the custom title height.
*
* @type { TitleHeight | Length }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 10
*/
/**
* Sets the custom title height.
*
* @type { TitleHeight | Length }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'11','1.2':'20'}
* @arkts 1.1&1.2
*/
height: TitleHeight | Length;
}
/**
* Types of system Transition.
*
* @enum { number }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'14','1.2':'20'}
* @arkts 1.1&1.2
*/
declare enum NavigationSystemTransitionType {
/**
* Default system transition animation.
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'14','1.2':'20'}
* @arkts 1.1&1.2
*/
DEFAULT = 0,
/**
* No system transition animation.
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'14','1.2':'20'}
* @arkts 1.1&1.2
*/
NONE = 1,
/**
* System transition animation of the title bar.
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'14','1.2':'20'}
* @arkts 1.1&1.2
*/
TITLE = 2,
/**
* System transition animation of the content area.
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'14','1.2':'20'}
* @arkts 1.1&1.2
*/
CONTENT = 3,
/**
* Fade-type system transition animation.
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'15','1.2':'20'}
* @arkts 1.1&1.2
*/
FADE = 4,
/**
* Center-scale type system transition animation.
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'15','1.2':'20'}
* @arkts 1.1&1.2
*/
EXPLODE = 5,
/**
* Right-slide type system transition animation.
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'15','1.2':'20'}
* @arkts 1.1&1.2
*/
SLIDE_RIGHT = 6,
/**
* Bottom-slide type system transition animation.
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'15','1.2':'20'}
* @arkts 1.1&1.2
*/
SLIDE_BOTTOM = 7,
}
/**
* NavDestination mode.
*
* @enum { number }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 11
*/
/**
* NavDestination mode.
*
* @enum { number }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'12','1.2':'20'}
* @arkts 1.1&1.2
*/
declare enum NavDestinationMode {
/**
* Standard mode is default mode of NavDestination.
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 11
*/
/**
* Standard mode is default mode of NavDestination.
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'12','1.2':'20'}
* @arkts 1.1&1.2
*/
STANDARD = 0,
/**
* Dialog mode, where the navigation destination is transparent by default, and adding or removing the navigation
* destination from the navigation stack does not affect the lifecycle of the lower-layer navigation destinations.
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 11
*/
/**
* Dialog mode, where the navigation destination is transparent by default, and adding or removing the navigation
* destination from the navigation stack does not affect the lifecycle of the lower-layer navigation destinations.
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'12','1.2':'20'}
* @arkts 1.1&1.2
*/
DIALOG = 1,
}
/**
* Reason of navDestination be active or inactive.
*
* @enum { number }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'17','1.2':'20'}
* @arkts 1.1&1.2
*/
declare enum NavDestinationActiveReason {
/**
* The activation state changes through page navigation.
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'17','1.2':'20'}
* @arkts 1.1&1.2
*/
TRANSITION = 0,
/**
* The activation state changes due to the opening or closing of a modal page.
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'17','1.2':'20'}
* @arkts 1.1&1.2
*/
CONTENT_COVER = 1,
/**
* The activation state changes due to the opening or closing of a sheet.
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'17','1.2':'20'}
* @arkts 1.1&1.2
*/
SHEET = 2,
/**
* The activation state changes due to the opening or closing of a custom dialog.
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'17','1.2':'20'}
* @arkts 1.1&1.2
*/
DIALOG = 3,
/**
* The activation state changes due to the opening or closing of an overlay using **OverlayManager**.
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'17','1.2':'20'}
* @arkts 1.1&1.2
*/
OVERLAY = 4,
/**
* The activation state changes due to switching between foreground and background states of the application.
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'17','1.2':'20'}
* @arkts 1.1&1.2
*/
APP_STATE = 5,
}
/**
* The construct function of NavDestination.
*
* @interface NavDestinationInterface
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 9
*/
/**
* The construct function of NavDestination.
*
* @interface NavDestinationInterface
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 10
*/
/**
* The construct function of NavDestination.
*
* @interface NavDestinationInterface
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'11','1.2':'20'}
* @arkts 1.1&1.2
*/
declare interface NavDestinationInterface {
/**
* Constructor.
*
* @returns { NavDestinationAttribute }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 9
*/
/**
* Constructor.
*
* @returns { NavDestinationAttribute }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 10
*/
/**
* Constructor.
*
* @returns { NavDestinationAttribute }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'11','1.2':'20'}
* @arkts 1.1&1.2
*/
(): NavDestinationAttribute;
}
/**
* Indicates configuration info of destination.
*
* @interface RouteMapConfig
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'12','1.2':'20'}
* @arkts 1.1&1.2
*/
declare interface RouteMapConfig {
/**
* Navdestination name.
*
* @type { string }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'12','1.2':'20'}
* @arkts 1.1&1.2
*/
name: string;
/**
* Path of the navdestination in the current package.
*
* @type { string }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'12','1.2':'20'}
* @arkts 1.1&1.2
*/
pageSourceFile: string;
/**
* Custom data of the page.
*
* @type { Object }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'12','1.2':'20'}
* @arkts 1.1&1.2
*/
data: Object
}
/**
* Indicates the context of NavDestination.
*
* @interface NavDestinationContext
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'11','1.2':'20'}
* @arkts 1.1&1.2
*/
declare interface NavDestinationContext {
/**
* Path information of the navigation destination page.
*
* @type { NavPathInfo }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'11','1.2':'20'}
* @arkts 1.1&1.2
*/
pathInfo: NavPathInfo;
/**
* Page stack where the current navigation destination page is located.
*
* @type { NavPathStack }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'11','1.2':'20'}
* @arkts 1.1&1.2
*/
pathStack: NavPathStack;
/**
* Unique ID of the current navigation destination page, which is automatically generated by the system
* and is irrelevant to the universal attribute **id** of the component.
*
* @type { ?string }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'12','1.2':'20'}
* @arkts 1.1&1.2
*/
navDestinationId?: string;
/**
* Get configuration of current Destination in module.json
*
* @returns {RouteMapConfig | undefined} - Route map configuration of the current page.
* **undefined**, returned when the page is not configured through the route table.
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'12','1.2':'20'}
* @arkts 1.1&1.2
*/
getConfigInRouteMap(): RouteMapConfig | undefined;
}
/**
* Indicates the nested scrollable container components.
*
* @interface NestedScrollInfo
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'14','1.2':'20'}
* @arkts 1.1&1.2
*/
declare interface NestedScrollInfo {
/**
* Controller of the target scrollable container.
*
* @type { Scroller }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'14','1.2':'20'}
* @arkts 1.1&1.2
*/
parent: Scroller;
/**
* Controller of the scrollable container nested within the target scrollable container.
* This scrollable container is a child component of the target scrollable container.
*
* @type { Scroller }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'14','1.2':'20'}
* @arkts 1.1&1.2
*/
child: Scroller;
}
/**
* NavDestination animation protocol.
*
* @interface NavDestinationTransition
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'15','1.2':'20'}
* @arkts 1.1&1.2
*/
declare interface NavDestinationTransition {
/**
* Callback triggered when the transition animation ends.
*
* @type { ?Callback }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'15','1.2':'20'}
* @arkts 1.1&1.2
*/
onTransitionEnd?: Callback;
/**
* Duration of the transition animation.
* Default value: **1000** (in milliseconds).
*
* @type { ?number }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'15','1.2':'20'}
* @arkts 1.1&1.2
*/
duration?: number;
/**
* Curve type of the animation.
* Default value: Curve.EaseInOut.
*
* @type { ?Curve }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'15','1.2':'20'}
* @arkts 1.1&1.2
*/
curve?: Curve;
/**
* Delay of the transition animation.
* Default value: **0** (in milliseconds)
*
* @type { ?number }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'15','1.2':'20'}
* @arkts 1.1&1.2
*/
delay?: number;
/**
* Closure function specifying the transition animation.
* The system generates the corresponding transition animation based on the modifications
* to the component's UI state within the closure.
*
* @type { Callback }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'15','1.2':'20'}
* @arkts 1.1&1.2
*/
event: Callback;
}
/**
* The attribute function of NavDestination
*
* @extends CommonMethod
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 9
*/
/**
* The attribute function of NavDestination
*
* @extends CommonMethod
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 10
*/
/**
* The attribute function of NavDestination
*
* @extends CommonMethod
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'11','1.2':'20'}
* @arkts 1.1&1.2
*/
declare class NavDestinationAttribute extends CommonMethod {
/**
* Navigation title bar
*
* @param { string | CustomBuilder | NavDestinationCommonTitle | NavDestinationCustomTitle } value
* @returns { NavDestinationAttribute }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 9
*/
/**
* Navigation title bar
*
* @param { string | CustomBuilder | NavDestinationCommonTitle | NavDestinationCustomTitle } value
* @returns { NavDestinationAttribute }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 10
*/
/**
* Navigation title bar
*
* @param { string | CustomBuilder | NavDestinationCommonTitle | NavDestinationCustomTitle } value
* @returns { NavDestinationAttribute }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since 11
*/
/**
* NavDestination title bar
*
* @param { string | CustomBuilder | NavDestinationCommonTitle | NavDestinationCustomTitle } value
* @param { NavigationTitleOptions } [options] - Indicates the options of titlebar.
* @returns { NavDestinationAttribute }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since 12
*/
/**
* Sets the page title. When the NavigationCustomTitle type is used to set the height,
* the titleMode attribute does not take effect.
* When the title string is too long: (1) If no subtitle is set, the string is scaled down,
* wrapped in two lines, and then clipped with an ellipsis (...); (2) If a subtitle is set,
* the subtitle is scaled down and then clipped with an ellipsis (...).
*
* @param { string | CustomBuilder | NavDestinationCommonTitle | NavDestinationCustomTitle | Resource } value
* @param { NavigationTitleOptions } [options] - Indicates the options of titlebar.
* @returns { NavDestinationAttribute }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'14','1.2':'20'}
* @arkts 1.1&1.2
*/
title(value: string | CustomBuilder | NavDestinationCommonTitle | NavDestinationCustomTitle | Resource,
options?: NavigationTitleOptions): NavDestinationAttribute;
/**
* Hide navigation title bar
*
* @param { boolean } value
* @returns { NavDestinationAttribute }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 9
*/
/**
* Hide navigation title bar
*
* @param { boolean } value
* @returns { NavDestinationAttribute }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 10
*/
/**
* Specifies whether to hide the title bar.
*
* @param { boolean } value
* @returns { NavDestinationAttribute }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'11','1.2':'20'}
* @arkts 1.1&1.2
*/
hideTitleBar(value: boolean): NavDestinationAttribute;
/**
* Sets whether to hide the title bar and whether to animate the visibility change.
*
* @param { boolean } hide
* @param { boolean } animated
* @returns { NavDestinationAttribute }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'13','1.2':'20'}
* @arkts 1.1&1.2
*/
hideTitleBar(hide: boolean, animated: boolean): NavDestinationAttribute;
/**
* Sets whether to hide the back button in the title bar.
*
* @param { Optional } hide
* @returns { NavDestinationAttribute }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'15','1.2':'20'}
* @arkts 1.1&1.2
*/
hideBackButton(hide: Optional): NavDestinationAttribute;
/**
* Called when the navigation destination page is displayed.
*
* @param { function } callback - Indicates callback when the navDestination page is displayed.
* @returns { NavDestinationAttribute }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 10
*/
/**
* Called when the navigation destination page is displayed.
*
* @param { function } callback - Indicates callback when the navDestination page is displayed.
* @returns { NavDestinationAttribute }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'11','1.2':'20'}
* @arkts 1.1&1.2
*/
onShown(callback: () => void): NavDestinationAttribute;
/**
* Called when the navigation destination page is hidden.
*
* @param { function } callback - Indicates callback when the navDestination is hidden.
* @returns { NavDestinationAttribute }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 10
*/
/**
* Called when the navigation destination page is hidden.
*
* @param { function } callback - Indicates callback when the navDestination is hidden.
* @returns { NavDestinationAttribute }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'11','1.2':'20'}
* @arkts 1.1&1.2
*/
onHidden(callback: () => void): NavDestinationAttribute;
/**
* Called when the navigation destination is about
* to be unmounted (or when the transition animation, if any, is about to start).
*
* @param { function } callback - Indicates callback when the backButton is pressed.
* @returns { NavDestinationAttribute }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 10
*/
/**
* Called when the navigation destination is about
* to be unmounted (or when the transition animation, if any, is about to start).
*
* @param { function } callback - Indicates callback when the backButton is pressed.
* @returns { NavDestinationAttribute }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'11','1.2':'20'}
* @arkts 1.1&1.2
*/
onBackPressed(callback: () => boolean): NavDestinationAttribute;
/**
* Triggered when popping back from other NavDestination.
*
* @param {Optional>} callback - Indicates callback when pop to the navDestination with result.
* @returns {NavDestinationAttribute}
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since 15
*/
onResult(callback: Optional>): NavDestinationAttribute;
/**
* Sets the mode of the **NavDestination** component. Dynamic modification is not supported.
*
* @param { NavDestinationMode } value - Mode of the **NavDestination** component.
*
Default value: **NavDestinationMode.STANDARD**.
* @returns { NavDestinationAttribute }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 11
*/
/**
* Sets the mode of the **NavDestination** component. Dynamic modification is not supported.
*
* @param { NavDestinationMode } value - NavDestinationMode
* @returns { NavDestinationAttribute }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'12','1.2':'20'}
* @arkts 1.1&1.2
*/
mode(value: NavDestinationMode): NavDestinationAttribute;
/**
* Sets the icon of the back button on the title bar.
*
* @param { ResourceStr | PixelMap } value - Icon of the back button in the title bar.
* @returns { NavDestinationAttribute }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 11
*/
/**
* Sets the icon of the back button on the title bar.
*
* **NOTE**:
*
The following are not allowed: modify the icon size through the **fontSize** attribute of the
* **SymbolGlyphModifier** object, change the animation effects through the **effectStrategy** attribute,
* or change the type of animation effects through the **symbolEffect** attribute.
*
*
* @param { ResourceStr | PixelMap | SymbolGlyphModifier } value - Icon of the back button in the title bar.
* @returns { NavDestinationAttribute }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'12','1.2':'20'}
* @arkts 1.1&1.2
*/
backButtonIcon(value: ResourceStr | PixelMap | SymbolGlyphModifier): NavDestinationAttribute;
/**
* Sets the icon and accessibility text for the back button on the title bar.
*
* **NOTE**:
*
The following are not allowed: modify the icon size through the **fontSize** attribute of the
* **SymbolGlyphModifier** object, change the animation effects through the **effectStrategy** attribute,
* or change the type of animation effects through the **symbolEffect** attribute.
*
*
* @param { ResourceStr | PixelMap | SymbolGlyphModifier } icon - Icon of the back button on the title bar.
* @param { ResourceStr } [accessibilityText] - Accessibility text for the back button.
*
Default value: **back** when the system language is English.
* @returns { NavDestinationAttribute }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'19','1.2':'20'}
* @arkts 1.1&1.2
*/
backButtonIcon(icon: ResourceStr | PixelMap | SymbolGlyphModifier, accessibilityText?: ResourceStr): NavDestinationAttribute;
/**
* Sets the menu items in the upper right corner of the page.
* If this attribute is not set, no menu item is displayed.
* When the value type is Array**NOTE**:
*
he following are not allowed: modify the icon size through the **fontSize** attribute of
* the **SymbolGlyphModifier** object, change the animation effects through the **effectStrategy** attribute,
* or change the type of animation effects through the **symbolEffect** attribute.
*
* @param { Array | CustomBuilder } value - Menu items in the upper right corner of the NavDestination.
* @returns { NavDestinationAttribute }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'12','1.2':'20'}
* @arkts 1.1&1.2
*/
menus(value: Array | CustomBuilder): NavDestinationAttribute;
/**
* NavDestination title bar's menus
*
* @param { Array | CustomBuilder } items
* @param { NavigationMenuOptions } [options] - Indicates the options of menu.
* @returns { NavDestinationAttribute }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'19','1.2':'20'}
* @arkts 1.1&1.2
*/
menus(items: Array | CustomBuilder, options?: NavigationMenuOptions): NavDestinationAttribute;
/**
* Sets the content of the toolbar. If this API is not called, the toolbar remains hidden.
*
* @param { Array | CustomBuilder } toolbarParam - Content of the toolbar.
*
When configured with Array<ToolbarItem>,
* the toolbar follows the rules below:
- Toolbar items are evenly distributed on the bottom toolbar,
* with text and icons evenly spaced in each content area.
- If any item contains overlong text and
* there are fewer than five items, the toolbar will: 1. Increase the item width to accommodate the text
* until the toolbar spans the screen width; 2. Reduce the text size progressively; 3. Wrap the text over two lines;
* 4. Clip the text with an ellipsis (...).
- In portrait mode, the toolbar shows a maximum of five icons,
* with any additional icons placed under an automatically generated **More** icon. In landscape mode,
* the behavior of the toolbar is determined by the display mode: (1) If the display mode is
* Split, the toolbar follows the same rules as in portrait mode. (2) If the display mode is Stack,
* the toolbar must be used together with Array<NavigationMenuItem> of the **menus** attribute;
* in this configuration, the bottom toolbar is automatically hidden, and all items on the toolbar are relocated to
* the menu in the upper right corner of the screen.
When configured with CustomBuilder, the toolbar does not
* follow the above rules, except for evenly distributing items at the bottom of the toolbar.
*
* @param { NavigationToolbarOptions } [options] - Indicates the options of toolbar.
* @returns { NavDestinationAttribute }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'13','1.2':'20'}
* @arkts 1.1&1.2
*/
toolbarConfiguration(toolbarParam: Array | CustomBuilder, options?: NavigationToolbarOptions): NavDestinationAttribute;
/**
* Sets whether to hide the toolbar and whether to animate the visibility change.
*
* @param { boolean } hide - Whether to hide the toolbar.
* Default value: **false**.
* **true**: Hide the toolbar.
* **false**: Show the toolbar.
* @param { boolean } [animated] - Whether to animate the visibility change.
* Default value: **false**
* **true**: Animate the visibility change.
* **false**: Do not animate the visibility change.
* @returns { NavDestinationAttribute }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'13','1.2':'20'}
* @arkts 1.1&1.2
*/
hideToolBar(hide: boolean, animated?: boolean): NavDestinationAttribute;
/**
* Called when the **NavDestination** component is about to build a child component.
*
* @param { import('../api/@ohos.base').Callback } callback
* - Indicates callback that invoked before sub-components of NavDestination are created.
* @returns { NavDestinationAttribute }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since 11
*/
onReady(callback: import('../api/@ohos.base').Callback): NavDestinationAttribute;
/**
* Invoked before sub-components of NavDestination are created.
*
* @param { Callback } callback
* - Indicates callback that invoked before sub-components of NavDestination are created.
* @returns { NavDestinationAttribute }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since 20
* @arkts 1.2
*/
onReady(callback: Callback): NavDestinationAttribute;
/**
* Called when the navigation destination is about to be mounted.
* You can change the navigation stack in this callback function, and the change takes effect in the current frame.
*
* @param { Callback } callback - Indicates callback before the navDestination is appeared.
* @returns { NavDestinationAttribute }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'12','1.2':'20'}
* @arkts 1.1&1.2
*/
onWillAppear(callback: Callback): NavDestinationAttribute;
/**
* Called when the navigation destination is about to be unmounted (or when the transition animation,
* if any, is about to start).
*
* @param { Callback } callback - Indicates callback before the navDestination is disappeared.
* @returns { NavDestinationAttribute }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'12','1.2':'20'}
* @arkts 1.1&1.2
*/
onWillDisappear(callback: Callback): NavDestinationAttribute;
/**
* Called when the navigation destination is about to be displayed.
*
* @param { Callback } callback - Indicates callback before the navDestination is displayed.
* @returns { NavDestinationAttribute }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'12','1.2':'20'}
* @arkts 1.1&1.2
*/
onWillShow(callback: Callback): NavDestinationAttribute;
/**
* Called when the navigation destination is about to be hidden.
*
* @param { Callback } callback - Indicates callback before the navDestination is hidden.
* @returns { NavDestinationAttribute }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'12','1.2':'20'}
* @arkts 1.1&1.2
*/
onWillHide(callback: Callback): NavDestinationAttribute;
/**
* Ignores the layout safe area by allowing the component to extend into the non-safe areas of the screen.
*
* @param { Array } [types] - ypes of non-safe areas to extend into.
* Default value:
[LayoutSafeAreaType.SYSTEM].
* @param { Array } [edges] - Edges for expanding the safe area.
* Default value:
[LayoutSafeAreaEdge.TOP, LayoutSafeAreaEdge.BOTTOM].
* @returns { NavDestinationAttribute }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'12','1.2':'20'}
* @arkts 1.1&1.2
*/
ignoreLayoutSafeArea(types?: Array, edges?: Array): NavDestinationAttribute;
/**
* Sets the style of the system status bar
* when this **NavDestination** page is displayed in the **Navigation** component.
*
* **NOTE**:
*
1. The setting takes effect only when the **NavDestination** component is used
* in conjunction with the **Navigation** component.
*
2. For other usage restrictions, see the description of systemBarStylefor the **Navigation** component.
*
* @param { Optional } style - Style of the system status bar.
* @returns { NavDestinationAttribute }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @atomicservice
* @since arkts {'1.1':'12','1.2':'20'}
* @arkts 1.1&1.2
*/
systemBarStyle(style: Optional): NavDestinationAttribute;
/**
* Sets whether the **NavDestination** component is recoverable.
* If set to recoverable, when the application process exits unexpectedly and restarts,
* the **NavDestination** component will be automatically recreated. To use this feature,
* ensure that the **recoverable** attribute is set for the **Navigation** component associated
* with the **NavDestination** component.
*
* **NOTE**:
*
This API must be used together with
* the recoverable API of **Navigation**.
*
* @param { boolean } recoverable - Whether the **NavDestination** component is recoverable.
* By default, it is not recoverable.
* Default value: **false**.
* **true**: The **NavDestination** component is recoverable.
* **false**: The **NavDestination** component is not recoverable.
* @returns { NavDestinationAttribute }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since arkts {'1.1':'14','1.2':'20'}
* @arkts 1.1&1.2
*/
recoverable(recoverable: Optional): NavDestinationAttribute;
/**
* Sets the system transition animation of the **NavDestination** component.
* System transition animations for the title bar and content area can be configured separately.
*
* @param { NavigationSystemTransitionType } type - Type of the system transition animation.
* Default value: **NavigationSystemTransitionType.DEFAULT**.
* @returns { NavDestinationAttribute }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'14','1.2':'20'}
* @arkts 1.1&1.2
*/
systemTransition(type: NavigationSystemTransitionType): NavDestinationAttribute;
/**
* Binds the **NavDestination** component with a scrollable container, which can be a List, Scroll,
* or WaterFlow component. This way, scrolling in the scrollable container triggers
* the display and hide animations of the title bar and toolbar of all **NavDestination** components that are bound
* to it – scrolling up triggers the hide animation, and scrolling down triggers the show animation.
* A single **NavDestination** component can be bound to multiple scrollable containers,
* and a single scrollable container can be bound to multiple **NavDestination** components.
*
* **NOTE**:
*
The connection between the scrolling actions and the animations for showing or hiding the title bar
* and toolbar of the **NavDestination** component takes effect only when the title bar or toolbar is visible.
* If a **NavDestination** component is bound to multiple scrollable containers, scrolling in any of these containers
* triggers the display or hiding animations of the title bar and toolbar. Specifically, when any scrollable
* container reaches either the bottom or the top, the display animation for the title bar and
* toolbar is triggered without delay. As such, to ensure the optimal user experience,
* avoid triggering scroll events of multiple scrollable containers simultaneously.
*
*
* @param { Array } scrollers - Controller of the target scrollable container.
* @returns { NavDestinationAttribute } Returns the instance of the NavDestinationAttribute.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'14','1.2':'20'}
* @arkts 1.1&1.2
*/
bindToScrollable(scrollers: Array): NavDestinationAttribute;
/**
* Binds the **NavDestination** component with a nested scrollable container,
* which can be a List, Scroll, Grid, or WaterFlow component. This way, scrolling in the scrollable container
* triggers the display and hide animations of the title bar and toolbar of all **NavDestination** components that
* are bound to it – scrolling up triggers the hide animation, and scrolling down triggers the show animation.
* A single **NavDestination** component can be bound to multiple nested scrollable containers, and a single nested
* scrollable container can be bound to multiple **NavDestination** components.
*
* **NOTE**:
* The connection between the scrolling actions and the animations for showing or hiding the title bar
*
and toolbar of the **NavDestination** component takes effect only when the title bar or toolbar is visible.
* If a **NavDestination** component is bound to multiple scrollable containers, scrolling in any of these containers
*
triggers the display or hiding animations of the title bar and toolbar. Specifically, when any scrollable
*
container reaches either the bottom or the top, the display animation for the title bar and
*
toolbar is triggered without delay. As such, to ensure the optimal user experience,
*
avoid triggering scroll events of multiple scrollable containers simultaneously.
*
*
* @param { Array } scrollInfos - Controller of the target nested scrollable containers.
* @returns { NavDestinationAttribute } Returns the instance of the NavDestinationAttribute.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'14','1.2':'20'}
* @arkts 1.1&1.2
*/
bindToNestedScrollable(scrollInfos: Array): NavDestinationAttribute;
/**
* Triggered when the **NavDestination** component becomes active (on top of the stack and operable,
* with no special components blocking it).
*
* @param { Optional> } callback - Reason why the **NavDestination** component
* switches from inactive to active.
* @returns { NavDestinationAttribute }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'17','1.2':'20'}
* @arkts 1.1&1.2
*/
onActive(callback: Optional>): NavDestinationAttribute;
/**
* Triggered when **NavDestination** component becomes inactive
* (not on top of the stack and inoperable, or on top but blocked by special components).
*
* @param { Optional> } callback - Reason why the **NavDestination** component
* switches from active to inactive.
* @returns { NavDestinationAttribute }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'17','1.2':'20'}
* @arkts 1.1&1.2
*/
onInactive(callback: Optional>): NavDestinationAttribute;
/**
* Sets a custom transition animation for the **NavDestination** component.
*
* **NOTE**:
*
If both this attribute and systemTransition are set, whichever is set later takes effect.
*
* @param { NavDestinationTransitionDelegate } delegate - Delegate function for custom animations of
* the **NavDestination** component.
* @returns { NavDestinationAttribute } Returns the instance of the NavDestinationAttribute.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'15','1.2':'20'}
* @arkts 1.1&1.2
*/
customTransition(delegate: NavDestinationTransitionDelegate): NavDestinationAttribute;
/**
* Triggered when a **NavDestination** page that already exists in the stack is moved to the top using
* launchMode.MOVE_TO_TOP_SINGLETON or launchMode.POP_TO_SINGLETON.
*
* **NOTE**:
*
This callback is not triggered by replacePath or replaceDestination.
*
* @param { Optional> } callback - Callback triggered by **onNewParam**, with the parameter
* being the data passed to the target page during navigation.
* @returns { NavDestinationAttribute }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since 19
*/
onNewParam(callback: Optional>): NavDestinationAttribute;
/**
* Invoked when destination be pushed with singleton mode.
*
* @param { Optional> } callback - Indicates callback when destination be pushed with singleton mode.
* @returns { NavDestinationAttribute }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since 20
* @arkts 1.2
*/
onNewParam(callback: Optional>): NavDestinationAttribute;
/**
* Sets the display orientation for the **NavDestination** component. After the transition to the NavDestination,
* the system also switches the application's main window to the specified display orientation.
*
* **NOTE**:
*
This attribute is effective only if the following conditions are all met:
*
1. The **NavDestination** component belongs to the application's main window page,
* and the main window is a full-screen window.
*
2. The size of the **Navigation** container to which the **NavDestination** component belongs occupies
* the entire application page.
*
3. The type of **NavDestination** is STANDARD.
* The actual effect of setting the display orientation depends on the specific device support.
*
*
* @param { Optional } orientation - Display orientation to set.
* @returns { NavDestinationAttribute } Returns the instance of the NavDestinationAttribute.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'19','1.2':'20'}
* @arkts 1.1&1.2
*/
preferredOrientation(orientation: Optional): NavDestinationAttribute;
/**
* Sets whether to show or hide the system status bar when entering this **NavDestination** component.
*
* **NOTE**:
*
This attribute is effective only if the following conditions are all met:
*
1. The **NavDestination** component belongs to the application's main window page, and the main window is a
* full-screen window.
*
2. The size of the **Navigation** container to which the **NavDestination** component belongs
* occupies the entire application page.
*
3. The size of the **NavDestination** component occupies the entire **Navigation** container.
*
4. The type of **NavDestination** is STANDARD.
* The actual effect of setting the system status bar depends on the specific device support.
*
* @param { Optional } enabled - Whether to show or hide the system status bar when entering the current
*
**NavDestination** component.
* @param { boolean } [animated] - Whether to use an animation to show or hide the system status bar.
*
Default value: **false**.
* @returns { NavDestinationAttribute } Returns the instance of the NavDestinationAttribute.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'19','1.2':'20'}
* @arkts 1.1&1.2
*/
enableStatusBar(enabled: Optional, animated?: boolean): NavDestinationAttribute;
/**
* Sets whether to show or hide the system navigation bar when entering this **NavDestination** component.
*
* **NOTE**
* This attribute is effective only if the following conditions are all met:
* 1. The **NavDestination** component belongs to the application's main window page,
*
and the main window is a full-screen window.
* 2. The size of the **Navigation** container to which the **NavDestination** component
*
belongs occupies the entire application page.
* 3. The size of the **NavDestination** component occupies the entire **Navigation** container.
* 4. The type of **NavDestination** is STANDARD.
* The actual effect of setting the system navigation bar depends on the specific device support.
*
* @param { Optional } enabled - Whether to show or hide the system navigation bar
* when entering the current **NavDestination** component.
* @returns { NavDestinationAttribute } Returns the instance of the NavDestinationAttribute.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'19','1.2':'20'}
* @arkts 1.1&1.2
*/
enableNavigationIndicator(enabled: Optional): NavDestinationAttribute;
}
/**
* Defines NavDestination Component.
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 9
*/
/**
* Defines NavDestination Component.
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 10
*/
/**
* Defines NavDestination Component.
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since 11
*/
declare const NavDestination: NavDestinationInterface;
/**
* Defines NavDestination Component instance.
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 9
*/
/**
* Defines NavDestination Component instance.
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 10
*/
/**
* Defines NavDestination Component instance.
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since 11
*/
declare const NavDestinationInstance: NavDestinationAttribute;
/**
* Defines the delegate function for custom transition animations of the **NavDestination** component.
*
* @typedef { function } NavDestinationTransitionDelegate
* @param { NavigationOperation } operation - Type of navigation operation for the current page transition.
* @param { boolean } isEnter - Whether the current page is an entry page.
*
**true**: The current page is an entry page.
*
**false**: The current page is not an entry page.
* @returns { Array | undefined } Array of custom animations for the **NavDestination** page.
*
If **undefined** is returned, the default system animation is used.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'15','1.2':'20'}
* @arkts 1.1&1.2
*/
declare type NavDestinationTransitionDelegate =
(operation: NavigationOperation, isEnter: boolean) => Array | undefined;