1/* 2 * Copyright (c) 2022-2023 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 * Defines the navigation destination common title. 18 * 19 * @interface NavDestinationCommonTitle 20 * @syscap SystemCapability.ArkUI.ArkUI.Full 21 * @since 9 22 */ 23/** 24 * Defines the navigation destination common title. 25 * 26 * @interface NavDestinationCommonTitle 27 * @syscap SystemCapability.ArkUI.ArkUI.Full 28 * @crossplatform 29 * @since 10 30 */ 31declare interface NavDestinationCommonTitle { 32 /** 33 * Sets the main title. 34 * 35 * @type { string } 36 * @syscap SystemCapability.ArkUI.ArkUI.Full 37 * @since 9 38 */ 39 /** 40 * Sets the main title. 41 * 42 * @type { string } 43 * @syscap SystemCapability.ArkUI.ArkUI.Full 44 * @crossplatform 45 * @since 10 46 */ 47 main: string; 48 49 /** 50 * Sets the sub title. 51 * 52 * @type { string } 53 * @syscap SystemCapability.ArkUI.ArkUI.Full 54 * @since 9 55 */ 56 /** 57 * Sets the sub title. 58 * 59 * @type { string } 60 * @syscap SystemCapability.ArkUI.ArkUI.Full 61 * @crossplatform 62 * @since 10 63 */ 64 sub: string; 65} 66 67/** 68 * Defines the navigation destination custom title. 69 * 70 * @interface NavDestinationCustomTitle 71 * @syscap SystemCapability.ArkUI.ArkUI.Full 72 * @since 9 73 */ 74/** 75 * Defines the navigation destination custom title. 76 * 77 * @interface NavDestinationCustomTitle 78 * @syscap SystemCapability.ArkUI.ArkUI.Full 79 * @crossplatform 80 * @since 10 81 */ 82declare interface NavDestinationCustomTitle { 83 /** 84 * Sets the custom title builder. 85 * 86 * @type { CustomBuilder } 87 * @syscap SystemCapability.ArkUI.ArkUI.Full 88 * @since 9 89 */ 90 /** 91 * Sets the custom title builder. 92 * 93 * @type { CustomBuilder } 94 * @syscap SystemCapability.ArkUI.ArkUI.Full 95 * @crossplatform 96 * @since 10 97 */ 98 builder: CustomBuilder; 99 100 /** 101 * Sets the custom title height. 102 * 103 * @type { TitleHeight | Length } 104 * @syscap SystemCapability.ArkUI.ArkUI.Full 105 * @since 9 106 */ 107 /** 108 * Sets the custom title height. 109 * 110 * @type { TitleHeight | Length } 111 * @syscap SystemCapability.ArkUI.ArkUI.Full 112 * @crossplatform 113 * @since 10 114 */ 115 height: TitleHeight | Length; 116} 117 118/** 119 * The construct function of NavDestination. 120 * 121 * @interface NavDestinationInterface 122 * @syscap SystemCapability.ArkUI.ArkUI.Full 123 * @since 9 124 */ 125/** 126 * The construct function of NavDestination. 127 * 128 * @interface NavDestinationInterface 129 * @syscap SystemCapability.ArkUI.ArkUI.Full 130 * @crossplatform 131 * @since 10 132 */ 133declare interface NavDestinationInterface { 134 /** 135 * Constructor. 136 * 137 * @returns { NavDestinationAttribute } 138 * @syscap SystemCapability.ArkUI.ArkUI.Full 139 * @since 9 140 */ 141 /** 142 * Constructor. 143 * 144 * @returns { NavDestinationAttribute } 145 * @syscap SystemCapability.ArkUI.ArkUI.Full 146 * @crossplatform 147 * @since 10 148 */ 149 (): NavDestinationAttribute; 150} 151 152/** 153 * The attribute function of NavDestination 154 * 155 * @extends CommonMethod 156 * @syscap SystemCapability.ArkUI.ArkUI.Full 157 * @since 9 158 */ 159/** 160 * The attribute function of NavDestination 161 * 162 * @extends CommonMethod 163 * @syscap SystemCapability.ArkUI.ArkUI.Full 164 * @crossplatform 165 * @since 10 166 */ 167declare class NavDestinationAttribute extends CommonMethod<NavDestinationAttribute> { 168 /** 169 * Navigation title bar 170 * 171 * @param { string | CustomBuilder | NavDestinationCommonTitle | NavDestinationCustomTitle } value 172 * @returns { NavDestinationAttribute } 173 * @syscap SystemCapability.ArkUI.ArkUI.Full 174 * @since 9 175 */ 176 /** 177 * Navigation title bar 178 * 179 * @param { string | CustomBuilder | NavDestinationCommonTitle | NavDestinationCustomTitle } value 180 * @returns { NavDestinationAttribute } 181 * @syscap SystemCapability.ArkUI.ArkUI.Full 182 * @crossplatform 183 * @since 10 184 */ 185 title(value: string | CustomBuilder | NavDestinationCommonTitle | NavDestinationCustomTitle): NavDestinationAttribute; 186 187 /** 188 * Hide navigation title bar 189 * 190 * @param { boolean } value 191 * @returns { NavDestinationAttribute } 192 * @syscap SystemCapability.ArkUI.ArkUI.Full 193 * @since 9 194 */ 195 /** 196 * Hide navigation title bar 197 * 198 * @param { boolean } value 199 * @returns { NavDestinationAttribute } 200 * @syscap SystemCapability.ArkUI.ArkUI.Full 201 * @crossplatform 202 * @since 10 203 */ 204 hideTitleBar(value: boolean): NavDestinationAttribute; 205 206 /** 207 * Invoked when the navDestination page is displayed. 208 * 209 * @param { function } callback - Indicates callback when the navDestination page is displayed. 210 * @returns { NavDestinationAttribute } 211 * @syscap SystemCapability.ArkUI.ArkUI.Full 212 * @crossplatform 213 * @since 10 214 */ 215 onShown(callback: () => void): NavDestinationAttribute; 216 217 /** 218 * Invoked when the navDestination is hidden. 219 * 220 * @param { function } callback - Indicates callback when the navDestination is hidden. 221 * @returns { NavDestinationAttribute } 222 * @syscap SystemCapability.ArkUI.ArkUI.Full 223 * @crossplatform 224 * @since 10 225 */ 226 onHidden(callback: () => void): NavDestinationAttribute; 227 228 /** 229 * Invoked when the backButton is pressed. 230 * 231 * @param { function } callback - Indicates callback when the backButton is pressed. 232 * @returns { NavDestinationAttribute } 233 * @syscap SystemCapability.ArkUI.ArkUI.Full 234 * @crossplatform 235 * @since 10 236 */ 237 onBackPressed(callback: () => boolean): NavDestinationAttribute; 238} 239 240/** 241 * Defines NavDestination Component. 242 * 243 * @syscap SystemCapability.ArkUI.ArkUI.Full 244 * @since 9 245 */ 246/** 247 * Defines NavDestination Component. 248 * 249 * @syscap SystemCapability.ArkUI.ArkUI.Full 250 * @crossplatform 251 * @since 10 252 */ 253declare const NavDestination: NavDestinationInterface; 254 255/** 256 * Defines NavDestination Component instance. 257 * 258 * @syscap SystemCapability.ArkUI.ArkUI.Full 259 * @since 9 260 */ 261/** 262 * Defines NavDestination Component instance. 263 * 264 * @syscap SystemCapability.ArkUI.ArkUI.Full 265 * @crossplatform 266 * @since 10 267 */ 268declare const NavDestinationInstance: NavDestinationAttribute; 269