tsparticles 1.39.2 → 1.40.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Core/Container.d.ts +3 -1
- package/Core/Container.js +30 -15
- package/Core/Loader.d.ts +12 -9
- package/Core/Loader.js +35 -19
- package/Core/Particle.d.ts +3 -1
- package/Core/Particle.js +17 -2
- package/Core/Particles.d.ts +3 -1
- package/Core/Particles.js +20 -5
- package/Core/Utils/InteractionManager.d.ts +5 -3
- package/Core/Utils/InteractionManager.js +19 -3
- package/Core/Utils/Plugins.d.ts +29 -15
- package/Core/Utils/Plugins.js +58 -46
- package/Options/Classes/Options.d.ts +2 -1
- package/Options/Classes/Options.js +14 -7
- package/Plugins/Emitters/EmitterInstance.d.ts +6 -3
- package/Plugins/Emitters/EmitterInstance.js +46 -16
- package/Plugins/Emitters/Emitters.d.ts +3 -1
- package/Plugins/Emitters/Emitters.js +17 -2
- package/Plugins/Emitters/{EmittersMain.d.ts → EmittersEngine.d.ts} +3 -1
- package/Plugins/Emitters/{EmittersMain.js → EmittersEngine.js} +0 -0
- package/Plugins/Emitters/IEmitterShape.d.ts +2 -2
- package/Plugins/Emitters/Options/Classes/Emitter.d.ts +1 -0
- package/Plugins/Emitters/Options/Classes/Emitter.js +1 -0
- package/Plugins/Emitters/Options/Interfaces/IEmitter.d.ts +1 -0
- package/Plugins/Emitters/ShapeManager.d.ts +6 -3
- package/Plugins/Emitters/ShapeManager.js +16 -4
- package/Plugins/Emitters/Shapes/Circle/CircleShape.d.ts +2 -2
- package/Plugins/Emitters/Shapes/Circle/CircleShape.js +2 -2
- package/Plugins/Emitters/Shapes/Square/SquareShape.d.ts +2 -2
- package/Plugins/Emitters/Shapes/Square/SquareShape.js +4 -4
- package/Plugins/Emitters/index.d.ts +3 -3
- package/Plugins/Emitters/index.js +25 -6
- package/README.md +1 -1
- package/browser/Core/Container.d.ts +4 -1
- package/browser/Core/Container.js +32 -16
- package/browser/Core/Loader.d.ts +12 -9
- package/browser/Core/Loader.js +35 -19
- package/browser/Core/Particle.d.ts +3 -1
- package/browser/Core/Particle.js +18 -3
- package/browser/Core/Particles.d.ts +3 -1
- package/browser/Core/Particles.js +21 -6
- package/browser/Core/Utils/InteractionManager.d.ts +5 -3
- package/browser/Core/Utils/InteractionManager.js +19 -3
- package/browser/Core/Utils/Plugins.d.ts +29 -15
- package/browser/Core/Utils/Plugins.js +58 -46
- package/browser/Options/Classes/Options.d.ts +2 -1
- package/browser/Options/Classes/Options.js +14 -7
- package/browser/Plugins/Emitters/EmitterInstance.d.ts +6 -3
- package/browser/Plugins/Emitters/EmitterInstance.js +46 -16
- package/browser/Plugins/Emitters/Emitters.d.ts +3 -1
- package/browser/Plugins/Emitters/Emitters.js +17 -2
- package/{esm/Plugins/Emitters/EmittersMain.d.ts → browser/Plugins/Emitters/EmittersEngine.d.ts} +3 -1
- package/browser/Plugins/Emitters/{EmittersMain.js → EmittersEngine.js} +0 -0
- package/browser/Plugins/Emitters/IEmitterShape.d.ts +2 -2
- package/browser/Plugins/Emitters/Options/Classes/Emitter.d.ts +1 -0
- package/browser/Plugins/Emitters/Options/Classes/Emitter.js +1 -0
- package/browser/Plugins/Emitters/Options/Interfaces/IEmitter.d.ts +4 -0
- package/browser/Plugins/Emitters/ShapeManager.d.ts +6 -3
- package/browser/Plugins/Emitters/ShapeManager.js +16 -4
- package/browser/Plugins/Emitters/Shapes/Circle/CircleShape.d.ts +2 -2
- package/browser/Plugins/Emitters/Shapes/Circle/CircleShape.js +2 -2
- package/browser/Plugins/Emitters/Shapes/Square/SquareShape.d.ts +2 -2
- package/browser/Plugins/Emitters/Shapes/Square/SquareShape.js +4 -4
- package/browser/Plugins/Emitters/index.d.ts +3 -3
- package/browser/Plugins/Emitters/index.js +25 -6
- package/browser/engine.d.ts +5 -1
- package/browser/engine.js +22 -17
- package/engine.d.ts +3 -0
- package/engine.js +20 -16
- package/esm/Core/Container.d.ts +3 -1
- package/esm/Core/Container.js +31 -16
- package/esm/Core/Loader.d.ts +12 -9
- package/esm/Core/Loader.js +35 -19
- package/esm/Core/Particle.d.ts +3 -1
- package/esm/Core/Particle.js +18 -3
- package/esm/Core/Particles.d.ts +3 -1
- package/esm/Core/Particles.js +21 -6
- package/esm/Core/Utils/InteractionManager.d.ts +5 -3
- package/esm/Core/Utils/InteractionManager.js +19 -3
- package/esm/Core/Utils/Plugins.d.ts +29 -15
- package/esm/Core/Utils/Plugins.js +58 -46
- package/esm/Options/Classes/Options.d.ts +2 -1
- package/esm/Options/Classes/Options.js +14 -7
- package/esm/Plugins/Emitters/EmitterInstance.d.ts +6 -3
- package/esm/Plugins/Emitters/EmitterInstance.js +46 -16
- package/esm/Plugins/Emitters/Emitters.d.ts +3 -1
- package/esm/Plugins/Emitters/Emitters.js +17 -2
- package/{browser/Plugins/Emitters/EmittersMain.d.ts → esm/Plugins/Emitters/EmittersEngine.d.ts} +3 -1
- package/esm/Plugins/Emitters/{EmittersMain.js → EmittersEngine.js} +0 -0
- package/esm/Plugins/Emitters/IEmitterShape.d.ts +2 -2
- package/esm/Plugins/Emitters/Options/Classes/Emitter.d.ts +1 -0
- package/esm/Plugins/Emitters/Options/Classes/Emitter.js +1 -0
- package/esm/Plugins/Emitters/Options/Interfaces/IEmitter.d.ts +1 -0
- package/esm/Plugins/Emitters/ShapeManager.d.ts +6 -3
- package/esm/Plugins/Emitters/ShapeManager.js +16 -4
- package/esm/Plugins/Emitters/Shapes/Circle/CircleShape.d.ts +2 -2
- package/esm/Plugins/Emitters/Shapes/Circle/CircleShape.js +2 -2
- package/esm/Plugins/Emitters/Shapes/Square/SquareShape.d.ts +2 -2
- package/esm/Plugins/Emitters/Shapes/Square/SquareShape.js +4 -4
- package/esm/Plugins/Emitters/index.d.ts +3 -3
- package/esm/Plugins/Emitters/index.js +25 -6
- package/esm/engine.d.ts +3 -0
- package/esm/engine.js +20 -16
- package/package.json +11 -6
- package/report.html +2 -2
- package/report.slim.html +2 -2
- package/tsparticles.engine.js +227 -118
- package/tsparticles.engine.min.js +2 -2
- package/tsparticles.interaction.external.attract.js +205 -100
- package/tsparticles.interaction.external.attract.min.js +2 -2
- package/tsparticles.interaction.external.bounce.js +205 -100
- package/tsparticles.interaction.external.bounce.min.js +2 -2
- package/tsparticles.interaction.external.bubble.js +205 -100
- package/tsparticles.interaction.external.bubble.min.js +2 -2
- package/tsparticles.interaction.external.connect.js +205 -100
- package/tsparticles.interaction.external.connect.min.js +2 -2
- package/tsparticles.interaction.external.grab.js +205 -100
- package/tsparticles.interaction.external.grab.min.js +2 -2
- package/tsparticles.interaction.external.repulse.js +205 -100
- package/tsparticles.interaction.external.repulse.min.js +2 -2
- package/tsparticles.interaction.external.trail.js +205 -100
- package/tsparticles.interaction.external.trail.min.js +2 -2
- package/tsparticles.interaction.particles.attract.js +205 -100
- package/tsparticles.interaction.particles.attract.min.js +2 -2
- package/tsparticles.interaction.particles.collisions.js +205 -100
- package/tsparticles.interaction.particles.collisions.min.js +2 -2
- package/tsparticles.interaction.particles.links.js +205 -100
- package/tsparticles.interaction.particles.links.min.js +2 -2
- package/tsparticles.js +347 -156
- package/tsparticles.min.js +2 -2
- package/tsparticles.pathseg.min.js +1 -1
- package/tsparticles.plugins.absorbers.js +205 -100
- package/tsparticles.plugins.absorbers.min.js +2 -2
- package/tsparticles.plugins.emitters.js +330 -143
- package/tsparticles.plugins.emitters.min.js +2 -2
- package/tsparticles.plugins.polygonMask.js +205 -100
- package/tsparticles.plugins.polygonMask.min.js +2 -2
- package/tsparticles.shape.circle.min.js +1 -1
- package/tsparticles.shape.image.js +208 -103
- package/tsparticles.shape.image.min.js +2 -2
- package/tsparticles.shape.line.min.js +1 -1
- package/tsparticles.shape.polygon.min.js +1 -1
- package/tsparticles.shape.square.min.js +1 -1
- package/tsparticles.shape.star.min.js +1 -1
- package/tsparticles.shape.text.js +205 -100
- package/tsparticles.shape.text.min.js +2 -2
- package/tsparticles.slim.js +227 -118
- package/tsparticles.slim.min.js +2 -2
- package/tsparticles.updater.angle.js +205 -100
- package/tsparticles.updater.angle.min.js +2 -2
- package/tsparticles.updater.color.js +205 -100
- package/tsparticles.updater.color.min.js +2 -2
- package/tsparticles.updater.life.js +205 -100
- package/tsparticles.updater.life.min.js +2 -2
- package/tsparticles.updater.opacity.js +205 -100
- package/tsparticles.updater.opacity.min.js +2 -2
- package/tsparticles.updater.outModes.js +205 -100
- package/tsparticles.updater.outModes.min.js +2 -2
- package/tsparticles.updater.roll.js +205 -100
- package/tsparticles.updater.roll.min.js +2 -2
- package/tsparticles.updater.size.js +205 -100
- package/tsparticles.updater.size.min.js +2 -2
- package/tsparticles.updater.strokeColor.js +205 -100
- package/tsparticles.updater.strokeColor.min.js +2 -2
- package/tsparticles.updater.tilt.js +205 -100
- package/tsparticles.updater.tilt.min.js +2 -2
- package/tsparticles.updater.wobble.js +205 -100
- package/tsparticles.updater.wobble.min.js +2 -2
package/Core/Container.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { FrameManager, Vector } from "./Utils";
|
|
2
2
|
import type { IAttract, IBubble, IContainerInteractivity, IContainerPlugin, IMovePathGenerator, IRepulse, IShapeDrawer } from "./Interfaces";
|
|
3
3
|
import { Canvas } from "./Canvas";
|
|
4
|
+
import type { Engine } from "../engine";
|
|
4
5
|
import type { IOptions } from "../Options/Interfaces/IOptions";
|
|
5
6
|
import { Options } from "../Options/Classes/Options";
|
|
6
7
|
import { Particle } from "./Particle";
|
|
@@ -8,6 +9,7 @@ import { Particles } from "./Particles";
|
|
|
8
9
|
import type { RecursivePartial } from "../Types";
|
|
9
10
|
import { Retina } from "./Retina";
|
|
10
11
|
export declare class Container {
|
|
12
|
+
#private;
|
|
11
13
|
readonly id: string;
|
|
12
14
|
started: boolean;
|
|
13
15
|
destroyed: boolean;
|
|
@@ -43,7 +45,7 @@ export declare class Container {
|
|
|
43
45
|
private readonly presets;
|
|
44
46
|
private readonly eventListeners;
|
|
45
47
|
private readonly intersectionObserver?;
|
|
46
|
-
constructor(id: string, sourceOptions?: RecursivePartial<IOptions>, ...presets: string[]);
|
|
48
|
+
constructor(engine: Engine, id: string, sourceOptions?: RecursivePartial<IOptions>, ...presets: string[]);
|
|
47
49
|
play(force?: boolean): void;
|
|
48
50
|
pause(): void;
|
|
49
51
|
draw(force: boolean): void;
|
package/Core/Container.js
CHANGED
|
@@ -1,4 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
3
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
4
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
5
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
6
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
7
|
+
};
|
|
8
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
9
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
10
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
11
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
12
|
+
};
|
|
13
|
+
var _Container_engine;
|
|
2
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
15
|
exports.Container = void 0;
|
|
4
16
|
const Utils_1 = require("./Utils");
|
|
@@ -8,9 +20,11 @@ const Options_1 = require("../Options/Classes/Options");
|
|
|
8
20
|
const Particles_1 = require("./Particles");
|
|
9
21
|
const Retina_1 = require("./Retina");
|
|
10
22
|
class Container {
|
|
11
|
-
constructor(id, sourceOptions, ...presets) {
|
|
23
|
+
constructor(engine, id, sourceOptions, ...presets) {
|
|
12
24
|
this.id = id;
|
|
13
|
-
this
|
|
25
|
+
_Container_engine.set(this, void 0);
|
|
26
|
+
__classPrivateFieldSet(this, _Container_engine, engine, "f");
|
|
27
|
+
this.fpsLimit = 120;
|
|
14
28
|
this.duration = 0;
|
|
15
29
|
this.lifeTime = 0;
|
|
16
30
|
this.firstStart = true;
|
|
@@ -24,7 +38,7 @@ class Container {
|
|
|
24
38
|
this._initialSourceOptions = sourceOptions;
|
|
25
39
|
this.retina = new Retina_1.Retina(this);
|
|
26
40
|
this.canvas = new Canvas_1.Canvas(this);
|
|
27
|
-
this.particles = new Particles_1.Particles(this);
|
|
41
|
+
this.particles = new Particles_1.Particles(__classPrivateFieldGet(this, _Container_engine, "f"), this);
|
|
28
42
|
this.drawer = new Utils_1.FrameManager(this);
|
|
29
43
|
this.presets = presets;
|
|
30
44
|
this.pathGenerator = {
|
|
@@ -51,8 +65,8 @@ class Container {
|
|
|
51
65
|
this.plugins = new Map();
|
|
52
66
|
this.drawers = new Map();
|
|
53
67
|
this.density = 1;
|
|
54
|
-
this._options = new Options_1.Options();
|
|
55
|
-
this.actualOptions = new Options_1.Options();
|
|
68
|
+
this._options = new Options_1.Options(__classPrivateFieldGet(this, _Container_engine, "f"));
|
|
69
|
+
this.actualOptions = new Options_1.Options(__classPrivateFieldGet(this, _Container_engine, "f"));
|
|
56
70
|
this.eventListeners = new Utils_1.EventListeners(this);
|
|
57
71
|
if (typeof IntersectionObserver !== "undefined" && IntersectionObserver) {
|
|
58
72
|
this.intersectionObserver = new IntersectionObserver((entries) => this.intersectionManager(entries));
|
|
@@ -168,7 +182,7 @@ class Container {
|
|
|
168
182
|
return this.start();
|
|
169
183
|
}
|
|
170
184
|
reset() {
|
|
171
|
-
this._options = new Options_1.Options();
|
|
185
|
+
this._options = new Options_1.Options(__classPrivateFieldGet(this, _Container_engine, "f"));
|
|
172
186
|
return this.refresh();
|
|
173
187
|
}
|
|
174
188
|
stop() {
|
|
@@ -182,7 +196,7 @@ class Container {
|
|
|
182
196
|
this.particles.clear();
|
|
183
197
|
this.canvas.clear();
|
|
184
198
|
if (this.interactivity.element instanceof HTMLElement && this.intersectionObserver) {
|
|
185
|
-
this.intersectionObserver.
|
|
199
|
+
this.intersectionObserver.unobserve(this.interactivity.element);
|
|
186
200
|
}
|
|
187
201
|
for (const [, plugin] of this.plugins) {
|
|
188
202
|
if (plugin.stop) {
|
|
@@ -310,20 +324,20 @@ class Container {
|
|
|
310
324
|
return false;
|
|
311
325
|
}
|
|
312
326
|
async init() {
|
|
313
|
-
this._options = new Options_1.Options();
|
|
327
|
+
this._options = new Options_1.Options(__classPrivateFieldGet(this, _Container_engine, "f"));
|
|
314
328
|
for (const preset of this.presets) {
|
|
315
|
-
this._options.load(
|
|
329
|
+
this._options.load(__classPrivateFieldGet(this, _Container_engine, "f").plugins.getPreset(preset));
|
|
316
330
|
}
|
|
317
|
-
const shapes =
|
|
331
|
+
const shapes = __classPrivateFieldGet(this, _Container_engine, "f").plugins.getSupportedShapes();
|
|
318
332
|
for (const type of shapes) {
|
|
319
|
-
const drawer =
|
|
333
|
+
const drawer = __classPrivateFieldGet(this, _Container_engine, "f").plugins.getShapeDrawer(type);
|
|
320
334
|
if (drawer) {
|
|
321
335
|
this.drawers.set(type, drawer);
|
|
322
336
|
}
|
|
323
337
|
}
|
|
324
338
|
this._options.load(this._initialSourceOptions);
|
|
325
339
|
this._options.load(this._sourceOptions);
|
|
326
|
-
this.actualOptions = new Options_1.Options();
|
|
340
|
+
this.actualOptions = new Options_1.Options(__classPrivateFieldGet(this, _Container_engine, "f"));
|
|
327
341
|
this.actualOptions.load(this._options);
|
|
328
342
|
this.retina.init();
|
|
329
343
|
this.canvas.init();
|
|
@@ -333,8 +347,8 @@ class Container {
|
|
|
333
347
|
this.zLayers = this.actualOptions.zLayers;
|
|
334
348
|
this.duration = (0, Utils_2.getRangeValue)(this.actualOptions.duration);
|
|
335
349
|
this.lifeTime = 0;
|
|
336
|
-
this.fpsLimit = this.actualOptions.fpsLimit > 0 ? this.actualOptions.fpsLimit :
|
|
337
|
-
const availablePlugins =
|
|
350
|
+
this.fpsLimit = this.actualOptions.fpsLimit > 0 ? this.actualOptions.fpsLimit : 120;
|
|
351
|
+
const availablePlugins = __classPrivateFieldGet(this, _Container_engine, "f").plugins.getAvailablePlugins(this);
|
|
338
352
|
for (const [id, plugin] of availablePlugins) {
|
|
339
353
|
this.plugins.set(id, plugin);
|
|
340
354
|
}
|
|
@@ -353,7 +367,7 @@ class Container {
|
|
|
353
367
|
}
|
|
354
368
|
const pathOptions = this.actualOptions.particles.move.path;
|
|
355
369
|
if (pathOptions.generator) {
|
|
356
|
-
const customGenerator =
|
|
370
|
+
const customGenerator = __classPrivateFieldGet(this, _Container_engine, "f").plugins.getPathGenerator(pathOptions.generator);
|
|
357
371
|
if (customGenerator) {
|
|
358
372
|
if (customGenerator.init) {
|
|
359
373
|
this.pathGenerator.init = customGenerator.init;
|
|
@@ -392,3 +406,4 @@ class Container {
|
|
|
392
406
|
}
|
|
393
407
|
}
|
|
394
408
|
exports.Container = Container;
|
|
409
|
+
_Container_engine = new WeakMap();
|
package/Core/Loader.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Container } from "./Container";
|
|
2
|
+
import type { Engine } from "../engine";
|
|
2
3
|
import type { IOptions } from "../Options/Interfaces/IOptions";
|
|
3
4
|
import type { Particle } from "./Particle";
|
|
4
5
|
import type { RecursivePartial } from "../Types";
|
|
@@ -16,14 +17,16 @@ interface RemoteLoaderParams {
|
|
|
16
17
|
url?: SingleOrMultiple<string>;
|
|
17
18
|
}
|
|
18
19
|
export declare class Loader {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
20
|
+
#private;
|
|
21
|
+
constructor(engine: Engine);
|
|
22
|
+
dom(): Container[];
|
|
23
|
+
domItem(index: number): Container | undefined;
|
|
24
|
+
loadOptions(params: LoaderParams): Promise<Container | undefined>;
|
|
25
|
+
loadRemoteOptions(params: RemoteLoaderParams): Promise<Container | undefined>;
|
|
26
|
+
load(tagId: string | SingleOrMultiple<RecursivePartial<IOptions>>, options?: SingleOrMultiple<RecursivePartial<IOptions>> | number, index?: number): Promise<Container | undefined>;
|
|
27
|
+
set(id: string | HTMLElement, domContainer: HTMLElement | SingleOrMultiple<RecursivePartial<IOptions>>, options?: SingleOrMultiple<RecursivePartial<IOptions>> | number, index?: number): Promise<Container | undefined>;
|
|
28
|
+
loadJSON(tagId: string | SingleOrMultiple<string>, jsonUrl?: SingleOrMultiple<string> | number, index?: number): Promise<Container | undefined>;
|
|
29
|
+
setJSON(id: string | HTMLElement, domContainer: HTMLElement | SingleOrMultiple<string>, jsonUrl: SingleOrMultiple<string> | (number | undefined), index?: number): Promise<Container | undefined>;
|
|
30
|
+
setOnClickHandler(callback: (evt: Event, particles?: Particle[]) => void): void;
|
|
28
31
|
}
|
|
29
32
|
export {};
|
package/Core/Loader.js
CHANGED
|
@@ -1,27 +1,42 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
3
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
4
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
5
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
6
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
7
|
+
};
|
|
8
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
9
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
10
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
11
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
12
|
+
};
|
|
13
|
+
var _Loader_engine;
|
|
2
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
15
|
exports.Loader = void 0;
|
|
4
16
|
const Utils_1 = require("./Utils");
|
|
5
17
|
const Container_1 = require("./Container");
|
|
6
18
|
const Utils_2 = require("../Utils");
|
|
7
|
-
const tsParticlesDom = [];
|
|
8
19
|
function fetchError(statusCode) {
|
|
9
20
|
console.error(`Error tsParticles - fetch status: ${statusCode}`);
|
|
10
21
|
console.error("Error tsParticles - File config not found");
|
|
11
22
|
}
|
|
12
23
|
class Loader {
|
|
13
|
-
|
|
14
|
-
|
|
24
|
+
constructor(engine) {
|
|
25
|
+
_Loader_engine.set(this, void 0);
|
|
26
|
+
__classPrivateFieldSet(this, _Loader_engine, engine, "f");
|
|
15
27
|
}
|
|
16
|
-
|
|
17
|
-
|
|
28
|
+
dom() {
|
|
29
|
+
return __classPrivateFieldGet(this, _Loader_engine, "f").domArray;
|
|
30
|
+
}
|
|
31
|
+
domItem(index) {
|
|
32
|
+
const dom = this.dom();
|
|
18
33
|
const item = dom[index];
|
|
19
34
|
if (item && !item.destroyed) {
|
|
20
35
|
return item;
|
|
21
36
|
}
|
|
22
37
|
dom.splice(index, 1);
|
|
23
38
|
}
|
|
24
|
-
|
|
39
|
+
async loadOptions(params) {
|
|
25
40
|
var _a, _b, _c;
|
|
26
41
|
const tagId = (_a = params.tagId) !== null && _a !== void 0 ? _a : `tsparticles${Math.floor(Math.random() * 10000)}`;
|
|
27
42
|
const { options, index } = params;
|
|
@@ -32,10 +47,10 @@ class Loader {
|
|
|
32
47
|
(_c = document.querySelector("body")) === null || _c === void 0 ? void 0 : _c.append(domContainer);
|
|
33
48
|
}
|
|
34
49
|
const currentOptions = options instanceof Array ? (0, Utils_2.itemFromArray)(options, index) : options;
|
|
35
|
-
const dom =
|
|
50
|
+
const dom = this.dom();
|
|
36
51
|
const oldIndex = dom.findIndex((v) => v.id === tagId);
|
|
37
52
|
if (oldIndex >= 0) {
|
|
38
|
-
const old =
|
|
53
|
+
const old = this.domItem(oldIndex);
|
|
39
54
|
if (old && !old.destroyed) {
|
|
40
55
|
old.destroy();
|
|
41
56
|
dom.splice(oldIndex, 1);
|
|
@@ -60,7 +75,7 @@ class Loader {
|
|
|
60
75
|
domContainer.appendChild(canvasEl);
|
|
61
76
|
}
|
|
62
77
|
}
|
|
63
|
-
const newItem = new Container_1.Container(tagId, currentOptions);
|
|
78
|
+
const newItem = new Container_1.Container(__classPrivateFieldGet(this, _Loader_engine, "f"), tagId, currentOptions);
|
|
64
79
|
if (oldIndex >= 0) {
|
|
65
80
|
dom.splice(oldIndex, 0, newItem);
|
|
66
81
|
}
|
|
@@ -71,7 +86,7 @@ class Loader {
|
|
|
71
86
|
await newItem.start();
|
|
72
87
|
return newItem;
|
|
73
88
|
}
|
|
74
|
-
|
|
89
|
+
async loadRemoteOptions(params) {
|
|
75
90
|
const { url: jsonUrl, index } = params;
|
|
76
91
|
const url = jsonUrl instanceof Array ? (0, Utils_2.itemFromArray)(jsonUrl, index) : jsonUrl;
|
|
77
92
|
if (!url) {
|
|
@@ -83,14 +98,14 @@ class Loader {
|
|
|
83
98
|
return;
|
|
84
99
|
}
|
|
85
100
|
const data = await response.json();
|
|
86
|
-
return
|
|
101
|
+
return this.loadOptions({
|
|
87
102
|
tagId: params.tagId,
|
|
88
103
|
element: params.element,
|
|
89
104
|
index,
|
|
90
105
|
options: data,
|
|
91
106
|
});
|
|
92
107
|
}
|
|
93
|
-
|
|
108
|
+
load(tagId, options, index) {
|
|
94
109
|
const params = { index };
|
|
95
110
|
if (typeof tagId === "string") {
|
|
96
111
|
params.tagId = tagId;
|
|
@@ -106,7 +121,7 @@ class Loader {
|
|
|
106
121
|
}
|
|
107
122
|
return this.loadOptions(params);
|
|
108
123
|
}
|
|
109
|
-
|
|
124
|
+
async set(id, domContainer, options, index) {
|
|
110
125
|
const params = { index };
|
|
111
126
|
if (typeof id === "string") {
|
|
112
127
|
params.tagId = id;
|
|
@@ -128,7 +143,7 @@ class Loader {
|
|
|
128
143
|
}
|
|
129
144
|
return this.loadOptions(params);
|
|
130
145
|
}
|
|
131
|
-
|
|
146
|
+
async loadJSON(tagId, jsonUrl, index) {
|
|
132
147
|
let url, id;
|
|
133
148
|
if (typeof jsonUrl === "number" || jsonUrl === undefined) {
|
|
134
149
|
url = tagId;
|
|
@@ -137,9 +152,9 @@ class Loader {
|
|
|
137
152
|
id = tagId;
|
|
138
153
|
url = jsonUrl;
|
|
139
154
|
}
|
|
140
|
-
return
|
|
155
|
+
return this.loadRemoteOptions({ tagId: id, url, index });
|
|
141
156
|
}
|
|
142
|
-
|
|
157
|
+
async setJSON(id, domContainer, jsonUrl, index) {
|
|
143
158
|
let url, newId, newIndex, element;
|
|
144
159
|
if (id instanceof HTMLElement) {
|
|
145
160
|
element = id;
|
|
@@ -152,10 +167,10 @@ class Loader {
|
|
|
152
167
|
url = jsonUrl;
|
|
153
168
|
newIndex = index;
|
|
154
169
|
}
|
|
155
|
-
return
|
|
170
|
+
return this.loadRemoteOptions({ tagId: newId, url, index: newIndex, element });
|
|
156
171
|
}
|
|
157
|
-
|
|
158
|
-
const dom =
|
|
172
|
+
setOnClickHandler(callback) {
|
|
173
|
+
const dom = this.dom();
|
|
159
174
|
if (dom.length === 0) {
|
|
160
175
|
throw new Error("Can only set click handlers after calling tsParticles.load() or tsParticles.loadJSON()");
|
|
161
176
|
}
|
|
@@ -165,3 +180,4 @@ class Loader {
|
|
|
165
180
|
}
|
|
166
181
|
}
|
|
167
182
|
exports.Loader = Loader;
|
|
183
|
+
_Loader_engine = new WeakMap();
|
package/Core/Particle.d.ts
CHANGED
|
@@ -2,11 +2,13 @@ import { ShapeType } from "../Enums";
|
|
|
2
2
|
import type { IBubbleParticleData, ICoordinates, ICoordinates3d, IDelta, IHsl, IParticle, IParticleGradientAnimation, IParticleHslAnimation, IParticleLife, IParticleNumericValueAnimation, IParticleRetinaProps, IParticleRoll, IParticleSpin, IParticleTiltValueAnimation, IParticleValueAnimation, IParticleWobble, IRgb, IShapeValues } from "./Interfaces";
|
|
3
3
|
import { Vector, Vector3d } from "./Utils";
|
|
4
4
|
import type { Container } from "./Container";
|
|
5
|
+
import type { Engine } from "../engine";
|
|
5
6
|
import type { IParticles } from "../Options/Interfaces/Particles/IParticles";
|
|
6
7
|
import { ParticlesOptions } from "../Options/Classes/Particles/ParticlesOptions";
|
|
7
8
|
import type { RecursivePartial } from "../Types";
|
|
8
9
|
import type { Stroke } from "../Options/Classes/Particles/Stroke";
|
|
9
10
|
export declare class Particle implements IParticle {
|
|
11
|
+
#private;
|
|
10
12
|
readonly id: number;
|
|
11
13
|
readonly container: Container;
|
|
12
14
|
readonly group?: string | undefined;
|
|
@@ -49,7 +51,7 @@ export declare class Particle implements IParticle {
|
|
|
49
51
|
readonly bubble: IBubbleParticleData;
|
|
50
52
|
readonly zIndexFactor: number;
|
|
51
53
|
readonly retina: IParticleRetinaProps;
|
|
52
|
-
constructor(id: number, container: Container, position?: ICoordinates, overrideOptions?: RecursivePartial<IParticles>, group?: string | undefined);
|
|
54
|
+
constructor(engine: Engine, id: number, container: Container, position?: ICoordinates, overrideOptions?: RecursivePartial<IParticles>, group?: string | undefined);
|
|
53
55
|
isVisible(): boolean;
|
|
54
56
|
isInsideCanvas(): boolean;
|
|
55
57
|
draw(delta: IDelta): void;
|
package/Core/Particle.js
CHANGED
|
@@ -1,4 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
3
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
4
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
5
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
6
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
7
|
+
};
|
|
8
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
9
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
10
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
11
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
12
|
+
};
|
|
13
|
+
var _Particle_engine;
|
|
2
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
15
|
exports.Particle = void 0;
|
|
4
16
|
const Utils_1 = require("./Utils");
|
|
@@ -16,11 +28,13 @@ const fixOutMode = (data) => {
|
|
|
16
28
|
}
|
|
17
29
|
};
|
|
18
30
|
class Particle {
|
|
19
|
-
constructor(id, container, position, overrideOptions, group) {
|
|
31
|
+
constructor(engine, id, container, position, overrideOptions, group) {
|
|
20
32
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
21
33
|
this.id = id;
|
|
22
34
|
this.container = container;
|
|
23
35
|
this.group = group;
|
|
36
|
+
_Particle_engine.set(this, void 0);
|
|
37
|
+
__classPrivateFieldSet(this, _Particle_engine, engine, "f");
|
|
24
38
|
this.fill = true;
|
|
25
39
|
this.close = true;
|
|
26
40
|
this.lastPathTime = 0;
|
|
@@ -118,7 +132,7 @@ class Particle {
|
|
|
118
132
|
this.sides = 24;
|
|
119
133
|
let drawer = container.drawers.get(this.shape);
|
|
120
134
|
if (!drawer) {
|
|
121
|
-
drawer =
|
|
135
|
+
drawer = __classPrivateFieldGet(this, _Particle_engine, "f").plugins.getShapeDrawer(this.shape);
|
|
122
136
|
if (drawer) {
|
|
123
137
|
container.drawers.set(this.shape, drawer);
|
|
124
138
|
}
|
|
@@ -367,3 +381,4 @@ class Particle {
|
|
|
367
381
|
}
|
|
368
382
|
}
|
|
369
383
|
exports.Particle = Particle;
|
|
384
|
+
_Particle_engine = new WeakMap();
|
package/Core/Particles.d.ts
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import type { ICoordinates, IDelta, IMouseData, IParticle, IRgb } from "./Interfaces";
|
|
2
2
|
import { QuadTree } from "./Utils";
|
|
3
3
|
import type { Container } from "./Container";
|
|
4
|
+
import type { Engine } from "../engine";
|
|
4
5
|
import type { IParticles } from "../Options/Interfaces/Particles/IParticles";
|
|
5
6
|
import { Particle } from "./Particle";
|
|
6
7
|
import type { RecursivePartial } from "../Types";
|
|
7
8
|
export declare class Particles {
|
|
9
|
+
#private;
|
|
8
10
|
private readonly container;
|
|
9
11
|
get count(): number;
|
|
10
12
|
quadTree: QuadTree;
|
|
@@ -22,7 +24,7 @@ export declare class Particles {
|
|
|
22
24
|
private nextId;
|
|
23
25
|
private readonly freqs;
|
|
24
26
|
private readonly mover;
|
|
25
|
-
constructor(container: Container);
|
|
27
|
+
constructor(engine: Engine, container: Container);
|
|
26
28
|
init(): void;
|
|
27
29
|
redraw(): void;
|
|
28
30
|
removeAt(index: number, quantity?: number, group?: string, override?: boolean): void;
|
package/Core/Particles.js
CHANGED
|
@@ -1,4 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
3
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
4
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
5
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
6
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
7
|
+
};
|
|
8
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
9
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
10
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
11
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
12
|
+
};
|
|
13
|
+
var _Particles_engine;
|
|
2
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
15
|
exports.Particles = void 0;
|
|
4
16
|
const Utils_1 = require("./Utils");
|
|
@@ -6,8 +18,10 @@ const Utils_2 = require("../Utils");
|
|
|
6
18
|
const Particle_1 = require("./Particle");
|
|
7
19
|
const ParticlesOptions_1 = require("../Options/Classes/Particles/ParticlesOptions");
|
|
8
20
|
class Particles {
|
|
9
|
-
constructor(container) {
|
|
21
|
+
constructor(engine, container) {
|
|
10
22
|
this.container = container;
|
|
23
|
+
_Particles_engine.set(this, void 0);
|
|
24
|
+
__classPrivateFieldSet(this, _Particles_engine, engine, "f");
|
|
11
25
|
this.nextId = 0;
|
|
12
26
|
this.array = [];
|
|
13
27
|
this.zArray = [];
|
|
@@ -19,11 +33,11 @@ class Particles {
|
|
|
19
33
|
links: new Map(),
|
|
20
34
|
triangles: new Map(),
|
|
21
35
|
};
|
|
22
|
-
this.interactionManager = new Utils_1.InteractionManager(container);
|
|
36
|
+
this.interactionManager = new Utils_1.InteractionManager(__classPrivateFieldGet(this, _Particles_engine, "f"), container);
|
|
23
37
|
const canvasSize = this.container.canvas.size;
|
|
24
38
|
this.linksColors = new Map();
|
|
25
39
|
this.quadTree = new Utils_1.QuadTree(new Utils_1.Rectangle(-canvasSize.width / 4, -canvasSize.height / 4, (canvasSize.width * 3) / 2, (canvasSize.height * 3) / 2), 4);
|
|
26
|
-
this.updaters =
|
|
40
|
+
this.updaters = __classPrivateFieldGet(this, _Particles_engine, "f").plugins.getUpdaters(container, true);
|
|
27
41
|
}
|
|
28
42
|
get count() {
|
|
29
43
|
return this.array.length;
|
|
@@ -37,7 +51,7 @@ class Particles {
|
|
|
37
51
|
this.freqs.links = new Map();
|
|
38
52
|
this.freqs.triangles = new Map();
|
|
39
53
|
let handled = false;
|
|
40
|
-
this.updaters =
|
|
54
|
+
this.updaters = __classPrivateFieldGet(this, _Particles_engine, "f").plugins.getUpdaters(container, true);
|
|
41
55
|
this.interactionManager.init();
|
|
42
56
|
for (const [, plugin] of container.plugins) {
|
|
43
57
|
if (plugin.particlesInitialization !== undefined) {
|
|
@@ -284,7 +298,7 @@ class Particles {
|
|
|
284
298
|
}
|
|
285
299
|
pushParticle(position, overrideOptions, group, initializer) {
|
|
286
300
|
try {
|
|
287
|
-
const particle = new Particle_1.Particle(this.nextId, this.container, position, overrideOptions, group);
|
|
301
|
+
const particle = new Particle_1.Particle(__classPrivateFieldGet(this, _Particles_engine, "f"), this.nextId, this.container, position, overrideOptions, group);
|
|
288
302
|
let canAdd = true;
|
|
289
303
|
if (initializer) {
|
|
290
304
|
canAdd = initializer(particle);
|
|
@@ -304,3 +318,4 @@ class Particles {
|
|
|
304
318
|
}
|
|
305
319
|
}
|
|
306
320
|
exports.Particles = Particles;
|
|
321
|
+
_Particles_engine = new WeakMap();
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import type { IDelta } from "../Interfaces";
|
|
2
2
|
import type { Container } from "../Container";
|
|
3
|
+
import type { Engine } from "../../engine";
|
|
3
4
|
import type { Particle } from "../Particle";
|
|
4
5
|
export declare class InteractionManager {
|
|
6
|
+
#private;
|
|
5
7
|
private readonly container;
|
|
6
|
-
private
|
|
7
|
-
private
|
|
8
|
-
constructor(container: Container);
|
|
8
|
+
private externalInteractors;
|
|
9
|
+
private particleInteractors;
|
|
10
|
+
constructor(engine: Engine, container: Container);
|
|
9
11
|
init(): void;
|
|
10
12
|
externalInteract(delta: IDelta): void;
|
|
11
13
|
particlesInteract(particle: Particle, delta: IDelta): void;
|
|
@@ -1,16 +1,31 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
3
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
4
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
5
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
6
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
7
|
+
};
|
|
8
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
9
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
10
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
11
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
12
|
+
};
|
|
13
|
+
var _InteractionManager_engine;
|
|
2
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
15
|
exports.InteractionManager = void 0;
|
|
4
|
-
const Utils_1 = require("../Utils");
|
|
5
16
|
class InteractionManager {
|
|
6
|
-
constructor(container) {
|
|
17
|
+
constructor(engine, container) {
|
|
7
18
|
this.container = container;
|
|
19
|
+
_InteractionManager_engine.set(this, void 0);
|
|
20
|
+
__classPrivateFieldSet(this, _InteractionManager_engine, engine, "f");
|
|
8
21
|
this.externalInteractors = [];
|
|
9
22
|
this.particleInteractors = [];
|
|
10
23
|
this.init();
|
|
11
24
|
}
|
|
12
25
|
init() {
|
|
13
|
-
const interactors =
|
|
26
|
+
const interactors = __classPrivateFieldGet(this, _InteractionManager_engine, "f").plugins.getInteractors(this.container, true);
|
|
27
|
+
this.externalInteractors = [];
|
|
28
|
+
this.particleInteractors = [];
|
|
14
29
|
for (const interactor of interactors) {
|
|
15
30
|
switch (interactor.type) {
|
|
16
31
|
case 0:
|
|
@@ -41,3 +56,4 @@ class InteractionManager {
|
|
|
41
56
|
}
|
|
42
57
|
}
|
|
43
58
|
exports.InteractionManager = InteractionManager;
|
|
59
|
+
_InteractionManager_engine = new WeakMap();
|
package/Core/Utils/Plugins.d.ts
CHANGED
|
@@ -1,22 +1,36 @@
|
|
|
1
1
|
import type { IContainerPlugin, IInteractor, IMovePathGenerator, IParticleUpdater, IPlugin, IShapeDrawer } from "../Interfaces";
|
|
2
2
|
import type { Container } from "../Container";
|
|
3
|
+
import type { Engine } from "../../engine";
|
|
3
4
|
import type { IOptions } from "../../Options/Interfaces/IOptions";
|
|
4
5
|
import type { Options } from "../../Options/Classes/Options";
|
|
5
6
|
import type { RecursivePartial } from "../../Types";
|
|
7
|
+
declare type InteractorInitializer = (container: Container) => IInteractor;
|
|
8
|
+
declare type UpdaterInitializer = (container: Container) => IParticleUpdater;
|
|
6
9
|
export declare class Plugins {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
10
|
+
#private;
|
|
11
|
+
readonly plugins: IPlugin[];
|
|
12
|
+
readonly interactorsInitializers: Map<string, InteractorInitializer>;
|
|
13
|
+
readonly updatersInitializers: Map<string, UpdaterInitializer>;
|
|
14
|
+
readonly interactors: Map<Container, IInteractor[]>;
|
|
15
|
+
readonly updaters: Map<Container, IParticleUpdater[]>;
|
|
16
|
+
readonly presets: Map<string, RecursivePartial<IOptions>>;
|
|
17
|
+
readonly drawers: Map<string, IShapeDrawer>;
|
|
18
|
+
readonly pathGenerators: Map<string, IMovePathGenerator>;
|
|
19
|
+
constructor(engine: Engine);
|
|
20
|
+
getPlugin(plugin: string): IPlugin | undefined;
|
|
21
|
+
addPlugin(plugin: IPlugin): void;
|
|
22
|
+
getAvailablePlugins(container: Container): Map<string, IContainerPlugin>;
|
|
23
|
+
loadOptions(options: Options, sourceOptions: RecursivePartial<IOptions>): void;
|
|
24
|
+
getPreset(preset: string): RecursivePartial<IOptions> | undefined;
|
|
25
|
+
addPreset(presetKey: string, options: RecursivePartial<IOptions>, override?: boolean): void;
|
|
26
|
+
addShapeDrawer(type: string, drawer: IShapeDrawer): void;
|
|
27
|
+
getShapeDrawer(type: string): IShapeDrawer | undefined;
|
|
28
|
+
getSupportedShapes(): IterableIterator<string>;
|
|
29
|
+
getPathGenerator(type: string): IMovePathGenerator | undefined;
|
|
30
|
+
addPathGenerator(type: string, pathGenerator: IMovePathGenerator): void;
|
|
31
|
+
getInteractors(container: Container, force?: boolean): IInteractor[];
|
|
32
|
+
addInteractor(name: string, initInteractor: (container: Container) => IInteractor): void;
|
|
33
|
+
getUpdaters(container: Container, force?: boolean): IParticleUpdater[];
|
|
34
|
+
addParticleUpdater(name: string, initUpdater: (container: Container) => IParticleUpdater): void;
|
|
22
35
|
}
|
|
36
|
+
export {};
|