@tsparticles/engine 4.0.0-alpha.5 → 4.0.0-beta.0
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/164.min.js +1 -0
- package/README.md +41 -7
- package/browser/Core/Canvas.js +250 -143
- package/browser/Core/Container.js +80 -74
- package/browser/Core/Engine.js +44 -67
- package/browser/Core/Particle.js +202 -173
- package/browser/Core/Particles.js +187 -138
- package/browser/Core/Retina.js +5 -0
- package/browser/Core/Utils/Constants.js +2 -2
- package/browser/Core/Utils/EventListeners.js +67 -63
- package/browser/Core/Utils/Ranges.js +29 -10
- package/browser/Core/Utils/SpatialHashGrid.js +102 -0
- package/browser/Core/Utils/Vectors.js +17 -18
- package/browser/Enums/Types/EasingType.js +18 -3
- package/browser/Options/Classes/AnimatableColor.js +1 -0
- package/browser/Options/Classes/AnimationOptions.js +8 -0
- package/browser/Options/Classes/Background/Background.js +6 -0
- package/browser/Options/Classes/ColorAnimation.js +12 -1
- package/browser/Options/Classes/FullScreen/FullScreen.js +2 -0
- package/browser/Options/Classes/HslAnimation.js +4 -5
- package/browser/Options/Classes/Options.js +63 -4
- package/browser/Options/Classes/OptionsColor.js +1 -0
- package/browser/Options/Classes/Particles/Bounce/ParticlesBounce.js +2 -0
- package/browser/Options/Classes/Particles/Effect/Effect.js +3 -4
- package/browser/Options/Classes/Particles/Fill.js +28 -0
- package/browser/Options/Classes/Particles/Move/Move.js +17 -3
- package/browser/Options/Classes/Particles/Move/MoveAngle.js +2 -0
- package/browser/Options/Classes/Particles/Move/MoveCenter.js +4 -0
- package/browser/Options/Classes/Particles/Move/MoveGravity.js +4 -0
- package/browser/Options/Classes/Particles/Move/OutModes.js +5 -0
- package/browser/Options/Classes/Particles/Move/Path/MovePath.js +5 -0
- package/browser/Options/Classes/Particles/Move/Spin.js +3 -0
- package/browser/Options/Classes/Particles/Number/ParticlesDensity.js +3 -0
- package/browser/Options/Classes/Particles/Number/ParticlesNumber.js +3 -0
- package/browser/Options/Classes/Particles/Number/ParticlesNumberLimit.js +2 -0
- package/browser/Options/Classes/Particles/Opacity/Opacity.js +1 -0
- package/browser/Options/Classes/Particles/Opacity/OpacityAnimation.js +1 -0
- package/browser/Options/Classes/Particles/ParticlesOptions.js +25 -5
- package/browser/Options/Classes/Particles/Shape/Shape.js +3 -4
- package/browser/Options/Classes/Particles/Size/Size.js +1 -0
- package/browser/Options/Classes/Particles/Size/SizeAnimation.js +1 -0
- package/browser/Options/Classes/Particles/Stroke.js +3 -0
- package/browser/Options/Classes/Particles/ZIndex/ZIndex.js +3 -0
- package/browser/Options/Classes/ResizeEvent.js +2 -0
- package/browser/Options/Classes/ValueWithRandom.js +3 -4
- package/browser/Utils/CanvasUtils.js +43 -62
- package/browser/Utils/ColorUtils.js +30 -19
- package/browser/Utils/EventDispatcher.js +1 -0
- package/browser/Utils/MathUtils.js +12 -7
- package/browser/Utils/Utils.js +109 -31
- package/browser/exports.js +1 -2
- package/cjs/Core/Canvas.js +250 -143
- package/cjs/Core/Container.js +80 -74
- package/cjs/Core/Engine.js +44 -67
- package/cjs/Core/Particle.js +202 -173
- package/cjs/Core/Particles.js +187 -138
- package/cjs/Core/Retina.js +5 -0
- package/cjs/Core/Utils/Constants.js +2 -2
- package/cjs/Core/Utils/EventListeners.js +67 -63
- package/cjs/Core/Utils/Ranges.js +29 -10
- package/cjs/Core/Utils/SpatialHashGrid.js +102 -0
- package/cjs/Core/Utils/Vectors.js +17 -18
- package/cjs/Enums/Types/EasingType.js +18 -3
- package/cjs/Options/Classes/AnimatableColor.js +1 -0
- package/cjs/Options/Classes/AnimationOptions.js +8 -0
- package/cjs/Options/Classes/Background/Background.js +6 -0
- package/cjs/Options/Classes/ColorAnimation.js +12 -1
- package/cjs/Options/Classes/FullScreen/FullScreen.js +2 -0
- package/cjs/Options/Classes/HslAnimation.js +4 -5
- package/cjs/Options/Classes/Options.js +63 -4
- package/cjs/Options/Classes/OptionsColor.js +1 -0
- package/cjs/Options/Classes/Particles/Bounce/ParticlesBounce.js +2 -0
- package/cjs/Options/Classes/Particles/Effect/Effect.js +3 -4
- package/cjs/Options/Classes/Particles/Fill.js +28 -0
- package/cjs/Options/Classes/Particles/Move/Move.js +17 -3
- package/cjs/Options/Classes/Particles/Move/MoveAngle.js +2 -0
- package/cjs/Options/Classes/Particles/Move/MoveCenter.js +4 -0
- package/cjs/Options/Classes/Particles/Move/MoveGravity.js +4 -0
- package/cjs/Options/Classes/Particles/Move/OutModes.js +5 -0
- package/cjs/Options/Classes/Particles/Move/Path/MovePath.js +5 -0
- package/cjs/Options/Classes/Particles/Move/Spin.js +3 -0
- package/cjs/Options/Classes/Particles/Number/ParticlesDensity.js +3 -0
- package/cjs/Options/Classes/Particles/Number/ParticlesNumber.js +3 -0
- package/cjs/Options/Classes/Particles/Number/ParticlesNumberLimit.js +2 -0
- package/cjs/Options/Classes/Particles/Opacity/Opacity.js +1 -0
- package/cjs/Options/Classes/Particles/Opacity/OpacityAnimation.js +1 -0
- package/cjs/Options/Classes/Particles/ParticlesOptions.js +25 -5
- package/cjs/Options/Classes/Particles/Shape/Shape.js +3 -4
- package/cjs/Options/Classes/Particles/Size/Size.js +1 -0
- package/cjs/Options/Classes/Particles/Size/SizeAnimation.js +1 -0
- package/cjs/Options/Classes/Particles/Stroke.js +3 -0
- package/cjs/Options/Classes/Particles/ZIndex/ZIndex.js +3 -0
- package/cjs/Options/Classes/ResizeEvent.js +2 -0
- package/cjs/Options/Classes/ValueWithRandom.js +3 -4
- package/cjs/Utils/CanvasUtils.js +43 -62
- package/cjs/Utils/ColorUtils.js +30 -19
- package/cjs/Utils/EventDispatcher.js +1 -0
- package/cjs/Utils/MathUtils.js +12 -7
- package/cjs/Utils/Utils.js +109 -31
- package/cjs/exports.js +1 -2
- package/dist_browser_Core_Container_js.js +12 -12
- package/esm/Core/Canvas.js +250 -143
- package/esm/Core/Container.js +80 -74
- package/esm/Core/Engine.js +44 -67
- package/esm/Core/Particle.js +202 -173
- package/esm/Core/Particles.js +187 -138
- package/esm/Core/Retina.js +5 -0
- package/esm/Core/Utils/Constants.js +2 -2
- package/esm/Core/Utils/EventListeners.js +67 -63
- package/esm/Core/Utils/Ranges.js +29 -10
- package/esm/Core/Utils/SpatialHashGrid.js +102 -0
- package/esm/Core/Utils/Vectors.js +17 -18
- package/esm/Enums/Types/EasingType.js +18 -3
- package/esm/Options/Classes/AnimatableColor.js +1 -0
- package/esm/Options/Classes/AnimationOptions.js +8 -0
- package/esm/Options/Classes/Background/Background.js +6 -0
- package/esm/Options/Classes/ColorAnimation.js +12 -1
- package/esm/Options/Classes/FullScreen/FullScreen.js +2 -0
- package/esm/Options/Classes/HslAnimation.js +4 -5
- package/esm/Options/Classes/Options.js +63 -4
- package/esm/Options/Classes/OptionsColor.js +1 -0
- package/esm/Options/Classes/Particles/Bounce/ParticlesBounce.js +2 -0
- package/esm/Options/Classes/Particles/Effect/Effect.js +3 -4
- package/esm/Options/Classes/Particles/Fill.js +28 -0
- package/esm/Options/Classes/Particles/Move/Move.js +17 -3
- package/esm/Options/Classes/Particles/Move/MoveAngle.js +2 -0
- package/esm/Options/Classes/Particles/Move/MoveCenter.js +4 -0
- package/esm/Options/Classes/Particles/Move/MoveGravity.js +4 -0
- package/esm/Options/Classes/Particles/Move/OutModes.js +5 -0
- package/esm/Options/Classes/Particles/Move/Path/MovePath.js +5 -0
- package/esm/Options/Classes/Particles/Move/Spin.js +3 -0
- package/esm/Options/Classes/Particles/Number/ParticlesDensity.js +3 -0
- package/esm/Options/Classes/Particles/Number/ParticlesNumber.js +3 -0
- package/esm/Options/Classes/Particles/Number/ParticlesNumberLimit.js +2 -0
- package/esm/Options/Classes/Particles/Opacity/Opacity.js +1 -0
- package/esm/Options/Classes/Particles/Opacity/OpacityAnimation.js +1 -0
- package/esm/Options/Classes/Particles/ParticlesOptions.js +25 -5
- package/esm/Options/Classes/Particles/Shape/Shape.js +3 -4
- package/esm/Options/Classes/Particles/Size/Size.js +1 -0
- package/esm/Options/Classes/Particles/Size/SizeAnimation.js +1 -0
- package/esm/Options/Classes/Particles/Stroke.js +3 -0
- package/esm/Options/Classes/Particles/ZIndex/ZIndex.js +3 -0
- package/esm/Options/Classes/ResizeEvent.js +2 -0
- package/esm/Options/Classes/ValueWithRandom.js +3 -4
- package/esm/Utils/CanvasUtils.js +43 -62
- package/esm/Utils/ColorUtils.js +30 -19
- package/esm/Utils/EventDispatcher.js +1 -0
- package/esm/Utils/MathUtils.js +12 -7
- package/esm/Utils/Utils.js +109 -31
- package/esm/exports.js +1 -2
- package/package.json +1 -1
- package/report.html +3 -3
- package/scripts/install.js +4 -20
- package/tsparticles.engine.js +93 -91
- package/tsparticles.engine.min.js +2 -2
- package/types/Core/Canvas.d.ts +17 -4
- package/types/Core/Container.d.ts +3 -7
- package/types/Core/Engine.d.ts +13 -20
- package/types/Core/Interfaces/IColorManager.d.ts +0 -1
- package/types/Core/Interfaces/IContainerPlugin.d.ts +6 -1
- package/types/Core/Interfaces/IPalette.d.ts +7 -0
- package/types/Core/Interfaces/IParticleOpacityData.d.ts +1 -0
- package/types/Core/Interfaces/IParticleValueAnimation.d.ts +3 -3
- package/types/Core/Interfaces/IShapeDrawData.d.ts +8 -0
- package/types/Core/Interfaces/IShapeDrawer.d.ts +0 -1
- package/types/Core/Interfaces/IShapeValues.d.ts +0 -1
- package/types/Core/Particle.d.ts +4 -7
- package/types/Core/Particles.d.ts +15 -7
- package/types/Core/Utils/Constants.d.ts +2 -2
- package/types/Core/Utils/Ranges.d.ts +4 -1
- package/types/Core/Utils/SpatialHashGrid.d.ts +25 -0
- package/types/Core/Utils/Vectors.d.ts +8 -10
- package/types/Enums/Types/EasingType.d.ts +20 -5
- package/types/Options/Classes/ColorAnimation.d.ts +3 -1
- package/types/Options/Classes/HslAnimation.d.ts +3 -4
- package/types/Options/Classes/Options.d.ts +2 -0
- package/types/Options/Classes/Particles/Effect/Effect.d.ts +0 -1
- package/types/Options/Classes/Particles/Fill.d.ts +12 -0
- package/types/Options/Classes/Particles/Move/Move.d.ts +0 -2
- package/types/Options/Classes/Particles/ParticlesOptions.d.ts +2 -2
- package/types/Options/Classes/Particles/Shape/Shape.d.ts +0 -1
- package/types/Options/Classes/ValueWithRandom.d.ts +0 -1
- package/types/Options/Interfaces/IColorAnimation.d.ts +2 -0
- package/types/Options/Interfaces/IOptions.d.ts +1 -0
- package/types/Options/Interfaces/Particles/Effect/IEffect.d.ts +0 -1
- package/types/Options/Interfaces/Particles/IFill.d.ts +9 -0
- package/types/Options/Interfaces/Particles/IParticlesOptions.d.ts +2 -2
- package/types/Options/Interfaces/Particles/IStroke.d.ts +2 -2
- package/types/Options/Interfaces/Particles/Move/IMove.d.ts +0 -2
- package/types/Options/Interfaces/Particles/Shape/IShape.d.ts +0 -1
- package/types/Types/EngineInitializers.d.ts +6 -3
- package/types/Utils/CanvasUtils.d.ts +6 -14
- package/types/Utils/ColorUtils.d.ts +3 -2
- package/types/Utils/MathUtils.d.ts +2 -0
- package/types/Utils/Utils.d.ts +8 -1
- package/types/export-types.d.ts +3 -5
- package/types/exports.d.ts +1 -2
- package/umd/Core/Canvas.js +248 -141
- package/umd/Core/Container.js +80 -74
- package/umd/Core/Engine.js +43 -66
- package/umd/Core/Particle.js +203 -174
- package/umd/Core/Particles.js +187 -138
- package/umd/Core/Retina.js +5 -0
- package/umd/Core/Utils/Constants.js +3 -3
- package/umd/Core/Utils/EventListeners.js +67 -63
- package/umd/Core/Utils/Ranges.js +28 -9
- package/umd/Core/Utils/SpatialHashGrid.js +116 -0
- package/umd/Core/Utils/Vectors.js +17 -18
- package/umd/Enums/Types/EasingType.js +18 -3
- package/umd/Options/Classes/AnimatableColor.js +1 -0
- package/umd/Options/Classes/AnimationOptions.js +8 -0
- package/umd/Options/Classes/Background/Background.js +6 -0
- package/umd/Options/Classes/ColorAnimation.js +12 -1
- package/umd/Options/Classes/FullScreen/FullScreen.js +2 -0
- package/umd/Options/Classes/HslAnimation.js +5 -6
- package/umd/Options/Classes/Options.js +63 -4
- package/umd/Options/Classes/OptionsColor.js +1 -0
- package/umd/Options/Classes/Particles/Bounce/ParticlesBounce.js +2 -0
- package/umd/Options/Classes/Particles/Effect/Effect.js +3 -4
- package/umd/Options/Classes/Particles/Fill.js +42 -0
- package/umd/Options/Classes/Particles/Move/Move.js +18 -4
- package/umd/Options/Classes/Particles/Move/MoveAngle.js +2 -0
- package/umd/Options/Classes/Particles/Move/MoveCenter.js +4 -0
- package/umd/Options/Classes/Particles/Move/MoveGravity.js +4 -0
- package/umd/Options/Classes/Particles/Move/OutModes.js +5 -0
- package/umd/Options/Classes/Particles/Move/Path/MovePath.js +5 -0
- package/umd/Options/Classes/Particles/Move/Spin.js +3 -0
- package/umd/Options/Classes/Particles/Number/ParticlesDensity.js +3 -0
- package/umd/Options/Classes/Particles/Number/ParticlesNumber.js +3 -0
- package/umd/Options/Classes/Particles/Number/ParticlesNumberLimit.js +2 -0
- package/umd/Options/Classes/Particles/Opacity/Opacity.js +1 -0
- package/umd/Options/Classes/Particles/Opacity/OpacityAnimation.js +1 -0
- package/umd/Options/Classes/Particles/ParticlesOptions.js +26 -6
- package/umd/Options/Classes/Particles/Shape/Shape.js +3 -4
- package/umd/Options/Classes/Particles/Size/Size.js +1 -0
- package/umd/Options/Classes/Particles/Size/SizeAnimation.js +1 -0
- package/umd/Options/Classes/Particles/Stroke.js +3 -0
- package/umd/Options/Classes/Particles/ZIndex/ZIndex.js +3 -0
- package/umd/Options/Classes/ResizeEvent.js +2 -0
- package/umd/Options/Classes/ValueWithRandom.js +3 -4
- package/umd/Utils/CanvasUtils.js +43 -66
- package/umd/Utils/ColorUtils.js +30 -18
- package/umd/Utils/EventDispatcher.js +1 -0
- package/umd/Utils/MathUtils.js +14 -7
- package/umd/Utils/Utils.js +111 -32
- package/umd/exports.js +2 -3
- package/794.min.js +0 -2
- package/794.min.js.LICENSE.txt +0 -1
- package/browser/Core/Utils/Point.js +0 -6
- package/browser/Core/Utils/QuadTree.js +0 -59
- package/browser/Options/Classes/Particles/Move/MoveAttract.js +0 -33
- package/cjs/Core/Utils/Point.js +0 -6
- package/cjs/Core/Utils/QuadTree.js +0 -59
- package/cjs/Options/Classes/Particles/Move/MoveAttract.js +0 -33
- package/esm/Core/Interfaces/IMovePathGenerator.js +0 -1
- package/esm/Core/Interfaces/IParticleMover.js +0 -1
- package/esm/Core/Utils/Point.js +0 -6
- package/esm/Core/Utils/QuadTree.js +0 -59
- package/esm/Options/Classes/Particles/Move/MoveAttract.js +0 -33
- package/esm/Options/Interfaces/Particles/Move/IMoveAttract.js +0 -1
- package/tsparticles.engine.min.js.LICENSE.txt +0 -1
- package/types/Core/Interfaces/IMovePathGenerator.d.ts +0 -10
- package/types/Core/Interfaces/IParticleMover.d.ts +0 -7
- package/types/Core/Utils/Point.d.ts +0 -7
- package/types/Core/Utils/QuadTree.d.ts +0 -18
- package/types/Options/Classes/Particles/Move/MoveAttract.d.ts +0 -12
- package/types/Options/Interfaces/Particles/Move/IMoveAttract.d.ts +0 -7
- package/umd/Core/Utils/Point.js +0 -20
- package/umd/Core/Utils/QuadTree.js +0 -73
- package/umd/Options/Classes/Particles/Move/MoveAttract.js +0 -47
- package/umd/Options/Interfaces/Particles/Move/IMoveAttract.js +0 -12
- /package/browser/Core/Interfaces/{IMovePathGenerator.js → IPalette.js} +0 -0
- /package/browser/{Core/Interfaces/IParticleMover.js → Options/Interfaces/Particles/IFill.js} +0 -0
- /package/{browser/Options/Interfaces/Particles/Move/IMoveAttract.js → cjs/Core/Interfaces/IPalette.js} +0 -0
- /package/cjs/{Core/Interfaces/IMovePathGenerator.js → Options/Interfaces/Particles/IFill.js} +0 -0
- /package/{cjs/Core/Interfaces/IParticleMover.js → esm/Core/Interfaces/IPalette.js} +0 -0
- /package/{cjs/Options/Interfaces/Particles/Move/IMoveAttract.js → esm/Options/Interfaces/Particles/IFill.js} +0 -0
- /package/umd/Core/Interfaces/{IMovePathGenerator.js → IPalette.js} +0 -0
- /package/umd/{Core/Interfaces/IParticleMover.js → Options/Interfaces/Particles/IFill.js} +0 -0
|
@@ -1,29 +1,38 @@
|
|
|
1
1
|
import type { Container } from "./Container.js";
|
|
2
2
|
import type { Engine } from "./Engine.js";
|
|
3
|
+
import type { IContainerPlugin } from "./Interfaces/IContainerPlugin.js";
|
|
3
4
|
import type { ICoordinates } from "./Interfaces/ICoordinates.js";
|
|
4
5
|
import type { IDelta } from "./Interfaces/IDelta.js";
|
|
5
6
|
import type { IDimension } from "./Interfaces/IDimension.js";
|
|
6
|
-
import type {
|
|
7
|
+
import type { IEffectDrawer } from "./Interfaces/IEffectDrawer.js";
|
|
7
8
|
import type { IParticleUpdater } from "./Interfaces/IParticleUpdater.js";
|
|
8
9
|
import type { IParticlesOptions } from "../Options/Interfaces/Particles/IParticlesOptions.js";
|
|
10
|
+
import type { IShapeDrawer } from "./Interfaces/IShapeDrawer.js";
|
|
9
11
|
import { Particle } from "./Particle.js";
|
|
10
|
-
import { QuadTree } from "./Utils/QuadTree.js";
|
|
11
12
|
import type { RecursivePartial } from "../Types/RecursivePartial.js";
|
|
13
|
+
import { SpatialHashGrid } from "./Utils/SpatialHashGrid.js";
|
|
12
14
|
export declare class Particles {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
+
checkParticlePositionPlugins: IContainerPlugin[];
|
|
16
|
+
effectDrawers: Map<string, IEffectDrawer>;
|
|
17
|
+
grid: SpatialHashGrid;
|
|
18
|
+
shapeDrawers: Map<string, IShapeDrawer>;
|
|
15
19
|
updaters: IParticleUpdater[];
|
|
16
20
|
private _array;
|
|
17
21
|
private readonly _container;
|
|
18
22
|
private readonly _engine;
|
|
19
23
|
private readonly _groupLimits;
|
|
20
|
-
private _lastZIndex;
|
|
21
24
|
private _limit;
|
|
25
|
+
private _maxZIndex;
|
|
26
|
+
private _minZIndex;
|
|
22
27
|
private _needsSort;
|
|
23
28
|
private _nextId;
|
|
24
|
-
private
|
|
29
|
+
private _particleResetPlugins;
|
|
30
|
+
private _particleUpdatePlugins;
|
|
25
31
|
private readonly _pool;
|
|
32
|
+
private _postParticleUpdatePlugins;
|
|
33
|
+
private _postUpdatePlugins;
|
|
26
34
|
private _resizeFactor?;
|
|
35
|
+
private _updatePlugins;
|
|
27
36
|
private _zArray;
|
|
28
37
|
constructor(engine: Engine, container: Container);
|
|
29
38
|
get count(): number;
|
|
@@ -48,6 +57,5 @@ export declare class Particles {
|
|
|
48
57
|
private readonly _addToPool;
|
|
49
58
|
private readonly _applyDensity;
|
|
50
59
|
private readonly _initDensityFactor;
|
|
51
|
-
private readonly _pushParticle;
|
|
52
60
|
private readonly _removeParticle;
|
|
53
61
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ICoordinates3d } from "../Interfaces/ICoordinates.js";
|
|
2
|
-
export declare const generatedAttribute = "generated", resizeEvent = "resize", visibilityChangeEvent = "visibilitychange", percentDenominator = 100, half = 0.5, millisecondsToSeconds = 1000, originPoint: ICoordinates3d, defaultTransform: {
|
|
2
|
+
export declare const generatedAttribute = "generated", defaultCompositeValue: GlobalCompositeOperation, resizeEvent = "resize", visibilityChangeEvent = "visibilitychange", percentDenominator = 100, half = 0.5, millisecondsToSeconds = 1000, originPoint: ICoordinates3d, defaultTransform: {
|
|
3
3
|
a: number;
|
|
4
4
|
b: number;
|
|
5
5
|
c: number;
|
|
6
6
|
d: number;
|
|
7
|
-
}, randomColorValue = "random", midColorValue = "mid", double = 2, doublePI: number, defaultFps = 60, defaultAlpha = 1, generatedTrue = "true", generatedFalse = "false", canvasTag = "canvas", defaultRetryCount = 0, squareExp = 2,
|
|
7
|
+
}, randomColorValue = "random", midColorValue = "mid", double = 2, doublePI: number, defaultFps = 60, defaultAlpha = 1, generatedTrue = "true", generatedFalse = "false", canvasTag = "canvas", defaultRetryCount = 0, squareExp = 2, spatialHashGridCellSize = 100, defaultRemoveQuantity = 1, defaultRatio = 1, defaultReduceFactor = 1, inverseFactorNumerator = 1, rgbMax = 255, hMax = 360, sMax = 100, lMax = 100, hMin = 0, sMin = 0, hPhase = 60, empty = 0, quarter = 0.25, threeQuarter: number, minVelocity = 0, defaultTransformValue = 1, minimumSize = 0, zIndexFactorOffset = 1, defaultOpacity = 1, removeDeleteCount = 1, removeMinIndex = 0, defaultFpsLimit = 120, minFpsLimit = 0, canvasFirstIndex = 0, loadRandomFactor = 10000, loadMinIndex = 0, one = 1, none = 0, decayOffset = 1, tryCountIncrement = 1, minZ = 0, minLimit = 0, countOffset = 1, minCount = 0, minIndex = 0, lengthOffset = 1, defaultDensityFactor = 1, deleteCount = 1, defaultAngle = 0, identity = 1, minStrokeWidth = 0, lFactor = 1, lMin = 0, triple = 3, sextuple = 6, sNormalizedOffset = 1, phaseNumerator = 1, defaultRgbMin = 0, defaultVelocity = 0, defaultLoops = 0, defaultTime = 0, defaultZoom = 1;
|
|
@@ -4,18 +4,21 @@ export declare abstract class BaseRange {
|
|
|
4
4
|
readonly position: ICoordinates;
|
|
5
5
|
readonly type: string;
|
|
6
6
|
protected constructor(x: number, y: number, type: string);
|
|
7
|
+
protected _resetPosition(x: number, y: number): void;
|
|
7
8
|
abstract contains(point: ICoordinates): boolean;
|
|
8
9
|
abstract intersects(range: BaseRange): boolean;
|
|
9
10
|
}
|
|
10
11
|
export declare class Circle extends BaseRange {
|
|
11
|
-
|
|
12
|
+
radius: number;
|
|
12
13
|
constructor(x: number, y: number, radius: number);
|
|
13
14
|
contains(point: ICoordinates): boolean;
|
|
14
15
|
intersects(range: BaseRange): boolean;
|
|
16
|
+
reset(x: number, y: number, radius: number): this;
|
|
15
17
|
}
|
|
16
18
|
export declare class Rectangle extends BaseRange {
|
|
17
19
|
readonly size: IDimension;
|
|
18
20
|
constructor(x: number, y: number, width: number, height: number);
|
|
19
21
|
contains(point: ICoordinates): boolean;
|
|
20
22
|
intersects(range: BaseRange): boolean;
|
|
23
|
+
reset(x: number, y: number, width: number, height: number): this;
|
|
21
24
|
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { type BaseRange } from "./Ranges.js";
|
|
2
|
+
import type { ICoordinates } from "../Interfaces/ICoordinates.js";
|
|
3
|
+
import type { IDimension } from "../Interfaces/IDimension.js";
|
|
4
|
+
import type { Particle } from "../Particle.js";
|
|
5
|
+
export declare class SpatialHashGrid {
|
|
6
|
+
private _cellSize;
|
|
7
|
+
private readonly _cells;
|
|
8
|
+
private readonly _circlePool;
|
|
9
|
+
private _circlePoolIdx;
|
|
10
|
+
private _pendingCellSize?;
|
|
11
|
+
private readonly _rectanglePool;
|
|
12
|
+
private _rectanglePoolIdx;
|
|
13
|
+
constructor(cellSize: number);
|
|
14
|
+
clear(): void;
|
|
15
|
+
insert(particle: Particle): void;
|
|
16
|
+
query(range: BaseRange, check?: (particle: Particle) => boolean, out?: Particle[]): Particle[];
|
|
17
|
+
queryCircle(position: ICoordinates, radius: number, check?: (particle: Particle) => boolean, out?: Particle[]): Particle[];
|
|
18
|
+
queryRectangle(position: ICoordinates, size: IDimension, check?: (particle: Particle) => boolean, out?: Particle[]): Particle[];
|
|
19
|
+
setCellSize(cellSize: number): void;
|
|
20
|
+
private _acquireCircle;
|
|
21
|
+
private _acquireRectangle;
|
|
22
|
+
private _cellKeyFromCoords;
|
|
23
|
+
private _getRangeBounds;
|
|
24
|
+
private _releaseShapes;
|
|
25
|
+
}
|
|
@@ -9,13 +9,11 @@ export declare class Vector3d implements ICoordinates3d {
|
|
|
9
9
|
set angle(angle: number);
|
|
10
10
|
get length(): number;
|
|
11
11
|
set length(length: number);
|
|
12
|
-
static clone(source:
|
|
12
|
+
static clone(source: ICoordinates | ICoordinates3d): Vector3d;
|
|
13
13
|
static create(x: number | ICoordinates | ICoordinates3d, y?: number, z?: number): Vector3d;
|
|
14
|
-
add(v:
|
|
15
|
-
addTo(v:
|
|
14
|
+
add(v: ICoordinates | ICoordinates3d): Vector3d;
|
|
15
|
+
addTo(v: ICoordinates | ICoordinates3d): void;
|
|
16
16
|
copy(): Vector3d;
|
|
17
|
-
distanceTo(v: Vector3d): number;
|
|
18
|
-
distanceToSq(v: Vector3d): number;
|
|
19
17
|
div(n: number): Vector3d;
|
|
20
18
|
divTo(n: number): void;
|
|
21
19
|
getLengthSq(): number;
|
|
@@ -23,14 +21,14 @@ export declare class Vector3d implements ICoordinates3d {
|
|
|
23
21
|
multTo(n: number): void;
|
|
24
22
|
normalize(): void;
|
|
25
23
|
rotate(angle: number): Vector3d;
|
|
26
|
-
setTo(c: ICoordinates): void;
|
|
27
|
-
sub(v:
|
|
28
|
-
subFrom(v:
|
|
29
|
-
private
|
|
24
|
+
setTo(c: ICoordinates | ICoordinates3d): void;
|
|
25
|
+
sub(v: ICoordinates | ICoordinates3d): Vector3d;
|
|
26
|
+
subFrom(v: ICoordinates | ICoordinates3d): void;
|
|
27
|
+
private _updateFromAngle;
|
|
30
28
|
}
|
|
31
29
|
export declare class Vector extends Vector3d {
|
|
32
30
|
protected constructor(x?: number, y?: number);
|
|
33
31
|
static get origin(): Vector;
|
|
34
|
-
static clone(source:
|
|
32
|
+
static clone(source: ICoordinates): Vector;
|
|
35
33
|
static create(x: number | ICoordinates, y?: number): Vector;
|
|
36
34
|
}
|
|
@@ -1,30 +1,45 @@
|
|
|
1
1
|
export declare enum EasingType {
|
|
2
2
|
easeInBack = "ease-in-back",
|
|
3
|
+
easeInBounce = "ease-in-bounce",
|
|
3
4
|
easeInCirc = "ease-in-circ",
|
|
4
5
|
easeInCubic = "ease-in-cubic",
|
|
6
|
+
easeInElastic = "ease-in-elastic",
|
|
7
|
+
easeInExpo = "ease-in-expo",
|
|
8
|
+
easeInGaussian = "ease-in-gaussian",
|
|
5
9
|
easeInLinear = "ease-in-linear",
|
|
6
10
|
easeInQuad = "ease-in-quad",
|
|
7
11
|
easeInQuart = "ease-in-quart",
|
|
8
12
|
easeInQuint = "ease-in-quint",
|
|
9
|
-
|
|
13
|
+
easeInSigmoid = "ease-in-sigmoid",
|
|
10
14
|
easeInSine = "ease-in-sine",
|
|
15
|
+
easeInSmoothstep = "ease-in-smoothstep",
|
|
11
16
|
easeOutBack = "ease-out-back",
|
|
17
|
+
easeOutBounce = "ease-out-bounce",
|
|
12
18
|
easeOutCirc = "ease-out-circ",
|
|
13
19
|
easeOutCubic = "ease-out-cubic",
|
|
20
|
+
easeOutElastic = "ease-out-elastic",
|
|
21
|
+
easeOutExpo = "ease-out-expo",
|
|
22
|
+
easeOutGaussian = "ease-out-gaussian",
|
|
14
23
|
easeOutLinear = "ease-out-linear",
|
|
15
24
|
easeOutQuad = "ease-out-quad",
|
|
16
25
|
easeOutQuart = "ease-out-quart",
|
|
17
26
|
easeOutQuint = "ease-out-quint",
|
|
18
|
-
|
|
27
|
+
easeOutSigmoid = "ease-out-sigmoid",
|
|
19
28
|
easeOutSine = "ease-out-sine",
|
|
29
|
+
easeOutSmoothstep = "ease-out-smoothstep",
|
|
20
30
|
easeInOutBack = "ease-in-out-back",
|
|
31
|
+
easeInOutBounce = "ease-in-out-bounce",
|
|
21
32
|
easeInOutCirc = "ease-in-out-circ",
|
|
22
33
|
easeInOutCubic = "ease-in-out-cubic",
|
|
34
|
+
easeInOutElastic = "ease-in-out-elastic",
|
|
35
|
+
easeInOutExpo = "ease-in-out-expo",
|
|
36
|
+
easeInOutGaussian = "ease-in-out-gaussian",
|
|
23
37
|
easeInOutLinear = "ease-in-out-linear",
|
|
24
38
|
easeInOutQuad = "ease-in-out-quad",
|
|
25
39
|
easeInOutQuart = "ease-in-out-quart",
|
|
26
40
|
easeInOutQuint = "ease-in-out-quint",
|
|
27
|
-
|
|
28
|
-
easeInOutSine = "ease-in-out-sine"
|
|
41
|
+
easeInOutSigmoid = "ease-in-out-sigmoid",
|
|
42
|
+
easeInOutSine = "ease-in-out-sine",
|
|
43
|
+
easeInOutSmoothstep = "ease-in-out-smoothstep"
|
|
29
44
|
}
|
|
30
|
-
export type EasingTypeAlt = "ease-in-back" | "ease-out-back" | "ease-in-out-back" | "ease-in-circ" | "ease-out-circ" | "ease-in-out-circ" | "ease-in-cubic" | "ease-out-cubic" | "ease-in-out-cubic" | "ease-in-quad" | "ease-out-quad" | "ease-in-out-quad" | "ease-in-quart" | "ease-out-quart" | "ease-in-out-quart" | "ease-in-quint" | "ease-out-quint" | "ease-in-out-quint" | "ease-in-
|
|
45
|
+
export type EasingTypeAlt = "ease-in-back" | "ease-out-back" | "ease-in-out-back" | "ease-in-bounce" | "ease-out-bounce" | "ease-in-out-bounce" | "ease-in-circ" | "ease-out-circ" | "ease-in-out-circ" | "ease-in-cubic" | "ease-out-cubic" | "ease-in-out-cubic" | "ease-in-elastic" | "ease-out-elastic" | "ease-in-out-elastic" | "ease-in-expo" | "ease-out-expo" | "ease-in-out-expo" | "ease-in-gaussian" | "ease-out-gaussian" | "ease-in-out-gaussian" | "ease-in-linear" | "ease-out-linear" | "ease-in-out-linear" | "ease-in-quad" | "ease-out-quad" | "ease-in-out-quad" | "ease-in-quart" | "ease-out-quart" | "ease-in-out-quart" | "ease-in-quint" | "ease-out-quint" | "ease-in-out-quint" | "ease-in-sigmoid" | "ease-out-sigmoid" | "ease-in-out-sigmoid" | "ease-in-sine" | "ease-out-sine" | "ease-in-out-sine" | "ease-in-smoothstep" | "ease-out-smoothstep" | "ease-in-out-smoothstep";
|
|
@@ -4,7 +4,9 @@ import type { IOptionLoader } from "../Interfaces/IOptionLoader.js";
|
|
|
4
4
|
import type { RangeValue } from "../../Types/RangeValue.js";
|
|
5
5
|
import type { RecursivePartial } from "../../Types/RecursivePartial.js";
|
|
6
6
|
export declare class ColorAnimation extends AnimationOptions implements IColorAnimation, IOptionLoader<IColorAnimation> {
|
|
7
|
+
max: number;
|
|
8
|
+
min: number;
|
|
7
9
|
offset: RangeValue;
|
|
8
|
-
constructor();
|
|
10
|
+
constructor(min: number, max: number);
|
|
9
11
|
load(data?: RecursivePartial<IColorAnimation>): void;
|
|
10
12
|
}
|
|
@@ -3,9 +3,8 @@ import type { IHslAnimation } from "../Interfaces/IHslAnimation.js";
|
|
|
3
3
|
import type { IOptionLoader } from "../Interfaces/IOptionLoader.js";
|
|
4
4
|
import type { RecursivePartial } from "../../Types/RecursivePartial.js";
|
|
5
5
|
export declare class HslAnimation implements IHslAnimation, IOptionLoader<IHslAnimation> {
|
|
6
|
-
h: ColorAnimation;
|
|
7
|
-
l: ColorAnimation;
|
|
8
|
-
s: ColorAnimation;
|
|
9
|
-
constructor();
|
|
6
|
+
readonly h: ColorAnimation;
|
|
7
|
+
readonly l: ColorAnimation;
|
|
8
|
+
readonly s: ColorAnimation;
|
|
10
9
|
load(data?: RecursivePartial<IHslAnimation>): void;
|
|
11
10
|
}
|
|
@@ -27,6 +27,7 @@ export declare class Options implements IOptions, IOptionLoader<IOptions> {
|
|
|
27
27
|
hdr: boolean;
|
|
28
28
|
key?: string;
|
|
29
29
|
name?: string;
|
|
30
|
+
palette?: string;
|
|
30
31
|
readonly particles: import("./Particles/ParticlesOptions.js").ParticlesOptions;
|
|
31
32
|
pauseOnBlur: boolean;
|
|
32
33
|
pauseOnOutsideViewport: boolean;
|
|
@@ -39,6 +40,7 @@ export declare class Options implements IOptions, IOptionLoader<IOptions> {
|
|
|
39
40
|
private readonly _engine;
|
|
40
41
|
constructor(engine: Engine, container: Container);
|
|
41
42
|
load(data?: ISourceOptions): void;
|
|
43
|
+
private readonly _importPalette;
|
|
42
44
|
private readonly _importPreset;
|
|
43
45
|
}
|
|
44
46
|
export {};
|
|
@@ -5,7 +5,6 @@ import type { ShapeData } from "../../../../Types/ShapeData.js";
|
|
|
5
5
|
import type { SingleOrMultiple } from "../../../../Types/SingleOrMultiple.js";
|
|
6
6
|
export declare class Effect implements IEffect, IOptionLoader<IEffect> {
|
|
7
7
|
close: boolean;
|
|
8
|
-
fill: boolean;
|
|
9
8
|
options: ShapeData;
|
|
10
9
|
type: SingleOrMultiple<string>;
|
|
11
10
|
constructor();
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { AnimatableColor } from "../AnimatableColor.js";
|
|
2
|
+
import type { IFill } from "../../Interfaces/Particles/IFill.js";
|
|
3
|
+
import type { IOptionLoader } from "../../Interfaces/IOptionLoader.js";
|
|
4
|
+
import type { RangeValue } from "../../../Types/RangeValue.js";
|
|
5
|
+
import type { RecursivePartial } from "../../../Types/RecursivePartial.js";
|
|
6
|
+
export declare class Fill implements IFill, IOptionLoader<IFill> {
|
|
7
|
+
color: AnimatableColor;
|
|
8
|
+
enable: boolean;
|
|
9
|
+
opacity: RangeValue;
|
|
10
|
+
constructor();
|
|
11
|
+
load(data?: RecursivePartial<IFill>): void;
|
|
12
|
+
}
|
|
@@ -3,7 +3,6 @@ import type { IDistance } from "../../../../Core/Interfaces/IDistance.js";
|
|
|
3
3
|
import type { IMove } from "../../../Interfaces/Particles/Move/IMove.js";
|
|
4
4
|
import type { IOptionLoader } from "../../../Interfaces/IOptionLoader.js";
|
|
5
5
|
import { MoveAngle } from "./MoveAngle.js";
|
|
6
|
-
import { MoveAttract } from "./MoveAttract.js";
|
|
7
6
|
import { MoveCenter } from "./MoveCenter.js";
|
|
8
7
|
import { MoveGravity } from "./MoveGravity.js";
|
|
9
8
|
import { MovePath } from "./Path/MovePath.js";
|
|
@@ -13,7 +12,6 @@ import type { RecursivePartial } from "../../../../Types/RecursivePartial.js";
|
|
|
13
12
|
import { Spin } from "./Spin.js";
|
|
14
13
|
export declare class Move implements IMove, IOptionLoader<IMove> {
|
|
15
14
|
readonly angle: MoveAngle;
|
|
16
|
-
readonly attract: MoveAttract;
|
|
17
15
|
readonly center: MoveCenter;
|
|
18
16
|
decay: RangeValue;
|
|
19
17
|
direction: MoveDirection | keyof typeof MoveDirection | MoveDirectionAlt | number;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { AnimatableColor } from "../AnimatableColor.js";
|
|
2
1
|
import type { Container } from "../../../Core/Container.js";
|
|
3
2
|
import { Effect } from "./Effect/Effect.js";
|
|
4
3
|
import type { Engine } from "../../../Core/Engine.js";
|
|
4
|
+
import { Fill } from "./Fill.js";
|
|
5
5
|
import type { IOptionLoader } from "../../Interfaces/IOptionLoader.js";
|
|
6
6
|
import type { IParticlesOptions } from "../../Interfaces/Particles/IParticlesOptions.js";
|
|
7
7
|
import { Move } from "./Move/Move.js";
|
|
@@ -18,8 +18,8 @@ import { ZIndex } from "./ZIndex/ZIndex.js";
|
|
|
18
18
|
export declare class ParticlesOptions implements IParticlesOptions, IOptionLoader<IParticlesOptions> {
|
|
19
19
|
[name: string]: unknown;
|
|
20
20
|
readonly bounce: ParticlesBounce;
|
|
21
|
-
color: AnimatableColor;
|
|
22
21
|
readonly effect: Effect;
|
|
22
|
+
fill: SingleOrMultiple<Fill>;
|
|
23
23
|
readonly groups: ParticlesGroups;
|
|
24
24
|
readonly move: Move;
|
|
25
25
|
readonly number: ParticlesNumber;
|
|
@@ -5,7 +5,6 @@ import type { ShapeData } from "../../../../Types/ShapeData.js";
|
|
|
5
5
|
import type { SingleOrMultiple } from "../../../../Types/SingleOrMultiple.js";
|
|
6
6
|
export declare class Shape implements IShape, IOptionLoader<IShape> {
|
|
7
7
|
close: boolean;
|
|
8
|
-
fill: boolean;
|
|
9
8
|
options: ShapeData;
|
|
10
9
|
type: SingleOrMultiple<string>;
|
|
11
10
|
constructor();
|
|
@@ -10,7 +10,6 @@ export declare class ValueWithRandom implements IValueWithRandom, IOptionLoader<
|
|
|
10
10
|
}
|
|
11
11
|
export declare class AnimationValueWithRandom extends ValueWithRandom implements IOptionLoader<IAnimationValueWithRandom> {
|
|
12
12
|
readonly animation: AnimationOptions;
|
|
13
|
-
constructor();
|
|
14
13
|
load(data?: RecursivePartial<IAnimationValueWithRandom>): void;
|
|
15
14
|
}
|
|
16
15
|
export declare class RangedAnimationValueWithRandom extends AnimationValueWithRandom implements IOptionLoader<IRangedAnimationValueWithRandom> {
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { IAnimatableColor } from "../IAnimatableColor.js";
|
|
2
|
+
import type { IRangeColor } from "../../../Core/Interfaces/Colors.js";
|
|
3
|
+
import type { RangeValue } from "../../../Types/RangeValue.js";
|
|
4
|
+
import type { RecursivePartial } from "../../../Types/RecursivePartial.js";
|
|
5
|
+
export interface IFill {
|
|
6
|
+
color?: RecursivePartial<IAnimatableColor> | RecursivePartial<IRangeColor>;
|
|
7
|
+
enable: boolean;
|
|
8
|
+
opacity?: RangeValue;
|
|
9
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { IAnimatableColor } from "../IAnimatableColor.js";
|
|
2
1
|
import type { IEffect } from "./Effect/IEffect.js";
|
|
2
|
+
import type { IFill } from "./IFill.js";
|
|
3
3
|
import type { IMove } from "./Move/IMove.js";
|
|
4
4
|
import type { IOpacity } from "./Opacity/IOpacity.js";
|
|
5
5
|
import type { IParticlesBounce } from "./Bounce/IParticlesBounce.js";
|
|
@@ -13,8 +13,8 @@ import type { SingleOrMultiple } from "../../../Types/SingleOrMultiple.js";
|
|
|
13
13
|
export interface IParticlesOptions {
|
|
14
14
|
[name: string]: unknown;
|
|
15
15
|
bounce: IParticlesBounce;
|
|
16
|
-
color: IAnimatableColor;
|
|
17
16
|
effect: IEffect;
|
|
17
|
+
fill: SingleOrMultiple<IFill>;
|
|
18
18
|
groups: ParticlesGroups;
|
|
19
19
|
move: IMove;
|
|
20
20
|
number: IParticlesNumber;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { IAnimatableColor } from "../IAnimatableColor.js";
|
|
2
|
-
import type {
|
|
2
|
+
import type { IRangeColor } from "../../../Core/Interfaces/Colors.js";
|
|
3
3
|
import type { RangeValue } from "../../../Types/RangeValue.js";
|
|
4
4
|
import type { RecursivePartial } from "../../../Types/RecursivePartial.js";
|
|
5
5
|
export interface IStroke {
|
|
6
|
-
color?:
|
|
6
|
+
color?: RecursivePartial<IAnimatableColor> | RecursivePartial<IRangeColor>;
|
|
7
7
|
opacity?: RangeValue;
|
|
8
8
|
width: RangeValue;
|
|
9
9
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { MoveDirection, MoveDirectionAlt } from "../../../../Enums/Directions/MoveDirection.js";
|
|
2
2
|
import type { IDistance } from "../../../../Core/Interfaces/IDistance.js";
|
|
3
3
|
import type { IMoveAngle } from "./IMoveAngle.js";
|
|
4
|
-
import type { IMoveAttract } from "./IMoveAttract.js";
|
|
5
4
|
import type { IMoveCenter } from "./IMoveCenter.js";
|
|
6
5
|
import type { IMoveGravity } from "./IMoveGravity.js";
|
|
7
6
|
import type { IMovePath } from "./Path/IMovePath.js";
|
|
@@ -11,7 +10,6 @@ import type { OutMode } from "../../../../Enums/Modes/OutMode.js";
|
|
|
11
10
|
import type { RangeValue } from "../../../../Types/RangeValue.js";
|
|
12
11
|
export interface IMove {
|
|
13
12
|
angle: number | IMoveAngle;
|
|
14
|
-
attract: IMoveAttract;
|
|
15
13
|
center: IMoveCenter;
|
|
16
14
|
decay: RangeValue;
|
|
17
15
|
direction: MoveDirection | keyof typeof MoveDirection | MoveDirectionAlt | number;
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import type { Container } from "../Core/Container.js";
|
|
2
|
-
import type {
|
|
2
|
+
import type { IEffectDrawer } from "../Core/Interfaces/IEffectDrawer.js";
|
|
3
3
|
import type { IParticleUpdater } from "../Core/Interfaces/IParticleUpdater.js";
|
|
4
|
+
import type { IShapeDrawer } from "../Core/Interfaces/IShapeDrawer.js";
|
|
4
5
|
export type GenericInitializer<T> = (container: Container) => Promise<T>;
|
|
5
|
-
export type
|
|
6
|
+
export type EffectInitializer = GenericInitializer<IEffectDrawer>;
|
|
7
|
+
export type ShapeInitializer = GenericInitializer<IShapeDrawer>;
|
|
6
8
|
export type UpdaterInitializer = GenericInitializer<IParticleUpdater>;
|
|
7
9
|
export interface Initializers {
|
|
8
|
-
|
|
10
|
+
effects: Map<string, EffectInitializer>;
|
|
11
|
+
shapes: Map<string, ShapeInitializer>;
|
|
9
12
|
updaters: Map<string, UpdaterInitializer>;
|
|
10
13
|
}
|
|
@@ -1,24 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import type { Container } from "../Core/Container.js";
|
|
1
|
+
import type { IEffectDrawer, IShapeDrawData, IShapeDrawer } from "../export-types.js";
|
|
3
2
|
import type { IContainerPlugin } from "../Core/Interfaces/IContainerPlugin.js";
|
|
4
|
-
import type { ICoordinates } from "../Core/Interfaces/ICoordinates.js";
|
|
5
3
|
import type { IDelta } from "../Core/Interfaces/IDelta.js";
|
|
6
4
|
import type { IDimension } from "../Core/Interfaces/IDimension.js";
|
|
7
5
|
import type { IDrawParticleParams } from "../Core/Interfaces/IDrawParticleParams.js";
|
|
8
|
-
import type { IHsl } from "../Core/Interfaces/Colors.js";
|
|
9
|
-
import type { IShapeDrawData } from "../export-types.js";
|
|
10
6
|
import type { Particle } from "../Core/Particle.js";
|
|
11
|
-
export declare function clearDrawPlugin(context: CanvasRenderingContext2D, plugin: IContainerPlugin, delta: IDelta): void;
|
|
12
|
-
export declare function drawLine(context: CanvasRenderingContext2D, begin: ICoordinates, end: ICoordinates): void;
|
|
13
7
|
export declare function paintBase(context: CanvasRenderingContext2D, dimension: IDimension, baseColor?: string): void;
|
|
14
8
|
export declare function paintImage(context: CanvasRenderingContext2D, dimension: IDimension, image: HTMLImageElement | undefined, opacity: number): void;
|
|
15
9
|
export declare function clear(context: CanvasRenderingContext2D, dimension: IDimension): void;
|
|
16
10
|
export declare function drawParticle(data: IDrawParticleParams): void;
|
|
17
|
-
export declare function drawAfterEffect(
|
|
18
|
-
export declare function drawBeforeEffect(
|
|
19
|
-
export declare function drawShape(
|
|
20
|
-
export declare function drawShapeAfterDraw(
|
|
21
|
-
export declare function drawShapeBeforeDraw(
|
|
22
|
-
export declare function drawPlugin(context: CanvasRenderingContext2D, plugin: IContainerPlugin, delta: IDelta): void;
|
|
11
|
+
export declare function drawAfterEffect(drawer: IEffectDrawer | undefined, data: IShapeDrawData): void;
|
|
12
|
+
export declare function drawBeforeEffect(drawer: IEffectDrawer | undefined, data: IShapeDrawData): void;
|
|
13
|
+
export declare function drawShape(drawer: IShapeDrawer | undefined, data: IShapeDrawData): void;
|
|
14
|
+
export declare function drawShapeAfterDraw(drawer: IShapeDrawer | undefined, data: IShapeDrawData): void;
|
|
15
|
+
export declare function drawShapeBeforeDraw(drawer: IShapeDrawer | undefined, data: IShapeDrawData): void;
|
|
23
16
|
export declare function drawParticlePlugin(context: CanvasRenderingContext2D, plugin: IContainerPlugin, particle: Particle, delta: IDelta): void;
|
|
24
|
-
export declare function alterHsl(color: IHsl, type: AlterType, value: number): IHsl;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { IColor, IHsl, IHsla, IRangeColor, IRgb, IRgba } from "../Core/Interfaces/Colors.js";
|
|
2
|
+
import { AlterType } from "../Enums/Types/AlterType.js";
|
|
2
3
|
import type { Engine } from "../Core/Engine.js";
|
|
3
4
|
import type { HslAnimation } from "../Options/Classes/HslAnimation.js";
|
|
4
5
|
import type { IDelta } from "../Core/Interfaces/IDelta.js";
|
|
5
6
|
import type { IOptionsColor } from "../Options/Interfaces/IOptionsColor.js";
|
|
6
7
|
import type { IParticleColorAnimation } from "../Core/Interfaces/IParticleValueAnimation.js";
|
|
7
8
|
import type { IParticleHslAnimation } from "../Core/Interfaces/IParticleHslAnimation.js";
|
|
8
|
-
import type { IRangeValue } from "../Core/Interfaces/IRangeValue.js";
|
|
9
9
|
import type { Particle } from "../Core/Particle.js";
|
|
10
10
|
export declare function rangeColorToRgb(engine: Engine, input?: string | IRangeColor, index?: number, useIndex?: boolean): IRgb | undefined;
|
|
11
11
|
export declare function colorToRgb(engine: Engine, input?: string | IColor, index?: number, useIndex?: boolean): IRgb | undefined;
|
|
@@ -24,5 +24,6 @@ export declare function getLinkColor(p1: Particle, p2?: Particle, linkColor?: st
|
|
|
24
24
|
export declare function getLinkRandomColor(engine: Engine, optColor: string | IOptionsColor, blink: boolean, consent: boolean): IRgb | string | undefined;
|
|
25
25
|
export declare function getHslFromAnimation(animation?: IParticleHslAnimation): IHsl | undefined;
|
|
26
26
|
export declare function getHslAnimationFromHsl(hsl: IHsl, animationOptions: HslAnimation | undefined, reduceFactor: number): IParticleHslAnimation;
|
|
27
|
-
export declare function updateColorValue(data: IParticleColorAnimation,
|
|
27
|
+
export declare function updateColorValue(data: IParticleColorAnimation, decrease: boolean, delta: IDelta): void;
|
|
28
28
|
export declare function updateColor(color: IParticleHslAnimation | undefined, delta: IDelta): void;
|
|
29
|
+
export declare function alterHsl(color: IHsl, type: AlterType, value: number): IHsl;
|
|
@@ -21,7 +21,9 @@ export declare function getDistances(pointA: ICoordinates, pointB: ICoordinates)
|
|
|
21
21
|
dx: number;
|
|
22
22
|
dy: number;
|
|
23
23
|
};
|
|
24
|
+
export declare function getDistanceSq(pointA: ICoordinates, pointB: ICoordinates): number;
|
|
24
25
|
export declare function getDistance(pointA: ICoordinates, pointB: ICoordinates): number;
|
|
26
|
+
export declare function checkDistance(pointA: ICoordinates, pointB: ICoordinates, distance: number): boolean;
|
|
25
27
|
export declare function degToRad(degrees: number): number;
|
|
26
28
|
export declare function getParticleDirectionAngle(direction: MoveDirection | keyof typeof MoveDirection | MoveDirectionAlt | number, position: ICoordinates, center: ICoordinates): number;
|
|
27
29
|
export declare function getParticleBaseVelocity(direction: number): Vector;
|
package/types/Utils/Utils.d.ts
CHANGED
|
@@ -11,13 +11,18 @@ import { OutModeDirection } from "../Enums/Directions/OutModeDirection.js";
|
|
|
11
11
|
import type { Particle } from "../Core/Particle.js";
|
|
12
12
|
import type { RangedAnimationValueWithRandom } from "../Options/Classes/ValueWithRandom.js";
|
|
13
13
|
import type { SingleOrMultiple } from "../Types/SingleOrMultiple.js";
|
|
14
|
+
interface MemoizeOptions<TArgs> {
|
|
15
|
+
keyFn?: (args: TArgs) => string;
|
|
16
|
+
maxSize?: number;
|
|
17
|
+
ttlMs?: number;
|
|
18
|
+
}
|
|
19
|
+
export declare function memoize<TArgs extends unknown[], Result>(fn: (...args: TArgs) => Result, options?: MemoizeOptions<TArgs>): (...args: TArgs) => Result;
|
|
14
20
|
export declare function hasMatchMedia(): boolean;
|
|
15
21
|
export declare function safeDocument(): Document;
|
|
16
22
|
export declare function safeMatchMedia(query: string): MediaQueryList | undefined;
|
|
17
23
|
export declare function safeIntersectionObserver(callback: (records: IntersectionObserverEntry[]) => void): IntersectionObserver | undefined;
|
|
18
24
|
export declare function safeMutationObserver(callback: (records: MutationRecord[]) => void): MutationObserver | undefined;
|
|
19
25
|
export declare function isInArray<T>(value: T, array: SingleOrMultiple<T>): boolean;
|
|
20
|
-
export declare function loadFont(font?: string, weight?: string): Promise<void>;
|
|
21
26
|
export declare function arrayRandomIndex(array: unknown[]): number;
|
|
22
27
|
export declare function itemFromArray<T>(array: T[], index?: number, useIndex?: boolean): T | undefined;
|
|
23
28
|
export declare function isPointInside(point: ICoordinates, size: IDimension, offset: ICoordinates, radius?: number, direction?: OutModeDirection): boolean;
|
|
@@ -37,3 +42,5 @@ export declare function cloneStyle(style: Partial<CSSStyleDeclaration>): CSSStyl
|
|
|
37
42
|
export declare const getFullScreenStyle: (zIndex: number) => CSSStyleDeclaration;
|
|
38
43
|
export declare function manageListener(element: HTMLElement | Node | Window | MediaQueryList | typeof globalThis, event: string, handler: EventListenerOrEventListenerObject, add: boolean, options?: boolean | AddEventListenerOptions | EventListenerObject): void;
|
|
39
44
|
export declare function getItemsFromInitializer<TItem, TInitializer extends GenericInitializer<TItem>>(container: Container, map: Map<Container, TItem[]>, initializers: Map<string, TInitializer>, force?: boolean): Promise<TItem[]>;
|
|
45
|
+
export declare function getItemMapFromInitializer<TItem, TInitializer extends GenericInitializer<TItem>>(container: Container, map: Map<Container, Map<string, TItem>>, initializers: Map<string, TInitializer>, force?: boolean): Promise<Map<string, TItem>>;
|
|
46
|
+
export {};
|
package/types/export-types.d.ts
CHANGED
|
@@ -11,11 +11,10 @@ export type * from "./Core/Interfaces/IDistance.js";
|
|
|
11
11
|
export type * from "./Core/Interfaces/IDrawParticleParams.js";
|
|
12
12
|
export type * from "./Core/Interfaces/IEffectDrawer.js";
|
|
13
13
|
export type * from "./Core/Interfaces/ILoadParams.js";
|
|
14
|
-
export type * from "./Core/Interfaces/
|
|
14
|
+
export type * from "./Core/Interfaces/IPalette.js";
|
|
15
15
|
export type * from "./Core/Interfaces/IParticleColorStyle.js";
|
|
16
16
|
export type * from "./Core/Interfaces/IParticleHslAnimation.js";
|
|
17
17
|
export type * from "./Core/Interfaces/IParticleLife.js";
|
|
18
|
-
export type * from "./Core/Interfaces/IParticleMover.js";
|
|
19
18
|
export type * from "./Core/Interfaces/IParticleRetinaProps.js";
|
|
20
19
|
export type * from "./Core/Interfaces/IParticleRoll.js";
|
|
21
20
|
export type * from "./Core/Interfaces/IParticleTransformValues.js";
|
|
@@ -43,8 +42,8 @@ export type * from "./Options/Interfaces/IValueWithRandom.js";
|
|
|
43
42
|
export type * from "./Options/Interfaces/Particles/Bounce/IParticlesBounce.js";
|
|
44
43
|
export type * from "./Options/Interfaces/Particles/Effect/IEffect.js";
|
|
45
44
|
export type * from "./Options/Interfaces/Particles/IParticlesOptions.js";
|
|
45
|
+
export type * from "./Options/Interfaces/Particles/IFill.js";
|
|
46
46
|
export type * from "./Options/Interfaces/Particles/IStroke.js";
|
|
47
|
-
export type * from "./Options/Interfaces/Particles/Move/IMoveAttract.js";
|
|
48
47
|
export type * from "./Options/Interfaces/Particles/Move/IMove.js";
|
|
49
48
|
export type * from "./Options/Interfaces/Particles/Move/IMoveAngle.js";
|
|
50
49
|
export type * from "./Options/Interfaces/Particles/Move/IMoveCenter.js";
|
|
@@ -74,11 +73,10 @@ export type * from "./Types/RecursivePartial.js";
|
|
|
74
73
|
export type * from "./Types/ShapeData.js";
|
|
75
74
|
export type * from "./Types/SingleOrMultiple.js";
|
|
76
75
|
export type { EventListeners } from "./Core/Utils/EventListeners.js";
|
|
77
|
-
export type {
|
|
76
|
+
export type { SpatialHashGrid } from "./Core/Utils/SpatialHashGrid.js";
|
|
78
77
|
export type { Canvas } from "./Core/Canvas.js";
|
|
79
78
|
export type { Container } from "./Core/Container.js";
|
|
80
79
|
export type { Particle } from "./Core/Particle.js";
|
|
81
80
|
export type { Particles } from "./Core/Particles.js";
|
|
82
81
|
export type { Retina } from "./Core/Retina.js";
|
|
83
82
|
export type { Engine } from "./Core/Engine.js";
|
|
84
|
-
export type { IParticlesNumberLimit } from "./Options/Interfaces/Particles/Number/IParticlesNumberLimit.js";
|
package/types/exports.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
export * from "./Core/Utils/Constants.js";
|
|
2
|
-
export * from "./Core/Utils/Point.js";
|
|
3
2
|
export * from "./Core/Utils/Ranges.js";
|
|
4
3
|
export * from "./Core/Utils/Vectors.js";
|
|
5
4
|
export * from "./Enums/Directions/MoveDirection.js";
|
|
@@ -28,8 +27,8 @@ export * from "./Options/Classes/OptionsColor.js";
|
|
|
28
27
|
export * from "./Options/Classes/Particles/Bounce/ParticlesBounce.js";
|
|
29
28
|
export * from "./Options/Classes/Particles/Bounce/ParticlesBounceFactor.js";
|
|
30
29
|
export * from "./Options/Classes/Particles/ParticlesOptions.js";
|
|
30
|
+
export * from "./Options/Classes/Particles/Fill.js";
|
|
31
31
|
export * from "./Options/Classes/Particles/Stroke.js";
|
|
32
|
-
export * from "./Options/Classes/Particles/Move/MoveAttract.js";
|
|
33
32
|
export * from "./Options/Classes/Particles/Move/Move.js";
|
|
34
33
|
export * from "./Options/Classes/Particles/Move/MoveAngle.js";
|
|
35
34
|
export * from "./Options/Classes/Particles/Move/MoveCenter.js";
|