UNPKG

3.56 kBTypeScriptView Raw
1import type { Container } from "./Container";
2import type { IParticleValueAnimation } from "./Interfaces/IParticleValueAnimation";
3import type { ICoordinates } from "./Interfaces/ICoordinates";
4import type { IParticleImage } from "./Interfaces/IParticleImage";
5import { Updater } from "./Particle/Updater";
6import type { IHsl, IRgb } from "./Interfaces/Colors";
7import type { IShapeValues } from "../Options/Interfaces/Particles/Shape/IShapeValues";
8import type { IBubbleParticleData } from "./Interfaces/IBubbleParticleData";
9import type { IParticle } from "./Interfaces/IParticle";
10import type { IParticles } from "../Options/Interfaces/Particles/IParticles";
11import { ParticlesOptions } from "../Options/Classes/Particles/ParticlesOptions";
12import { MoveDirection, MoveDirectionAlt, ShapeType } from "../Enums";
13import type { RecursivePartial } from "../Types";
14import { Infecter } from "./Particle/Infecter";
15import type { IDelta } from "./Interfaces/IDelta";
16import { Mover } from "./Particle/Mover";
17import type { ILink } from "./Interfaces/ILink";
18import type { IParticleHslAnimation } from "./Interfaces/IParticleHslAnimation";
19import type { Stroke } from "../Options/Classes/Particles/Stroke";
20import type { IParticleLoops } from "./Interfaces/IParticleLoops";
21import { Vector } from "./Particle/Vector";
22export declare class Particle implements IParticle {
23 readonly id: number;
24 private readonly container;
25 destroyed: boolean;
26 lastPathTime: number;
27 lifeDelay: number;
28 lifeDelayTime: number;
29 lifeDuration: number;
30 lifeTime: number;
31 livesRemaining: number;
32 misplaced: boolean;
33 spawning: boolean;
34 splitCount: number;
35 unbreakable: boolean;
36 readonly pathDelay: number;
37 readonly updater: Updater;
38 readonly infecter: Infecter;
39 readonly mover: Mover;
40 readonly sides: number;
41 readonly strokeWidth: number;
42 readonly options: ParticlesOptions;
43 readonly loops: IParticleLoops;
44 links: ILink[];
45 randomIndexData?: number;
46 linksDistance?: number;
47 linksWidth?: number;
48 maxDistance?: number;
49 moveDrift?: number;
50 moveSpeed?: number;
51 sizeAnimationSpeed?: number;
52 readonly close: boolean;
53 readonly direction: MoveDirection | keyof typeof MoveDirection | MoveDirectionAlt;
54 readonly fill: boolean;
55 readonly stroke: Stroke;
56 readonly position: Vector;
57 readonly offset: Vector;
58 readonly shadowColor: IRgb | undefined;
59 readonly color?: IParticleHslAnimation;
60 readonly opacity: IParticleValueAnimation<number>;
61 readonly rotate: IParticleValueAnimation<number>;
62 readonly size: IParticleValueAnimation<number>;
63 readonly strokeColor?: IParticleHslAnimation;
64 readonly velocity: Vector;
65 readonly shape: ShapeType | string;
66 readonly image?: IParticleImage;
67 readonly initialPosition: Vector;
68 readonly initialVelocity: Vector;
69 readonly shapeData?: IShapeValues;
70 readonly bubble: IBubbleParticleData;
71 constructor(id: number, container: Container, position?: ICoordinates, overrideOptions?: RecursivePartial<IParticles>);
72 move(delta: IDelta): void;
73 update(delta: IDelta): void;
74 draw(delta: IDelta): void;
75 getPosition(): ICoordinates;
76 getRadius(): number;
77 getMass(): number;
78 getFillColor(): IHsl | undefined;
79 getStrokeColor(): IHsl | undefined;
80 destroy(override?: boolean): void;
81 reset(): void;
82 private split;
83 private setColorAnimation;
84 private calcPosition;
85 private checkOverlap;
86 private calculateVelocity;
87 private loadImageShape;
88}