1/* 2 * Copyright (c) 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 * @file 18 * @kit ArkUI 19 */ 20 21/** 22 * Import the WindowStatusType type object for onHoverStatusChange. 23 * 24 * @typedef {import('../api/@ohos.window').default.WindowStatusType} WindowStatusType 25 * @syscap SystemCapability.ArkUI.ArkUI.Full 26 * @atomicservice 27 * @since 12 28 */ 29declare type WindowStatusType = import('../api/@ohos.window').default.WindowStatusType; 30 31/** 32 * FolderStack constructor options. 33 * 34 * @interface FolderStackOptions 35 * @syscap SystemCapability.ArkUI.ArkUI.Full 36 * @crossplatform 37 * @atomicservice 38 * @since 18 39 */ 40interface FolderStackOptions { 41 /** 42 * Define the IDs of the sub component that will be moved to the upper half screen when hovering. 43 * 44 * @type { ?Array<string> } 45 * @syscap SystemCapability.ArkUI.ArkUI.Full 46 * @crossplatform 47 * @since 11 48 */ 49 /** 50 * Define the IDs of the sub component that will be moved to the upper half screen when hovering. 51 * 52 * @type { ?Array<string> } 53 * @syscap SystemCapability.ArkUI.ArkUI.Full 54 * @crossplatform 55 * @atomicservice 56 * @since 12 57 */ 58 /** 59 * Define the IDs of the sub component that will be moved to the upper half screen when hovering. 60 * 61 * Anonymous Object Rectification 62 * @type { ?Array<string> } 63 * @syscap SystemCapability.ArkUI.ArkUI.Full 64 * @crossplatform 65 * @atomicservice 66 * @since 18 67 */ 68 upperItems?: Array<string>; 69} 70 71/** 72 * Provides ports for stacking containers. 73 * 74 * @interface FolderStackInterface 75 * @syscap SystemCapability.ArkUI.ArkUI.Full 76 * @crossplatform 77 * @since 11 78 */ 79/** 80 * Provides ports for stacking containers. 81 * 82 * @interface FolderStackInterface 83 * @syscap SystemCapability.ArkUI.ArkUI.Full 84 * @crossplatform 85 * @atomicservice 86 * @since 12 87 */ 88 89interface FolderStackInterface { 90 /** 91 * Defines the constructor of folderStack. 92 * 93 * @param { object } value - id of children need to be show in upperItem 94 * @returns { FolderStackAttribute } 95 * @syscap SystemCapability.ArkUI.ArkUI.Full 96 * @crossplatform 97 * @since 11 98 */ 99 /** 100 * Defines the constructor of folderStack. 101 * 102 * @param { object } value - id of children need to be show in upperItem 103 * @returns { FolderStackAttribute } 104 * @syscap SystemCapability.ArkUI.ArkUI.Full 105 * @crossplatform 106 * @atomicservice 107 * @since 12 108 */ 109 /** 110 * Defines the constructor of folderStack. 111 * 112 * Anonymous Object Rectification 113 * @param { FolderStackOptions } [options] - id of children need to be show in upperItem 114 * @returns { FolderStackAttribute } 115 * @syscap SystemCapability.ArkUI.ArkUI.Full 116 * @crossplatform 117 * @atomicservice 118 * @since 18 119 */ 120 (options?: FolderStackOptions): FolderStackAttribute; 121} 122 123/** 124 * Information when onFolderStateChange. 125 * 126 * @interface OnFoldStatusChangeInfo 127 * @syscap SystemCapability.ArkUI.ArkUI.Full 128 * @crossplatform 129 * @atomicservice 130 * @since 18 131 */ 132interface OnFoldStatusChangeInfo { 133 /** 134 * Folder state. 135 * 136 * @type { FoldStatus } 137 * @syscap SystemCapability.ArkUI.ArkUI.Full 138 * @crossplatform 139 * @since 11 140 */ 141 /** 142 * Folder state. 143 * 144 * @type { FoldStatus } 145 * @syscap SystemCapability.ArkUI.ArkUI.Full 146 * @crossplatform 147 * @atomicservice 148 * @since 12 149 */ 150 /** 151 * Folder state. 152 * 153 * Anonymous Object Rectification 154 * @type { FoldStatus } 155 * @syscap SystemCapability.ArkUI.ArkUI.Full 156 * @crossplatform 157 * @atomicservice 158 * @since 18 159 */ 160 foldStatus: FoldStatus 161} 162 163/** 164 * Callback when onStateChangeCallback. 165 * 166 * Anonymous Object Rectification 167 * @typedef { function } OnFoldStatusChangeCallback 168 * @param { OnFoldStatusChangeInfo } event - the folding information of the current device 169 * @syscap SystemCapability.ArkUI.ArkUI.Full 170 * @crossplatform 171 * @atomicservice 172 * @since 18 173 */ 174declare type OnFoldStatusChangeCallback = (event: OnFoldStatusChangeInfo) => void; 175 176/** 177 * Callback when onHoverStatusChange. 178 * 179 * Anonymous Object Rectification 180 * @typedef { function } OnHoverStatusChangeCallback 181 * @param { HoverEventParam } param - hover event param 182 * @syscap SystemCapability.ArkUI.ArkUI.Full 183 * @atomicservice 184 * @since 18 185 */ 186declare type OnHoverStatusChangeCallback = (param: HoverEventParam) => void; 187 188/** 189/** 190 * @extends CommonMethod<FolderStackAttribute> 191 * @syscap SystemCapability.ArkUI.ArkUI.Full 192 * @crossplatform 193 * @since 11 194 */ 195/** 196 * @extends CommonMethod<FolderStackAttribute> 197 * @syscap SystemCapability.ArkUI.ArkUI.Full 198 * @crossplatform 199 * @atomicservice 200 * @since 12 201 */ 202declare class FolderStackAttribute extends CommonMethod<FolderStackAttribute> { 203 /** 204 * Set the alignment of folderStack. 205 * 206 * @param { Alignment } value - align of children 207 * @returns { FolderStackAttribute } 208 * @syscap SystemCapability.ArkUI.ArkUI.Full 209 * @crossplatform 210 * @since 11 211 */ 212 /** 213 * Set the alignment of folderStack. 214 * 215 * @param { Alignment } value - align of children 216 * @returns { FolderStackAttribute } 217 * @syscap SystemCapability.ArkUI.ArkUI.Full 218 * @crossplatform 219 * @atomicservice 220 * @since 12 221 */ 222 alignContent(value: Alignment): FolderStackAttribute; 223 224 /** 225 * Callback folderState when the folderState changes 226 * 227 * @param { function } callback - executed when folderStatus changed 228 * @returns { FolderStackAttribute } 229 * @syscap SystemCapability.ArkUI.ArkUI.Full 230 * @crossplatform 231 * @since 11 232 */ 233 /** 234 * Callback folderState when the folderState changes 235 * 236 * @param { function } callback - executed when folderStatus changed 237 * @returns { FolderStackAttribute } 238 * @syscap SystemCapability.ArkUI.ArkUI.Full 239 * @crossplatform 240 * @atomicservice 241 * @since 12 242 */ 243 /** 244 * Callback folderState when the folderState changes 245 * 246 * Anonymous Object Rectification 247 * @param { OnFoldStatusChangeCallback } callback - executed when folderStatus changed 248 * @returns { FolderStackAttribute } 249 * @syscap SystemCapability.ArkUI.ArkUI.Full 250 * @crossplatform 251 * @atomicservice 252 * @since 18 253 */ 254 onFolderStateChange(callback: OnFoldStatusChangeCallback): FolderStackAttribute; 255 256 257 /** 258 * Callback hoverStatus|folderStatus|rotation|windowMode when the hoverStatus changes 259 * 260 * @param { function } handler - executed when hoverStatus changed 261 * @returns { FolderStackAttribute } 262 * @syscap SystemCapability.ArkUI.ArkUI.Full 263 * @atomicservice 264 * @since 12 265 */ 266 /** 267 * Callback hoverStatus|folderStatus|rotation|windowMode when the hoverStatus changes 268 * 269 * Anonymous Object Rectification 270 * @param { OnHoverStatusChangeCallback } handler - executed when hoverStatus changed 271 * @returns { FolderStackAttribute } 272 * @syscap SystemCapability.ArkUI.ArkUI.Full 273 * @atomicservice 274 * @since 18 275 */ 276 onHoverStatusChange(handler: OnHoverStatusChangeCallback): FolderStackAttribute; 277 278 /** 279 * Enable the animation of folderStack. 280 * 281 * @param { boolean } value - enable the animation of folderStatus changed 282 * @returns { FolderStackAttribute } 283 * @syscap SystemCapability.ArkUI.ArkUI.Full 284 * @crossplatform 285 * @since 11 286 */ 287 /** 288 * Enable the animation of folderStack. 289 * 290 * @param { boolean } value - enable the animation of folderStatus changed 291 * @returns { FolderStackAttribute } 292 * @syscap SystemCapability.ArkUI.ArkUI.Full 293 * @crossplatform 294 * @atomicservice 295 * @since 12 296 */ 297 enableAnimation(value: boolean): FolderStackAttribute; 298 299 /** 300 * Enable auto halfFolder when orientation. 301 * 302 * @param { boolean } value - enable auto halfFold 303 * @returns { FolderStackAttribute } 304 * @syscap SystemCapability.ArkUI.ArkUI.Full 305 * @crossplatform 306 * @since 11 307 */ 308 /** 309 * Enable auto halfFolder when orientation. 310 * 311 * @param { boolean } value - enable auto halfFold 312 * @returns { FolderStackAttribute } 313 * @syscap SystemCapability.ArkUI.ArkUI.Full 314 * @crossplatform 315 * @atomicservice 316 * @since 12 317 */ 318 autoHalfFold(value: boolean): FolderStackAttribute; 319} 320 321/** 322 * Defines the Embed Data info. 323 * 324 * @interface HoverEventParam 325 * @syscap SystemCapability.ArkUI.ArkUI.Full 326 * @atomicservice 327 * @since 12 328 */ 329declare interface HoverEventParam { 330 /** 331 * Folder state. 332 * 333 * @type { FoldStatus } 334 * @syscap SystemCapability.ArkUI.ArkUI.Full 335 * @atomicservice 336 * @since 12 337 */ 338 foldStatus: FoldStatus 339 340 /** 341 * Is hover mode 342 * 343 * @type { boolean } 344 * @syscap SystemCapability.ArkUI.ArkUI.Full 345 * @atomicservice 346 * @since 12 347 */ 348 isHoverMode: boolean 349 350 /** 351 * App rotation 352 * 353 * @type { AppRotation } 354 * @syscap SystemCapability.ArkUI.ArkUI.Full 355 * @atomicservice 356 * @since 12 357 */ 358 appRotation: AppRotation 359 360 /** 361 * Window status type 362 * 363 * @type { WindowStatusType } 364 * @syscap SystemCapability.ArkUI.ArkUI.Full 365 * @atomicservice 366 * @since 12 367 */ 368 windowStatusType: WindowStatusType 369} 370/** 371 * Defines FolderStack Component. 372 * 373 * @syscap SystemCapability.ArkUI.ArkUI.Full 374 * @crossplatform 375 * @since 11 376 */ 377/** 378 * Defines FolderStack Component. 379 * 380 * @syscap SystemCapability.ArkUI.ArkUI.Full 381 * @crossplatform 382 * @atomicservice 383 * @since 12 384 */ 385declare const FolderStack: FolderStackInterface; 386 387/** 388 * Defines FolderStack Component instance. 389 * 390 * @syscap SystemCapability.ArkUI.ArkUI.Full 391 * @crossplatform 392 * @since 11 393 */ 394/** 395 * Defines FolderStack Component instance. 396 * 397 * @syscap SystemCapability.ArkUI.ArkUI.Full 398 * @crossplatform 399 * @atomicservice 400 * @since 12 401 */ 402declare const FolderStackInstance: FolderStackAttribute; 403