@tsparticles/plugin-sounds 3.0.0-alpha.0 → 3.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.
Files changed (37) hide show
  1. package/README.md +15 -11
  2. package/browser/Options/Classes/SoundsAudio.js +2 -1
  3. package/browser/Options/Classes/SoundsEvent.js +4 -3
  4. package/browser/Options/Classes/SoundsVolume.js +2 -1
  5. package/browser/SoundsInstance.js +300 -279
  6. package/browser/index.js +6 -8
  7. package/browser/utils.js +0 -1
  8. package/cjs/Options/Classes/SoundsAudio.js +2 -1
  9. package/cjs/Options/Classes/SoundsEvent.js +4 -3
  10. package/cjs/Options/Classes/SoundsVolume.js +2 -1
  11. package/cjs/SoundsInstance.js +283 -281
  12. package/cjs/index.js +6 -19
  13. package/cjs/utils.js +0 -1
  14. package/esm/Options/Classes/SoundsAudio.js +2 -1
  15. package/esm/Options/Classes/SoundsEvent.js +4 -3
  16. package/esm/Options/Classes/SoundsVolume.js +2 -1
  17. package/esm/SoundsInstance.js +300 -279
  18. package/esm/index.js +6 -8
  19. package/esm/utils.js +0 -1
  20. package/package.json +6 -5
  21. package/report.html +4 -4
  22. package/tsparticles.plugin.sounds.js +343 -305
  23. package/tsparticles.plugin.sounds.min.js +1 -1
  24. package/tsparticles.plugin.sounds.min.js.LICENSE.txt +1 -8
  25. package/types/Options/Classes/SoundsAudio.d.ts +1 -1
  26. package/types/Options/Classes/SoundsEvent.d.ts +1 -1
  27. package/types/Options/Classes/SoundsVolume.d.ts +1 -1
  28. package/types/SoundsInstance.d.ts +15 -15
  29. package/types/enums.d.ts +4 -0
  30. package/types/index.d.ts +1 -1
  31. package/types/types.d.ts +16 -0
  32. package/umd/Options/Classes/SoundsAudio.js +3 -2
  33. package/umd/Options/Classes/SoundsEvent.js +5 -4
  34. package/umd/Options/Classes/SoundsVolume.js +3 -2
  35. package/umd/SoundsInstance.js +301 -280
  36. package/umd/index.js +6 -8
  37. package/umd/utils.js +0 -1
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SoundsEvent = void 0;
4
+ const engine_1 = require("@tsparticles/engine");
4
5
  const SoundsAudio_1 = require("./SoundsAudio");
5
6
  const SoundsMelody_1 = require("./SoundsMelody");
6
7
  const SoundsNote_1 = require("./SoundsNote");
@@ -17,7 +18,7 @@ class SoundsEvent {
17
18
  this.event = data.event;
18
19
  }
19
20
  if (data.audio !== undefined) {
20
- if (data.audio instanceof Array) {
21
+ if ((0, engine_1.isArray)(data.audio)) {
21
22
  this.audio = data.audio.map((s) => {
22
23
  const tmp = new SoundsAudio_1.SoundsAudio();
23
24
  tmp.load(s);
@@ -44,8 +45,8 @@ class SoundsEvent {
44
45
  });
45
46
  }
46
47
  if (data.filter !== undefined) {
47
- if (typeof data.filter === "string") {
48
- if (typeof window[data.filter] === "function") {
48
+ if ((0, engine_1.isString)(data.filter)) {
49
+ if ((0, engine_1.isFunction)(window[data.filter])) {
49
50
  this.filter = window[data.filter];
50
51
  }
51
52
  }
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SoundsVolume = void 0;
4
+ const engine_1 = require("@tsparticles/engine");
4
5
  class SoundsVolume {
5
6
  constructor() {
6
7
  this.value = 100;
@@ -12,7 +13,7 @@ class SoundsVolume {
12
13
  if (data === undefined) {
13
14
  return;
14
15
  }
15
- if (typeof data === "object") {
16
+ if ((0, engine_1.isObject)(data)) {
16
17
  if (data.max !== undefined) {
17
18
  this.max = data.max;
18
19
  }