UNPKG

3.44 kBTypeScriptView Raw
1import type { ICenterCoordinates, ICoordinates, ICoordinates3d } from "./Interfaces/ICoordinates";
2import type { IHsl, IRgb } from "./Interfaces/Colors";
3import type { Container } from "./Container";
4import type { Engine } from "../engine";
5import type { IBubbleParticleData } from "./Interfaces/IBubbleParticleData";
6import type { IDelta } from "./Interfaces/IDelta";
7import type { IMovePathGenerator } from "./Interfaces/IMovePathGenerator";
8import type { IParticle } from "./Interfaces/IParticle";
9import type { IParticleHslAnimation } from "./Interfaces/IParticleHslAnimation";
10import type { IParticleNumericValueAnimation } from "./Interfaces/IParticleValueAnimation";
11import type { IParticleRetinaProps } from "./Interfaces/IParticleRetinaProps";
12import type { IParticleRoll } from "./Interfaces/IParticleRoll";
13import type { IParticlesOptions } from "../Options/Interfaces/Particles/IParticlesOptions";
14import type { IShapeValues } from "./Interfaces/IShapeValues";
15import type { ISlowParticleData } from "./Interfaces/ISlowParticleData";
16import { Interactivity } from "../Options/Classes/Interactivity/Interactivity";
17import { ParticleOutType } from "../Enums/Types/ParticleOutType";
18import type { ParticlesOptions } from "../Options/Classes/Particles/ParticlesOptions";
19import type { RecursivePartial } from "../Types/RecursivePartial";
20import { Vector } from "./Utils/Vector";
21import { Vector3d } from "./Utils/Vector3d";
22export declare class Particle implements IParticle {
23 readonly container: Container;
24 backColor?: IHsl;
25 bubble: IBubbleParticleData;
26 close: boolean;
27 color?: IParticleHslAnimation;
28 destroyed: boolean;
29 direction: number;
30 fill: boolean;
31 group?: string;
32 id: number;
33 ignoresResizeRatio: boolean;
34 initialPosition: Vector;
35 initialVelocity: Vector;
36 interactivity: Interactivity;
37 lastPathTime: number;
38 misplaced: boolean;
39 moveCenter: ICenterCoordinates;
40 moveDecay: number;
41 offset: Vector;
42 opacity?: IParticleNumericValueAnimation;
43 options: ParticlesOptions;
44 outType: ParticleOutType;
45 pathDelay: number;
46 pathGenerator?: IMovePathGenerator;
47 pathRotation: boolean;
48 position: Vector3d;
49 randomIndexData?: number;
50 retina: IParticleRetinaProps;
51 roll?: IParticleRoll;
52 rotation: number;
53 shadowColor?: IRgb;
54 shape: string;
55 shapeData?: IShapeValues;
56 sides: number;
57 size: IParticleNumericValueAnimation;
58 slow: ISlowParticleData;
59 spawning: boolean;
60 strokeColor?: IParticleHslAnimation;
61 strokeOpacity?: number;
62 strokeWidth?: number;
63 unbreakable: boolean;
64 velocity: Vector;
65 zIndexFactor: number;
66 private readonly _engine;
67 constructor(engine: Engine, id: number, container: Container, position?: ICoordinates, overrideOptions?: RecursivePartial<IParticlesOptions>, group?: string);
68 destroy(override?: boolean): void;
69 draw(delta: IDelta): void;
70 getFillColor(): IHsl | undefined;
71 getMass(): number;
72 getPosition(): ICoordinates3d;
73 getRadius(): number;
74 getStrokeColor(): IHsl | undefined;
75 init(id: number, position?: ICoordinates, overrideOptions?: RecursivePartial<IParticlesOptions>, group?: string): void;
76 isInsideCanvas(): boolean;
77 isVisible(): boolean;
78 reset(): void;
79 private _calcPosition;
80 private _calculateVelocity;
81 private _checkOverlap;
82 private _getRollColor;
83 private _loadShapeData;
84}