• 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/**
22 * Defines the ParticleOptions Interface.
23 * @interface ParticleOptions
24 * @syscap SystemCapability.ArkUI.ArkUI.Full
25 * @crossplatform
26 * @since 10
27 */
28/**
29 * Defines the ParticleOptions Interface.
30 * @interface ParticleOptions
31 * @syscap SystemCapability.ArkUI.ArkUI.Full
32 * @crossplatform
33 * @atomicservice
34 * @since 11
35 */
36interface ParticleOptions<
37  PARTICLE extends ParticleType,
38  COLOR_UPDATER extends ParticleUpdater,
39  OPACITY_UPDATER extends ParticleUpdater,
40  SCALE_UPDATER extends ParticleUpdater,
41  ACC_SPEED_UPDATER extends ParticleUpdater,
42  ACC_ANGLE_UPDATER extends ParticleUpdater,
43  SPIN_UPDATER extends ParticleUpdater
44> {
45  /**
46   * Particle emitter.
47   * @type { EmitterOptions<PARTICLE> }
48   * @syscap SystemCapability.ArkUI.ArkUI.Full
49   * @crossplatform
50   * @since 10
51   */
52  /**
53   * Particle emitter.
54   * @type { EmitterOptions<PARTICLE> }
55   * @syscap SystemCapability.ArkUI.ArkUI.Full
56   * @crossplatform
57   * @atomicservice
58   * @since 11
59   */
60  emitter: EmitterOptions<PARTICLE>;
61
62  /**
63   * Particle color.
64   * @type { ?ParticleColorPropertyOptions<COLOR_UPDATER> }
65   * @default {range:['#FFFFFF','#FFFFFF']}
66   * @syscap SystemCapability.ArkUI.ArkUI.Full
67   * @crossplatform
68   * @since 10
69   */
70  /**
71   * Particle color.
72   * @type { ?ParticleColorPropertyOptions<COLOR_UPDATER> }
73   * @default {range:['#FFFFFF','#FFFFFF']}
74   * @syscap SystemCapability.ArkUI.ArkUI.Full
75   * @crossplatform
76   * @atomicservice
77   * @since 11
78   */
79  color?: ParticleColorPropertyOptions<COLOR_UPDATER>;
80
81  /**
82   * Particle opacity.
83   * @type { ?ParticlePropertyOptions<number, OPACITY_UPDATER> }
84   * @default {range:[1.0,1.0]}
85   * @syscap SystemCapability.ArkUI.ArkUI.Full
86   * @crossplatform
87   * @since 10
88   */
89  /**
90   * Particle opacity.
91   * @type { ?ParticlePropertyOptions<number, OPACITY_UPDATER> }
92   * @default {range:[1.0,1.0]}
93   * @syscap SystemCapability.ArkUI.ArkUI.Full
94   * @crossplatform
95   * @atomicservice
96   * @since 11
97   */
98  opacity?: ParticlePropertyOptions<number, OPACITY_UPDATER>;
99
100  /**
101   * Particle scale.
102   * @type { ?ParticlePropertyOptions<number, SCALE_UPDATER> }
103   * @default {range:[1.0,1.0]}
104   * @syscap SystemCapability.ArkUI.ArkUI.Full
105   * @crossplatform
106   * @since 10
107   */
108  /**
109   * Particle scale.
110   * @type { ?ParticlePropertyOptions<number, SCALE_UPDATER> }
111   * @default {range:[1.0,1.0]}
112   * @syscap SystemCapability.ArkUI.ArkUI.Full
113   * @crossplatform
114   * @atomicservice
115   * @since 11
116   */
117  scale?: ParticlePropertyOptions<number, SCALE_UPDATER>;
118
119  /**
120   * Particle velocity.
121   * @type { ?object }
122   * @default {speed:[0,0];angle:[0,0]}
123   * @syscap SystemCapability.ArkUI.ArkUI.Full
124   * @crossplatform
125   * @since 10
126   */
127  /**
128   * Particle velocity.
129   * @type { ?object }
130   * @default {speed:[0,0];angle:[0,0]}
131   * @syscap SystemCapability.ArkUI.ArkUI.Full
132   * @crossplatform
133   * @atomicservice
134   * @since 11
135   */
136  velocity?: {
137    speed: [number, number];
138    angle: [number, number];
139  };
140
141  /**
142   * Particle acceleration.
143   * @type { ?object }
144   * @default {speed:{range:[0,0]};angle:{range:[0,0]}}
145   * @syscap SystemCapability.ArkUI.ArkUI.Full
146   * @crossplatform
147   * @since 10
148   */
149  /**
150   * Particle acceleration.
151   * @type { ?object }
152   * @default {speed:{range:[0,0]};angle:{range:[0,0]}}
153   * @syscap SystemCapability.ArkUI.ArkUI.Full
154   * @crossplatform
155   * @atomicservice
156   * @since 11
157   */
158  acceleration?: {
159    speed?: ParticlePropertyOptions<number, ACC_SPEED_UPDATER>;
160    angle?: ParticlePropertyOptions<number, ACC_ANGLE_UPDATER>;
161  };
162
163  /**
164   * Particle spin.
165   * @type { ?ParticlePropertyOptions<number, SPIN_UPDATER> }
166   * @default {range:[0,0]}
167   * @syscap SystemCapability.ArkUI.ArkUI.Full
168   * @crossplatform
169   * @since 10
170   */
171  /**
172   * Particle spin.
173   * @type { ?ParticlePropertyOptions<number, SPIN_UPDATER> }
174   * @default {range:[0,0]}
175   * @syscap SystemCapability.ArkUI.ArkUI.Full
176   * @crossplatform
177   * @atomicservice
178   * @since 11
179   */
180  spin?: ParticlePropertyOptions<number, SPIN_UPDATER>;
181}
182
183/**
184 * Defines the parameters for a point-like particle.
185 * @interface PointParticleParameters
186 * @syscap SystemCapability.ArkUI.ArkUI.Full
187 * @crossplatform
188 * @since 10
189 */
190/**
191 * Defines the parameters for a point-like particle.
192 * @interface PointParticleParameters
193 * @syscap SystemCapability.ArkUI.ArkUI.Full
194 * @crossplatform
195 * @atomicservice
196 * @since 11
197 */
198interface PointParticleParameters {
199  /**
200   * Particle radius.
201   * @type { VP }
202   * @syscap SystemCapability.ArkUI.ArkUI.Full
203   * @crossplatform
204   * @since 10
205   */
206  /**
207   * Particle radius.
208   * @type { VP }
209   * @syscap SystemCapability.ArkUI.ArkUI.Full
210   * @crossplatform
211   * @atomicservice
212   * @since 11
213   */
214  radius: VP;
215}
216
217/**
218 * Defines the parameters for an image-like particle.
219 * @interface ImageParticleParameters
220 * @syscap SystemCapability.ArkUI.ArkUI.Full
221 * @crossplatform
222 * @since 10
223 */
224/**
225 * Defines the parameters for an image-like particle.
226 * @interface ImageParticleParameters
227 * @syscap SystemCapability.ArkUI.ArkUI.Full
228 * @crossplatform
229 * @atomicservice
230 * @since 11
231 */
232interface ImageParticleParameters {
233  /**
234   * Particle image pixelMap.
235   * @type { ResourceStr }
236   * @syscap SystemCapability.ArkUI.ArkUI.Full
237   * @crossplatform
238   * @since 10
239   */
240  /**
241   * Particle image pixelMap.
242   * @type { ResourceStr }
243   * @syscap SystemCapability.ArkUI.ArkUI.Full
244   * @crossplatform
245   * @atomicservice
246   * @since 11
247   */
248  src: ResourceStr;
249
250  /**
251   * Particle image size.
252   * @type { [Dimension, Dimension] }
253   * @syscap SystemCapability.ArkUI.ArkUI.Full
254   * @crossplatform
255   * @since 10
256   */
257  /**
258   * Particle image size.
259   * @type { [Dimension, Dimension] }
260   * @syscap SystemCapability.ArkUI.ArkUI.Full
261   * @crossplatform
262   * @atomicservice
263   * @since 11
264   */
265  size: [Dimension, Dimension];
266
267  /**
268   * Image fit.
269   * @type { ?ImageFit }
270   * @default ImageFit.Cover
271   * @syscap SystemCapability.ArkUI.ArkUI.Full
272   * @crossplatform
273   * @since 10
274   */
275  /**
276   * Image fit.
277   * @type { ?ImageFit }
278   * @default ImageFit.Cover
279   * @syscap SystemCapability.ArkUI.ArkUI.Full
280   * @crossplatform
281   * @atomicservice
282   * @since 11
283   */
284  objectFit?: ImageFit;
285}
286
287/**
288 * Defines the particle configs.
289 * @interface ParticleConfigs
290 * @syscap SystemCapability.ArkUI.ArkUI.Full
291 * @crossplatform
292 * @since 10
293 */
294/**
295 * Defines the particle configs.
296 * @interface ParticleConfigs
297 * @syscap SystemCapability.ArkUI.ArkUI.Full
298 * @crossplatform
299 * @atomicservice
300 * @since 11
301 */
302interface ParticleConfigs {
303  /**
304   * Point-like Particle.
305   * @type { PointParticleParameters }
306   * @syscap SystemCapability.ArkUI.ArkUI.Full
307   * @crossplatform
308   * @since 10
309   */
310  /**
311   * Point-like Particle.
312   * @type { PointParticleParameters }
313   * @syscap SystemCapability.ArkUI.ArkUI.Full
314   * @crossplatform
315   * @atomicservice
316   * @since 11
317   */
318  [ParticleType.POINT]: PointParticleParameters;
319
320  /**
321   * Image-like Particle.
322   * @type { ImageParticleParameters }
323   * @syscap SystemCapability.ArkUI.ArkUI.Full
324   * @crossplatform
325   * @since 10
326   */
327  /**
328   * Image-like Particle.
329   * @type { ImageParticleParameters }
330   * @syscap SystemCapability.ArkUI.ArkUI.Full
331   * @crossplatform
332   * @atomicservice
333   * @since 11
334   */
335  [ParticleType.IMAGE]: ImageParticleParameters;
336}
337
338/**
339 * Defines the emitter property.
340 *
341 * @interface EmitterProperty
342 * @syscap SystemCapability.ArkUI.ArkUI.Full
343 * @crossplatform
344 * @since 12
345 */
346interface EmitterProperty {
347
348  /**
349   * Emitter index.
350   *
351   * @type { number }
352   * @syscap SystemCapability.ArkUI.ArkUI.Full
353   * @crossplatform
354   * @since 12
355   */
356  index : number;
357
358  /**
359   * Emitter emission rate.
360   *
361   * @type { ?number }
362   * @syscap SystemCapability.ArkUI.ArkUI.Full
363   * @crossplatform
364   * @since 12
365   */
366  emitRate?: number;
367
368  /**
369   * Emitter emission rate. Only support number type.
370   *
371   * @type { ?PositionT<number> }
372   * @syscap SystemCapability.ArkUI.ArkUI.Full
373   * @crossplatform
374   * @since 12
375   */
376  position?: PositionT<number>;
377
378  /**
379   * Emitter emission window size. Only support number type.
380   *
381   * @type { ?SizeT<number> }
382   * @syscap SystemCapability.ArkUI.ArkUI.Full
383   * @crossplatform
384   * @since 12
385   */
386  size?: SizeT<number>;
387}
388
389/**
390 * Defines the emitter Options.
391 * @interface EmitterOptions
392 * @syscap SystemCapability.ArkUI.ArkUI.Full
393 * @crossplatform
394 * @since 10
395 */
396/**
397 * Defines the emitter Options.
398 * @interface EmitterOptions
399 * @syscap SystemCapability.ArkUI.ArkUI.Full
400 * @crossplatform
401 * @atomicservice
402 * @since 11
403 */
404interface EmitterOptions<PARTICLE extends ParticleType> {
405  /**
406   * Set particle config.
407   * @type { object }
408   * @syscap SystemCapability.ArkUI.ArkUI.Full
409   * @crossplatform
410   * @since 10
411   */
412  /**
413   * Set particle config.
414   * @type { object }
415   * @syscap SystemCapability.ArkUI.ArkUI.Full
416   * @crossplatform
417   * @atomicservice
418   * @since 11
419   */
420  particle: {
421    /**
422     * Particle type.
423     * @type { PARTICLE }
424     * @syscap SystemCapability.ArkUI.ArkUI.Full
425     * @crossplatform
426     * @since 10
427     */
428    /**
429     * Particle type.
430     * @type { PARTICLE }
431     * @syscap SystemCapability.ArkUI.ArkUI.Full
432     * @crossplatform
433     * @atomicservice
434     * @since 11
435     */
436    type: PARTICLE;
437    /**
438     * Particle config.
439     * @type { ParticleConfigs[PARTICLE] }
440     * @syscap SystemCapability.ArkUI.ArkUI.Full
441     * @crossplatform
442     * @since 10
443     */
444    /**
445     * Particle config.
446     * @type { ParticleConfigs[PARTICLE] }
447     * @syscap SystemCapability.ArkUI.ArkUI.Full
448     * @crossplatform
449     * @atomicservice
450     * @since 11
451     */
452    config: ParticleConfigs[PARTICLE];
453
454    /**
455     * Particle count.
456     * @type { number }
457     * @syscap SystemCapability.ArkUI.ArkUI.Full
458     * @crossplatform
459     * @since 10
460     */
461    /**
462     * Particle count.
463     * @type { number }
464     * @syscap SystemCapability.ArkUI.ArkUI.Full
465     * @crossplatform
466     * @atomicservice
467     * @since 11
468     */
469    count: number;
470
471    /**
472     * Particle lifetime.
473     * @type { ?number }
474     * @default 1000
475     * @syscap SystemCapability.ArkUI.ArkUI.Full
476     * @crossplatform
477     * @since 10
478     */
479    /**
480     * Particle lifetime.
481     * @type { ?number }
482     * @default 1000
483     * @syscap SystemCapability.ArkUI.ArkUI.Full
484     * @crossplatform
485     * @atomicservice
486     * @since 11
487     */
488    lifetime?: number;
489
490    /**
491     * Particle lifetimeRange,value range [0, ∞).
492     * when lifetimeRange>lifetime,minimum lifetime is 0.
493     * @type { ?number }
494     * @default 0
495     * @syscap SystemCapability.ArkUI.ArkUI.Full
496     * @crossplatform
497     * @since 12
498     */
499    lifetimeRange?: number;
500  };
501
502  /**
503   * Emitting rate, that is, the number of particles produced per second.
504   * @type { ?number }
505   * @default 5
506   * @syscap SystemCapability.ArkUI.ArkUI.Full
507   * @crossplatform
508   * @since 10
509   */
510  /**
511   * Emitting rate, that is, the number of particles produced per second.
512   * @type { ?number }
513   * @default 5
514   * @syscap SystemCapability.ArkUI.ArkUI.Full
515   * @crossplatform
516   * @atomicservice
517   * @since 11
518   */
519  emitRate?: number;
520
521  /**
522   * Shape of emitter.
523   * @type { ?ParticleEmitterShape }
524   * @default ParticleEmitterShape.RECTANGLE
525   * @syscap SystemCapability.ArkUI.ArkUI.Full
526   * @crossplatform
527   * @since 10
528   */
529  /**
530   * Shape of emitter.
531   * @type { ?ParticleEmitterShape }
532   * @default ParticleEmitterShape.RECTANGLE
533   * @syscap SystemCapability.ArkUI.ArkUI.Full
534   * @crossplatform
535   * @atomicservice
536   * @since 11
537   */
538  shape?: ParticleEmitterShape;
539
540  /**
541   * Position of emitter.
542   * The first element means X-axis location.
543   * The second element means the Y-axis location.
544   * @type { ?[Dimension, Dimension] }
545   * @default [0,0]
546   * @syscap SystemCapability.ArkUI.ArkUI.Full
547   * @crossplatform
548   * @since 10
549   */
550  /**
551   * Position of emitter.
552   * The first element means X-axis location.
553   * The second element means the Y-axis location.
554   * @type { ?[Dimension, Dimension] }
555   * @default [0,0]
556   * @syscap SystemCapability.ArkUI.ArkUI.Full
557   * @crossplatform
558   * @atomicservice
559   * @since 11
560   */
561  position?: [Dimension, Dimension];
562
563  /**
564   * Size of emitter.
565   * The first element means emitter width.
566   * The second element means emitter height.
567   * @type { ?[Dimension, Dimension] }
568   * @default ['100%','100%']
569   * @syscap SystemCapability.ArkUI.ArkUI.Full
570   * @crossplatform
571   * @since 10
572   */
573  /**
574   * Size of emitter.
575   * The first element means emitter width.
576   * The second element means emitter height.
577   * @type { ?[Dimension, Dimension] }
578   * @default ['100%','100%']
579   * @syscap SystemCapability.ArkUI.ArkUI.Full
580   * @crossplatform
581   * @atomicservice
582   * @since 11
583   */
584  size?: [Dimension, Dimension];
585}
586
587/**
588 * Defines the particle property updater configs.
589 * @interface ParticlePropertyUpdaterConfigs
590 * @syscap SystemCapability.ArkUI.ArkUI.Full
591 * @crossplatform
592 * @since 10
593 */
594/**
595 * Defines the particle property updater configs.
596 * @interface ParticlePropertyUpdaterConfigs
597 * @syscap SystemCapability.ArkUI.ArkUI.Full
598 * @crossplatform
599 * @atomicservice
600 * @since 11
601 */
602interface ParticlePropertyUpdaterConfigs<T> {
603  /**
604   * No effect of particle updater.
605   * @syscap SystemCapability.ArkUI.ArkUI.Full
606   * @crossplatform
607   * @since 10
608   */
609  /**
610   * No effect of particle updater.
611   * @syscap SystemCapability.ArkUI.ArkUI.Full
612   * @crossplatform
613   * @atomicservice
614   * @since 11
615   */
616  [ParticleUpdater.NONE]: void;
617
618  /**
619   * Random effect of particle updater.
620   * @type { [T, T] }
621   * @syscap SystemCapability.ArkUI.ArkUI.Full
622   * @crossplatform
623   * @since 10
624   */
625  /**
626   * Random effect of particle updater.
627   * @type { [T, T] }
628   * @syscap SystemCapability.ArkUI.ArkUI.Full
629   * @crossplatform
630   * @atomicservice
631   * @since 11
632   */
633  [ParticleUpdater.RANDOM]: [T, T];
634
635  /**
636   * Curve effect of particle updater.
637   * @type { Array<ParticlePropertyAnimation<T>> }
638   * @syscap SystemCapability.ArkUI.ArkUI.Full
639   * @crossplatform
640   * @since 10
641   */
642  /**
643   * Curve effect of particle updater.
644   * @type { Array<ParticlePropertyAnimation<T>> }
645   * @syscap SystemCapability.ArkUI.ArkUI.Full
646   * @crossplatform
647   * @atomicservice
648   * @since 11
649   */
650  [ParticleUpdater.CURVE]: Array<ParticlePropertyAnimation<T>>;
651}
652
653/**
654 * Defines the particle property Options.
655 * @interface ParticlePropertyOptions
656 * @syscap SystemCapability.ArkUI.ArkUI.Full
657 * @crossplatform
658 * @since 10
659 */
660/**
661 * Defines the particle property Options.
662 * @interface ParticlePropertyOptions
663 * @syscap SystemCapability.ArkUI.ArkUI.Full
664 * @crossplatform
665 * @atomicservice
666 * @since 11
667 */
668interface ParticlePropertyOptions<TYPE, UPDATER extends ParticleUpdater> {
669  /**
670   * Initial range, within which the initial value are randomly generated.
671   * @type { [TYPE, TYPE] }
672   * @syscap SystemCapability.ArkUI.ArkUI.Full
673   * @crossplatform
674   * @since 10
675   */
676  /**
677   * Initial range, within which the initial value are randomly generated.
678   * @type { [TYPE, TYPE] }
679   * @syscap SystemCapability.ArkUI.ArkUI.Full
680   * @crossplatform
681   * @atomicservice
682   * @since 11
683   */
684  range: [TYPE, TYPE];
685
686  /**
687   * Particle property updater.
688   * @type { ?object }
689   * @default  {type:UPDATER.NONE;config:ParticlePropertyUpdaterConfigs<UPDATER.NONE>[UPDATER.NONE]}
690   * @syscap SystemCapability.ArkUI.ArkUI.Full
691   * @crossplatform
692   * @since 10
693   */
694  /**
695   * Particle property updater.
696   * @type { ?object }
697   * @default  {type:UPDATER.NONE;config:ParticlePropertyUpdaterConfigs<UPDATER.NONE>[UPDATER.NONE]}
698   * @syscap SystemCapability.ArkUI.ArkUI.Full
699   * @crossplatform
700   * @atomicservice
701   * @since 11
702   */
703  updater?: {
704    type: UPDATER;
705    config: ParticlePropertyUpdaterConfigs<TYPE>[UPDATER];
706  };
707}
708
709/**
710 * Defines the particle color property updater configs.
711 * @interface ParticleColorPropertyUpdaterConfigs
712 * @syscap SystemCapability.ArkUI.ArkUI.Full
713 * @crossplatform
714 * @since 10
715 */
716/**
717 * Defines the particle color property updater configs.
718 * @interface ParticleColorPropertyUpdaterConfigs
719 * @syscap SystemCapability.ArkUI.ArkUI.Full
720 * @crossplatform
721 * @atomicservice
722 * @since 11
723 */
724interface ParticleColorPropertyUpdaterConfigs {
725  /**
726   * No effect of particle color property updater.
727   * @syscap SystemCapability.ArkUI.ArkUI.Full
728   * @crossplatform
729   * @since 10
730   */
731  /**
732   * No effect of particle color property updater.
733   * @syscap SystemCapability.ArkUI.ArkUI.Full
734   * @crossplatform
735   * @atomicservice
736   * @since 11
737   */
738  [ParticleUpdater.NONE]: void;
739
740  /**
741   * Random effect of particle color property updater.
742   * @type { object }
743   * @syscap SystemCapability.ArkUI.ArkUI.Full
744   * @crossplatform
745   * @since 10
746   */
747  /**
748   * Random effect of particle color property updater.
749   * @type { object }
750   * @syscap SystemCapability.ArkUI.ArkUI.Full
751   * @crossplatform
752   * @atomicservice
753   * @since 11
754   */
755  [ParticleUpdater.RANDOM]: {
756    r: [number, number];
757    g: [number, number];
758    b: [number, number];
759    a: [number, number];
760  };
761
762  /**
763   * Curve effect of particle color property updater.
764   *
765   * @type { Array<ParticlePropertyAnimation<ResourceColor>> }
766   * @syscap SystemCapability.ArkUI.ArkUI.Full
767   * @crossplatform
768   * @since 10
769   */
770  /**
771   * Curve effect of particle color property updater.
772   *
773   * @type { Array<ParticlePropertyAnimation<ResourceColor>> }
774   * @syscap SystemCapability.ArkUI.ArkUI.Full
775   * @crossplatform
776   * @atomicservice
777   * @since 11
778   */
779  [ParticleUpdater.CURVE]: Array<ParticlePropertyAnimation<ResourceColor>>;
780}
781
782/**
783 * Defines the particle color property updater configs which can support generics.
784 * @interface ParticleColorPropertyOptions
785 * @syscap SystemCapability.ArkUI.ArkUI.Full
786 * @crossplatform
787 * @since 10
788 */
789/**
790 * Defines the particle color property updater configs which can support generics.
791 * @interface ParticleColorPropertyOptions
792 * @syscap SystemCapability.ArkUI.ArkUI.Full
793 * @crossplatform
794 * @atomicservice
795 * @since 11
796 */
797interface ParticleColorPropertyOptions<UPDATER extends ParticleUpdater> {
798  /**
799   * Initial color range, within which the initial color is randomly generated.
800   * @type { [ResourceColor, ResourceColor] }
801   * @syscap SystemCapability.ArkUI.ArkUI.Full
802   * @crossplatform
803   * @since 10
804   */
805  /**
806   * Initial color range, within which the initial color is randomly generated.
807   * @type { [ResourceColor, ResourceColor] }
808   * @syscap SystemCapability.ArkUI.ArkUI.Full
809   * @crossplatform
810   * @atomicservice
811   * @since 11
812   */
813  range: [ResourceColor, ResourceColor];
814
815  /**
816   * Distribution type of particle color.
817   * @type { ?DistributionType }
818   * @default DistributionType.UNIFORM
819   * @syscap SystemCapability.ArkUI.ArkUI.Full
820   * @crossplatform
821   * @since 12
822   */
823  distributionType?: DistributionType;
824
825  /**
826   * Particle color property updater.
827   * @type { ?object }
828   * @default {type:UPDATER.NONE;config:ParticleColorPropertyUpdaterConfigs[UPDATER.NONE]}
829   * @syscap SystemCapability.ArkUI.ArkUI.Full
830   * @crossplatform
831   * @since 10
832   */
833  /**
834   * Particle color property updater.
835   * @type { ?object }
836   * @default {type:UPDATER.NONE;config:ParticleColorPropertyUpdaterConfigs[UPDATER.NONE]}
837   * @syscap SystemCapability.ArkUI.ArkUI.Full
838   * @crossplatform
839   * @atomicservice
840   * @since 11
841   */
842  updater?: {
843    type: UPDATER;
844    config: ParticleColorPropertyUpdaterConfigs[UPDATER];
845  };
846}
847
848/**
849 * Defines the particle property lifecycle.
850 * @interface ParticlePropertyAnimation
851 * @syscap SystemCapability.ArkUI.ArkUI.Full
852 * @crossplatform
853 * @since 10
854 */
855/**
856 * Defines the particle property lifecycle.
857 * @interface ParticlePropertyAnimation
858 * @syscap SystemCapability.ArkUI.ArkUI.Full
859 * @crossplatform
860 * @atomicservice
861 * @since 11
862 */
863interface ParticlePropertyAnimation<T> {
864  /**
865   * Start position of the particle animation.
866   * @type { T }
867   * @syscap SystemCapability.ArkUI.ArkUI.Full
868   * @crossplatform
869   * @since 10
870   */
871  /**
872   * Start position of the particle animation.
873   * @type { T }
874   * @syscap SystemCapability.ArkUI.ArkUI.Full
875   * @crossplatform
876   * @atomicservice
877   * @since 11
878   */
879  from: T;
880
881  /**
882   * End position of the particle animation.
883   * @type { T }
884   * @syscap SystemCapability.ArkUI.ArkUI.Full
885   * @crossplatform
886   * @since 10
887   */
888  /**
889   * End position of the particle animation.
890   * @type { T }
891   * @syscap SystemCapability.ArkUI.ArkUI.Full
892   * @crossplatform
893   * @atomicservice
894   * @since 11
895   */
896  to: T;
897
898  /**
899   * Start millis of the particle animation.
900   * @type { number }
901   * @syscap SystemCapability.ArkUI.ArkUI.Full
902   * @crossplatform
903   * @since 10
904   */
905  /**
906   * Start millis of the particle animation.
907   * @type { number }
908   * @syscap SystemCapability.ArkUI.ArkUI.Full
909   * @crossplatform
910   * @atomicservice
911   * @since 11
912   */
913  startMillis: number;
914
915  /**
916   * End millis of the particle animation.
917   * @type { number }
918   * @syscap SystemCapability.ArkUI.ArkUI.Full
919   * @crossplatform
920   * @since 10
921   */
922  /**
923   * End millis of the particle animation.
924   * @type { number }
925   * @syscap SystemCapability.ArkUI.ArkUI.Full
926   * @crossplatform
927   * @atomicservice
928   * @since 11
929   */
930  endMillis: number;
931
932  /**
933   * Curve of the particle animation.
934   * @type { ?(Curve | ICurve) }
935   * @default Curve.Linear
936   * @syscap SystemCapability.ArkUI.ArkUI.Full
937   * @crossplatform
938   * @since 10
939   */
940  /**
941   * Curve of the particle animation.
942   * @type { ?(Curve | ICurve) }
943   * @default Curve.Linear
944   * @syscap SystemCapability.ArkUI.ArkUI.Full
945   * @crossplatform
946   * @atomicservice
947   * @since 11
948   */
949  curve?: Curve | ICurve;
950}
951
952/**
953 * Defines the particle Interface.
954 * @interface ParticleInterface
955 * @syscap SystemCapability.ArkUI.ArkUI.Full
956 * @crossplatform
957 * @since 10
958 */
959/**
960 * Defines the particle Interface.
961 * @interface ParticleInterface
962 * @syscap SystemCapability.ArkUI.ArkUI.Full
963 * @crossplatform
964 * @atomicservice
965 * @since 11
966 */
967interface ParticleInterface {
968  /**
969   * create a particle array.
970   * @param { object } value - Particle value
971   * particles - list of ParticleOptions.
972   * @returns { ParticleAttribute } Returns the particle attribute.
973   * @syscap SystemCapability.ArkUI.ArkUI.Full
974   * @crossplatform
975   * @since 10
976   */
977  /**
978   * create a particle array.
979   * @param { object } value - Particle value
980   * particles - list of ParticleOptions.
981   * @returns { ParticleAttribute } Returns the particle attribute.
982   * @syscap SystemCapability.ArkUI.ArkUI.Full
983   * @crossplatform
984   * @atomicservice
985   * @since 11
986   */
987  <
988    PARTICLE extends ParticleType,
989    COLOR_UPDATER extends ParticleUpdater,
990    OPACITY_UPDATER extends ParticleUpdater,
991    SCALE_UPDATER extends ParticleUpdater,
992    ACC_SPEED_UPDATER extends ParticleUpdater,
993    ACC_ANGLE_UPDATER extends ParticleUpdater,
994    SPIN_UPDATER extends ParticleUpdater
995  >(value: {
996    particles: Array<
997    ParticleOptions<
998    PARTICLE,
999    COLOR_UPDATER,
1000    OPACITY_UPDATER,
1001    SCALE_UPDATER,
1002    ACC_SPEED_UPDATER,
1003    ACC_ANGLE_UPDATER,
1004    SPIN_UPDATER
1005    >
1006    >;
1007  }): ParticleAttribute;
1008}
1009
1010/**
1011 * Enumerates the particle types.
1012 * @enum { string }
1013 * @syscap SystemCapability.ArkUI.ArkUI.Full
1014 * @crossplatform
1015 * @since 10
1016 */
1017/**
1018 * Enumerates the particle types.
1019 * @enum { string }
1020 * @syscap SystemCapability.ArkUI.ArkUI.Full
1021 * @crossplatform
1022 * @atomicservice
1023 * @since 11
1024 */
1025declare enum ParticleType {
1026  /**
1027   * Point-like particle.
1028   * @syscap SystemCapability.ArkUI.ArkUI.Full
1029   * @crossplatform
1030   * @since 10
1031   */
1032  /**
1033   * Point-like particle.
1034   * @syscap SystemCapability.ArkUI.ArkUI.Full
1035   * @crossplatform
1036   * @atomicservice
1037   * @since 11
1038   */
1039  POINT = 'point',
1040
1041  /**
1042   * Image-like particle.
1043   * @syscap SystemCapability.ArkUI.ArkUI.Full
1044   * @crossplatform
1045   * @since 10
1046   */
1047  /**
1048   * Image-like particle.
1049   * @syscap SystemCapability.ArkUI.ArkUI.Full
1050   * @crossplatform
1051   * @atomicservice
1052   * @since 11
1053   */
1054  IMAGE = 'image',
1055}
1056
1057/**
1058 * Enumerates the emitter shapes of a particle.
1059 * @enum { string }
1060 * @syscap SystemCapability.ArkUI.ArkUI.Full
1061 * @crossplatform
1062 * @since 10
1063 */
1064/**
1065 * Enumerates the emitter shapes of a particle.
1066 * @enum { string }
1067 * @syscap SystemCapability.ArkUI.ArkUI.Full
1068 * @crossplatform
1069 * @atomicservice
1070 * @since 11
1071 */
1072declare enum ParticleEmitterShape {
1073  /**
1074   * Rectangle.
1075   * @syscap SystemCapability.ArkUI.ArkUI.Full
1076   * @crossplatform
1077   * @since 10
1078   */
1079  /**
1080   * Rectangle.
1081   * @syscap SystemCapability.ArkUI.ArkUI.Full
1082   * @crossplatform
1083   * @atomicservice
1084   * @since 11
1085   */
1086  RECTANGLE = 'rectangle',
1087
1088  /**
1089   * Circle.
1090   * @syscap SystemCapability.ArkUI.ArkUI.Full
1091   * @crossplatform
1092   * @since 10
1093   */
1094  /**
1095   * Circle.
1096   * @syscap SystemCapability.ArkUI.ArkUI.Full
1097   * @crossplatform
1098   * @atomicservice
1099   * @since 11
1100   */
1101  CIRCLE = 'circle',
1102
1103  /**
1104   * Ellipse.
1105   * @syscap SystemCapability.ArkUI.ArkUI.Full
1106   * @crossplatform
1107   * @since 10
1108   */
1109  /**
1110   * Ellipse.
1111   * @syscap SystemCapability.ArkUI.ArkUI.Full
1112   * @crossplatform
1113   * @atomicservice
1114   * @since 11
1115   */
1116  ELLIPSE = 'ellipse',
1117}
1118
1119/**
1120 * Enumerates the color distribution types of a particle.
1121 *
1122 * @enum { number }
1123 * @syscap SystemCapability.ArkUI.ArkUI.Full
1124 * @crossplatform
1125 * @since 12
1126 */
1127declare enum DistributionType {
1128  /**
1129   * Uniform distribution.
1130   *
1131   * @syscap SystemCapability.ArkUI.ArkUI.Full
1132   * @crossplatform
1133   * @since 12
1134   */
1135  UNIFORM = 0,
1136
1137  /**
1138   * Gaussian distribution.
1139   *
1140   * @syscap SystemCapability.ArkUI.ArkUI.Full
1141   * @crossplatform
1142   * @since 12
1143   */
1144  GAUSSIAN = 1,
1145}
1146
1147/**
1148 * Enumerates the updater types of a particle.
1149 * @enum { string }
1150 * @syscap SystemCapability.ArkUI.ArkUI.Full
1151 * @crossplatform
1152 * @since 10
1153 */
1154/**
1155 * Enumerates the updater types of a particle.
1156 * @enum { string }
1157 * @syscap SystemCapability.ArkUI.ArkUI.Full
1158 * @crossplatform
1159 * @atomicservice
1160 * @since 11
1161 */
1162declare enum ParticleUpdater {
1163  /**
1164   * No updater is used.
1165   * @syscap SystemCapability.ArkUI.ArkUI.Full
1166   * @crossplatform
1167   * @since 10
1168   */
1169  /**
1170   * No updater is used.
1171   * @syscap SystemCapability.ArkUI.ArkUI.Full
1172   * @crossplatform
1173   * @atomicservice
1174   * @since 11
1175   */
1176  NONE = 'none',
1177
1178  /**
1179   * Random updater.
1180   * @syscap SystemCapability.ArkUI.ArkUI.Full
1181   * @crossplatform
1182   * @since 10
1183   */
1184  /**
1185   * Random updater.
1186   * @syscap SystemCapability.ArkUI.ArkUI.Full
1187   * @crossplatform
1188   * @atomicservice
1189   * @since 11
1190   */
1191  RANDOM = 'random',
1192
1193  /**
1194   * Curve updater.
1195   * @syscap SystemCapability.ArkUI.ArkUI.Full
1196   * @crossplatform
1197   * @since 10
1198   */
1199  /**
1200   * Curve updater.
1201   * @syscap SystemCapability.ArkUI.ArkUI.Full
1202   * @crossplatform
1203   * @atomicservice
1204   * @since 11
1205   */
1206  CURVE = 'curve',
1207}
1208
1209 /**
1210 * Defines the SizeT type.
1211 *
1212 * @typedef { import('../../../../api/arkui/Graphics').SizeT<T> }
1213 * @syscap SystemCapability.ArkUI.ArkUI.Full
1214 * @crossplatform
1215 * @atomicservice
1216 * @since 12
1217 */
1218declare type SizeT<T> = import('../../../../api/arkui/Graphics').SizeT<T>;
1219
1220 /**
1221 * Defines the PositionT type.
1222 *
1223 * @typedef { import('../../../../api/arkui/Graphics').PositionT<T> }
1224 * @syscap SystemCapability.ArkUI.ArkUI.Full
1225 * @crossplatform
1226 * @atomicservice
1227 * @since 12
1228 */
1229declare type PositionT<T> = import('../../../../api/arkui/Graphics').PositionT<T>;
1230
1231/**
1232 * Defines the Particle component attribute functions.
1233 * @extends CommonMethod<ParticleAttribute>
1234 * @syscap SystemCapability.ArkUI.ArkUI.Full
1235 * @crossplatform
1236 * @since 10
1237 */
1238/**
1239 * Defines the Particle component attribute functions.
1240 * @extends CommonMethod<ParticleAttribute>
1241 * @syscap SystemCapability.ArkUI.ArkUI.Full
1242 * @crossplatform
1243 * @atomicservice
1244 * @since 11
1245 */
1246declare class ParticleAttribute extends CommonMethod<ParticleAttribute> {
1247
1248  /**
1249   * Add particle animation component properties.
1250   *
1251   * @param { Array<EmitterProperty> } value - The emitter property.
1252   * @returns { ParticleAttribute } Returns the particle attribute.
1253   * @syscap SystemCapability.ArkUI.ArkUI.Full
1254   * @crossplatform
1255   * @atomicservice
1256   * @since 12
1257   */
1258  emitter(value : Array<EmitterProperty>) : ParticleAttribute;
1259
1260  /**
1261   * Particle disturbance Field.
1262   *
1263   * @param { Array<DisturbanceFieldOptions> } fields - particle disturbance Field params.
1264  * @returns { ParticleAttribute } Returns the particle attribute.
1265  * @syscap SystemCapability.ArkUI.ArkUI.Full
1266  * @crossplatform
1267  * @atomicservice
1268  * @since 12
1269  */
1270  disturbanceFields(fields: Array<DisturbanceFieldOptions>): ParticleAttribute;
1271}
1272
1273/**
1274 * Defines Particle Component.
1275 * @syscap SystemCapability.ArkUI.ArkUI.Full
1276 * @crossplatform
1277 * @since 10
1278 */
1279/**
1280 * Defines Particle Component.
1281 * @syscap SystemCapability.ArkUI.ArkUI.Full
1282 * @crossplatform
1283 * @atomicservice
1284 * @since 11
1285 */
1286declare const Particle: ParticleInterface;
1287
1288/**
1289 * Defines particle disturbance Field params.
1290 * @interface DisturbanceFieldOptions
1291 * @syscap SystemCapability.ArkUI.ArkUI.Full
1292 * @crossplatform
1293 * @since 12
1294 */
1295declare interface DisturbanceFieldOptions {
1296
1297  /**
1298   * Strength of the repulsive force from the center outward,
1299   * with positive numbers indicating outward repulsion and negative numbers indicating
1300   * inward attraction.
1301   *
1302   * @type { ?number }
1303   * @default 0
1304   * @syscap SystemCapability.ArkUI.ArkUI.Full
1305   * @crossplatform
1306   * @since 12
1307   */
1308  strength?: number;
1309
1310  /**
1311   * Disturbance filed shape.
1312   *
1313   * @type { ?DisturbanceFieldShape }
1314   * @default DisturbanceFieldShape.RECT
1315   * @syscap SystemCapability.ArkUI.ArkUI.Full
1316   * @crossplatform
1317   * @since 12
1318   */
1319  shape?: DisturbanceFieldShape;
1320
1321  /**
1322   * Disturbance filed size width value width, height.
1323   *
1324   * @type { ?SizeT<number> }
1325   * @default {width:0,height:0}
1326   * @syscap SystemCapability.ArkUI.ArkUI.Full
1327   * @crossplatform
1328   * @since 12
1329   */
1330  size?: SizeT<number>;
1331
1332  /**
1333   * Disturbance filed position width value x, y.
1334   *
1335   * @type { ?PositionT<number> }
1336   * @default {x:0,y:0}
1337   * @syscap SystemCapability.ArkUI.ArkUI.Full
1338   * @crossplatform
1339   * @since 12
1340   */
1341  position?: PositionT<number>;
1342
1343  /**
1344   * Attenuation degree of the field from the center point to the field boundary.
1345   * ranging from 0 to 100 integers. If 0, it indicates that the field is a rigid body,
1346   * and all particles within the range will be excluded.
1347   * a larger feather value indicates a greater degree of relaxation in the field,
1348   * and more particles near the center point will appear in the field strength range. The default value is 0.
1349   *
1350   * @type { ?number }
1351   * @default 0
1352   * @syscap SystemCapability.ArkUI.ArkUI.Full
1353   * @crossplatform
1354   * @since 12
1355   */
1356  feather?: number;
1357
1358  /**
1359   * Scaling parameter is used to control the overall size of noise, with a value greater or equal 0.
1360   *
1361   * @type { ?number }
1362   * @default 1
1363   * @syscap SystemCapability.ArkUI.ArkUI.Full
1364   * @crossplatform
1365   * @since 12
1366   */
1367  noiseScale?: number;
1368
1369   /**
1370   * Noise frequency with a value greater or equal 0.
1371   *
1372   * @type { ?number }
1373   * @default 1
1374   * @syscap SystemCapability.ArkUI.ArkUI.Full
1375   * @crossplatform
1376   * @since 12
1377   */
1378  noiseFrequency?: number;
1379
1380  /**
1381   * NoiseAmplitude fluctuation range of noise,  value,
1382   *
1383   * @type { ?number }
1384   * @default 1
1385   * @syscap SystemCapability.ArkUI.ArkUI.Full
1386   * @crossplatform
1387   * @since 12
1388   */
1389  noiseAmplitude?: number;
1390}
1391
1392/**
1393 * Defines particle disturbance shape.
1394 *
1395 * @enum { number }
1396 * @syscap SystemCapability.ArkUI.ArkUI.Full
1397 * @crossplatform
1398 * @since 12
1399 */
1400declare enum DisturbanceFieldShape {
1401
1402  /**
1403   * Shape rect.
1404   *
1405   * @syscap SystemCapability.ArkUI.ArkUI.Full
1406   * @crossplatform
1407   * @since 12
1408   */
1409  RECT,
1410
1411   /**
1412   * Shape circle.
1413   *
1414   * @syscap SystemCapability.ArkUI.ArkUI.Full
1415   * @crossplatform
1416   * @since 12
1417   */
1418  CIRCLE,
1419
1420  /**
1421   * Shape eclipse.
1422   *
1423   * @syscap SystemCapability.ArkUI.ArkUI.Full
1424   * @crossplatform
1425   * @since 12
1426   */
1427  ELLIPSE
1428
1429}