From a0f2bd4faa9bd74aeedbf079175f4b3aa4e6be2d Mon Sep 17 00:00:00 2001 From: humeng Date: Fri, 9 Aug 2024 10:11:56 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E6=96=B0=E5=A2=9ENavPushPathHelper?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: humeng --- ...ohos.atomicservice.NavPushPathHelper.d.ets | 229 ++++++++++++++++++ kits/@kit.ArkUI.d.ts | 2 + 2 files changed, 231 insertions(+) create mode 100644 api/@ohos.atomicservice.NavPushPathHelper.d.ets diff --git a/api/@ohos.atomicservice.NavPushPathHelper.d.ets b/api/@ohos.atomicservice.NavPushPathHelper.d.ets new file mode 100644 index 000000000..a1e29a9b0 --- /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 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 + * @crossplatform + * @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 { import('../api/@ohos.base').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 { import('../api/@ohos.base').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 + * @crossplatform + * @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 58189c626..e7392c3e9 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, From 0d15e5a06bc383f074b955eeeda0d8c08a8a3ba3 Mon Sep 17 00:00:00 2001 From: humeng Date: Fri, 9 Aug 2024 02:46:42 +0000 Subject: [PATCH 2/5] update api/@ohos.atomicservice.NavPushPathHelper.d.ets. Signed-off-by: humeng --- api/@ohos.atomicservice.NavPushPathHelper.d.ets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/@ohos.atomicservice.NavPushPathHelper.d.ets b/api/@ohos.atomicservice.NavPushPathHelper.d.ets index a1e29a9b0..8e7901580 100644 --- a/api/@ohos.atomicservice.NavPushPathHelper.d.ets +++ b/api/@ohos.atomicservice.NavPushPathHelper.d.ets @@ -25,7 +25,7 @@ * @atomicservice * @since 12 */ -export class NavPushPathHelper { +export declare class NavPushPathHelper { /** * The constructor used to create a NavPushPathHelper object. * From ce20c38d9e465ddc0852a4bf632d53c3dffa4ac9 Mon Sep 17 00:00:00 2001 From: humeng Date: Fri, 9 Aug 2024 02:50:57 +0000 Subject: [PATCH 3/5] update api/@ohos.atomicservice.NavPushPathHelper.d.ets. Signed-off-by: humeng --- api/@ohos.atomicservice.NavPushPathHelper.d.ets | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/api/@ohos.atomicservice.NavPushPathHelper.d.ets b/api/@ohos.atomicservice.NavPushPathHelper.d.ets index 8e7901580..e4b1cdc9b 100644 --- a/api/@ohos.atomicservice.NavPushPathHelper.d.ets +++ b/api/@ohos.atomicservice.NavPushPathHelper.d.ets @@ -128,7 +128,7 @@ export declare class NavPushPathHelper { * @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 { import('../api/@ohos.base').Callback } onPop - The callback when next page returns. + * @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. @@ -166,7 +166,7 @@ export declare class NavPushPathHelper { * @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 { import('../api/@ohos.base').Callback } onPop - The callback when next page returns. + * @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: @@ -181,7 +181,8 @@ export declare class NavPushPathHelper { * @atomicservice * @since 12 */ - pushDestinationByName(moduleName: string, name: string, param: Object, onPop: Callback, animated?: boolean): Promise; + 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. From 29acc4ec3822b816133a71f22f0e41e8a10f9dba Mon Sep 17 00:00:00 2001 From: humeng Date: Fri, 9 Aug 2024 06:01:19 +0000 Subject: [PATCH 4/5] update api/@ohos.atomicservice.NavPushPathHelper.d.ets. Signed-off-by: humeng --- api/@ohos.atomicservice.NavPushPathHelper.d.ets | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/api/@ohos.atomicservice.NavPushPathHelper.d.ets b/api/@ohos.atomicservice.NavPushPathHelper.d.ets index e4b1cdc9b..cf95efc9e 100644 --- a/api/@ohos.atomicservice.NavPushPathHelper.d.ets +++ b/api/@ohos.atomicservice.NavPushPathHelper.d.ets @@ -136,7 +136,8 @@ export declare class NavPushPathHelper { * @atomicservice * @since 12 */ - pushPathByName(moduleName: string, name: string, param: Object, onPop: Callback, animated?: boolean): Promise; + pushPathByName(moduleName: string, name: string, param: Object, + onPop: Callback, animated?: boolean): Promise; /** * Pushes the specified route page into the stack. From 9bc700681391efe2be97b6ddbb96353227f86406 Mon Sep 17 00:00:00 2001 From: humeng Date: Fri, 9 Aug 2024 07:15:01 +0000 Subject: [PATCH 5/5] update api/@ohos.atomicservice.NavPushPathHelper.d.ets. Signed-off-by: humeng --- api/@ohos.atomicservice.NavPushPathHelper.d.ets | 2 -- 1 file changed, 2 deletions(-) diff --git a/api/@ohos.atomicservice.NavPushPathHelper.d.ets b/api/@ohos.atomicservice.NavPushPathHelper.d.ets index cf95efc9e..d4a759167 100644 --- a/api/@ohos.atomicservice.NavPushPathHelper.d.ets +++ b/api/@ohos.atomicservice.NavPushPathHelper.d.ets @@ -101,7 +101,6 @@ export declare class NavPushPathHelper { * @throws { BusinessError } 100006 - NavDestination not found. * @throws { BusinessError } 300001 - hsp silent install fail. * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform * @atomicservice * @since 12 */ @@ -208,7 +207,6 @@ export declare class NavPushPathHelper { * @returns { Promise } The promise returned by the function. * @throws { BusinessError } 300001 - hsp silent install fail. * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform * @atomicservice * @since 12 */