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
|
@@ -1,16 +1,31 @@
|
|
|
1
|
-
|
|
1
|
+
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
2
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
3
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
4
|
+
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");
|
|
5
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
6
|
+
};
|
|
7
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
8
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
9
|
+
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");
|
|
10
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
11
|
+
};
|
|
12
|
+
var _InteractionManager_engine;
|
|
2
13
|
/**
|
|
3
14
|
* @category Core
|
|
4
15
|
*/
|
|
5
16
|
export 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 /* External */:
|
|
@@ -41,3 +56,4 @@ export class InteractionManager {
|
|
|
41
56
|
}
|
|
42
57
|
}
|
|
43
58
|
}
|
|
59
|
+
_InteractionManager_engine = new WeakMap();
|
|
@@ -1,25 +1,39 @@
|
|
|
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
|
/**
|
|
7
10
|
* @category Utils
|
|
8
11
|
*/
|
|
9
12
|
export declare class Plugins {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
13
|
+
#private;
|
|
14
|
+
readonly plugins: IPlugin[];
|
|
15
|
+
readonly interactorsInitializers: Map<string, InteractorInitializer>;
|
|
16
|
+
readonly updatersInitializers: Map<string, UpdaterInitializer>;
|
|
17
|
+
readonly interactors: Map<Container, IInteractor[]>;
|
|
18
|
+
readonly updaters: Map<Container, IParticleUpdater[]>;
|
|
19
|
+
readonly presets: Map<string, RecursivePartial<IOptions>>;
|
|
20
|
+
readonly drawers: Map<string, IShapeDrawer>;
|
|
21
|
+
readonly pathGenerators: Map<string, IMovePathGenerator>;
|
|
22
|
+
constructor(engine: Engine);
|
|
23
|
+
getPlugin(plugin: string): IPlugin | undefined;
|
|
24
|
+
addPlugin(plugin: IPlugin): void;
|
|
25
|
+
getAvailablePlugins(container: Container): Map<string, IContainerPlugin>;
|
|
26
|
+
loadOptions(options: Options, sourceOptions: RecursivePartial<IOptions>): void;
|
|
27
|
+
getPreset(preset: string): RecursivePartial<IOptions> | undefined;
|
|
28
|
+
addPreset(presetKey: string, options: RecursivePartial<IOptions>, override?: boolean): void;
|
|
29
|
+
addShapeDrawer(type: string, drawer: IShapeDrawer): void;
|
|
30
|
+
getShapeDrawer(type: string): IShapeDrawer | undefined;
|
|
31
|
+
getSupportedShapes(): IterableIterator<string>;
|
|
32
|
+
getPathGenerator(type: string): IMovePathGenerator | undefined;
|
|
33
|
+
addPathGenerator(type: string, pathGenerator: IMovePathGenerator): void;
|
|
34
|
+
getInteractors(container: Container, force?: boolean): IInteractor[];
|
|
35
|
+
addInteractor(name: string, initInteractor: (container: Container) => IInteractor): void;
|
|
36
|
+
getUpdaters(container: Container, force?: boolean): IParticleUpdater[];
|
|
37
|
+
addParticleUpdater(name: string, initUpdater: (container: Container) => IParticleUpdater): void;
|
|
25
38
|
}
|
|
39
|
+
export {};
|
|
@@ -1,26 +1,37 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const pathGenerators = new Map();
|
|
1
|
+
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
2
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
3
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
4
|
+
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");
|
|
5
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
6
|
+
};
|
|
7
|
+
var _Plugins_engine;
|
|
9
8
|
/**
|
|
10
9
|
* @category Utils
|
|
11
10
|
*/
|
|
12
11
|
export class Plugins {
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
constructor(engine) {
|
|
13
|
+
_Plugins_engine.set(this, void 0);
|
|
14
|
+
__classPrivateFieldSet(this, _Plugins_engine, engine, "f");
|
|
15
|
+
this.plugins = [];
|
|
16
|
+
this.interactorsInitializers = new Map();
|
|
17
|
+
this.updatersInitializers = new Map();
|
|
18
|
+
this.interactors = new Map();
|
|
19
|
+
this.updaters = new Map();
|
|
20
|
+
this.presets = new Map();
|
|
21
|
+
this.drawers = new Map();
|
|
22
|
+
this.pathGenerators = new Map();
|
|
15
23
|
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
24
|
+
getPlugin(plugin) {
|
|
25
|
+
return this.plugins.find((t) => t.id === plugin);
|
|
26
|
+
}
|
|
27
|
+
addPlugin(plugin) {
|
|
28
|
+
if (!this.getPlugin(plugin.id)) {
|
|
29
|
+
this.plugins.push(plugin);
|
|
19
30
|
}
|
|
20
31
|
}
|
|
21
|
-
|
|
32
|
+
getAvailablePlugins(container) {
|
|
22
33
|
const res = new Map();
|
|
23
|
-
for (const plugin of plugins) {
|
|
34
|
+
for (const plugin of this.plugins) {
|
|
24
35
|
if (!plugin.needsPlugin(container.actualOptions)) {
|
|
25
36
|
continue;
|
|
26
37
|
}
|
|
@@ -28,58 +39,59 @@ export class Plugins {
|
|
|
28
39
|
}
|
|
29
40
|
return res;
|
|
30
41
|
}
|
|
31
|
-
|
|
32
|
-
for (const plugin of plugins) {
|
|
42
|
+
loadOptions(options, sourceOptions) {
|
|
43
|
+
for (const plugin of this.plugins) {
|
|
33
44
|
plugin.loadOptions(options, sourceOptions);
|
|
34
45
|
}
|
|
35
46
|
}
|
|
36
|
-
|
|
37
|
-
return presets.get(preset);
|
|
47
|
+
getPreset(preset) {
|
|
48
|
+
return this.presets.get(preset);
|
|
38
49
|
}
|
|
39
|
-
|
|
40
|
-
if (override || !
|
|
41
|
-
presets.set(presetKey, options);
|
|
50
|
+
addPreset(presetKey, options, override = false) {
|
|
51
|
+
if (override || !this.getPreset(presetKey)) {
|
|
52
|
+
this.presets.set(presetKey, options);
|
|
42
53
|
}
|
|
43
54
|
}
|
|
44
|
-
|
|
45
|
-
if (!
|
|
46
|
-
drawers.set(type, drawer);
|
|
55
|
+
addShapeDrawer(type, drawer) {
|
|
56
|
+
if (!this.getShapeDrawer(type)) {
|
|
57
|
+
this.drawers.set(type, drawer);
|
|
47
58
|
}
|
|
48
59
|
}
|
|
49
|
-
|
|
50
|
-
return drawers.get(type);
|
|
60
|
+
getShapeDrawer(type) {
|
|
61
|
+
return this.drawers.get(type);
|
|
51
62
|
}
|
|
52
|
-
|
|
53
|
-
return drawers.keys();
|
|
63
|
+
getSupportedShapes() {
|
|
64
|
+
return this.drawers.keys();
|
|
54
65
|
}
|
|
55
|
-
|
|
56
|
-
return pathGenerators.get(type);
|
|
66
|
+
getPathGenerator(type) {
|
|
67
|
+
return this.pathGenerators.get(type);
|
|
57
68
|
}
|
|
58
|
-
|
|
59
|
-
if (!
|
|
60
|
-
pathGenerators.set(type, pathGenerator);
|
|
69
|
+
addPathGenerator(type, pathGenerator) {
|
|
70
|
+
if (!this.getPathGenerator(type)) {
|
|
71
|
+
this.pathGenerators.set(type, pathGenerator);
|
|
61
72
|
}
|
|
62
73
|
}
|
|
63
|
-
|
|
64
|
-
let res = interactors.get(container);
|
|
74
|
+
getInteractors(container, force = false) {
|
|
75
|
+
let res = this.interactors.get(container);
|
|
65
76
|
if (!res || force) {
|
|
66
|
-
res = [...interactorsInitializers.values()].map((t) => t(container));
|
|
67
|
-
interactors.set(container, res);
|
|
77
|
+
res = [...this.interactorsInitializers.values()].map((t) => t(container));
|
|
78
|
+
this.interactors.set(container, res);
|
|
68
79
|
}
|
|
69
80
|
return res;
|
|
70
81
|
}
|
|
71
|
-
|
|
72
|
-
interactorsInitializers.set(name, initInteractor);
|
|
82
|
+
addInteractor(name, initInteractor) {
|
|
83
|
+
this.interactorsInitializers.set(name, initInteractor);
|
|
73
84
|
}
|
|
74
|
-
|
|
75
|
-
let res = updaters.get(container);
|
|
85
|
+
getUpdaters(container, force = false) {
|
|
86
|
+
let res = this.updaters.get(container);
|
|
76
87
|
if (!res || force) {
|
|
77
|
-
res = [...updatersInitializers.values()].map((t) => t(container));
|
|
78
|
-
updaters.set(container, res);
|
|
88
|
+
res = [...this.updatersInitializers.values()].map((t) => t(container));
|
|
89
|
+
this.updaters.set(container, res);
|
|
79
90
|
}
|
|
80
91
|
return res;
|
|
81
92
|
}
|
|
82
|
-
|
|
83
|
-
updatersInitializers.set(name, initUpdater);
|
|
93
|
+
addParticleUpdater(name, initUpdater) {
|
|
94
|
+
this.updatersInitializers.set(name, initUpdater);
|
|
84
95
|
}
|
|
85
96
|
}
|
|
97
|
+
_Plugins_engine = new WeakMap();
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { RangeValue, RecursivePartial } from "../../Types";
|
|
2
2
|
import { Background } from "./Background/Background";
|
|
3
3
|
import { BackgroundMask } from "./BackgroundMask/BackgroundMask";
|
|
4
|
+
import type { Engine } from "../../engine";
|
|
4
5
|
import { FullScreen } from "./FullScreen/FullScreen";
|
|
5
6
|
import type { IOptionLoader } from "../Interfaces/IOptionLoader";
|
|
6
7
|
import type { IOptions } from "../Interfaces/IOptions";
|
|
@@ -65,7 +66,7 @@ export declare class Options implements IOptions, IOptionLoader<IOptions> {
|
|
|
65
66
|
defaultDarkTheme?: string;
|
|
66
67
|
defaultLightTheme?: string;
|
|
67
68
|
[name: string]: unknown;
|
|
68
|
-
constructor();
|
|
69
|
+
constructor(engine: Engine);
|
|
69
70
|
/**
|
|
70
71
|
* This methods loads the source object in the current instance
|
|
71
72
|
* @param data the source data to load into the instance
|
|
@@ -1,9 +1,15 @@
|
|
|
1
|
+
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
2
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
3
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
4
|
+
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");
|
|
5
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
6
|
+
};
|
|
1
7
|
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
2
8
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
3
9
|
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");
|
|
4
10
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
5
11
|
};
|
|
6
|
-
var _Options_instances, _Options_findDefaultTheme;
|
|
12
|
+
var _Options_instances, _Options_engine, _Options_findDefaultTheme;
|
|
7
13
|
import { Background } from "./Background/Background";
|
|
8
14
|
import { BackgroundMask } from "./BackgroundMask/BackgroundMask";
|
|
9
15
|
import { FullScreen } from "./FullScreen/FullScreen";
|
|
@@ -11,7 +17,6 @@ import { Interactivity } from "./Interactivity/Interactivity";
|
|
|
11
17
|
import { ManualParticle } from "./ManualParticle";
|
|
12
18
|
import { Motion } from "./Motion/Motion";
|
|
13
19
|
import { ParticlesOptions } from "./Particles/ParticlesOptions";
|
|
14
|
-
import { Plugins } from "../../Core";
|
|
15
20
|
import { Responsive } from "./Responsive";
|
|
16
21
|
import { Theme } from "./Theme/Theme";
|
|
17
22
|
import { deepExtend } from "../../Utils";
|
|
@@ -20,15 +25,17 @@ import { deepExtend } from "../../Utils";
|
|
|
20
25
|
* @category Options
|
|
21
26
|
*/
|
|
22
27
|
export class Options {
|
|
23
|
-
constructor() {
|
|
28
|
+
constructor(engine) {
|
|
24
29
|
_Options_instances.add(this);
|
|
30
|
+
_Options_engine.set(this, void 0);
|
|
31
|
+
__classPrivateFieldSet(this, _Options_engine, engine, "f");
|
|
25
32
|
this.autoPlay = true;
|
|
26
33
|
this.background = new Background();
|
|
27
34
|
this.backgroundMask = new BackgroundMask();
|
|
28
35
|
this.fullScreen = new FullScreen();
|
|
29
36
|
this.detectRetina = true;
|
|
30
37
|
this.duration = 0;
|
|
31
|
-
this.fpsLimit =
|
|
38
|
+
this.fpsLimit = 120;
|
|
32
39
|
this.interactivity = new Interactivity();
|
|
33
40
|
this.manualParticles = [];
|
|
34
41
|
this.motion = new Motion();
|
|
@@ -142,7 +149,7 @@ export class Options {
|
|
|
142
149
|
this.motion.load(data.motion);
|
|
143
150
|
this.particles.load(data.particles);
|
|
144
151
|
this.style = deepExtend(this.style, data.style);
|
|
145
|
-
|
|
152
|
+
__classPrivateFieldGet(this, _Options_engine, "f").plugins.loadOptions(this, data);
|
|
146
153
|
if (data.responsive !== undefined) {
|
|
147
154
|
for (const responsive of data.responsive) {
|
|
148
155
|
const optResponsive = new Responsive();
|
|
@@ -184,10 +191,10 @@ export class Options {
|
|
|
184
191
|
return responsiveOptions === null || responsiveOptions === void 0 ? void 0 : responsiveOptions.maxWidth;
|
|
185
192
|
}
|
|
186
193
|
importPreset(preset) {
|
|
187
|
-
this.load(
|
|
194
|
+
this.load(__classPrivateFieldGet(this, _Options_engine, "f").plugins.getPreset(preset));
|
|
188
195
|
}
|
|
189
196
|
}
|
|
190
|
-
_Options_instances = new WeakSet(), _Options_findDefaultTheme = function _Options_findDefaultTheme(mode) {
|
|
197
|
+
_Options_engine = new WeakMap(), _Options_instances = new WeakSet(), _Options_findDefaultTheme = function _Options_findDefaultTheme(mode) {
|
|
191
198
|
var _a;
|
|
192
199
|
return ((_a = this.themes.find((theme) => theme.default.value && theme.default.mode === mode)) !== null && _a !== void 0 ? _a : this.themes.find((theme) => theme.default.value && theme.default.mode === "any" /* any */));
|
|
193
200
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import type { Container, ICoordinates, IDelta, IHsl } from "../../Core";
|
|
1
|
+
import type { Container, ICoordinates, IDelta, IDimension, IHsl } from "../../Core";
|
|
2
2
|
import { Emitter } from "./Options/Classes/Emitter";
|
|
3
3
|
import type { Emitters } from "./Emitters";
|
|
4
|
+
import type { EmittersEngine } from "./EmittersEngine";
|
|
4
5
|
import type { IEmitter } from "./Options/Interfaces/IEmitter";
|
|
5
6
|
import type { IEmitterSize } from "./Options/Interfaces/IEmitterSize";
|
|
6
7
|
import type { RecursivePartial } from "../../Types";
|
|
@@ -11,7 +12,7 @@ export declare class EmitterInstance {
|
|
|
11
12
|
#private;
|
|
12
13
|
private readonly emitters;
|
|
13
14
|
private readonly container;
|
|
14
|
-
position
|
|
15
|
+
position?: ICoordinates;
|
|
15
16
|
size: IEmitterSize;
|
|
16
17
|
options: Emitter;
|
|
17
18
|
spawnColor?: IHsl;
|
|
@@ -29,13 +30,15 @@ export declare class EmitterInstance {
|
|
|
29
30
|
private readonly shape?;
|
|
30
31
|
private readonly initialPosition?;
|
|
31
32
|
private readonly particlesOptions;
|
|
32
|
-
constructor(emitters: Emitters, container: Container, options: RecursivePartial<IEmitter>, position?: ICoordinates);
|
|
33
|
+
constructor(engine: EmittersEngine, emitters: Emitters, container: Container, options: RecursivePartial<IEmitter>, position?: ICoordinates);
|
|
33
34
|
externalPlay(): void;
|
|
34
35
|
externalPause(): void;
|
|
35
36
|
play(): void;
|
|
36
37
|
pause(): void;
|
|
37
38
|
resize(): void;
|
|
38
39
|
update(delta: IDelta): void;
|
|
40
|
+
getPosition(): ICoordinates | undefined;
|
|
41
|
+
getSize(): IDimension;
|
|
39
42
|
private prepareToDie;
|
|
40
43
|
private destroy;
|
|
41
44
|
private calcPosition;
|
|
@@ -9,22 +9,23 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
9
9
|
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");
|
|
10
10
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
11
11
|
};
|
|
12
|
-
var _EmitterInstance_firstSpawn, _EmitterInstance_startParticlesAdded;
|
|
12
|
+
var _EmitterInstance_firstSpawn, _EmitterInstance_startParticlesAdded, _EmitterInstance_engine;
|
|
13
13
|
import { colorToHsl, deepExtend, getRangeValue, isPointInside, randomInRange } from "../../Utils";
|
|
14
14
|
import { Emitter } from "./Options/Classes/Emitter";
|
|
15
15
|
import { EmitterSize } from "./Options/Classes/EmitterSize";
|
|
16
|
-
import { ShapeManager } from "./ShapeManager";
|
|
17
16
|
/**
|
|
18
17
|
* @category Emitters Plugin
|
|
19
18
|
*/
|
|
20
19
|
export class EmitterInstance {
|
|
21
|
-
constructor(emitters, container, options, position) {
|
|
20
|
+
constructor(engine, emitters, container, options, position) {
|
|
22
21
|
var _a, _b, _c, _d, _e, _f;
|
|
23
22
|
var _g;
|
|
24
23
|
this.emitters = emitters;
|
|
25
24
|
this.container = container;
|
|
26
25
|
_EmitterInstance_firstSpawn.set(this, void 0);
|
|
27
26
|
_EmitterInstance_startParticlesAdded.set(this, void 0);
|
|
27
|
+
_EmitterInstance_engine.set(this, void 0);
|
|
28
|
+
__classPrivateFieldSet(this, _EmitterInstance_engine, engine, "f");
|
|
28
29
|
this.currentDuration = 0;
|
|
29
30
|
this.currentEmitDelay = 0;
|
|
30
31
|
this.currentSpawnDelay = 0;
|
|
@@ -37,9 +38,8 @@ export class EmitterInstance {
|
|
|
37
38
|
this.options.load(options);
|
|
38
39
|
}
|
|
39
40
|
this.spawnDelay = (((_a = this.options.life.delay) !== null && _a !== void 0 ? _a : 0) * 1000) / this.container.retina.reduceFactor;
|
|
40
|
-
this.position = (_b = this.initialPosition) !== null && _b !== void 0 ? _b : this.calcPosition();
|
|
41
41
|
this.name = this.options.name;
|
|
42
|
-
this.shape =
|
|
42
|
+
this.shape = (_b = __classPrivateFieldGet(this, _EmitterInstance_engine, "f").emitterShapeManager) === null || _b === void 0 ? void 0 : _b.getShape(this.options.shape);
|
|
43
43
|
this.fill = this.options.fill;
|
|
44
44
|
__classPrivateFieldSet(this, _EmitterInstance_firstSpawn, !this.options.life.wait, "f");
|
|
45
45
|
__classPrivateFieldSet(this, _EmitterInstance_startParticlesAdded, false, "f");
|
|
@@ -155,6 +155,40 @@ export class EmitterInstance {
|
|
|
155
155
|
}
|
|
156
156
|
}
|
|
157
157
|
}
|
|
158
|
+
getPosition() {
|
|
159
|
+
if (this.options.domId) {
|
|
160
|
+
const container = this.container, element = document.getElementById(this.options.domId);
|
|
161
|
+
if (element) {
|
|
162
|
+
const elRect = element.getBoundingClientRect();
|
|
163
|
+
return {
|
|
164
|
+
x: (elRect.x + elRect.width / 2) * container.retina.pixelRatio,
|
|
165
|
+
y: (elRect.y + elRect.height / 2) * container.retina.pixelRatio,
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
return this.position;
|
|
170
|
+
}
|
|
171
|
+
getSize() {
|
|
172
|
+
const container = this.container;
|
|
173
|
+
if (this.options.domId) {
|
|
174
|
+
const element = document.getElementById(this.options.domId);
|
|
175
|
+
if (element) {
|
|
176
|
+
const elRect = element.getBoundingClientRect();
|
|
177
|
+
return {
|
|
178
|
+
width: elRect.width * container.retina.pixelRatio,
|
|
179
|
+
height: elRect.height * container.retina.pixelRatio,
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
return {
|
|
184
|
+
width: this.size.mode === "percent" /* percent */
|
|
185
|
+
? (container.canvas.size.width * this.size.width) / 100
|
|
186
|
+
: this.size.width,
|
|
187
|
+
height: this.size.mode === "percent" /* percent */
|
|
188
|
+
? (container.canvas.size.height * this.size.height) / 100
|
|
189
|
+
: this.size.height,
|
|
190
|
+
};
|
|
191
|
+
}
|
|
158
192
|
prepareToDie() {
|
|
159
193
|
var _a;
|
|
160
194
|
if (this.paused) {
|
|
@@ -190,15 +224,8 @@ export class EmitterInstance {
|
|
|
190
224
|
emitParticles(quantity) {
|
|
191
225
|
var _a, _b, _c;
|
|
192
226
|
const container = this.container;
|
|
193
|
-
const position = this.
|
|
194
|
-
const
|
|
195
|
-
x: this.size.mode === "percent" /* percent */
|
|
196
|
-
? (container.canvas.size.width * this.size.width) / 100
|
|
197
|
-
: this.size.width,
|
|
198
|
-
y: this.size.mode === "percent" /* percent */
|
|
199
|
-
? (container.canvas.size.height * this.size.height) / 100
|
|
200
|
-
: this.size.height,
|
|
201
|
-
};
|
|
227
|
+
const position = this.getPosition();
|
|
228
|
+
const size = this.getSize();
|
|
202
229
|
for (let i = 0; i < quantity; i++) {
|
|
203
230
|
const particlesOptions = deepExtend({}, this.particlesOptions);
|
|
204
231
|
if (this.spawnColor) {
|
|
@@ -217,7 +244,10 @@ export class EmitterInstance {
|
|
|
217
244
|
particlesOptions.color.value = this.spawnColor;
|
|
218
245
|
}
|
|
219
246
|
}
|
|
220
|
-
|
|
247
|
+
if (!position) {
|
|
248
|
+
return;
|
|
249
|
+
}
|
|
250
|
+
const pPosition = (_c = (_b = this.shape) === null || _b === void 0 ? void 0 : _b.randomPosition(position, size, this.fill)) !== null && _c !== void 0 ? _c : position;
|
|
221
251
|
container.particles.addParticle(pPosition, particlesOptions);
|
|
222
252
|
}
|
|
223
253
|
}
|
|
@@ -234,4 +264,4 @@ export class EmitterInstance {
|
|
|
234
264
|
return (initValue + (colorSpeed * container.fpsLimit) / emitFactor + colorOffset * 3.6) % maxValue;
|
|
235
265
|
}
|
|
236
266
|
}
|
|
237
|
-
_EmitterInstance_firstSpawn = new WeakMap(), _EmitterInstance_startParticlesAdded = new WeakMap();
|
|
267
|
+
_EmitterInstance_firstSpawn = new WeakMap(), _EmitterInstance_startParticlesAdded = new WeakMap(), _EmitterInstance_engine = new WeakMap();
|
|
@@ -2,6 +2,7 @@ import type { Container, IContainerPlugin, ICoordinates, IDelta } from "../../Co
|
|
|
2
2
|
import type { RecursivePartial, SingleOrMultiple } from "../../Types";
|
|
3
3
|
import { Emitter } from "./Options/Classes/Emitter";
|
|
4
4
|
import { EmitterInstance } from "./EmitterInstance";
|
|
5
|
+
import type { EmittersEngine } from "./EmittersEngine";
|
|
5
6
|
import type { IEmitter } from "./Options/Interfaces/IEmitter";
|
|
6
7
|
import type { IEmitterOptions } from "./Options/Interfaces/IEmitterOptions";
|
|
7
8
|
import type { IOptions } from "../../Options/Interfaces/IOptions";
|
|
@@ -9,11 +10,12 @@ import type { IOptions } from "../../Options/Interfaces/IOptions";
|
|
|
9
10
|
* @category Emitters Plugin
|
|
10
11
|
*/
|
|
11
12
|
export declare class Emitters implements IContainerPlugin {
|
|
13
|
+
#private;
|
|
12
14
|
private readonly container;
|
|
13
15
|
array: EmitterInstance[];
|
|
14
16
|
emitters: SingleOrMultiple<Emitter>;
|
|
15
17
|
interactivityEmitters: SingleOrMultiple<Emitter>;
|
|
16
|
-
constructor(container: Container);
|
|
18
|
+
constructor(engine: EmittersEngine, container: Container);
|
|
17
19
|
init(options?: RecursivePartial<IOptions & IEmitterOptions>): void;
|
|
18
20
|
play(): void;
|
|
19
21
|
pause(): void;
|
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
2
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
3
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
4
|
+
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");
|
|
5
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
6
|
+
};
|
|
7
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
8
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
9
|
+
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");
|
|
10
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
11
|
+
};
|
|
12
|
+
var _Emitters_engine;
|
|
1
13
|
import { deepExtend, itemFromArray } from "../../Utils";
|
|
2
14
|
import { Emitter } from "./Options/Classes/Emitter";
|
|
3
15
|
import { EmitterInstance } from "./EmitterInstance";
|
|
@@ -5,8 +17,10 @@ import { EmitterInstance } from "./EmitterInstance";
|
|
|
5
17
|
* @category Emitters Plugin
|
|
6
18
|
*/
|
|
7
19
|
export class Emitters {
|
|
8
|
-
constructor(container) {
|
|
20
|
+
constructor(engine, container) {
|
|
9
21
|
this.container = container;
|
|
22
|
+
_Emitters_engine.set(this, void 0);
|
|
23
|
+
__classPrivateFieldSet(this, _Emitters_engine, engine, "f");
|
|
10
24
|
this.array = [];
|
|
11
25
|
this.emitters = [];
|
|
12
26
|
this.interactivityEmitters = [];
|
|
@@ -124,7 +138,7 @@ export class Emitters {
|
|
|
124
138
|
addEmitter(options, position) {
|
|
125
139
|
const emitterOptions = new Emitter();
|
|
126
140
|
emitterOptions.load(options);
|
|
127
|
-
const emitter = new EmitterInstance(this, this.container, emitterOptions, position);
|
|
141
|
+
const emitter = new EmitterInstance(__classPrivateFieldGet(this, _Emitters_engine, "f"), this, this.container, emitterOptions, position);
|
|
128
142
|
this.array.push(emitter);
|
|
129
143
|
return emitter;
|
|
130
144
|
}
|
|
@@ -135,3 +149,4 @@ export class Emitters {
|
|
|
135
149
|
}
|
|
136
150
|
}
|
|
137
151
|
}
|
|
152
|
+
_Emitters_engine = new WeakMap();
|
package/{esm/Plugins/Emitters/EmittersMain.d.ts → browser/Plugins/Emitters/EmittersEngine.d.ts}
RENAMED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { Engine } from "../../engine";
|
|
2
2
|
import type { IEmitterShape } from "./IEmitterShape";
|
|
3
|
-
|
|
3
|
+
import type { ShapeManager } from "./ShapeManager";
|
|
4
|
+
export declare type EmittersEngine = Engine & {
|
|
5
|
+
emitterShapeManager?: ShapeManager;
|
|
4
6
|
addEmitterShape?: (name: string, shape: IEmitterShape) => void;
|
|
5
7
|
};
|
|
File without changes
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ICoordinates } from "../../Core";
|
|
1
|
+
import type { ICoordinates, IDimension } from "../../Core";
|
|
2
2
|
export interface IEmitterShape {
|
|
3
|
-
randomPosition(position: ICoordinates,
|
|
3
|
+
randomPosition(position: ICoordinates, size: IDimension, fill: boolean): ICoordinates;
|
|
4
4
|
}
|
|
@@ -17,6 +17,7 @@ export declare class Emitter implements IEmitter, IOptionLoader<IEmitter> {
|
|
|
17
17
|
autoPlay: boolean;
|
|
18
18
|
size?: EmitterSize;
|
|
19
19
|
direction?: MoveDirection | keyof typeof MoveDirection | MoveDirectionAlt | number;
|
|
20
|
+
domId?: string;
|
|
20
21
|
fill: boolean;
|
|
21
22
|
life: EmitterLife;
|
|
22
23
|
name?: string;
|
|
@@ -25,6 +25,10 @@ export interface IEmitter {
|
|
|
25
25
|
* The direction of the emitted particles, [[MoveDirection]] is the enum used for values
|
|
26
26
|
*/
|
|
27
27
|
direction?: MoveDirection | keyof typeof MoveDirection | MoveDirectionAlt | number;
|
|
28
|
+
/**
|
|
29
|
+
* Using this id to link the emitter to an HTML element
|
|
30
|
+
*/
|
|
31
|
+
domId?: string;
|
|
28
32
|
/**
|
|
29
33
|
* Sets if the particles will spawn at the emitter perimeter or inside the area
|
|
30
34
|
*/
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
+
import type { Engine } from "../../engine";
|
|
1
2
|
import type { IEmitterShape } from "./IEmitterShape";
|
|
2
3
|
export declare class ShapeManager {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
#private;
|
|
5
|
+
constructor(engine: Engine);
|
|
6
|
+
addShape(name: string, drawer: IEmitterShape): void;
|
|
7
|
+
getShape(name: string): IEmitterShape | undefined;
|
|
8
|
+
getSupportedShapes(): IterableIterator<string>;
|
|
6
9
|
}
|
|
@@ -1,14 +1,26 @@
|
|
|
1
|
+
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
2
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
3
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
4
|
+
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");
|
|
5
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
6
|
+
};
|
|
7
|
+
var _ShapeManager_engine;
|
|
1
8
|
const shapes = new Map();
|
|
2
9
|
export class ShapeManager {
|
|
3
|
-
|
|
4
|
-
|
|
10
|
+
constructor(engine) {
|
|
11
|
+
_ShapeManager_engine.set(this, void 0);
|
|
12
|
+
__classPrivateFieldSet(this, _ShapeManager_engine, engine, "f");
|
|
13
|
+
}
|
|
14
|
+
addShape(name, drawer) {
|
|
15
|
+
if (!this.getShape(name)) {
|
|
5
16
|
shapes.set(name, drawer);
|
|
6
17
|
}
|
|
7
18
|
}
|
|
8
|
-
|
|
19
|
+
getShape(name) {
|
|
9
20
|
return shapes.get(name);
|
|
10
21
|
}
|
|
11
|
-
|
|
22
|
+
getSupportedShapes() {
|
|
12
23
|
return shapes.keys();
|
|
13
24
|
}
|
|
14
25
|
}
|
|
26
|
+
_ShapeManager_engine = new WeakMap();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { ICoordinates } from "../../../../Core";
|
|
1
|
+
import type { ICoordinates, IDimension } from "../../../../Core";
|
|
2
2
|
import type { IEmitterShape } from "../../IEmitterShape";
|
|
3
3
|
export declare class CircleShape implements IEmitterShape {
|
|
4
|
-
randomPosition(position: ICoordinates,
|
|
4
|
+
randomPosition(position: ICoordinates, size: IDimension, fill: boolean): ICoordinates;
|
|
5
5
|
}
|