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 { LengthMetrics, SizeT, PositionT } from '../../arkui/Graphics'; 23import { VP, ResourceStr,Dimension,ResourceColor } from './units' 24import { ImageFit, Curve } from './enums' 25import { ICurve, CommonMethod } from './common' 26/*** endif */ 27 28/** 29 * Defines a pair of given type for particle. 30 * 31 * @typedef { [T1, T2] } ParticleTuple 32 * @syscap SystemCapability.ArkUI.ArkUI.Full 33 * @crossplatform 34 * @atomicservice 35 * @since arkts{ '1.1':'18','1.2':'20'} 36 * @arkts 1.1&1.2 37 */ 38declare type ParticleTuple<T1, T2> = [T1, T2]; 39 40/** 41 * Defines velocity options. 42 * 43 * @typedef VelocityOptions 44 * @syscap SystemCapability.ArkUI.ArkUI.Full 45 * @crossplatform 46 * @atomicservice 47 * @since arkts {'1.1':'18','1.2':'20'} 48 * @arkts 1.1&1.2 49 */ 50declare interface VelocityOptions { 51 /** 52 * Particle speed. 53 * @type { ParticleTuple<number, number> } 54 * @syscap SystemCapability.ArkUI.ArkUI.Full 55 * @crossplatform 56 * @since 10 57 */ 58 /** 59 * Particle speed. 60 * @type { ParticleTuple<number, number> } 61 * @syscap SystemCapability.ArkUI.ArkUI.Full 62 * @crossplatform 63 * @atomicservice 64 * @since 11 65 */ 66 /** 67 * Particle speed. 68 * 69 * Anonymous Object Rectification. 70 * @type { ParticleTuple<number, number> } 71 * @syscap SystemCapability.ArkUI.ArkUI.Full 72 * @crossplatform 73 * @atomicservice 74 * @since arkts {'1.1':'18','1.2':'20'} 75 * @arkts 1.1&1.2 76 */ 77 speed: ParticleTuple<number, number>; 78 79 /** 80 * Angle of particle's direction. 81 * @type { ParticleTuple<number, number> } 82 * @syscap SystemCapability.ArkUI.ArkUI.Full 83 * @crossplatform 84 * @since 10 85 */ 86 /** 87 * Angle of particle's direction. 88 * @type { ParticleTuple<number, number> } 89 * @syscap SystemCapability.ArkUI.ArkUI.Full 90 * @crossplatform 91 * @atomicservice 92 * @since 11 93 */ 94 /** 95 * Angle of particle's direction. 96 * 97 * Anonymous Object Rectification. 98 * @type { ParticleTuple<number, number> } 99 * @syscap SystemCapability.ArkUI.ArkUI.Full 100 * @crossplatform 101 * @atomicservice 102 * @since arkts{ '1.1':'18','1.2':'20'} 103 * @arkts 1.1&1.2 104 */ 105 angle: ParticleTuple<number, number>; 106} 107 108/** 109 * Defines acceleration options. 110 * 111 * @typedef AccelerationOptions<ACC_SPEED_UPDATER extends ParticleUpdater, ACC_ANGLE_UPDATER extends ParticleUpdater> 112 * @syscap SystemCapability.ArkUI.ArkUI.Full 113 * @crossplatform 114 * @atomicservice 115 * @since 18 116 */ 117declare interface AccelerationOptions< 118 ACC_SPEED_UPDATER extends ParticleUpdater, 119 ACC_ANGLE_UPDATER extends ParticleUpdater 120> { 121 /** 122 * Speed property options. 123 * @type { ?ParticlePropertyOptions<number, ACC_SPEED_UPDATER> } 124 * @syscap SystemCapability.ArkUI.ArkUI.Full 125 * @crossplatform 126 * @since 10 127 */ 128 /** 129 * Speed property options. 130 * @type { ?ParticlePropertyOptions<number, ACC_SPEED_UPDATER> } 131 * @syscap SystemCapability.ArkUI.ArkUI.Full 132 * @crossplatform 133 * @atomicservice 134 * @since 11 135 */ 136 /** 137 * Speed property options. 138 * 139 * Anonymous Object Rectification. 140 * @type { ?ParticlePropertyOptions<number, ACC_SPEED_UPDATER> } 141 * @syscap SystemCapability.ArkUI.ArkUI.Full 142 * @crossplatform 143 * @atomicservice 144 * @since 18 145 */ 146 speed?: ParticlePropertyOptions<number, ACC_SPEED_UPDATER>; 147 148 /** 149 * Angle property options. 150 * @type { ?ParticlePropertyOptions<number, ACC_ANGLE_UPDATER> } 151 * @syscap SystemCapability.ArkUI.ArkUI.Full 152 * @crossplatform 153 * @since 10 154 */ 155 /** 156 * Angle property options. 157 * @type { ?ParticlePropertyOptions<number, ACC_ANGLE_UPDATER> } 158 * @syscap SystemCapability.ArkUI.ArkUI.Full 159 * @crossplatform 160 * @atomicservice 161 * @since 11 162 */ 163 /** 164 * Angle property options. 165 * 166 * Anonymous Object Rectification. 167 * @type { ?ParticlePropertyOptions<number, ACC_ANGLE_UPDATER> } 168 * @syscap SystemCapability.ArkUI.ArkUI.Full 169 * @crossplatform 170 * @atomicservice 171 * @since 18 172 */ 173 angle?: ParticlePropertyOptions<number, ACC_ANGLE_UPDATER>; 174} 175 176/** 177 * Defines acceleration options. 178 * 179 * @interface AccelerationOptions 180 * @syscap SystemCapability.ArkUI.ArkUI.Full 181 * @crossplatform 182 * @atomicservice 183 * @since 20 184 * @arkts 1.2 185 */ 186declare interface AccelerationOptions { 187 /** 188 * Speed property options. 189 * 190 * @type { ?ParticlePropertyOptions } 191 * @syscap SystemCapability.ArkUI.ArkUI.Full 192 * @crossplatform 193 * @atomicservice 194 * @since 20 195 * @arkts 1.2 196 */ 197 speed?: ParticlePropertyOptions; 198 199 /** 200 * Angle property options. 201 * 202 * @type { ?ParticlePropertyOptions } 203 * @syscap SystemCapability.ArkUI.ArkUI.Full 204 * @crossplatform 205 * @atomicservice 206 * @since 20 207 * @arkts 1.2 208 */ 209 angle?: ParticlePropertyOptions; 210} 211 212/** 213 * Defines the ParticleOptions Interface. 214 * @interface ParticleOptions 215 * @syscap SystemCapability.ArkUI.ArkUI.Full 216 * @crossplatform 217 * @since 10 218 */ 219/** 220 * Defines the ParticleOptions Interface. 221 * @interface ParticleOptions 222 * @syscap SystemCapability.ArkUI.ArkUI.Full 223 * @crossplatform 224 * @atomicservice 225 * @since 11 226 */ 227interface ParticleOptions< 228 PARTICLE extends ParticleType, 229 COLOR_UPDATER extends ParticleUpdater, 230 OPACITY_UPDATER extends ParticleUpdater, 231 SCALE_UPDATER extends ParticleUpdater, 232 ACC_SPEED_UPDATER extends ParticleUpdater, 233 ACC_ANGLE_UPDATER extends ParticleUpdater, 234 SPIN_UPDATER extends ParticleUpdater 235> { 236 /** 237 * Particle emitter. 238 * @type { EmitterOptions<PARTICLE> } 239 * @syscap SystemCapability.ArkUI.ArkUI.Full 240 * @crossplatform 241 * @since 10 242 */ 243 /** 244 * Particle emitter. 245 * @type { EmitterOptions<PARTICLE> } 246 * @syscap SystemCapability.ArkUI.ArkUI.Full 247 * @crossplatform 248 * @atomicservice 249 * @since 11 250 */ 251 emitter: EmitterOptions<PARTICLE>; 252 253 /** 254 * Particle color. 255 * @type { ?ParticleColorPropertyOptions<COLOR_UPDATER> } 256 * @default {range:['#FFFFFF','#FFFFFF']} 257 * @syscap SystemCapability.ArkUI.ArkUI.Full 258 * @crossplatform 259 * @since 10 260 */ 261 /** 262 * Particle color. 263 * @type { ?ParticleColorPropertyOptions<COLOR_UPDATER> } 264 * @default {range:['#FFFFFF','#FFFFFF']} 265 * @syscap SystemCapability.ArkUI.ArkUI.Full 266 * @crossplatform 267 * @atomicservice 268 * @since 11 269 */ 270 color?: ParticleColorPropertyOptions<COLOR_UPDATER>; 271 272 /** 273 * Particle opacity. 274 * @type { ?ParticlePropertyOptions<number, OPACITY_UPDATER> } 275 * @default {range:[1.0,1.0]} 276 * @syscap SystemCapability.ArkUI.ArkUI.Full 277 * @crossplatform 278 * @since 10 279 */ 280 /** 281 * Particle opacity. 282 * @type { ?ParticlePropertyOptions<number, OPACITY_UPDATER> } 283 * @default {range:[1.0,1.0]} 284 * @syscap SystemCapability.ArkUI.ArkUI.Full 285 * @crossplatform 286 * @atomicservice 287 * @since 11 288 */ 289 opacity?: ParticlePropertyOptions<number, OPACITY_UPDATER>; 290 291 /** 292 * Particle scale. 293 * @type { ?ParticlePropertyOptions<number, SCALE_UPDATER> } 294 * @default {range:[1.0,1.0]} 295 * @syscap SystemCapability.ArkUI.ArkUI.Full 296 * @crossplatform 297 * @since 10 298 */ 299 /** 300 * Particle scale. 301 * @type { ?ParticlePropertyOptions<number, SCALE_UPDATER> } 302 * @default {range:[1.0,1.0]} 303 * @syscap SystemCapability.ArkUI.ArkUI.Full 304 * @crossplatform 305 * @atomicservice 306 * @since 11 307 */ 308 scale?: ParticlePropertyOptions<number, SCALE_UPDATER>; 309 310 /** 311 * Particle velocity. 312 * @type { ?object } 313 * @default {speed:[0,0];angle:[0,0]} 314 * @syscap SystemCapability.ArkUI.ArkUI.Full 315 * @crossplatform 316 * @since 10 317 */ 318 /** 319 * Particle velocity. 320 * @type { ?object } 321 * @default {speed:[0,0];angle:[0,0]} 322 * @syscap SystemCapability.ArkUI.ArkUI.Full 323 * @crossplatform 324 * @atomicservice 325 * @since 11 326 */ 327 /** 328 * Particle velocity. 329 * 330 * Anonymous Object Rectification. 331 * @type { ?VelocityOptions } 332 * @default {speed:[0,0];angle:[0,0]} 333 * @syscap SystemCapability.ArkUI.ArkUI.Full 334 * @crossplatform 335 * @atomicservice 336 * @since 18 337 */ 338 velocity?: VelocityOptions; 339 340 /** 341 * Particle acceleration. 342 * @type { ?object } 343 * @default {speed:{range:[0,0]};angle:{range:[0,0]}} 344 * @syscap SystemCapability.ArkUI.ArkUI.Full 345 * @crossplatform 346 * @since 10 347 */ 348 /** 349 * Particle acceleration. 350 * @type { ?object } 351 * @default {speed:{range:[0,0]};angle:{range:[0,0]}} 352 * @syscap SystemCapability.ArkUI.ArkUI.Full 353 * @crossplatform 354 * @atomicservice 355 * @since 11 356 */ 357 /** 358 * Particle acceleration. 359 * 360 * Anonymous Object Rectification. 361 * @type { ?AccelerationOptions<ACC_SPEED_UPDATER, ACC_ANGLE_UPDATER> } 362 * @default {speed:{range:[0,0]};angle:{range:[0,0]}} 363 * @syscap SystemCapability.ArkUI.ArkUI.Full 364 * @crossplatform 365 * @atomicservice 366 * @since 18 367 */ 368 acceleration?: AccelerationOptions<ACC_SPEED_UPDATER, ACC_ANGLE_UPDATER>; 369 370 /** 371 * Particle spin. 372 * @type { ?ParticlePropertyOptions<number, SPIN_UPDATER> } 373 * @default {range:[0,0]} 374 * @syscap SystemCapability.ArkUI.ArkUI.Full 375 * @crossplatform 376 * @since 10 377 */ 378 /** 379 * Particle spin. 380 * @type { ?ParticlePropertyOptions<number, SPIN_UPDATER> } 381 * @default {range:[0,0]} 382 * @syscap SystemCapability.ArkUI.ArkUI.Full 383 * @crossplatform 384 * @atomicservice 385 * @since 11 386 */ 387 spin?: ParticlePropertyOptions<number, SPIN_UPDATER>; 388} 389 390/** 391 * Defines the ParticleOptions Interface. 392 * @interface ParticleOptions 393 * @syscap SystemCapability.ArkUI.ArkUI.Full 394 * @crossplatform 395 * @atomicservice 396 * @since 20 397 * @arkts 1.2 398 */ 399interface ParticleOptions { 400 /** 401 * Particle emitter. 402 * @type { EmitterOptions } 403 * @syscap SystemCapability.ArkUI.ArkUI.Full 404 * @crossplatform 405 * @atomicservice 406 * @since 20 407 * @arkts 1.2 408 */ 409 emitter: EmitterOptions; 410 411 /** 412 * Particle color. 413 * @type { ?ParticleColorPropertyOptions } 414 * @default {range:['#FFFFFF','#FFFFFF']} 415 * @syscap SystemCapability.ArkUI.ArkUI.Full 416 * @crossplatform 417 * @atomicservice 418 * @since 20 419 * @arkts 1.2 420 */ 421 color?: ParticleColorPropertyOptions; 422 423 /** 424 * Particle opacity. 425 * @type { ?ParticlePropertyOptions } 426 * @default {range:[1.0,1.0]} 427 * @syscap SystemCapability.ArkUI.ArkUI.Full 428 * @crossplatform 429 * @atomicservice 430 * @since 20 431 * @arkts 1.2 432 */ 433 opacity?: ParticlePropertyOptions; 434 435 /** 436 * Particle scale. 437 * @type { ?ParticlePropertyOptions } 438 * @default {range:[1.0,1.0]} 439 * @syscap SystemCapability.ArkUI.ArkUI.Full 440 * @crossplatform 441 * @atomicservice 442 * @since 20 443 * @arkts 1.2 444 */ 445 scale?: ParticlePropertyOptions; 446 447 /** 448 * Particle velocity. 449 * 450 * @type { ?VelocityOptions } 451 * @default {speed:[0,0];angle:[0,0]} 452 * @syscap SystemCapability.ArkUI.ArkUI.Full 453 * @crossplatform 454 * @atomicservice 455 * @since 20 456 * @arkts 1.2 457 */ 458 velocity?: VelocityOptions; 459 460 /** 461 * Particle acceleration. 462 * 463 * @type { ?AccelerationOptions } 464 * @default {speed:{range:[0,0]};angle:{range:[0,0]}} 465 * @syscap SystemCapability.ArkUI.ArkUI.Full 466 * @crossplatform 467 * @atomicservice 468 * @since 20 469 * @arkts 1.2 470 */ 471 acceleration?: AccelerationOptions; 472 473 /** 474 * Particle spin. 475 * @type { ?ParticlePropertyOptions } 476 * @default {range:[0,0]} 477 * @syscap SystemCapability.ArkUI.ArkUI.Full 478 * @crossplatform 479 * @atomicservice 480 * @since 20 481 * @arkts 1.2 482 */ 483 spin?: ParticlePropertyOptions; 484} 485 486/** 487 * Defines the parameters for a point-like particle. 488 * @interface PointParticleParameters 489 * @syscap SystemCapability.ArkUI.ArkUI.Full 490 * @crossplatform 491 * @since 10 492 */ 493/** 494 * Defines the parameters for a point-like particle. 495 * @interface PointParticleParameters 496 * @syscap SystemCapability.ArkUI.ArkUI.Full 497 * @crossplatform 498 * @atomicservice 499 * @since arkts {'1.1':'11','1.2':'20'} 500 * @arkts 1.1&1.2 501 */ 502interface PointParticleParameters { 503 /** 504 * Particle radius. 505 * @type { VP } 506 * @syscap SystemCapability.ArkUI.ArkUI.Full 507 * @crossplatform 508 * @since 10 509 */ 510 /** 511 * Particle radius. 512 * @type { VP } 513 * @syscap SystemCapability.ArkUI.ArkUI.Full 514 * @crossplatform 515 * @atomicservice 516 * @since arkts {'1.1':'11','1.2':'20'} 517 * @arkts 1.1&1.2 518 */ 519 radius: VP; 520} 521 522/** 523 * Defines the parameters for an image-like particle. 524 * @interface ImageParticleParameters 525 * @syscap SystemCapability.ArkUI.ArkUI.Full 526 * @crossplatform 527 * @since 10 528 */ 529/** 530 * Defines the parameters for an image-like particle. 531 * @interface ImageParticleParameters 532 * @syscap SystemCapability.ArkUI.ArkUI.Full 533 * @crossplatform 534 * @atomicservice 535 * @since arkts {'1.1':'11','1.2':'20'} 536 * @arkts 1.1&1.2 537 */ 538interface ImageParticleParameters { 539 /** 540 * Particle image pixelMap. 541 * @type { ResourceStr } 542 * @syscap SystemCapability.ArkUI.ArkUI.Full 543 * @crossplatform 544 * @since 10 545 */ 546 /** 547 * Particle image pixelMap. 548 * @type { ResourceStr } 549 * @syscap SystemCapability.ArkUI.ArkUI.Full 550 * @crossplatform 551 * @atomicservice 552 * @since arkts {'1.1':'11','1.2':'20'} 553 * @arkts 1.1&1.2 554 */ 555 src: ResourceStr; 556 557 /** 558 * Particle image size. 559 * @type { [Dimension, Dimension] } 560 * @syscap SystemCapability.ArkUI.ArkUI.Full 561 * @crossplatform 562 * @since 10 563 */ 564 /** 565 * Particle image size. 566 * @type { [Dimension, Dimension] } 567 * @syscap SystemCapability.ArkUI.ArkUI.Full 568 * @crossplatform 569 * @atomicservice 570 * @since 11 571 */ 572 /** 573 * Particle image size. 574 * 575 * Anonymous Object Rectification. 576 * @type { ParticleTuple<Dimension, Dimension> } 577 * @syscap SystemCapability.ArkUI.ArkUI.Full 578 * @crossplatform 579 * @atomicservice 580 * @since arkts {'1.1':'18','1.2':'20'} 581 * @arkts 1.1&1.2 582 */ 583 size: ParticleTuple<Dimension, Dimension>; 584 585 /** 586 * Image fit. 587 * @type { ?ImageFit } 588 * @default ImageFit.Cover 589 * @syscap SystemCapability.ArkUI.ArkUI.Full 590 * @crossplatform 591 * @since 10 592 */ 593 /** 594 * Image fit. 595 * @type { ?ImageFit } 596 * @default ImageFit.Cover 597 * @syscap SystemCapability.ArkUI.ArkUI.Full 598 * @crossplatform 599 * @atomicservice 600 * @since arkts {'1.1':'11','1.2':'20'} 601 * @arkts 1.1&1.2 602 */ 603 objectFit?: ImageFit; 604} 605 606/** 607 * Defines the particle configs. 608 * @interface ParticleConfigs 609 * @syscap SystemCapability.ArkUI.ArkUI.Full 610 * @crossplatform 611 * @since 10 612 */ 613/** 614 * Defines the particle configs. 615 * @interface ParticleConfigs 616 * @syscap SystemCapability.ArkUI.ArkUI.Full 617 * @crossplatform 618 * @atomicservice 619 * @since 11 620 */ 621interface ParticleConfigs { 622 /** 623 * Point-like Particle. 624 * @type { PointParticleParameters } 625 * @syscap SystemCapability.ArkUI.ArkUI.Full 626 * @crossplatform 627 * @since 10 628 */ 629 /** 630 * Point-like Particle. 631 * @type { PointParticleParameters } 632 * @syscap SystemCapability.ArkUI.ArkUI.Full 633 * @crossplatform 634 * @atomicservice 635 * @since 11 636 */ 637 [ParticleType.POINT]: PointParticleParameters; 638 639 /** 640 * Image-like Particle. 641 * @type { ImageParticleParameters } 642 * @syscap SystemCapability.ArkUI.ArkUI.Full 643 * @crossplatform 644 * @since 10 645 */ 646 /** 647 * Image-like Particle. 648 * @type { ImageParticleParameters } 649 * @syscap SystemCapability.ArkUI.ArkUI.Full 650 * @crossplatform 651 * @atomicservice 652 * @since 11 653 */ 654 [ParticleType.IMAGE]: ImageParticleParameters; 655} 656 657/** 658 * Defines the particle configs. 659 * @typedef {PointParticleParameters | ImageParticleParameters} ParticleConfigs 660 * @syscap SystemCapability.ArkUI.ArkUI.Full 661 * @crossplatform 662 * @atomicservice 663 * @since 20 664 * @arkts 1.2 665 */ 666declare type ParticleConfigs = PointParticleParameters | ImageParticleParameters; 667 668/** 669 * Defines the emitter property. 670 * 671 * @interface EmitterProperty 672 * @syscap SystemCapability.ArkUI.ArkUI.Full 673 * @crossplatform 674 * @atomicservice 675 * @since arkts {'1.1':'12','1.2':'20'} 676 * @arkts 1.1&1.2 677 */ 678interface EmitterProperty { 679 680 /** 681 * Emitter index. 682 * 683 * @type { number } 684 * @syscap SystemCapability.ArkUI.ArkUI.Full 685 * @crossplatform 686 * @atomicservice 687 * @since arkts {'1.1':'12','1.2':'20'} 688 * @arkts 1.1&1.2 689 */ 690 index: number; 691 692 /** 693 * Emitter emission rate. 694 * 695 * @type { ?number } 696 * @syscap SystemCapability.ArkUI.ArkUI.Full 697 * @crossplatform 698 * @atomicservice 699 * @since arkts {'1.1':'12','1.2':'20'} 700 * @arkts 1.1&1.2 701 */ 702 emitRate?: number; 703 704 /** 705 * Emitter emission rate. Only support number type. 706 * 707 * @type { ?PositionT<number> } 708 * @syscap SystemCapability.ArkUI.ArkUI.Full 709 * @crossplatform 710 * @atomicservice 711 * @since arkts {'1.1':'12','1.2':'20'} 712 * @arkts 1.1&1.2 713 */ 714 position?: PositionT<number>; 715 716 /** 717 * Emitter emission window size. Only support number type. 718 * 719 * @type { ?SizeT<number> } 720 * @syscap SystemCapability.ArkUI.ArkUI.Full 721 * @crossplatform 722 * @atomicservice 723 * @since arkts {'1.1':'12','1.2':'20'} 724 * @arkts 1.1&1.2 725 */ 726 size?: SizeT<number>; 727 728 /** 729 * the description of the annulus region. This parameter is valid only for emitter whose shape is annulus. 730 * 731 * @type { ?ParticleAnnulusRegion } 732 * @syscap SystemCapability.ArkUI.ArkUI.Full 733 * @crossplatform 734 * @atomicservice 735 * @since 20 736 * @arkts 1.1&1.2 737 */ 738 annulusRegion?: ParticleAnnulusRegion; 739} 740 741/** 742 * Defines parameters of particles used by emitters. 743 * 744 * @typedef EmitterParticleOptions<PARTICLE extends ParticleType> 745 * @syscap SystemCapability.ArkUI.ArkUI.Full 746 * @crossplatform 747 * @atomicservice 748 * @since 18 749 */ 750interface EmitterParticleOptions<PARTICLE extends ParticleType> { 751 /** 752 * Particle type. 753 * @type { PARTICLE } 754 * @syscap SystemCapability.ArkUI.ArkUI.Full 755 * @crossplatform 756 * @since 10 757 */ 758 /** 759 * Particle type. 760 * @type { PARTICLE } 761 * @syscap SystemCapability.ArkUI.ArkUI.Full 762 * @crossplatform 763 * @atomicservice 764 * @since 11 765 */ 766 /** 767 * Particle type. 768 * 769 * Anonymous Object Rectification. 770 * @type { PARTICLE } 771 * @syscap SystemCapability.ArkUI.ArkUI.Full 772 * @crossplatform 773 * @atomicservice 774 * @since 18 775 */ 776 type: PARTICLE; 777 /** 778 * Particle config. 779 * @type { ParticleConfigs[PARTICLE] } 780 * @syscap SystemCapability.ArkUI.ArkUI.Full 781 * @crossplatform 782 * @since 10 783 */ 784 /** 785 * Particle config. 786 * @type { ParticleConfigs[PARTICLE] } 787 * @syscap SystemCapability.ArkUI.ArkUI.Full 788 * @crossplatform 789 * @atomicservice 790 * @since 11 791 */ 792 /** 793 * Particle config. 794 * 795 * Anonymous Object Rectification. 796 * @type { ParticleConfigs[PARTICLE] } 797 * @syscap SystemCapability.ArkUI.ArkUI.Full 798 * @crossplatform 799 * @atomicservice 800 * @since 18 801 */ 802 config: ParticleConfigs[PARTICLE]; 803 804 /** 805 * Particle count. 806 * @type { number } 807 * @syscap SystemCapability.ArkUI.ArkUI.Full 808 * @crossplatform 809 * @since 10 810 */ 811 /** 812 * Particle count. 813 * @type { number } 814 * @syscap SystemCapability.ArkUI.ArkUI.Full 815 * @crossplatform 816 * @atomicservice 817 * @since 11 818 */ 819 /** 820 * Particle count. 821 * 822 * Anonymous Object Rectification. 823 * @type { number } 824 * @syscap SystemCapability.ArkUI.ArkUI.Full 825 * @crossplatform 826 * @atomicservice 827 * @since 18 828 */ 829 count: number; 830 831 /** 832 * Particle lifetime. 833 * @type { ?number } 834 * @default 1000 835 * @syscap SystemCapability.ArkUI.ArkUI.Full 836 * @crossplatform 837 * @since 10 838 */ 839 /** 840 * Particle lifetime. 841 * @type { ?number } 842 * @default 1000 843 * @syscap SystemCapability.ArkUI.ArkUI.Full 844 * @crossplatform 845 * @atomicservice 846 * @since 11 847 */ 848 /** 849 * Particle lifetime. 850 * 851 * Anonymous Object Rectification. 852 * @type { ?number } 853 * @default 1000 854 * @syscap SystemCapability.ArkUI.ArkUI.Full 855 * @crossplatform 856 * @atomicservice 857 * @since 18 858 */ 859 lifetime?: number; 860 861 /** 862 * Particle lifetimeRange,value range [0, ∞). 863 * when lifetimeRange>lifetime,minimum lifetime is 0. 864 * @type { ?number } 865 * @default 0 866 * @syscap SystemCapability.ArkUI.ArkUI.Full 867 * @crossplatform 868 * @atomicservice 869 * @since 12 870 */ 871 /** 872 * Particle lifetimeRange,value range [0, ∞). 873 * when lifetimeRange>lifetime,minimum lifetime is 0. 874 * 875 * Anonymous Object Rectification. 876 * @type { ?number } 877 * @default 0 878 * @syscap SystemCapability.ArkUI.ArkUI.Full 879 * @crossplatform 880 * @atomicservice 881 * @since 18 882 */ 883 lifetimeRange?: number; 884} 885 886/** 887 * Defines parameters of particles used by emitters. 888 * 889 * @interface EmitterParticleOptions 890 * @syscap SystemCapability.ArkUI.ArkUI.Full 891 * @crossplatform 892 * @atomicservice 893 * @since 20 894 * @arkts 1.2 895 */ 896interface EmitterParticleOptions { 897 /** 898 * Particle type. 899 * 900 * @type { ParticleType } 901 * @syscap SystemCapability.ArkUI.ArkUI.Full 902 * @crossplatform 903 * @atomicservice 904 * @since 20 905 * @arkts 1.2 906 */ 907 type: ParticleType; 908 909 /** 910 * Particle config. 911 * 912 * @type { ParticleConfigs } 913 * @syscap SystemCapability.ArkUI.ArkUI.Full 914 * @crossplatform 915 * @atomicservice 916 * @since 20 917 * @arkts 1.2 918 */ 919 config: ParticleConfigs; 920 921 /** 922 * Particle count. 923 * 924 * @type { number } 925 * @syscap SystemCapability.ArkUI.ArkUI.Full 926 * @crossplatform 927 * @atomicservice 928 * @since 20 929 * @arkts 1.2 930 */ 931 count: number; 932 933 /** 934 * Particle lifetime. 935 * 936 * @type { ?number } 937 * @default 1000 938 * @syscap SystemCapability.ArkUI.ArkUI.Full 939 * @crossplatform 940 * @atomicservice 941 * @since 20 942 * @arkts 1.2 943 */ 944 lifetime?: number; 945 946 /** 947 * Particle lifetimeRange,value range [0, ∞). 948 * when lifetimeRange>lifetime,minimum lifetime is 0. 949 * 950 * @type { ?number } 951 * @default 0 952 * @syscap SystemCapability.ArkUI.ArkUI.Full 953 * @crossplatform 954 * @atomicservice 955 * @since 20 956 * @arkts 1.2 957 */ 958 lifetimeRange?: number; 959} 960 961/** 962 * Defines the emitter Options. 963 * @interface EmitterOptions 964 * @syscap SystemCapability.ArkUI.ArkUI.Full 965 * @crossplatform 966 * @since 10 967 */ 968/** 969 * Defines the emitter Options. 970 * @interface EmitterOptions 971 * @syscap SystemCapability.ArkUI.ArkUI.Full 972 * @crossplatform 973 * @atomicservice 974 * @since 11 975 */ 976interface EmitterOptions<PARTICLE extends ParticleType> { 977 /** 978 * Set particle config. 979 * @type { object } 980 * @syscap SystemCapability.ArkUI.ArkUI.Full 981 * @crossplatform 982 * @since 10 983 */ 984 /** 985 * Set particle config. 986 * @type { object } 987 * @syscap SystemCapability.ArkUI.ArkUI.Full 988 * @crossplatform 989 * @atomicservice 990 * @since 11 991 */ 992 /** 993 * Set particle config. 994 * 995 * Anonymous Object Rectification. 996 * @type { EmitterParticleOptions<PARTICLE> } 997 * @syscap SystemCapability.ArkUI.ArkUI.Full 998 * @crossplatform 999 * @atomicservice 1000 * @since 18 1001 */ 1002 particle: EmitterParticleOptions<PARTICLE>; 1003 1004 /** 1005 * Emitting rate, that is, the number of particles produced per second. 1006 * @type { ?number } 1007 * @default 5 1008 * @syscap SystemCapability.ArkUI.ArkUI.Full 1009 * @crossplatform 1010 * @since 10 1011 */ 1012 /** 1013 * Emitting rate, that is, the number of particles produced per second. 1014 * @type { ?number } 1015 * @default 5 1016 * @syscap SystemCapability.ArkUI.ArkUI.Full 1017 * @crossplatform 1018 * @atomicservice 1019 * @since 11 1020 */ 1021 emitRate?: number; 1022 1023 /** 1024 * Shape of emitter. 1025 * @type { ?ParticleEmitterShape } 1026 * @default ParticleEmitterShape.RECTANGLE 1027 * @syscap SystemCapability.ArkUI.ArkUI.Full 1028 * @crossplatform 1029 * @since 10 1030 */ 1031 /** 1032 * Shape of emitter. 1033 * @type { ?ParticleEmitterShape } 1034 * @default ParticleEmitterShape.RECTANGLE 1035 * @syscap SystemCapability.ArkUI.ArkUI.Full 1036 * @crossplatform 1037 * @atomicservice 1038 * @since 11 1039 */ 1040 shape?: ParticleEmitterShape; 1041 1042 /** 1043 * Position of emitter. 1044 * The first element means X-axis location. 1045 * The second element means the Y-axis location. 1046 * @type { ?[Dimension, Dimension] } 1047 * @default [0,0] 1048 * @syscap SystemCapability.ArkUI.ArkUI.Full 1049 * @crossplatform 1050 * @since 10 1051 */ 1052 /** 1053 * Position of emitter. 1054 * The first element means X-axis location. 1055 * The second element means the Y-axis location. 1056 * @type { ?[Dimension, Dimension] } 1057 * @default [0,0] 1058 * @syscap SystemCapability.ArkUI.ArkUI.Full 1059 * @crossplatform 1060 * @atomicservice 1061 * @since 11 1062 */ 1063 /** 1064 * Position of emitter. 1065 * The first element means X-axis location. 1066 * The second element means the Y-axis location. 1067 * 1068 * Anonymous Object Rectification. 1069 * @type { ?ParticleTuple<Dimension, Dimension> } 1070 * @default [0,0] 1071 * @syscap SystemCapability.ArkUI.ArkUI.Full 1072 * @crossplatform 1073 * @atomicservice 1074 * @since 18 1075 */ 1076 position?: ParticleTuple<Dimension, Dimension>; 1077 1078 /** 1079 * Size of emitter. 1080 * The first element means emitter width. 1081 * The second element means emitter height. 1082 * @type { ?[Dimension, Dimension] } 1083 * @default ['100%','100%'] 1084 * @syscap SystemCapability.ArkUI.ArkUI.Full 1085 * @crossplatform 1086 * @since 10 1087 */ 1088 /** 1089 * Size of emitter. 1090 * The first element means emitter width. 1091 * The second element means emitter height. 1092 * @type { ?[Dimension, Dimension] } 1093 * @default ['100%','100%'] 1094 * @syscap SystemCapability.ArkUI.ArkUI.Full 1095 * @crossplatform 1096 * @atomicservice 1097 * @since 11 1098 */ 1099 /** 1100 * Size of emitter. 1101 * The first element means emitter width. 1102 * The second element means emitter height. 1103 * 1104 * Anonymous Object Rectification. 1105 * @type { ?ParticleTuple<Dimension, Dimension> } 1106 * @default ['100%','100%'] 1107 * @syscap SystemCapability.ArkUI.ArkUI.Full 1108 * @crossplatform 1109 * @atomicservice 1110 * @since 18 1111 */ 1112 size?: ParticleTuple<Dimension, Dimension>; 1113 1114 /** 1115 * the description of the annulus region. This parameter is valid only for emitter whose shape is annulus. 1116 * 1117 * @type { ?ParticleAnnulusRegion } 1118 * @default {innerRadius:LengthMetrics.vp(0),outerRadius:LengthMetrics.vp(0)} 1119 * @syscap SystemCapability.ArkUI.ArkUI.Full 1120 * @crossplatform 1121 * @atomicservice 1122 * @since 20 1123 */ 1124 annulusRegion?: ParticleAnnulusRegion; 1125} 1126 1127/** 1128 * Defines the emitter Options. 1129 * @interface EmitterOptions 1130 * @syscap SystemCapability.ArkUI.ArkUI.Full 1131 * @crossplatform 1132 * @atomicservice 1133 * @since 20 1134 * @arkts 1.2 1135 */ 1136interface EmitterOptions { 1137 /** 1138 * Set particle config. 1139 * 1140 * @type { EmitterParticleOptions } 1141 * @syscap SystemCapability.ArkUI.ArkUI.Full 1142 * @crossplatform 1143 * @atomicservice 1144 * @since 20 1145 * @arkts 1.2 1146 */ 1147 particle: EmitterParticleOptions; 1148 1149 /** 1150 * Emitting rate, that is, the number of particles produced per second. 1151 * @type { ?number } 1152 * @default 5 1153 * @syscap SystemCapability.ArkUI.ArkUI.Full 1154 * @crossplatform 1155 * @atomicservice 1156 * @since 20 1157 * @arkts 1.2 1158 */ 1159 emitRate?: number; 1160 1161 /** 1162 * Shape of emitter. 1163 * @type { ?ParticleEmitterShape } 1164 * @default ParticleEmitterShape.RECTANGLE 1165 * @syscap SystemCapability.ArkUI.ArkUI.Full 1166 * @crossplatform 1167 * @atomicservice 1168 * @since 20 1169 * @arkts 1.2 1170 */ 1171 shape?: ParticleEmitterShape; 1172 1173 /** 1174 * Position of emitter. 1175 * The first element means X-axis location. 1176 * The second element means the Y-axis location. 1177 * 1178 * @type { ?ParticleTuple<Dimension, Dimension> } 1179 * @default [0,0] 1180 * @syscap SystemCapability.ArkUI.ArkUI.Full 1181 * @crossplatform 1182 * @atomicservice 1183 * @since 20 1184 * @arkts 1.2 1185 */ 1186 position?: ParticleTuple<Dimension, Dimension>; 1187 1188 /** 1189 * Size of emitter. 1190 * The first element means emitter width. 1191 * The second element means emitter height. 1192 * 1193 * @type { ?ParticleTuple<Dimension, Dimension> } 1194 * @default ['100%','100%'] 1195 * @syscap SystemCapability.ArkUI.ArkUI.Full 1196 * @crossplatform 1197 * @atomicservice 1198 * @since 20 1199 * @arkts 1.2 1200 */ 1201 size?: ParticleTuple<Dimension, Dimension>; 1202 1203 /** 1204 * the description of the annulus region. This parameter is valid only for emitter whose shape is annulus. 1205 * 1206 * @type { ?ParticleAnnulusRegion } 1207 * @default {innerRadius:LengthMetrics.vp(0),outerRadius:LengthMetrics.vp(0)} 1208 * @syscap SystemCapability.ArkUI.ArkUI.Full 1209 * @crossplatform 1210 * @atomicservice 1211 * @since 20 1212 * @arkts 1.2 1213 */ 1214 annulusRegion?: ParticleAnnulusRegion; 1215} 1216 1217/** 1218 * Defines the particle property updater configs. 1219 * @interface ParticlePropertyUpdaterConfigs 1220 * @syscap SystemCapability.ArkUI.ArkUI.Full 1221 * @crossplatform 1222 * @since 10 1223 */ 1224/** 1225 * Defines the particle property updater configs. 1226 * @interface ParticlePropertyUpdaterConfigs 1227 * @syscap SystemCapability.ArkUI.ArkUI.Full 1228 * @crossplatform 1229 * @atomicservice 1230 * @since 11 1231 */ 1232interface ParticlePropertyUpdaterConfigs<T> { 1233 /** 1234 * No effect of particle updater. 1235 * 1236 * @type { void } 1237 * @syscap SystemCapability.ArkUI.ArkUI.Full 1238 * @crossplatform 1239 * @since 10 1240 */ 1241 /** 1242 * No effect of particle updater. 1243 * 1244 * @type { void } 1245 * @syscap SystemCapability.ArkUI.ArkUI.Full 1246 * @crossplatform 1247 * @atomicservice 1248 * @since 11 1249 */ 1250 [ParticleUpdater.NONE]: void; 1251 1252 /** 1253 * Random effect of particle updater. 1254 * @type { [T, T] } 1255 * @syscap SystemCapability.ArkUI.ArkUI.Full 1256 * @crossplatform 1257 * @since 10 1258 */ 1259 /** 1260 * Random effect of particle updater. 1261 * @type { [T, T] } 1262 * @syscap SystemCapability.ArkUI.ArkUI.Full 1263 * @crossplatform 1264 * @atomicservice 1265 * @since 11 1266 */ 1267 /** 1268 * Random effect of particle updater. 1269 * 1270 * Anonymous Object Rectification. 1271 * @type { ParticleTuple<T, T> } 1272 * @syscap SystemCapability.ArkUI.ArkUI.Full 1273 * @crossplatform 1274 * @atomicservice 1275 * @since 18 1276 */ 1277 [ParticleUpdater.RANDOM]: ParticleTuple<T, T>; 1278 1279 /** 1280 * Curve effect of particle updater. 1281 * @type { Array<ParticlePropertyAnimation<T>> } 1282 * @syscap SystemCapability.ArkUI.ArkUI.Full 1283 * @crossplatform 1284 * @since 10 1285 */ 1286 /** 1287 * Curve effect of particle updater. 1288 * @type { Array<ParticlePropertyAnimation<T>> } 1289 * @syscap SystemCapability.ArkUI.ArkUI.Full 1290 * @crossplatform 1291 * @atomicservice 1292 * @since 11 1293 */ 1294 [ParticleUpdater.CURVE]: Array<ParticlePropertyAnimation<T>>; 1295} 1296 1297/** 1298 * Defines the particle property updater configs. 1299 * @typedef { undefined | ParticleTuple<number, number> | Array<ParticlePropertyAnimation<number>> } ParticlePropertyUpdaterConfigs 1300 * @syscap SystemCapability.ArkUI.ArkUI.Full 1301 * @crossplatform 1302 * @atomicservice 1303 * @since 20 1304 * @arkts 1.2 1305 */ 1306declare type ParticlePropertyUpdaterConfigs = undefined | ParticleTuple<number, number> | Array<ParticlePropertyAnimation<number>>; 1307 1308 1309/** 1310 * Defines the particle updater options. 1311 * 1312 * @typedef ParticleUpdaterOptions<TYPE, UPDATER extends ParticleUpdater> 1313 * @syscap SystemCapability.ArkUI.ArkUI.Full 1314 * @crossplatform 1315 * @atomicservice 1316 * @since 18 1317 */ 1318interface ParticleUpdaterOptions<TYPE, UPDATER extends ParticleUpdater> { 1319 /** 1320 * Particle updater type. 1321 * @type { UPDATER } 1322 * @syscap SystemCapability.ArkUI.ArkUI.Full 1323 * @crossplatform 1324 * @since 10 1325 */ 1326 /** 1327 * Particle updater type. 1328 * @type { UPDATER } 1329 * @syscap SystemCapability.ArkUI.ArkUI.Full 1330 * @crossplatform 1331 * @atomicservice 1332 * @since 11 1333 */ 1334 /** 1335 * Particle updater type. 1336 * 1337 * Anonymous Object Rectification. 1338 * @type { UPDATER } 1339 * @syscap SystemCapability.ArkUI.ArkUI.Full 1340 * @crossplatform 1341 * @atomicservice 1342 * @since 18 1343 */ 1344 type: UPDATER; 1345 1346 /** 1347 * Particle updater configuration. 1348 * @type { ParticlePropertyUpdaterConfigs<TYPE>[UPDATER] } 1349 * @syscap SystemCapability.ArkUI.ArkUI.Full 1350 * @crossplatform 1351 * @since 10 1352 */ 1353 /** 1354 * Particle updater configuration. 1355 * @type { ParticlePropertyUpdaterConfigs<TYPE>[UPDATER] } 1356 * @syscap SystemCapability.ArkUI.ArkUI.Full 1357 * @crossplatform 1358 * @atomicservice 1359 * @since 11 1360 */ 1361 /** 1362 * Particle updater configuration. 1363 * 1364 * Anonymous Object Rectification. 1365 * @type { ParticlePropertyUpdaterConfigs<TYPE>[UPDATER] } 1366 * @syscap SystemCapability.ArkUI.ArkUI.Full 1367 * @crossplatform 1368 * @atomicservice 1369 * @since 18 1370 */ 1371 config: ParticlePropertyUpdaterConfigs<TYPE>[UPDATER]; 1372} 1373 1374/** 1375 * Defines the particle updater options. 1376 * 1377 * @typedef ParticleUpdaterOptions 1378 * @syscap SystemCapability.ArkUI.ArkUI.Full 1379 * @crossplatform 1380 * @atomicservice 1381 * @since 20 1382 * @arkts 1.2 1383 */ 1384interface ParticleUpdaterOptions { 1385 /** 1386 * Particle updater type. 1387 * 1388 * @type { ParticleUpdater } 1389 * @syscap SystemCapability.ArkUI.ArkUI.Full 1390 * @crossplatform 1391 * @atomicservice 1392 * @since 20 1393 * @arkts 1.2 1394 */ 1395 type: ParticleUpdater; 1396 1397 /** 1398 * Particle updater configuration. 1399 * 1400 * @type { ParticlePropertyUpdaterConfigs } 1401 * @syscap SystemCapability.ArkUI.ArkUI.Full 1402 * @crossplatform 1403 * @atomicservice 1404 * @since 20 1405 * @arkts 1.2 1406 */ 1407 config: ParticlePropertyUpdaterConfigs; 1408} 1409 1410/** 1411 * Defines the particle color options. 1412 * 1413 * @typedef ParticleColorOptions 1414 * @syscap SystemCapability.ArkUI.ArkUI.Full 1415 * @crossplatform 1416 * @atomicservice 1417 * @since arkts {'1.1':'18','1.2':'20'} 1418 * @arkts 1.1&1.2 1419 */ 1420interface ParticleColorOptions { 1421 /** 1422 * Red component of particle color. 1423 * @type { ParticleTuple<number, number> } 1424 * @syscap SystemCapability.ArkUI.ArkUI.Full 1425 * @crossplatform 1426 * @since 10 1427 */ 1428 /** 1429 * Red component of particle color. 1430 * @type { ParticleTuple<number, number> } 1431 * @syscap SystemCapability.ArkUI.ArkUI.Full 1432 * @crossplatform 1433 * @atomicservice 1434 * @since 11 1435 */ 1436 /** 1437 * Red component of particle color. 1438 * 1439 * Anonymous Object Rectification. 1440 * @type { ParticleTuple<number, number> } 1441 * @syscap SystemCapability.ArkUI.ArkUI.Full 1442 * @crossplatform 1443 * @atomicservice 1444 * @since arkts{ '1.1':'18','1.2':'20'} 1445 * @arkts 1.1&1.2 1446 */ 1447 r: ParticleTuple<number, number>; 1448 1449 /** 1450 * Green component of particle color. 1451 * @type { ParticleTuple<number, number> } 1452 * @syscap SystemCapability.ArkUI.ArkUI.Full 1453 * @crossplatform 1454 * @since 10 1455 */ 1456 /** 1457 * Green component of particle color. 1458 * @type { ParticleTuple<number, number> } 1459 * @syscap SystemCapability.ArkUI.ArkUI.Full 1460 * @crossplatform 1461 * @atomicservice 1462 * @since 11 1463 */ 1464 /** 1465 * Green component of particle color. 1466 * 1467 * Anonymous Object Rectification. 1468 * @type { ParticleTuple<number, number> } 1469 * @syscap SystemCapability.ArkUI.ArkUI.Full 1470 * @crossplatform 1471 * @atomicservice 1472 * @since arkts{ '1.1':'18','1.2':'20'} 1473 * @arkts 1.1&1.2 1474 */ 1475 g: ParticleTuple<number, number>; 1476 1477 /** 1478 * Blue component of particle color. 1479 * @type { ParticleTuple<number, number> } 1480 * @syscap SystemCapability.ArkUI.ArkUI.Full 1481 * @crossplatform 1482 * @since 10 1483 */ 1484 /** 1485 * Blue component of particle color. 1486 * @type { ParticleTuple<number, number> } 1487 * @syscap SystemCapability.ArkUI.ArkUI.Full 1488 * @crossplatform 1489 * @atomicservice 1490 * @since 11 1491 */ 1492 /** 1493 * Blue component of particle color. 1494 * 1495 * Anonymous Object Rectification. 1496 * @type { ParticleTuple<number, number> } 1497 * @syscap SystemCapability.ArkUI.ArkUI.Full 1498 * @crossplatform 1499 * @atomicservice 1500 * @since arkts {'1.1':'18','1.2':'20'} 1501 * @arkts 1.1&1.2 1502 */ 1503 b: ParticleTuple<number, number>; 1504 1505 /** 1506 * Opacity component of particle color. 1507 * @type { ParticleTuple<number, number> } 1508 * @syscap SystemCapability.ArkUI.ArkUI.Full 1509 * @crossplatform 1510 * @since 10 1511 */ 1512 /** 1513 * Opacity component of particle color. 1514 * @type { ParticleTuple<number, number> } 1515 * @syscap SystemCapability.ArkUI.ArkUI.Full 1516 * @crossplatform 1517 * @atomicservice 1518 * @since 11 1519 */ 1520 /** 1521 * Opacity component of particle color. 1522 * 1523 * Anonymous Object Rectification. 1524 * @type { ParticleTuple<number, number> } 1525 * @syscap SystemCapability.ArkUI.ArkUI.Full 1526 * @crossplatform 1527 * @atomicservice 1528 * @since arkts {'1.1':'18','1.2':'20'} 1529 * @arkts 1.1&1.2 1530 */ 1531 a: ParticleTuple<number, number>; 1532} 1533 1534/** 1535 * Defines the particle color updater options. 1536 * 1537 * @typedef ParticleColorUpdaterOptions<UPDATER extends ParticleUpdater> 1538 * @syscap SystemCapability.ArkUI.ArkUI.Full 1539 * @crossplatform 1540 * @atomicservice 1541 * @since 18 1542 */ 1543interface ParticleColorUpdaterOptions<UPDATER extends ParticleUpdater> { 1544 /** 1545 * Color updater. 1546 * @type { UPDATER } 1547 * @syscap SystemCapability.ArkUI.ArkUI.Full 1548 * @crossplatform 1549 * @since 10 1550 */ 1551 /** 1552 * Color updater. 1553 * @type { UPDATER } 1554 * @syscap SystemCapability.ArkUI.ArkUI.Full 1555 * @crossplatform 1556 * @atomicservice 1557 * @since 11 1558 */ 1559 /** 1560 * Color updater. 1561 * 1562 * Anonymous Object Rectification. 1563 * @type { UPDATER } 1564 * @syscap SystemCapability.ArkUI.ArkUI.Full 1565 * @crossplatform 1566 * @atomicservice 1567 * @since 18 1568 */ 1569 type: UPDATER; 1570 1571 /** 1572 * Color updater configuration. 1573 * @type { ParticleColorPropertyUpdaterConfigs[UPDATER] } 1574 * @syscap SystemCapability.ArkUI.ArkUI.Full 1575 * @crossplatform 1576 * @since 10 1577 */ 1578 /** 1579 * Color updater configuration. 1580 * @type { ParticleColorPropertyUpdaterConfigs[UPDATER] } 1581 * @syscap SystemCapability.ArkUI.ArkUI.Full 1582 * @crossplatform 1583 * @atomicservice 1584 * @since 11 1585 */ 1586 /** 1587 * Color updater configuration. 1588 * 1589 * Anonymous Object Rectification. 1590 * @type { ParticleColorPropertyUpdaterConfigs[UPDATER] } 1591 * @syscap SystemCapability.ArkUI.ArkUI.Full 1592 * @crossplatform 1593 * @atomicservice 1594 * @since 18 1595 */ 1596 config: ParticleColorPropertyUpdaterConfigs[UPDATER]; 1597} 1598 1599/** 1600 * Defines the particle color updater options. 1601 * 1602 * @interface ParticleColorUpdaterOptions 1603 * @syscap SystemCapability.ArkUI.ArkUI.Full 1604 * @crossplatform 1605 * @atomicservice 1606 * @since 20 1607 * @arkts 1.2 1608 */ 1609interface ParticleColorUpdaterOptions { 1610 /** 1611 * Color updater. 1612 * 1613 * @type { ParticleUpdater } 1614 * @syscap SystemCapability.ArkUI.ArkUI.Full 1615 * @crossplatform 1616 * @atomicservice 1617 * @since 20 1618 * @arkts 1.2 1619 */ 1620 type: ParticleUpdater; 1621 1622 /** 1623 * Color updater configuration. 1624 * 1625 * @type { ParticleColorPropertyUpdaterConfigs } 1626 * @syscap SystemCapability.ArkUI.ArkUI.Full 1627 * @crossplatform 1628 * @atomicservice 1629 * @since 20 1630 * @arkts 1.2 1631 */ 1632 config: ParticleColorPropertyUpdaterConfigs; 1633} 1634 1635/** 1636 * Defines the particle property Options. 1637 * @interface ParticlePropertyOptions 1638 * @syscap SystemCapability.ArkUI.ArkUI.Full 1639 * @crossplatform 1640 * @since 10 1641 */ 1642/** 1643 * Defines the particle property Options. 1644 * @interface ParticlePropertyOptions 1645 * @syscap SystemCapability.ArkUI.ArkUI.Full 1646 * @crossplatform 1647 * @atomicservice 1648 * @since 11 1649 */ 1650interface ParticlePropertyOptions<TYPE, UPDATER extends ParticleUpdater> { 1651 /** 1652 * Initial range, within which the initial value are randomly generated. 1653 * @type { [TYPE, TYPE] } 1654 * @syscap SystemCapability.ArkUI.ArkUI.Full 1655 * @crossplatform 1656 * @since 10 1657 */ 1658 /** 1659 * Initial range, within which the initial value are randomly generated. 1660 * @type { [TYPE, TYPE] } 1661 * @syscap SystemCapability.ArkUI.ArkUI.Full 1662 * @crossplatform 1663 * @atomicservice 1664 * @since 11 1665 */ 1666 /** 1667 * Initial range, within which the initial value are randomly generated. 1668 * 1669 * Anonymous Object Rectification. 1670 * @type { ParticleTuple<TYPE, TYPE> } 1671 * @syscap SystemCapability.ArkUI.ArkUI.Full 1672 * @crossplatform 1673 * @atomicservice 1674 * @since 18 1675 */ 1676 range: ParticleTuple<TYPE, TYPE>; 1677 1678 /** 1679 * Particle property updater. 1680 * @type { ?object } 1681 * @default {type:UPDATER.NONE;config:ParticlePropertyUpdaterConfigs<UPDATER.NONE>[UPDATER.NONE]} 1682 * @syscap SystemCapability.ArkUI.ArkUI.Full 1683 * @crossplatform 1684 * @since 10 1685 */ 1686 /** 1687 * Particle property updater. 1688 * @type { ?object } 1689 * @default {type:UPDATER.NONE;config:ParticlePropertyUpdaterConfigs<UPDATER.NONE>[UPDATER.NONE]} 1690 * @syscap SystemCapability.ArkUI.ArkUI.Full 1691 * @crossplatform 1692 * @atomicservice 1693 * @since 11 1694 */ 1695 /** 1696 * Particle property updater. 1697 * 1698 * Anonymous Object Rectification. 1699 * @type { ?ParticleUpdaterOptions<TYPE, UPDATER> } 1700 * @default {type:UPDATER.NONE;config:ParticlePropertyUpdaterConfigs<UPDATER.NONE>[UPDATER.NONE]} 1701 * @syscap SystemCapability.ArkUI.ArkUI.Full 1702 * @crossplatform 1703 * @atomicservice 1704 * @since 18 1705 */ 1706 updater?: ParticleUpdaterOptions<TYPE, UPDATER>; 1707} 1708 1709/** 1710 * Defines the particle property Options. 1711 * @interface ParticlePropertyOptions 1712 * @syscap SystemCapability.ArkUI.ArkUI.Full 1713 * @crossplatform 1714 * @atomicservice 1715 * @since 20 1716 * @arkts 1.2 1717 */ 1718interface ParticlePropertyOptions { 1719 /** 1720 * Initial range, within which the initial value are randomly generated. 1721 * 1722 * @type { ParticleTuple<number, number> } 1723 * @syscap SystemCapability.ArkUI.ArkUI.Full 1724 * @crossplatform 1725 * @atomicservice 1726 * @since 20 1727 * @arkts 1.2 1728 */ 1729 range: ParticleTuple<number, number>; 1730 1731 /** 1732 * Particle property updater. 1733 * 1734 * @type { ?ParticleUpdaterOptions } 1735 * @default {type:UPDATER.NONE;config:undefined} 1736 * @syscap SystemCapability.ArkUI.ArkUI.Full 1737 * @crossplatform 1738 * @atomicservice 1739 * @since 20 1740 * @arkts 1.2 1741 */ 1742 updater?: ParticleUpdaterOptions; 1743} 1744 1745/** 1746 * Defines the particle color property updater configs. 1747 * @interface ParticleColorPropertyUpdaterConfigs 1748 * @syscap SystemCapability.ArkUI.ArkUI.Full 1749 * @crossplatform 1750 * @since 10 1751 */ 1752/** 1753 * Defines the particle color property updater configs. 1754 * @interface ParticleColorPropertyUpdaterConfigs 1755 * @syscap SystemCapability.ArkUI.ArkUI.Full 1756 * @crossplatform 1757 * @atomicservice 1758 * @since 11 1759 */ 1760interface ParticleColorPropertyUpdaterConfigs { 1761 /** 1762 * No effect of particle color property updater. 1763 * 1764 * @type { void } 1765 * @syscap SystemCapability.ArkUI.ArkUI.Full 1766 * @crossplatform 1767 * @since 10 1768 */ 1769 /** 1770 * No effect of particle color property updater. 1771 * 1772 * @type { void } 1773 * @syscap SystemCapability.ArkUI.ArkUI.Full 1774 * @crossplatform 1775 * @atomicservice 1776 * @since 11 1777 */ 1778 [ParticleUpdater.NONE]: void; 1779 1780 /** 1781 * Random effect of particle color property updater. 1782 * @type { object } 1783 * @syscap SystemCapability.ArkUI.ArkUI.Full 1784 * @crossplatform 1785 * @since 10 1786 */ 1787 /** 1788 * Random effect of particle color property updater. 1789 * @type { object } 1790 * @syscap SystemCapability.ArkUI.ArkUI.Full 1791 * @crossplatform 1792 * @atomicservice 1793 * @since 11 1794 */ 1795 /** 1796 * Random effect of particle color property updater. 1797 * 1798 * Anonymous Object Rectification. 1799 * @type { ParticleColorOptions } 1800 * @syscap SystemCapability.ArkUI.ArkUI.Full 1801 * @crossplatform 1802 * @atomicservice 1803 * @since 18 1804 */ 1805 [ParticleUpdater.RANDOM]: ParticleColorOptions; 1806 1807 /** 1808 * Curve effect of particle color property updater. 1809 * 1810 * @type { Array<ParticlePropertyAnimation<ResourceColor>> } 1811 * @syscap SystemCapability.ArkUI.ArkUI.Full 1812 * @crossplatform 1813 * @since 10 1814 */ 1815 /** 1816 * Curve effect of particle color property updater. 1817 * 1818 * @type { Array<ParticlePropertyAnimation<ResourceColor>> } 1819 * @syscap SystemCapability.ArkUI.ArkUI.Full 1820 * @crossplatform 1821 * @atomicservice 1822 * @since 11 1823 */ 1824 [ParticleUpdater.CURVE]: Array<ParticlePropertyAnimation<ResourceColor>>; 1825} 1826 1827/** 1828 * Defines the particle color property updater configs. 1829 * @typedef {undefined | ParticleColorOptions | Array<ParticlePropertyAnimation<ResourceColor>>} ParticleColorPropertyUpdaterConfigs 1830 * @syscap SystemCapability.ArkUI.ArkUI.Full 1831 * @crossplatform 1832 * @atomicservice 1833 * @since 20 1834 * @arkts 1.2 1835 */ 1836declare type ParticleColorPropertyUpdaterConfigs = undefined | ParticleColorOptions | Array<ParticlePropertyAnimation<ResourceColor>>; 1837 1838/** 1839 * Defines the particle color property updater configs which can support generics. 1840 * @interface ParticleColorPropertyOptions 1841 * @syscap SystemCapability.ArkUI.ArkUI.Full 1842 * @crossplatform 1843 * @since 10 1844 */ 1845/** 1846 * Defines the particle color property updater configs which can support generics. 1847 * @interface ParticleColorPropertyOptions 1848 * @syscap SystemCapability.ArkUI.ArkUI.Full 1849 * @crossplatform 1850 * @atomicservice 1851 * @since 11 1852 */ 1853interface ParticleColorPropertyOptions<UPDATER extends ParticleUpdater> { 1854 /** 1855 * Initial color range, within which the initial color is randomly generated. 1856 * @type { [ResourceColor, ResourceColor] } 1857 * @syscap SystemCapability.ArkUI.ArkUI.Full 1858 * @crossplatform 1859 * @since 10 1860 */ 1861 /** 1862 * Initial color range, within which the initial color is randomly generated. 1863 * @type { [ResourceColor, ResourceColor] } 1864 * @syscap SystemCapability.ArkUI.ArkUI.Full 1865 * @crossplatform 1866 * @atomicservice 1867 * @since 11 1868 */ 1869 /** 1870 * Initial color range, within which the initial color is randomly generated. 1871 * 1872 * Anonymous Object Rectification. 1873 * @type { ParticleTuple<ResourceColor, ResourceColor> } 1874 * @syscap SystemCapability.ArkUI.ArkUI.Full 1875 * @crossplatform 1876 * @atomicservice 1877 * @since 18 1878 */ 1879 range: ParticleTuple<ResourceColor, ResourceColor>; 1880 1881 /** 1882 * Distribution type of particle color. 1883 * @type { ?DistributionType } 1884 * @default DistributionType.UNIFORM 1885 * @syscap SystemCapability.ArkUI.ArkUI.Full 1886 * @crossplatform 1887 * @atomicservice 1888 * @since 12 1889 */ 1890 distributionType?: DistributionType; 1891 1892 /** 1893 * Particle color property updater. 1894 * @type { ?object } 1895 * @default {type:UPDATER.NONE;config:ParticleColorPropertyUpdaterConfigs[UPDATER.NONE]} 1896 * @syscap SystemCapability.ArkUI.ArkUI.Full 1897 * @crossplatform 1898 * @since 10 1899 */ 1900 /** 1901 * Particle color property updater. 1902 * @type { ?object } 1903 * @default {type:UPDATER.NONE;config:ParticleColorPropertyUpdaterConfigs[UPDATER.NONE]} 1904 * @syscap SystemCapability.ArkUI.ArkUI.Full 1905 * @crossplatform 1906 * @atomicservice 1907 * @since 11 1908 */ 1909 /** 1910 * Particle color property updater. 1911 * 1912 * Anonymous Object Rectification. 1913 * @type { ?ParticleColorUpdaterOptions<UPDATER> } 1914 * @default {type:UPDATER.NONE;config:ParticleColorPropertyUpdaterConfigs[UPDATER.NONE]} 1915 * @syscap SystemCapability.ArkUI.ArkUI.Full 1916 * @crossplatform 1917 * @atomicservice 1918 * @since 18 1919 */ 1920 updater?: ParticleColorUpdaterOptions<UPDATER>; 1921} 1922 1923/** 1924 * Defines the particle color property updater. 1925 * @interface ParticleColorPropertyOptions 1926 * @syscap SystemCapability.ArkUI.ArkUI.Full 1927 * @crossplatform 1928 * @atomicservice 1929 * @since 20 1930 * @arkts 1.2 1931 */ 1932interface ParticleColorPropertyOptions { 1933 /** 1934 * Initial color range, within which the initial color is randomly generated. 1935 * 1936 * @type { ParticleTuple<ResourceColor, ResourceColor> } 1937 * @syscap SystemCapability.ArkUI.ArkUI.Full 1938 * @crossplatform 1939 * @atomicservice 1940 * @since 20 1941 * @arkts 1.2 1942 */ 1943 range: ParticleTuple<ResourceColor, ResourceColor>; 1944 1945 /** 1946 * Distribution type of particle color. 1947 * @type { ?DistributionType } 1948 * @default DistributionType.UNIFORM 1949 * @syscap SystemCapability.ArkUI.ArkUI.Full 1950 * @crossplatform 1951 * @atomicservice 1952 * @since 20 1953 * @arkts 1.2 1954 */ 1955 distributionType?: DistributionType; 1956 1957 /** 1958 * Particle color property updater. 1959 * 1960 * @type { ?ParticleColorUpdaterOptions } 1961 * @default {type:UPDATER.NONE;config:undefined} 1962 * @syscap SystemCapability.ArkUI.ArkUI.Full 1963 * @crossplatform 1964 * @atomicservice 1965 * @since 20 1966 * @arkts 1.2 1967 */ 1968 updater?: ParticleColorUpdaterOptions; 1969} 1970 1971/** 1972 * Defines the particle property lifecycle. 1973 * @interface ParticlePropertyAnimation 1974 * @syscap SystemCapability.ArkUI.ArkUI.Full 1975 * @crossplatform 1976 * @since 10 1977 */ 1978/** 1979 * Defines the particle property lifecycle. 1980 * @interface ParticlePropertyAnimation 1981 * @syscap SystemCapability.ArkUI.ArkUI.Full 1982 * @crossplatform 1983 * @atomicservice 1984 * @since arkts {'1.1':'11','1.2':'20'} 1985 * @arkts 1.1&1.2 1986 */ 1987interface ParticlePropertyAnimation<T> { 1988 /** 1989 * Start position of the particle animation. 1990 * @type { T } 1991 * @syscap SystemCapability.ArkUI.ArkUI.Full 1992 * @crossplatform 1993 * @since 10 1994 */ 1995 /** 1996 * Start position of the particle animation. 1997 * @type { T } 1998 * @syscap SystemCapability.ArkUI.ArkUI.Full 1999 * @crossplatform 2000 * @atomicservice 2001 * @since arkts {'1.1':'11','1.2':'20'} 2002 * @arkts 1.1&1.2 2003 */ 2004 from: T; 2005 2006 /** 2007 * End position of the particle animation. 2008 * @type { T } 2009 * @syscap SystemCapability.ArkUI.ArkUI.Full 2010 * @crossplatform 2011 * @since 10 2012 */ 2013 /** 2014 * End position of the particle animation. 2015 * @type { T } 2016 * @syscap SystemCapability.ArkUI.ArkUI.Full 2017 * @crossplatform 2018 * @atomicservice 2019 * @since arkts {'1.1':'11','1.2':'20'} 2020 * @arkts 1.1&1.2 2021 */ 2022 to: T; 2023 2024 /** 2025 * Start millis of the particle animation. 2026 * @type { number } 2027 * @syscap SystemCapability.ArkUI.ArkUI.Full 2028 * @crossplatform 2029 * @since 10 2030 */ 2031 /** 2032 * Start millis of the particle animation. 2033 * @type { number } 2034 * @syscap SystemCapability.ArkUI.ArkUI.Full 2035 * @crossplatform 2036 * @atomicservice 2037 * @since arkts {'1.1':'11','1.2':'20'} 2038 * @arkts 1.1&1.2 2039 */ 2040 startMillis: number; 2041 2042 /** 2043 * End millis of the particle animation. 2044 * @type { number } 2045 * @syscap SystemCapability.ArkUI.ArkUI.Full 2046 * @crossplatform 2047 * @since 10 2048 */ 2049 /** 2050 * End millis of the particle animation. 2051 * @type { number } 2052 * @syscap SystemCapability.ArkUI.ArkUI.Full 2053 * @crossplatform 2054 * @atomicservice 2055 * @since arkts {'1.1':'11','1.2':'20'} 2056 * @arkts 1.1&1.2 2057 */ 2058 endMillis: number; 2059 2060 /** 2061 * Curve of the particle animation. 2062 * @type { ?(Curve | ICurve) } 2063 * @default Curve.Linear 2064 * @syscap SystemCapability.ArkUI.ArkUI.Full 2065 * @crossplatform 2066 * @since 10 2067 */ 2068 /** 2069 * Curve of the particle animation. 2070 * @type { ?(Curve | ICurve) } 2071 * @default Curve.Linear 2072 * @syscap SystemCapability.ArkUI.ArkUI.Full 2073 * @crossplatform 2074 * @atomicservice 2075 * @since arkts {'1.1':'11','1.2':'20'} 2076 * @arkts 1.1&1.2 2077 */ 2078 curve?: Curve | ICurve; 2079} 2080 2081/** 2082 * Defines the particle array. 2083 * 2084 * @typedef Particles 2085 * @syscap SystemCapability.ArkUI.ArkUI.Full 2086 * @crossplatform 2087 * @atomicservice 2088 * @since 18 2089 */ 2090interface Particles< 2091 PARTICLE extends ParticleType, 2092 COLOR_UPDATER extends ParticleUpdater, 2093 OPACITY_UPDATER extends ParticleUpdater, 2094 SCALE_UPDATER extends ParticleUpdater, 2095 ACC_SPEED_UPDATER extends ParticleUpdater, 2096 ACC_ANGLE_UPDATER extends ParticleUpdater, 2097 SPIN_UPDATER extends ParticleUpdater 2098> { 2099 /** 2100 * Array of particles. 2101 * @type { Array<ParticleOptions<PARTICLE, COLOR_UPDATER, OPACITY_UPDATER, SCALE_UPDATER, ACC_SPEED_UPDATER, ACC_ANGLE_UPDATER, SPIN_UPDATER>> } 2102 * @syscap SystemCapability.ArkUI.ArkUI.Full 2103 * @crossplatform 2104 * @since 10 2105 */ 2106 /** 2107 * Array of particles. 2108 * @type { Array<ParticleOptions<PARTICLE, COLOR_UPDATER, OPACITY_UPDATER, SCALE_UPDATER, ACC_SPEED_UPDATER, ACC_ANGLE_UPDATER, SPIN_UPDATER>> } 2109 * @syscap SystemCapability.ArkUI.ArkUI.Full 2110 * @crossplatform 2111 * @atomicservice 2112 * @since 11 2113 */ 2114 /** 2115 * Array of particles. 2116 * 2117 * Anonymous Object Rectification. 2118 * @type { Array<ParticleOptions<PARTICLE, COLOR_UPDATER, OPACITY_UPDATER, SCALE_UPDATER, ACC_SPEED_UPDATER, ACC_ANGLE_UPDATER, SPIN_UPDATER>> } 2119 * @syscap SystemCapability.ArkUI.ArkUI.Full 2120 * @crossplatform 2121 * @atomicservice 2122 * @since 18 2123 */ 2124 particles: Array< 2125 ParticleOptions< 2126 PARTICLE, 2127 COLOR_UPDATER, 2128 OPACITY_UPDATER, 2129 SCALE_UPDATER, 2130 ACC_SPEED_UPDATER, 2131 ACC_ANGLE_UPDATER, 2132 SPIN_UPDATER 2133 > 2134 >; 2135} 2136 2137/** 2138 * Defines the Particles interface. 2139 * 2140 * @interface Particles 2141 * @syscap SystemCapability.ArkUI.ArkUI.Full 2142 * @crossplatform 2143 * @atomicservice 2144 * @since 20 2145 * @arkts 1.2 2146 */ 2147interface Particles { 2148 /** 2149 * Array of particles. 2150 * 2151 * @type { Array<ParticleOptions> } 2152 * @syscap SystemCapability.ArkUI.ArkUI.Full 2153 * @crossplatform 2154 * @atomicservice 2155 * @since 20 2156 * @arkts 1.2 2157 */ 2158 particles: Array<ParticleOptions>; 2159} 2160 2161/** 2162 * Defines the particle Interface. 2163 * @interface ParticleInterface 2164 * @syscap SystemCapability.ArkUI.ArkUI.Full 2165 * @crossplatform 2166 * @since 10 2167 */ 2168/** 2169 * Defines the particle Interface. 2170 * @interface ParticleInterface 2171 * @syscap SystemCapability.ArkUI.ArkUI.Full 2172 * @crossplatform 2173 * @atomicservice 2174 * @since 11 2175 */ 2176interface ParticleInterface { 2177 /** 2178 * create a particle array. 2179 * @param { object } value - Particle value 2180 * particles - list of ParticleOptions. 2181 * @returns { ParticleAttribute } Returns the particle attribute. 2182 * @syscap SystemCapability.ArkUI.ArkUI.Full 2183 * @crossplatform 2184 * @since 10 2185 */ 2186 /** 2187 * create a particle array. 2188 * @param { object } value - Particle value 2189 * particles - list of ParticleOptions. 2190 * @returns { ParticleAttribute } Returns the particle attribute. 2191 * @syscap SystemCapability.ArkUI.ArkUI.Full 2192 * @crossplatform 2193 * @atomicservice 2194 * @since 11 2195 */ 2196 /** 2197 * create a particle array. 2198 * 2199 * Anonymous Object Rectification. 2200 * @param { Particles<PARTICLE, COLOR_UPDATER, OPACITY_UPDATER, SCALE_UPDATER, ACC_SPEED_UPDATER, ACC_ANGLE_UPDATER, 2201 * SPIN_UPDATER> } particles - Array of particles. 2202 * @returns { ParticleAttribute } Returns the particle attribute. 2203 * @syscap SystemCapability.ArkUI.ArkUI.Full 2204 * @crossplatform 2205 * @atomicservice 2206 * @since 18 2207 */ 2208 < 2209 PARTICLE extends ParticleType, 2210 COLOR_UPDATER extends ParticleUpdater, 2211 OPACITY_UPDATER extends ParticleUpdater, 2212 SCALE_UPDATER extends ParticleUpdater, 2213 ACC_SPEED_UPDATER extends ParticleUpdater, 2214 ACC_ANGLE_UPDATER extends ParticleUpdater, 2215 SPIN_UPDATER extends ParticleUpdater 2216 >(particles: Particles< 2217 PARTICLE, 2218 COLOR_UPDATER, 2219 OPACITY_UPDATER, 2220 SCALE_UPDATER, 2221 ACC_SPEED_UPDATER, 2222 ACC_ANGLE_UPDATER, 2223 SPIN_UPDATER 2224 >): ParticleAttribute; 2225} 2226 2227/** 2228 * create a particle array. 2229 * 2230 * @param { Particles } particles - Array of particles. 2231 * @returns { ParticleAttribute } Returns the particle attribute. 2232 * @syscap SystemCapability.ArkUI.ArkUI.Full 2233 * @crossplatform 2234 * @atomicservice 2235 * @since 20 2236 * @arkts 1.2 2237 */ 2238//@memo 2239//@ComponentBuilder 2240export declare function Particle( 2241 particles: Particles 2242): ParticleAttribute; 2243 2244/** 2245 * Enumerates the particle types. 2246 * @enum { string } 2247 * @syscap SystemCapability.ArkUI.ArkUI.Full 2248 * @crossplatform 2249 * @since 10 2250 */ 2251/** 2252 * Enumerates the particle types. 2253 * @enum { string } 2254 * @syscap SystemCapability.ArkUI.ArkUI.Full 2255 * @crossplatform 2256 * @atomicservice 2257 * @since arkts {'1.1':'11','1.2':'20'} 2258 * @arkts 1.1&1.2 2259 */ 2260declare enum ParticleType { 2261 /** 2262 * Point-like particle. 2263 * @syscap SystemCapability.ArkUI.ArkUI.Full 2264 * @crossplatform 2265 * @since 10 2266 */ 2267 /** 2268 * Point-like particle. 2269 * @syscap SystemCapability.ArkUI.ArkUI.Full 2270 * @crossplatform 2271 * @atomicservice 2272 * @since arkts {'1.1':'11','1.2':'20'} 2273 * @arkts 1.1&1.2 2274 */ 2275 POINT = 'point', 2276 2277 /** 2278 * Image-like particle. 2279 * @syscap SystemCapability.ArkUI.ArkUI.Full 2280 * @crossplatform 2281 * @since 10 2282 */ 2283 /** 2284 * Image-like particle. 2285 * @syscap SystemCapability.ArkUI.ArkUI.Full 2286 * @crossplatform 2287 * @atomicservice 2288 * @since arkts {'1.1':'11','1.2':'20'} 2289 * @arkts 1.1&1.2 2290 */ 2291 IMAGE = 'image', 2292} 2293 2294/** 2295 * Enumerates the emitter shapes of a particle. 2296 * @enum { string } 2297 * @syscap SystemCapability.ArkUI.ArkUI.Full 2298 * @crossplatform 2299 * @since 10 2300 */ 2301/** 2302 * Enumerates the emitter shapes of a particle. 2303 * @enum { string } 2304 * @syscap SystemCapability.ArkUI.ArkUI.Full 2305 * @crossplatform 2306 * @atomicservice 2307 * @since arkts {'1.1':'11','1.2':'20'} 2308 * @arkts 1.1&1.2 2309 */ 2310declare enum ParticleEmitterShape { 2311 /** 2312 * Rectangle. 2313 * @syscap SystemCapability.ArkUI.ArkUI.Full 2314 * @crossplatform 2315 * @since 10 2316 */ 2317 /** 2318 * Rectangle. 2319 * @syscap SystemCapability.ArkUI.ArkUI.Full 2320 * @crossplatform 2321 * @atomicservice 2322 * @since arkts {'1.1':'11','1.2':'20'} 2323 * @arkts 1.1&1.2 2324 */ 2325 RECTANGLE = 'rectangle', 2326 2327 /** 2328 * Circle. 2329 * @syscap SystemCapability.ArkUI.ArkUI.Full 2330 * @crossplatform 2331 * @since 10 2332 */ 2333 /** 2334 * Circle. 2335 * @syscap SystemCapability.ArkUI.ArkUI.Full 2336 * @crossplatform 2337 * @atomicservice 2338 * @since arkts {'1.1':'11','1.2':'20'} 2339 * @arkts 1.1&1.2 2340 */ 2341 CIRCLE = 'circle', 2342 2343 /** 2344 * Ellipse. 2345 * @syscap SystemCapability.ArkUI.ArkUI.Full 2346 * @crossplatform 2347 * @since 10 2348 */ 2349 /** 2350 * Ellipse. 2351 * @syscap SystemCapability.ArkUI.ArkUI.Full 2352 * @crossplatform 2353 * @atomicservice 2354 * @since arkts {'1.1':'11','1.2':'20'} 2355 * @arkts 1.1&1.2 2356 */ 2357 ELLIPSE = 'ellipse', 2358 2359 /** 2360 * Annulus. 2361 * @syscap SystemCapability.ArkUI.ArkUI.Full 2362 * @crossplatform 2363 * @atomicservice 2364 * @since 20 2365 * @arkts 1.1&1.2 2366 */ 2367 ANNULUS = 'annulus', 2368} 2369 2370/** 2371 * Enumerates the color distribution types of a particle. 2372 * 2373 * @enum { number } 2374 * @syscap SystemCapability.ArkUI.ArkUI.Full 2375 * @crossplatform 2376 * @atomicservice 2377 * @since arkts {'1.1':'12','1.2':'20'} 2378 * @arkts 1.1&1.2 2379 */ 2380declare enum DistributionType { 2381 /** 2382 * Uniform distribution. 2383 * 2384 * @syscap SystemCapability.ArkUI.ArkUI.Full 2385 * @crossplatform 2386 * @atomicservice 2387 * @since arkts {'1.1':'12','1.2':'20'} 2388 * @arkts 1.1&1.2 2389 */ 2390 UNIFORM = 0, 2391 2392 /** 2393 * Gaussian distribution. 2394 * 2395 * @syscap SystemCapability.ArkUI.ArkUI.Full 2396 * @crossplatform 2397 * @atomicservice 2398 * @since arkts {'1.1':'12','1.2':'20'} 2399 * @arkts 1.1&1.2 2400 */ 2401 GAUSSIAN = 1, 2402} 2403 2404/** 2405 * Enumerates the updater types of a particle. 2406 * @enum { string } 2407 * @syscap SystemCapability.ArkUI.ArkUI.Full 2408 * @crossplatform 2409 * @since 10 2410 */ 2411/** 2412 * Enumerates the updater types of a particle. 2413 * @enum { string } 2414 * @syscap SystemCapability.ArkUI.ArkUI.Full 2415 * @crossplatform 2416 * @atomicservice 2417 * @since arkts {'1.1':'11','1.2':'20'} 2418 * @arkts 1.1&1.2 2419 */ 2420declare enum ParticleUpdater { 2421 /** 2422 * No updater is used. 2423 * @syscap SystemCapability.ArkUI.ArkUI.Full 2424 * @crossplatform 2425 * @since 10 2426 */ 2427 /** 2428 * No updater is used. 2429 * @syscap SystemCapability.ArkUI.ArkUI.Full 2430 * @crossplatform 2431 * @atomicservice 2432 * @since arkts {'1.1':'11','1.2':'20'} 2433 * @arkts 1.1&1.2 2434 */ 2435 NONE = 'none', 2436 2437 /** 2438 * Random updater. 2439 * @syscap SystemCapability.ArkUI.ArkUI.Full 2440 * @crossplatform 2441 * @since 10 2442 */ 2443 /** 2444 * Random updater. 2445 * @syscap SystemCapability.ArkUI.ArkUI.Full 2446 * @crossplatform 2447 * @atomicservice 2448 * @since arkts {'1.1':'11','1.2':'20'} 2449 * @arkts 1.1&1.2 2450 */ 2451 RANDOM = 'random', 2452 2453 /** 2454 * Curve updater. 2455 * @syscap SystemCapability.ArkUI.ArkUI.Full 2456 * @crossplatform 2457 * @since 10 2458 */ 2459 /** 2460 * Curve updater. 2461 * @syscap SystemCapability.ArkUI.ArkUI.Full 2462 * @crossplatform 2463 * @atomicservice 2464 * @since arkts {'1.1':'11','1.2':'20'} 2465 * @arkts 1.1&1.2 2466 */ 2467 CURVE = 'curve', 2468} 2469 2470/** 2471 * Defines the SizeT type. 2472 * 2473 * @typedef { import('../api/arkui/Graphics').SizeT<T> } 2474 * @syscap SystemCapability.ArkUI.ArkUI.Full 2475 * @crossplatform 2476 * @atomicservice 2477 * @since 12 2478 */ 2479declare type SizeT<T> = import('../api/arkui/Graphics').SizeT<T>; 2480 2481 /** 2482 * Defines the PositionT type. 2483 * 2484 * @typedef { import('../api/arkui/Graphics').PositionT<T> } 2485 * @syscap SystemCapability.ArkUI.ArkUI.Full 2486 * @crossplatform 2487 * @atomicservice 2488 * @since 12 2489 */ 2490declare type PositionT<T> = import('../api/arkui/Graphics').PositionT<T>; 2491 2492/** 2493 * Defines the Particle component attribute functions. 2494 * @extends CommonMethod<ParticleAttribute> 2495 * @syscap SystemCapability.ArkUI.ArkUI.Full 2496 * @crossplatform 2497 * @since 10 2498 */ 2499/** 2500 * Defines the Particle component attribute functions. 2501 * @extends CommonMethod<ParticleAttribute> 2502 * @syscap SystemCapability.ArkUI.ArkUI.Full 2503 * @crossplatform 2504 * @atomicservice 2505 * @since arkts {'1.1':'11','1.2':'20'} 2506 * @arkts 1.1&1.2 2507 */ 2508declare class ParticleAttribute extends CommonMethod<ParticleAttribute> { 2509 /** 2510 * Particle disturbance Field. 2511 * 2512 * @param { Array<DisturbanceFieldOptions> } fields - particle disturbance Field params. 2513 * @returns { ParticleAttribute } Returns the particle attribute. 2514 * @syscap SystemCapability.ArkUI.ArkUI.Full 2515 * @crossplatform 2516 * @atomicservice 2517 * @since arkts {'1.1':'12','1.2':'20'} 2518 * @arkts 1.1&1.2 2519 */ 2520 disturbanceFields(fields: Array<DisturbanceFieldOptions>): ParticleAttribute; 2521 2522 /** 2523 * Add particle animation component properties. 2524 * 2525 * @param { Array<EmitterProperty> } value - The emitter property. 2526 * @returns { ParticleAttribute } Returns the particle attribute. 2527 * @syscap SystemCapability.ArkUI.ArkUI.Full 2528 * @crossplatform 2529 * @atomicservice 2530 * @since arkts {'1.1':'12','1.2':'20'} 2531 * @arkts 1.1&1.2 2532 */ 2533 emitter(value: Array<EmitterProperty>): ParticleAttribute; 2534} 2535 2536/** 2537 * Defines Particle Component. 2538 * @syscap SystemCapability.ArkUI.ArkUI.Full 2539 * @crossplatform 2540 * @since 10 2541 */ 2542/** 2543 * Defines Particle Component. 2544 * @syscap SystemCapability.ArkUI.ArkUI.Full 2545 * @crossplatform 2546 * @atomicservice 2547 * @since 11 2548 */ 2549declare const Particle: ParticleInterface; 2550 2551/** 2552 * Defines particle disturbance Field params. 2553 * @interface DisturbanceFieldOptions 2554 * @syscap SystemCapability.ArkUI.ArkUI.Full 2555 * @crossplatform 2556 * @atomicservice 2557 * @since arkts {'1.1':'12','1.2':'20'} 2558 * @arkts 1.1&1.2 2559 */ 2560declare interface DisturbanceFieldOptions { 2561 2562 /** 2563 * Strength of the repulsive force from the center outward, 2564 * with positive numbers indicating outward repulsion and negative numbers indicating 2565 * inward attraction. 2566 * 2567 * @type { ?number } 2568 * @default 0 2569 * @syscap SystemCapability.ArkUI.ArkUI.Full 2570 * @crossplatform 2571 * @atomicservice 2572 * @since arkts {'1.1':'12','1.2':'20'} 2573 * @arkts 1.1&1.2 2574 */ 2575 strength?: number; 2576 2577 /** 2578 * Disturbance filed shape. 2579 * 2580 * @type { ?DisturbanceFieldShape } 2581 * @default DisturbanceFieldShape.RECT 2582 * @syscap SystemCapability.ArkUI.ArkUI.Full 2583 * @crossplatform 2584 * @atomicservice 2585 * @since arkts {'1.1':'12','1.2':'20'} 2586 * @arkts 1.1&1.2 2587 */ 2588 shape?: DisturbanceFieldShape; 2589 2590 /** 2591 * Disturbance filed size width value width, height. 2592 * 2593 * @type { ?SizeT<number> } 2594 * @default {width:0,height:0} 2595 * @syscap SystemCapability.ArkUI.ArkUI.Full 2596 * @crossplatform 2597 * @atomicservice 2598 * @since arkts {'1.1':'12','1.2':'20'} 2599 * @arkts 1.1&1.2 2600 */ 2601 size?: SizeT<number>; 2602 2603 /** 2604 * Disturbance filed position width value x, y. 2605 * 2606 * @type { ?PositionT<number> } 2607 * @default {x:0,y:0} 2608 * @syscap SystemCapability.ArkUI.ArkUI.Full 2609 * @crossplatform 2610 * @atomicservice 2611 * @since arkts {'1.1':'12','1.2':'20'} 2612 * @arkts 1.1&1.2 2613 */ 2614 position?: PositionT<number>; 2615 2616 /** 2617 * Attenuation degree of the field from the center point to the field boundary. 2618 * ranging from 0 to 100 integers. If 0, it indicates that the field is a rigid body, 2619 * and all particles within the range will be excluded. 2620 * a larger feather value indicates a greater degree of relaxation in the field, 2621 * and more particles near the center point will appear in the field strength range. The default value is 0. 2622 * 2623 * @type { ?number } 2624 * @default 0 2625 * @syscap SystemCapability.ArkUI.ArkUI.Full 2626 * @crossplatform 2627 * @atomicservice 2628 * @since arkts {'1.1':'12','1.2':'20'} 2629 * @arkts 1.1&1.2 2630 */ 2631 feather?: number; 2632 2633 /** 2634 * Scaling parameter is used to control the overall size of noise, with a value greater or equal 0. 2635 * 2636 * @type { ?number } 2637 * @default 1 2638 * @syscap SystemCapability.ArkUI.ArkUI.Full 2639 * @crossplatform 2640 * @atomicservice 2641 * @since arkts {'1.1':'12','1.2':'20'} 2642 * @arkts 1.1&1.2 2643 */ 2644 noiseScale?: number; 2645 2646 /** 2647 * Noise frequency with a value greater or equal 0. 2648 * 2649 * @type { ?number } 2650 * @default 1 2651 * @syscap SystemCapability.ArkUI.ArkUI.Full 2652 * @crossplatform 2653 * @atomicservice 2654 * @since arkts {'1.1':'12','1.2':'20'} 2655 * @arkts 1.1&1.2 2656 */ 2657 noiseFrequency?: number; 2658 2659 /** 2660 * NoiseAmplitude fluctuation range of noise, value, 2661 * 2662 * @type { ?number } 2663 * @default 1 2664 * @syscap SystemCapability.ArkUI.ArkUI.Full 2665 * @crossplatform 2666 * @atomicservice 2667 * @since arkts {'1.1':'12','1.2':'20'} 2668 * @arkts 1.1&1.2 2669 */ 2670 noiseAmplitude?: number; 2671} 2672 2673/** 2674 * Defines particle disturbance shape. 2675 * 2676 * @enum { number } 2677 * @syscap SystemCapability.ArkUI.ArkUI.Full 2678 * @crossplatform 2679 * @atomicservice 2680 * @since arkts {'1.1':'12','1.2':'20'} 2681 * @arkts 1.1&1.2 2682 */ 2683declare enum DisturbanceFieldShape { 2684 2685 /** 2686 * Shape rect. 2687 * 2688 * @syscap SystemCapability.ArkUI.ArkUI.Full 2689 * @crossplatform 2690 * @atomicservice 2691 * @since arkts {'1.1':'12','1.2':'20'} 2692 * @arkts 1.1&1.2 2693 */ 2694 RECT = 0, 2695 2696 /** 2697 * Shape circle. 2698 * 2699 * @syscap SystemCapability.ArkUI.ArkUI.Full 2700 * @crossplatform 2701 * @atomicservice 2702 * @since arkts {'1.1':'12','1.2':'20'} 2703 * @arkts 1.1&1.2 2704 */ 2705 CIRCLE = 1, 2706 2707 /** 2708 * Shape eclipse. 2709 * 2710 * @syscap SystemCapability.ArkUI.ArkUI.Full 2711 * @crossplatform 2712 * @atomicservice 2713 * @since arkts {'1.1':'12','1.2':'20'} 2714 * @arkts 1.1&1.2 2715 */ 2716 ELLIPSE = 2 2717 2718} 2719 2720/** 2721 * Defines particle annuslus region params. 2722 * @interface ParticleAnnulusRegion 2723 * @syscap SystemCapability.ArkUI.ArkUI.Full 2724 * @crossplatform 2725 * @atomicservice 2726 * @since 20 2727 * @arkts 1.1&1.2 2728 */ 2729declare interface ParticleAnnulusRegion { 2730 /** 2731 * The coordinates of the center of the annulus 2732 * 2733 * @type { ?PositionT<LengthMetrics> } 2734 * @default {x:LengthMetrics.percent(0.5),y:LengthMetrics.percent(0.5)} 2735 * @syscap SystemCapability.ArkUI.ArkUI.Full 2736 * @crossplatform 2737 * @atomicservice 2738 * @since 20 2739 * @arkts 1.1&1.2 2740 */ 2741 center?: PositionT<LengthMetrics>, 2742 /** 2743 * The outer radius of the annulus 2744 * 2745 * @type { LengthMetrics } 2746 * @syscap SystemCapability.ArkUI.ArkUI.Full 2747 * @crossplatform 2748 * @atomicservice 2749 * @since 20 2750 * @arkts 1.1&1.2 2751 */ 2752 outerRadius: LengthMetrics, 2753 /** 2754 * The inner radius of the annulus 2755 * 2756 * @type { LengthMetrics } 2757 * @syscap SystemCapability.ArkUI.ArkUI.Full 2758 * @crossplatform 2759 * @atomicservice 2760 * @since 20 2761 * @arkts 1.1&1.2 2762 */ 2763 innerRadius: LengthMetrics, 2764 /** 2765 * The start angle of the annulus, in degree 2766 * 2767 * @type { ?number } 2768 * @default 0 2769 * @syscap SystemCapability.ArkUI.ArkUI.Full 2770 * @crossplatform 2771 * @atomicservice 2772 * @since 20 2773 * @arkts 1.1&1.2 2774 */ 2775 startAngle?: number, 2776 /** 2777 * The end angle of the annulus, in degree 2778 * 2779 * @type { ?number } 2780 * @default 360 2781 * @syscap SystemCapability.ArkUI.ArkUI.Full 2782 * @crossplatform 2783 * @atomicservice 2784 * @since 20 2785 * @arkts 1.1&1.2 2786 */ 2787 endAngle?: number, 2788} 2789