1/* 2 * Copyright (c) 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 Defines provides a push method for the target page in the routing table. 18 * @kit ArkUI 19 */ 20 21/** 22 * provides a push method for the target page in the routing table. 23 * 24 * @syscap SystemCapability.ArkUI.ArkUI.Full 25 * @atomicservice 26 * @since 12 27 */ 28export declare class NavPushPathHelper { 29 /** 30 * The constructor used to create a NavPushPathHelper object. 31 * 32 * @param { NavPathStack } navPathStack - The stack of the route table. 33 * @syscap SystemCapability.ArkUI.ArkUI.Full 34 * @atomicservice 35 * @since 12 36 */ 37 constructor(navPathStack: NavPathStack); 38 39 /** 40 * Pushes the route page into the stack. 41 * 42 * @param { string } moduleName - Module name 43 * @param { NavPathInfo } info - Indicates the route page to be pushed. 44 * @param { boolean } [animated] - Indicates whether the transition is animated. 45 * @returns { Promise<void> } The promise returned by the function. 46 * @throws { BusinessError } 300001 - hsp silent install fail. 47 * @syscap SystemCapability.ArkUI.ArkUI.Full 48 * @atomicservice 49 * @since 12 50 */ 51 pushPath(moduleName: string, info: NavPathInfo, animated?: boolean): Promise<void>; 52 53 /** 54 * Pushes the NavDestination into the stack. 55 * 56 * @param { string } moduleName - Module name 57 * @param { NavPathInfo } info - Indicates the NavDestination to be pushed. 58 * @param { NavigationOptions } [options] - Indicates options of stack operation. 59 * @returns { Promise<void> } The promise returned by the function. 60 * @throws { BusinessError } 300001 - hsp silent install fail. 61 * @syscap SystemCapability.ArkUI.ArkUI.Full 62 * @atomicservice 63 * @since 12 64 */ 65 pushPath(moduleName: string, info: NavPathInfo, options?: NavigationOptions): Promise<void>; 66 67 /** 68 * Pushes the route page into the stack. 69 * 70 * @param { string } moduleName - Module name 71 * @param { NavPathInfo } info - Indicates the route page to be pushed. 72 * @param { boolean } [animated] - Indicates whether the transition is animated. 73 * @returns { Promise<void> } The promise returned by the function. 74 * @throws { BusinessError } 401 - Parameter error. Possible causes: 75 * <br> 1. Mandatory parameters are left unspecified. 76 * <br> 2. Incorrect parameters types. 77 * <br> 3. Parameter verification failed. 78 * @throws { BusinessError } 100001 - Internal error. 79 * @throws { BusinessError } 100005 - Builder function not registered. 80 * @throws { BusinessError } 100006 - NavDestination not found. 81 * @throws { BusinessError } 300001 - hsp silent install fail. 82 * @syscap SystemCapability.ArkUI.ArkUI.Full 83 * @atomicservice 84 * @since 12 85 */ 86 pushDestination(moduleName: string, info: NavPathInfo, animated?: boolean): Promise<void>; 87 88 /** 89 * Pushes the NavDestination into the stack. 90 * 91 * @param { string } moduleName - Module name 92 * @param { NavPathInfo } info - Indicates the NavDestination to be pushed. 93 * @param { NavigationOptions } [options] - Indicates options of stack operation. 94 * @returns { Promise<void> } The promise returned by the function. 95 * @throws { BusinessError } 401 - Parameter error. Possible causes: 96 * 1. Mandatory parameters are left unspecified. 97 * 2. Incorrect parameters types. 98 * 3. Parameter verification failed. 99 * @throws { BusinessError } 100001 - Internal error. 100 * @throws { BusinessError } 100005 - Builder function not registered. 101 * @throws { BusinessError } 100006 - NavDestination not found. 102 * @throws { BusinessError } 300001 - hsp silent install fail. 103 * @syscap SystemCapability.ArkUI.ArkUI.Full 104 * @atomicservice 105 * @since 12 106 */ 107 pushDestination(moduleName: string, info: NavPathInfo, options?: NavigationOptions): Promise<void>; 108 109 /** 110 * Pushes the specified route page into the stack. 111 * 112 * @param { string } moduleName - Module name 113 * @param { string } name - Indicates the name of the route page to be pushed. 114 * @param { Object } param - Indicates the detailed parameter of the route page to be pushed. 115 * @param { boolean } [animated] - Indicates whether the transition is animated. 116 * @returns { Promise<void> } The promise returned by the function. 117 * @throws { BusinessError } 300001 - hsp silent install fail. 118 * @syscap SystemCapability.ArkUI.ArkUI.Full 119 * @atomicservice 120 * @since 12 121 */ 122 pushPathByName(moduleName: string, name: string, param: Object, animated?: boolean): Promise<void>; 123 124 /** 125 * Pushes the specified route page into the stack. 126 * 127 * @param { string } moduleName - Module name 128 * @param { string } name - Indicates the name of the route page to be pushed. 129 * @param { Object } param - Indicates the detailed parameter of the route page to be pushed. 130 * @param { Callback<PopInfo> } onPop - The callback when next page returns. 131 * @param { boolean } [animated] - Indicates whether the transition is animated. 132 * @returns { Promise<void> } The promise returned by the function. 133 * @throws { BusinessError } 300001 - hsp silent install fail. 134 * @syscap SystemCapability.ArkUI.ArkUI.Full 135 * @atomicservice 136 * @since 12 137 */ 138 pushPathByName(moduleName: string, name: string, param: Object, 139 onPop: Callback<PopInfo>, animated?: boolean): Promise<void>; 140 141 /** 142 * Pushes the specified route page into the stack. 143 * 144 * @param { string } moduleName - Module name 145 * @param { string } name - Indicates the name of the route page to be pushed. 146 * @param { Object } param - Indicates the detailed parameter of the route page to be pushed. 147 * @param { boolean } [animated] - Indicates whether the transition is animated. 148 * @returns { Promise<void> } The promise returned by the function. 149 * @throws { BusinessError } 401 - Parameter error. Possible causes: 150 * <br> 1. Mandatory parameters are left unspecified. 151 * <br> 2. Incorrect parameters types. 152 * <br> 3. Parameter verification failed. 153 * @throws { BusinessError } 100001 - Internal error. 154 * @throws { BusinessError } 100005 - Builder function not registered. 155 * @throws { BusinessError } 100006 - NavDestination not found. 156 * @throws { BusinessError } 300001 - hsp silent install fail. 157 * @syscap SystemCapability.ArkUI.ArkUI.Full 158 * @atomicservice 159 * @since 12 160 */ 161 pushDestinationByName(moduleName: string, name: string, param: Object, animated?: boolean): Promise<void>; 162 163 /** 164 * Pushes the specified route page into the stack. 165 * 166 * @param { string } moduleName - Module name 167 * @param { string } name - Indicates the name of the route page to be pushed. 168 * @param { Object } param - Indicates the detailed parameter of the route page to be pushed. 169 * @param { Callback<PopInfo> } onPop - The callback when next page returns. 170 * @param { boolean } [animated] - Indicates whether the transition is animated. 171 * @returns { Promise<void> } The promise returned by the function. 172 * @throws { BusinessError } 401 - Parameter error. Possible causes: 173 * <br> 1. Mandatory parameters are left unspecified. 174 * <br> 2. Incorrect parameters types. 175 * <br> 3. Parameter verification failed. 176 * @throws { BusinessError } 100001 - Internal error. 177 * @throws { BusinessError } 100005 - Builder function not registered. 178 * @throws { BusinessError } 100006 - NavDestination not found. 179 * @throws { BusinessError } 300001 - hsp silent install fail. 180 * @syscap SystemCapability.ArkUI.ArkUI.Full 181 * @atomicservice 182 * @since 12 183 */ 184 pushDestinationByName(moduleName: string, name: string, param: Object, 185 onPop: Callback<PopInfo>, animated?: boolean): Promise<void>; 186 187 /** 188 * replace the current page with the specific one.The current page will be destroyed. 189 * 190 * @param { string } moduleName - Module name 191 * @param { NavPathInfo } info - Indicates the the new route page in top of the stack. 192 * @param { boolean } [animated] - Indicates whether the transition is animated. 193 * @returns { Promise<void> } The promise returned by the function. 194 * @throws { BusinessError } 300001 - hsp silent install fail. 195 * @syscap SystemCapability.ArkUI.ArkUI.Full 196 * @atomicservice 197 * @since 12 198 */ 199 replacePath(moduleName: string, info: NavPathInfo, animated?: boolean): Promise<void>; 200 201 /** 202 * Replace the current NavDestination with the specific one.The current NavDestination will be destroyed. 203 * 204 * @param { string } moduleName - Module name 205 * @param { NavPathInfo } info - Indicates the new NavDestination in top of the stack. 206 * @param { NavigationOptions } [options] - Indicates options of stack operation. 207 * @returns { Promise<void> } The promise returned by the function. 208 * @throws { BusinessError } 300001 - hsp silent install fail. 209 * @syscap SystemCapability.ArkUI.ArkUI.Full 210 * @atomicservice 211 * @since 12 212 */ 213 replacePath(moduleName: string, info: NavPathInfo, options?: NavigationOptions): Promise<void>; 214 215 /** 216 * replace the current page with the specific one.The current page will be destroyed. 217 * 218 * @param { string } moduleName - Module name 219 * @param { string } name - Indicates name of the new route page in top of stack. 220 * @param { Object } param - Indicates the detailed parameter of the new route page in top of the stack. 221 * @param { boolean } [animated] - Indicates whether the transition is animated. 222 * @returns { Promise<void> } The promise returned by the function. 223 * @throws { BusinessError } 300001 - hsp silent install fail. 224 * @syscap SystemCapability.ArkUI.ArkUI.Full 225 * @atomicservice 226 * @since 12 227 */ 228 replacePathByName(moduleName: string, name: string, param: Object, animated?: boolean): Promise<void>; 229}