UNPKG

2.1 kBTypeScriptView Raw
1import type { Container } from "./Container";
2import { Particle } from "./Particle";
3import { QuadTree } from "../Utils";
4import type { RecursivePartial } from "../Types";
5import type { IParticles } from "../Options/Interfaces/Particles/IParticles";
6import type { ICoordinates, IDelta, IMouseData, IParticle, IRgb } from "./Interfaces";
7/**
8 * Particles manager object
9 * @category Core
10 */
11export declare class Particles {
12 private readonly container;
13 get count(): number;
14 /**
15 * The quad tree used to search particles withing ranges
16 */
17 quadTree: QuadTree;
18 linksColors: Map<string, string | IRgb | undefined>;
19 limit: number;
20 needsSort: boolean;
21 lastZIndex: number;
22 /**
23 * All the particles used in canvas
24 */
25 array: Particle[];
26 zArray: Particle[];
27 pushing?: boolean;
28 linksColor?: IRgb | string;
29 grabLineColor?: IRgb | string;
30 readonly updaters: import("./Interfaces").IParticleUpdater[];
31 private interactionManager;
32 private nextId;
33 private readonly freqs;
34 private readonly mover;
35 constructor(container: Container);
36 init(): void;
37 redraw(): void;
38 removeAt(index: number, quantity?: number, group?: string, override?: boolean): void;
39 remove(particle: Particle, group?: string, override?: boolean): void;
40 update(delta: IDelta): void;
41 draw(delta: IDelta): void;
42 /**
43 * Removes all particles from the array
44 */
45 clear(): void;
46 push(nb: number, mouse?: IMouseData, overrideOptions?: RecursivePartial<IParticles>, group?: string): void;
47 addParticle(position?: ICoordinates, overrideOptions?: RecursivePartial<IParticles>, group?: string): Particle | undefined;
48 addSplitParticle(parent: Particle): Particle | undefined;
49 removeQuantity(quantity: number, group?: string): void;
50 getLinkFrequency(p1: IParticle, p2: IParticle): number;
51 getTriangleFrequency(p1: IParticle, p2: IParticle, p3: IParticle): number;
52 addManualParticles(): void;
53 setDensity(): void;
54 private applyDensity;
55 private initDensityFactor;
56 private pushParticle;
57}