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