• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 2021-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 * Declare the jump method.
23 *
24 * @enum { number }
25 * @syscap SystemCapability.ArkUI.ArkUI.Full
26 * @since 7
27 */
28/**
29 * Declare the jump method.
30 *
31 * @enum { number }
32 * @syscap SystemCapability.ArkUI.ArkUI.Full
33 * @crossplatform
34 * @since 10
35 */
36/**
37 * Declare the jump method.
38 *
39 * @enum { number }
40 * @syscap SystemCapability.ArkUI.ArkUI.Full
41 * @crossplatform
42 * @atomicservice
43 * @since 11
44 */
45declare enum RouteType {
46  /**
47   * The page is not redirected.
48   *
49   * @syscap SystemCapability.ArkUI.ArkUI.Full
50   * @since 7
51   */
52  /**
53   * The page is not redirected.
54   *
55   * @syscap SystemCapability.ArkUI.ArkUI.Full
56   * @crossplatform
57   * @since 10
58   */
59  /**
60   * The page is not redirected.
61   *
62   * @syscap SystemCapability.ArkUI.ArkUI.Full
63   * @crossplatform
64   * @atomicservice
65   * @since 11
66   */
67  None,
68
69  /**
70   * Go to the next page.
71   *
72   * @syscap SystemCapability.ArkUI.ArkUI.Full
73   * @since 7
74   */
75  /**
76   * Go to the next page.
77   *
78   * @syscap SystemCapability.ArkUI.ArkUI.Full
79   * @crossplatform
80   * @since 10
81   */
82  /**
83   * Go to the next page.
84   *
85   * @syscap SystemCapability.ArkUI.ArkUI.Full
86   * @crossplatform
87   * @atomicservice
88   * @since 11
89   */
90  Push,
91
92  /**
93   * Redirect to a specified page.
94   *
95   * @syscap SystemCapability.ArkUI.ArkUI.Full
96   * @since 7
97   */
98  /**
99   * Redirect to a specified page.
100   *
101   * @syscap SystemCapability.ArkUI.ArkUI.Full
102   * @crossplatform
103   * @since 10
104   */
105  /**
106   * Redirect to a specified page.
107   *
108   * @syscap SystemCapability.ArkUI.ArkUI.Full
109   * @crossplatform
110   * @atomicservice
111   * @since 11
112   */
113  Pop,
114}
115
116/**
117 * Declare the sliding effect of transition.
118 *
119 * @enum { number }
120 * @syscap SystemCapability.ArkUI.ArkUI.Full
121 * @since 7
122 */
123/**
124 * Declare the sliding effect of transition.
125 *
126 * @enum { number }
127 * @syscap SystemCapability.ArkUI.ArkUI.Full
128 * @crossplatform
129 * @since 10
130 */
131/**
132 * Declare the sliding effect of transition.
133 *
134 * @enum { number }
135 * @syscap SystemCapability.ArkUI.ArkUI.Full
136 * @crossplatform
137 * @atomicservice
138 * @since 11
139 */
140declare enum SlideEffect {
141  /**
142   * Swipe left.
143   *
144   * @syscap SystemCapability.ArkUI.ArkUI.Full
145   * @since 7
146   */
147  /**
148   * Swipe left.
149   *
150   * @syscap SystemCapability.ArkUI.ArkUI.Full
151   * @crossplatform
152   * @since 10
153   */
154  /**
155   * Swipe left.
156   *
157   * @syscap SystemCapability.ArkUI.ArkUI.Full
158   * @crossplatform
159   * @atomicservice
160   * @since 11
161   */
162  Left,
163
164  /**
165   * Swipe right.
166   *
167   * @syscap SystemCapability.ArkUI.ArkUI.Full
168   * @since 7
169   */
170  /**
171   * Swipe right.
172   *
173   * @syscap SystemCapability.ArkUI.ArkUI.Full
174   * @crossplatform
175   * @since 10
176   */
177  /**
178   * Swipe right.
179   *
180   * @syscap SystemCapability.ArkUI.ArkUI.Full
181   * @crossplatform
182   * @atomicservice
183   * @since 11
184   */
185  Right,
186
187  /**
188   * Swipe top.
189   *
190   * @syscap SystemCapability.ArkUI.ArkUI.Full
191   * @since 7
192   */
193  /**
194   * Swipe top.
195   *
196   * @syscap SystemCapability.ArkUI.ArkUI.Full
197   * @crossplatform
198   * @since 10
199   */
200  /**
201   * Swipe top.
202   *
203   * @syscap SystemCapability.ArkUI.ArkUI.Full
204   * @crossplatform
205   * @atomicservice
206   * @since 11
207   */
208  Top,
209
210  /**
211   * Swipe bottom.
212   *
213   * @syscap SystemCapability.ArkUI.ArkUI.Full
214   * @since 7
215   */
216  /**
217   * Swipe bottom.
218   *
219   * @syscap SystemCapability.ArkUI.ArkUI.Full
220   * @crossplatform
221   * @since 10
222   */
223  /**
224   * Swipe bottom.
225   *
226   * @syscap SystemCapability.ArkUI.ArkUI.Full
227   * @crossplatform
228   * @atomicservice
229   * @since 11
230   */
231  Bottom,
232
233  /**
234   * Swipe start.
235   *
236   * @syscap SystemCapability.ArkUI.ArkUI.Full
237   * @crossplatform
238   * @atomicservice
239   * @since 12
240   */
241  START = 5,
242
243  /**
244   * Swipe end.
245   *
246   * @syscap SystemCapability.ArkUI.ArkUI.Full
247   * @crossplatform
248   * @atomicservice
249   * @since 12
250   */
251  END = 6,
252}
253
254/**
255 * Provides interfaces for common transitions.
256 *
257 * @syscap SystemCapability.ArkUI.ArkUI.Full
258 * @since 7
259 */
260/**
261 * Provides interfaces for common transitions.
262 *
263 * @syscap SystemCapability.ArkUI.ArkUI.Full
264 * @crossplatform
265 * @since 10
266 */
267/**
268 * Provides interfaces for common transitions.
269 *
270 * @syscap SystemCapability.ArkUI.ArkUI.Full
271 * @crossplatform
272 * @atomicservice
273 * @since 11
274 */
275declare class CommonTransition<T> {
276  /**
277   * Called when a transition method is required.
278   *
279   * @syscap SystemCapability.ArkUI.ArkUI.Full
280   * @since 7
281   */
282  /**
283   * Called when a transition method is required.
284   *
285   * @syscap SystemCapability.ArkUI.ArkUI.Full
286   * @crossplatform
287   * @since 10
288   */
289  /**
290   * Called when a transition method is required.
291   *
292   * @syscap SystemCapability.ArkUI.ArkUI.Full
293   * @crossplatform
294   * @atomicservice
295   * @since 11
296   */
297  constructor();
298
299  /**
300   * Called when the slide in effect of the transition is set.
301   *
302   * @param { SlideEffect } value
303   * @returns { T }
304   * @syscap SystemCapability.ArkUI.ArkUI.Full
305   * @since 7
306   */
307  /**
308   * Called when the slide in effect of the transition is set.
309   *
310   * @param { SlideEffect } value
311   * @returns { T }
312   * @syscap SystemCapability.ArkUI.ArkUI.Full
313   * @crossplatform
314   * @since 10
315   */
316  /**
317   * Called when the slide in effect of the transition is set.
318   *
319   * @param { SlideEffect } value
320   * @returns { T }
321   * @syscap SystemCapability.ArkUI.ArkUI.Full
322   * @crossplatform
323   * @atomicservice
324   * @since 11
325   */
326  slide(value: SlideEffect): T;
327
328  /**
329   * Called when the translation effect of page transition is set.
330   *
331   * @param { object } value
332   * @returns { T }
333   * @syscap SystemCapability.ArkUI.ArkUI.Full
334   * @since 7
335   */
336  /**
337   * Called when the translation effect of page transition is set.
338   *
339   * @param { object } value
340   * @returns { T }
341   * @syscap SystemCapability.ArkUI.ArkUI.Full
342   * @crossplatform
343   * @since 10
344   */
345  /**
346   * Called when the translation effect of page transition is set.
347   *
348   * @param { object } value
349   * @returns { T }
350   * @syscap SystemCapability.ArkUI.ArkUI.Full
351   * @crossplatform
352   * @atomicservice
353   * @since 11
354   */
355  /**
356   * Called when the translation effect of page transition is set.
357   *
358   * Anonymous Object Rectification.
359   * @param { TranslateOptions } value
360   * @returns { T }
361   * @syscap SystemCapability.ArkUI.ArkUI.Full
362   * @crossplatform
363   * @atomicservice
364   * @since 18
365   */
366  translate(value: TranslateOptions): T;
367
368  /**
369   * Called when setting the zoom effect of page transition.
370   *
371   * @param { object } value
372   * @returns { T }
373   * @syscap SystemCapability.ArkUI.ArkUI.Full
374   * @since 7
375   */
376  /**
377   * Called when setting the zoom effect of page transition.
378   *
379   * @param { object } value
380   * @returns { T }
381   * @syscap SystemCapability.ArkUI.ArkUI.Full
382   * @crossplatform
383   * @since 10
384   */
385  /**
386   * Called when setting the zoom effect of page transition.
387   *
388   * @param { object } value
389   * @returns { T }
390   * @syscap SystemCapability.ArkUI.ArkUI.Full
391   * @crossplatform
392   * @atomicservice
393   * @since 11
394   */
395  /**
396   * Called when setting the zoom effect of page transition.
397   *
398   * Anonymous Object Rectification.
399   * @param { ScaleOptions } value
400   * @returns { T }
401   * @syscap SystemCapability.ArkUI.ArkUI.Full
402   * @crossplatform
403   * @atomicservice
404   * @since 18
405   */
406  scale(value: ScaleOptions): T;
407
408  /**
409   * Called when the transparency value of the starting point of entry or the ending point of exit is set.
410   *
411   * @param { number } value
412   * @returns { T }
413   * @syscap SystemCapability.ArkUI.ArkUI.Full
414   * @since 7
415   */
416  /**
417   * Called when the transparency value of the starting point of entry or the ending point of exit is set.
418   *
419   * @param { number } value
420   * @returns { T }
421   * @syscap SystemCapability.ArkUI.ArkUI.Full
422   * @crossplatform
423   * @since 10
424   */
425  /**
426   * Called when the transparency value of the starting point of entry or the ending point of exit is set.
427   *
428   * @param { number } value
429   * @returns { T }
430   * @syscap SystemCapability.ArkUI.ArkUI.Full
431   * @crossplatform
432   * @atomicservice
433   * @since 11
434   */
435  opacity(value: number): T;
436}
437
438/**
439 * Defines pageTransition constructor parameters.
440 *
441 * @interface PageTransitionOptions
442 * @syscap SystemCapability.ArkUI.ArkUI.Full
443 * @since 7
444 */
445/**
446 * Defines pageTransition constructor parameters.
447 *
448 * @interface PageTransitionOptions
449 * @syscap SystemCapability.ArkUI.ArkUI.Full
450 * @crossplatform
451 * @since 10
452 */
453/**
454 * Defines pageTransition constructor parameters.
455 *
456 * @interface PageTransitionOptions
457 * @syscap SystemCapability.ArkUI.ArkUI.Full
458 * @crossplatform
459 * @atomicservice
460 * @since 11
461 */
462declare interface PageTransitionOptions {
463  /**
464   * RouteType in which the pageTransition can work.
465   * @type { ?RouteType }
466   * @syscap SystemCapability.ArkUI.ArkUI.Full
467   * @since 7
468   */
469  /**
470   * RouteType in which the pageTransition can work.
471   * @type { ?RouteType }
472   * @syscap SystemCapability.ArkUI.ArkUI.Full
473   * @crossplatform
474   * @since 10
475   */
476  /**
477   * RouteType in which the pageTransition can work.
478   * @type { ?RouteType }
479   * @syscap SystemCapability.ArkUI.ArkUI.Full
480   * @crossplatform
481   * @atomicservice
482   * @since 11
483   */
484  type?: RouteType;
485  /**
486   * PageTransition animation duration, in ms.
487   * @type { ?number }
488   * @syscap SystemCapability.ArkUI.ArkUI.Full
489   * @since 7
490   */
491  /**
492   * PageTransition animation duration, in ms.
493   * @type { ?number }
494   * @syscap SystemCapability.ArkUI.ArkUI.Full
495   * @crossplatform
496   * @since 10
497   */
498  /**
499   * PageTransition animation duration, in ms.
500   * @type { ?number }
501   * @syscap SystemCapability.ArkUI.ArkUI.Full
502   * @crossplatform
503   * @atomicservice
504   * @since 11
505   */
506  duration?: number;
507  /**
508   * PageTransition animation curve.
509   * @type { ?(Curve | string) }
510   * @default Curve.Linear
511   * @syscap SystemCapability.ArkUI.ArkUI.Full
512   * @since 7
513   */
514  /**
515   * PageTransition animation curve.
516   * @type { ?(Curve | string | ICurve) }
517   * @default Curve.Linear
518   * @syscap SystemCapability.ArkUI.ArkUI.Full
519   * @crossplatform
520   * @since 10
521   */
522  /**
523   * PageTransition animation curve.
524   * @type { ?(Curve | string | ICurve) }
525   * @default Curve.Linear
526   * @syscap SystemCapability.ArkUI.ArkUI.Full
527   * @crossplatform
528   * @atomicservice
529   * @since 11
530   */
531  curve?: Curve | string | ICurve;
532  /**
533   * PageTransition animation delay time, in ms.
534   * @type { ?number }
535   * @default 0
536   * @syscap SystemCapability.ArkUI.ArkUI.Full
537   * @since 7
538   */
539  /**
540   * PageTransition animation delay time, in ms.
541   * @type { ?number }
542   * @default 0
543   * @syscap SystemCapability.ArkUI.ArkUI.Full
544   * @crossplatform
545   * @since 10
546   */
547  /**
548   * PageTransition animation delay time, in ms.
549   * @type { ?number }
550   * @default 0
551   * @syscap SystemCapability.ArkUI.ArkUI.Full
552   * @crossplatform
553   * @atomicservice
554   * @since 11
555   */
556  delay?: number;
557}
558
559/**
560 * Callback used to report page trasition events.
561 *
562 * @typedef { function } PageTransitionCallback
563 * @param { RouteType } type - transition route type
564 * @param { number } progress - transition progess
565 * @syscap SystemCapability.ArkUI.ArkUI.Full
566 * @crossplatform
567 * @atomicservice
568 * @since 18
569 */
570declare type PageTransitionCallback = (type: RouteType, progress: number) => void;
571
572/**
573 * Provides an interface for page rotation mode.
574 *
575 * @extends CommonTransition<PageTransitionEnterInterface>
576 * @interface PageTransitionEnterInterface
577 * @syscap SystemCapability.ArkUI.ArkUI.Full
578 * @since 7
579 */
580/**
581 * Provides an interface to set transition style when a page enters.
582 *
583 * @extends CommonTransition<PageTransitionEnterInterface>
584 * @interface PageTransitionEnterInterface
585 * @syscap SystemCapability.ArkUI.ArkUI.Full
586 * @crossplatform
587 * @since 10
588 */
589/**
590 * Provides an interface to set transition style when a page enters.
591 *
592 * @extends CommonTransition<PageTransitionEnterInterface>
593 * @interface PageTransitionEnterInterface
594 * @syscap SystemCapability.ArkUI.ArkUI.Full
595 * @crossplatform
596 * @atomicservice
597 * @since 11
598 */
599interface PageTransitionEnterInterface extends CommonTransition<PageTransitionEnterInterface> {
600  /**
601   * Called when page Jump animation is used.
602   *
603   * @param { PageTransitionOptions } value
604   * @returns { PageTransitionEnterInterface }
605   * @syscap SystemCapability.ArkUI.ArkUI.Full
606   * @since 7
607   */
608  /**
609   * Called when page Jump animation is used.
610   *
611   * @param { PageTransitionOptions } value - pageTransition options
612   * @returns { PageTransitionEnterInterface }
613   * @syscap SystemCapability.ArkUI.ArkUI.Full
614   * @crossplatform
615   * @since 10
616   */
617  /**
618   * Called when page Jump animation is used.
619   *
620   * @param { PageTransitionOptions } value - pageTransition options
621   * @returns { PageTransitionEnterInterface }
622   * @syscap SystemCapability.ArkUI.ArkUI.Full
623   * @crossplatform
624   * @atomicservice
625   * @since 11
626   */
627  (value: PageTransitionOptions): PageTransitionEnterInterface;
628
629  /**
630   * Called when the incoming parameter is the normalized progress of the current incoming animation.
631   *
632   * @param { function } event
633   * @returns { PageTransitionEnterInterface }
634   * @syscap SystemCapability.ArkUI.ArkUI.Full
635   * @since 7
636   */
637  /**
638   * Called frame by frame to customize pageTransition animation when the page enters.
639   * The incoming parameter is the normalized progress of the current incoming animation.
640   *
641   * @param { function } event - animation callback frame by frame
642   * @returns { PageTransitionEnterInterface }
643   * @syscap SystemCapability.ArkUI.ArkUI.Full
644   * @crossplatform
645   * @since 10
646   */
647  /**
648   * Called frame by frame to customize pageTransition animation when the page enters.
649   * The incoming parameter is the normalized progress of the current incoming animation.
650   *
651   * @param { function } event - animation callback frame by frame
652   * @returns { PageTransitionEnterInterface }
653   * @syscap SystemCapability.ArkUI.ArkUI.Full
654   * @crossplatform
655   * @atomicservice
656   * @since 11
657   */
658  /**
659   * Called frame by frame to customize pageTransition animation when the page enters.
660   * The incoming parameter is the normalized progress of the current incoming animation.
661   *
662   * Anonymous Object Rectification.
663   * @param { PageTransitionCallback } event - animation callback frame by frame
664   * @returns { PageTransitionEnterInterface }
665   * @syscap SystemCapability.ArkUI.ArkUI.Full
666   * @crossplatform
667   * @atomicservice
668   * @since 18
669   */
670  onEnter(event: PageTransitionCallback): PageTransitionEnterInterface;
671}
672
673/**
674 * Provide an interface to exit the transition.
675 *
676 * @extends CommonTransition<PageTransitionExitInterface>
677 * @interface PageTransitionExitInterface
678 * @syscap SystemCapability.ArkUI.ArkUI.Full
679 * @since 7
680 */
681/**
682 * Provide an interface to set transition style when a page exits.
683 *
684 * @extends CommonTransition<PageTransitionExitInterface>
685 * @interface PageTransitionExitInterface
686 * @syscap SystemCapability.ArkUI.ArkUI.Full
687 * @crossplatform
688 * @since 10
689 */
690/**
691 * Provide an interface to set transition style when a page exits.
692 *
693 * @extends CommonTransition<PageTransitionExitInterface>
694 * @interface PageTransitionExitInterface
695 * @syscap SystemCapability.ArkUI.ArkUI.Full
696 * @crossplatform
697 * @atomicservice
698 * @since 11
699 */
700interface PageTransitionExitInterface extends CommonTransition<PageTransitionExitInterface> {
701  /**
702   * Called when the transition is delayed.
703   *
704   * @param { PageTransitionOptions } value
705   * @returns { PageTransitionExitInterface }
706   * @syscap SystemCapability.ArkUI.ArkUI.Full
707   * @since 7
708   */
709  /**
710   * Called when page Jump animation is used.
711   *
712   * @param { PageTransitionOptions } value - pageTransition options
713   * @returns { PageTransitionExitInterface }
714   * @syscap SystemCapability.ArkUI.ArkUI.Full
715   * @crossplatform
716   * @since 10
717   */
718  /**
719   * Called when page Jump animation is used.
720   *
721   * @param { PageTransitionOptions } value - pageTransition options
722   * @returns { PageTransitionExitInterface }
723   * @syscap SystemCapability.ArkUI.ArkUI.Full
724   * @crossplatform
725   * @atomicservice
726   * @since 11
727   */
728  (value: PageTransitionOptions): PageTransitionExitInterface;
729
730  /**
731   * Called when the input parameter is the normalized progress of the current exit animation.
732   *
733   * @param { function } event
734   * @returns { PageTransitionExitInterface }
735   * @syscap SystemCapability.ArkUI.ArkUI.Full
736   * @since 7
737   */
738  /**
739   * Called frame by frame to customize pageTransition animation when the page exits.
740   * The input parameter is the normalized progress of the current exit animation.
741   *
742   * @param { function } event
743   * @returns { PageTransitionExitInterface }
744   * @syscap SystemCapability.ArkUI.ArkUI.Full
745   * @crossplatform
746   * @since 10
747   */
748  /**
749   * Called frame by frame to customize pageTransition animation when the page exits.
750   * The input parameter is the normalized progress of the current exit animation.
751   *
752   * @param { function } event
753   * @returns { PageTransitionExitInterface }
754   * @syscap SystemCapability.ArkUI.ArkUI.Full
755   * @crossplatform
756   * @atomicservice
757   * @since 11
758   */
759  /**
760   * Called frame by frame to customize pageTransition animation when the page exits.
761   * The input parameter is the normalized progress of the current exit animation.
762   *
763   * Anonymous Object Rectification.
764   * @param { PageTransitionCallback } event
765   * @returns { PageTransitionExitInterface }
766   * @syscap SystemCapability.ArkUI.ArkUI.Full
767   * @crossplatform
768   * @atomicservice
769   * @since 18
770   */
771  onExit(event: PageTransitionCallback): PageTransitionExitInterface;
772}
773
774/**
775 * Defines PageTransitionEnter Component.
776 *
777 * @syscap SystemCapability.ArkUI.ArkUI.Full
778 * @since 7
779 */
780/**
781 * Defines PageTransitionEnter Component.
782 *
783 * @syscap SystemCapability.ArkUI.ArkUI.Full
784 * @crossplatform
785 * @since 10
786 */
787/**
788 * Defines PageTransitionEnter Component.
789 *
790 * @syscap SystemCapability.ArkUI.ArkUI.Full
791 * @crossplatform
792 * @atomicservice
793 * @since 11
794 */
795declare const PageTransitionEnter: PageTransitionEnterInterface;
796
797/**
798 * Defines PageTransitionExit Component.
799 *
800 * @syscap SystemCapability.ArkUI.ArkUI.Full
801 * @since 7
802 */
803/**
804 * Defines PageTransitionExit Component.
805 *
806 * @syscap SystemCapability.ArkUI.ArkUI.Full
807 * @crossplatform
808 * @since 10
809 */
810/**
811 * Defines PageTransitionExit Component.
812 *
813 * @syscap SystemCapability.ArkUI.ArkUI.Full
814 * @crossplatform
815 * @atomicservice
816 * @since 11
817 */
818declare const PageTransitionExit: PageTransitionExitInterface;
819