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