diff --git a/api/@ohos.atomicservice.NavPushPathHelper.d.ets b/api/@ohos.atomicservice.NavPushPathHelper.d.ets new file mode 100644 index 0000000000000000000000000000000000000000..d4a7591670792a91a007e45ce49d6c45c8189fc1 --- /dev/null +++ b/api/@ohos.atomicservice.NavPushPathHelper.d.ets @@ -0,0 +1,229 @@ +/* + * Copyright (c) 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 Defines provides a push method for the target page in the routing table. + * @kit ArkUI + */ + +/** + * provides a push method for the target page in the routing table. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ +export declare class NavPushPathHelper { + /** + * The constructor used to create a NavPushPathHelper object. + * + * @param { NavPathStack } navPathStack - The stack of the route table. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + constructor(navPathStack: NavPathStack); + + /** + * Pushes the route page into the stack. + * + * @param { string } moduleName - Module name + * @param { NavPathInfo } info - Indicates the route page to be pushed. + * @param { boolean } [animated] - Indicates whether the transition is animated. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 300001 - hsp silent install fail. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + pushPath(moduleName: string, info: NavPathInfo, animated?: boolean): Promise; + + /** + * Pushes the NavDestination into the stack. + * + * @param { string } moduleName - Module name + * @param { NavPathInfo } info - Indicates the NavDestination to be pushed. + * @param { NavigationOptions } [options] - Indicates options of stack operation. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 300001 - hsp silent install fail. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + pushPath(moduleName: string, info: NavPathInfo, options?: NavigationOptions): Promise; + + /** + * Pushes the route page into the stack. + * + * @param { string } moduleName - Module name + * @param { NavPathInfo } info - Indicates the route page to be pushed. + * @param { boolean } [animated] - Indicates whether the transition is animated. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + *
1. Mandatory parameters are left unspecified. + *
2. Incorrect parameters types. + *
3. Parameter verification failed. + * @throws { BusinessError } 100001 - Internal error. + * @throws { BusinessError } 100005 - Builder function not registered. + * @throws { BusinessError } 100006 - NavDestination not found. + * @throws { BusinessError } 300001 - hsp silent install fail. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + pushDestination(moduleName: string, info: NavPathInfo, animated?: boolean): Promise; + + /** + * Pushes the NavDestination into the stack. + * + * @param { string } moduleName - Module name + * @param { NavPathInfo } info - Indicates the NavDestination to be pushed. + * @param { NavigationOptions } [options] - Indicates options of stack operation. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + * 1. Mandatory parameters are left unspecified. + * 2. Incorrect parameters types. + * 3. Parameter verification failed. + * @throws { BusinessError } 100001 - Internal error. + * @throws { BusinessError } 100005 - Builder function not registered. + * @throws { BusinessError } 100006 - NavDestination not found. + * @throws { BusinessError } 300001 - hsp silent install fail. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + pushDestination(moduleName: string, info: NavPathInfo, options?: NavigationOptions): Promise; + + /** + * Pushes the specified route page into the stack. + * + * @param { string } moduleName - Module name + * @param { string } name - Indicates the name of the route page to be pushed. + * @param { unknown } param - Indicates the detailed parameter of the route page to be pushed. + * @param { boolean } [animated] - Indicates whether the transition is animated. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 300001 - hsp silent install fail. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + pushPathByName(moduleName: string, name: string, param: unknown, animated?: boolean): Promise; + + /** + * Pushes the specified route page into the stack. + * + * @param { string } moduleName - Module name + * @param { string } name - Indicates the name of the route page to be pushed. + * @param { Object } param - Indicates the detailed parameter of the route page to be pushed. + * @param { Callback } onPop - The callback when next page returns. + * @param { boolean } [animated] - Indicates whether the transition is animated. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 300001 - hsp silent install fail. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + pushPathByName(moduleName: string, name: string, param: Object, + onPop: Callback, animated?: boolean): Promise; + + /** + * Pushes the specified route page into the stack. + * + * @param { string } moduleName - Module name + * @param { string } name - Indicates the name of the route page to be pushed. + * @param { Object } param - Indicates the detailed parameter of the route page to be pushed. + * @param { boolean } [animated] - Indicates whether the transition is animated. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + *
1. Mandatory parameters are left unspecified. + *
2. Incorrect parameters types. + *
3. Parameter verification failed. + * @throws { BusinessError } 100001 - Internal error. + * @throws { BusinessError } 100005 - Builder function not registered. + * @throws { BusinessError } 100006 - NavDestination not found. + * @throws { BusinessError } 300001 - hsp silent install fail. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + pushDestinationByName(moduleName: string, name: string, param: Object, animated?: boolean): Promise; + + /** + * Pushes the specified route page into the stack. + * + * @param { string } moduleName - Module name + * @param { string } name - Indicates the name of the route page to be pushed. + * @param { Object } param - Indicates the detailed parameter of the route page to be pushed. + * @param { Callback } onPop - The callback when next page returns. + * @param { boolean } [animated] - Indicates whether the transition is animated. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + *
1. Mandatory parameters are left unspecified. + *
2. Incorrect parameters types. + *
3. Parameter verification failed. + * @throws { BusinessError } 100001 - Internal error. + * @throws { BusinessError } 100005 - Builder function not registered. + * @throws { BusinessError } 100006 - NavDestination not found. + * @throws { BusinessError } 300001 - hsp silent install fail. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + pushDestinationByName(moduleName: string, name: string, param: Object, + onPop: Callback, animated?: boolean): Promise; + + /** + * replace the current page with the specific one.The current page will be destroyed. + * + * @param { string } moduleName - Module name + * @param { NavPathInfo } info - Indicates the the new route page in top of the stack. + * @param { boolean } [animated] - Indicates whether the transition is animated. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 300001 - hsp silent install fail. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + replacePath(moduleName: string, info: NavPathInfo, animated?: boolean): Promise; + + /** + * Replace the current NavDestination with the specific one.The current NavDestination will be destroyed. + * + * @param { string } moduleName - Module name + * @param { NavPathInfo } info - Indicates the new NavDestination in top of the stack. + * @param { NavigationOptions } [options] - Indicates options of stack operation. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 300001 - hsp silent install fail. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + replacePath(moduleName: string, info: NavPathInfo, options?: NavigationOptions): Promise; + + /** + * replace the current page with the specific one.The current page will be destroyed. + * + * @param { string } moduleName - Module name + * @param { string } name - Indicates name of the new route page in top of stack. + * @param { Object } param - Indicates the detailed parameter of the new route page in top of the stack. + * @param { boolean } [animated] - Indicates whether the transition is animated. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 300001 - hsp silent install fail. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + replacePathByName(moduleName: string, name: string, param: Object, animated?: boolean): Promise; +} \ No newline at end of file diff --git a/kits/@kit.ArkUI.d.ts b/kits/@kit.ArkUI.d.ts index 2cb1eafcb13b80db6aa1d42ae324eab294edcead..6346e2a882207460a6b1ddc2af2e99e3f68b496e 100644 --- a/kits/@kit.ArkUI.d.ts +++ b/kits/@kit.ArkUI.d.ts @@ -26,6 +26,7 @@ import { Chip, ChipOptions, ChipSize, IconCommonOptions, LabelMarginOptions, LabelOptions, PrefixIconOptions, SuffixIconOptions, ChipSymbolGlyphOptions } from '@ohos.arkui.advanced.Chip'; +import { NavPushPathHelper } from '@ohos.atomicservice.NavPushPathHelper'; import { IconOptions, LabelOptions as ChipItemLabelOptions, ChipGroupItemOptions, ChipItemStyle, ChipGroupSpaceOptions, IconItemOptions, IconGroupSuffix, ChipGroup } from '@ohos.arkui.advanced.ChipGroup'; @@ -158,6 +159,7 @@ import { export { AddFormMenuItem, AddFormOptions, AlertDialog, Animator, AnimatorOptions, AnimatorResult, App, AppResponse, AtomicServiceBar, AtomicServiceNavigation, NavDestinationBuilder, + NavPushPathHelper, BackRouterOptions, BuilderNode, Button, ButtonOptions, CallbackParam, CapsuleSegmentButtonConstructionOptions, CapsuleSegmentButtonOptions, Chip, ChipOptions, ChipSize, CircleShape, ComponentUtils, ComposeListItem, ComposeTitleBar, ComposeTitleBarMenuItem, Configuration, ConfirmDialog, ContentItem, ContextMenuController,