@woosh/meep-engine 2.113.6 → 2.113.8

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 (82) hide show
  1. package/build/bundle-worker-terrain.js +1 -1
  2. package/build/meep.cjs +168 -88
  3. package/build/meep.min.js +1 -1
  4. package/build/meep.module.js +168 -88
  5. package/package.json +1 -1
  6. package/src/core/binary/Base64.d.ts.map +1 -1
  7. package/src/core/binary/Base64.js +73 -31
  8. package/src/core/binary/BitSet.d.ts +2 -2
  9. package/src/core/binary/BitSet.d.ts.map +1 -1
  10. package/src/core/binary/BitSet.js +8 -8
  11. package/src/core/binary/align_32.d.ts +2 -2
  12. package/src/core/binary/align_32.d.ts.map +1 -1
  13. package/src/core/binary/align_32.js +7 -3
  14. package/src/core/binary/dec2hex.d.ts +2 -2
  15. package/src/core/binary/dec2hex.d.ts.map +1 -1
  16. package/src/core/binary/dec2hex.js +7 -3
  17. package/src/core/binary/downloadAsFile.d.ts +7 -1
  18. package/src/core/binary/downloadAsFile.d.ts.map +1 -1
  19. package/src/core/binary/downloadAsFile.js +10 -7
  20. package/src/core/binary/downloadUrlAsFile.d.ts +1 -1
  21. package/src/core/binary/downloadUrlAsFile.d.ts.map +1 -1
  22. package/src/core/binary/downloadUrlAsFile.js +6 -1
  23. package/src/core/binary/int32_to_binary_string.d.ts +1 -2
  24. package/src/core/binary/int32_to_binary_string.d.ts.map +1 -1
  25. package/src/core/binary/int32_to_binary_string.js +4 -2
  26. package/src/core/binary/url_to_data_url.d.ts +2 -1
  27. package/src/core/binary/url_to_data_url.d.ts.map +1 -1
  28. package/src/core/binary/url_to_data_url.js +2 -1
  29. package/src/core/codegen/LineBuilder.d.ts +4 -3
  30. package/src/core/codegen/LineBuilder.d.ts.map +1 -1
  31. package/src/core/codegen/LineBuilder.js +35 -6
  32. package/src/core/collection/array/arrayIndexByEquality.d.ts +1 -1
  33. package/src/core/collection/array/arrayIndexByEquality.js +1 -1
  34. package/src/core/collection/array/array_push_if_unique.d.ts.map +1 -1
  35. package/src/core/collection/array/array_push_if_unique.js +4 -0
  36. package/src/core/collection/list/List.d.ts.map +1 -1
  37. package/src/core/collection/list/List.js +7 -2
  38. package/src/core/collection/table/RowFirstTable.d.ts +12 -12
  39. package/src/core/collection/table/RowFirstTable.d.ts.map +1 -1
  40. package/src/core/collection/table/RowFirstTable.js +39 -36
  41. package/src/core/collection/table/RowFirstTableSpec.d.ts +1 -0
  42. package/src/core/collection/table/RowFirstTableSpec.d.ts.map +1 -1
  43. package/src/core/collection/table/RowFirstTableSpec.js +1 -0
  44. package/src/core/collection/table/serializeRowFirstTable.d.ts.map +1 -1
  45. package/src/core/collection/table/serializeRowFirstTable.js +6 -4
  46. package/src/core/geom/3d/frustum/frustum3_computeNearestPointToPoint.d.ts.map +1 -1
  47. package/src/core/geom/3d/frustum/frustum3_computeNearestPointToPoint.js +5 -5
  48. package/src/core/geom/3d/frustum/frustum_from_projection_matrix_array.d.ts +3 -2
  49. package/src/core/geom/3d/frustum/frustum_from_projection_matrix_array.d.ts.map +1 -1
  50. package/src/core/geom/3d/frustum/frustum_from_projection_matrix_array.js +9 -33
  51. package/src/core/geom/3d/plane/plane3_normalize.d.ts +11 -0
  52. package/src/core/geom/3d/plane/plane3_normalize.d.ts.map +1 -0
  53. package/src/core/geom/3d/plane/plane3_normalize.js +26 -0
  54. package/src/core/geom/3d/plane/plane3_project_point.d.ts +13 -0
  55. package/src/core/geom/3d/plane/plane3_project_point.d.ts.map +1 -0
  56. package/src/core/geom/3d/plane/{plane3_projectPoint.js → plane3_project_point.js} +6 -2
  57. package/src/core/math/isPowerOfTwo.d.ts +1 -1
  58. package/src/core/math/isPowerOfTwo.d.ts.map +1 -1
  59. package/src/core/math/isPowerOfTwo.js +2 -4
  60. package/src/core/model/LinearValue.d.ts +5 -1
  61. package/src/core/model/LinearValue.d.ts.map +1 -1
  62. package/src/core/model/LinearValue.js +16 -5
  63. package/src/core/model/ModuleRegistry.d.ts.map +1 -1
  64. package/src/core/model/ModuleRegistry.js +33 -29
  65. package/src/core/model/ResourceAccessSpecification.d.ts.map +1 -1
  66. package/src/core/model/ResourceAccessSpecification.js +7 -1
  67. package/src/core/model/node-graph/Connection.d.ts.map +1 -1
  68. package/src/core/model/node-graph/Connection.js +13 -7
  69. package/src/core/model/node-graph/NodeGraph.d.ts +2 -1
  70. package/src/core/model/node-graph/NodeGraph.d.ts.map +1 -1
  71. package/src/core/model/node-graph/NodeGraph.js +1 -1
  72. package/src/core/model/node-graph/node/NodeDescription.d.ts.map +1 -1
  73. package/src/core/model/node-graph/node/NodeDescription.js +8 -0
  74. package/src/core/model/node-graph/node/NodeInstance.d.ts.map +1 -1
  75. package/src/core/model/node-graph/node/NodeInstance.js +4 -0
  76. package/src/core/model/node-graph/node/NodeInstancePortReference.d.ts.map +1 -1
  77. package/src/core/model/node-graph/node/NodeInstancePortReference.js +6 -10
  78. package/src/core/bvh2/traversal/__process_point_if_within_planes.d.ts +0 -15
  79. package/src/core/bvh2/traversal/__process_point_if_within_planes.d.ts.map +0 -1
  80. package/src/core/bvh2/traversal/__process_point_if_within_planes.js +0 -56
  81. package/src/core/geom/3d/plane/plane3_projectPoint.d.ts +0 -13
  82. package/src/core/geom/3d/plane/plane3_projectPoint.d.ts.map +0 -1
@@ -48667,6 +48667,7 @@ function SplatMaterial(
48667
48667
  /**
48668
48668
  * Adapted from https://github.com/beatgammit/base64-js
48669
48669
  * @author Jameson Little
48670
+ * @author Alex Goldring
48670
48671
  */
48671
48672
 
48672
48673
  /**
@@ -48674,12 +48675,12 @@ function SplatMaterial(
48674
48675
  * @type {string[]}
48675
48676
  */
48676
48677
  const lookup = [];
48678
+
48677
48679
  /**
48678
48680
  *
48679
48681
  * @type {number[]}
48680
48682
  */
48681
48683
  const revLookup = [];
48682
- const Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array;
48683
48684
 
48684
48685
  const code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
48685
48686
 
@@ -48699,7 +48700,7 @@ revLookup['_'.charCodeAt(0)] = 63;
48699
48700
  * @return {number[]}
48700
48701
  */
48701
48702
  function getLens(b64) {
48702
- var len = b64.length;
48703
+ const len = b64.length;
48703
48704
 
48704
48705
  if (len % 4 > 0) {
48705
48706
  throw new Error('Invalid string. Length must be a multiple of 4');
@@ -48707,63 +48708,88 @@ function getLens(b64) {
48707
48708
 
48708
48709
  // Trim off extra bytes after placeholder bytes are found
48709
48710
  // See: https://github.com/beatgammit/base64-js/issues/42
48710
- var validLen = b64.indexOf('=');
48711
+ let validLen = b64.indexOf('=');
48712
+
48711
48713
  if (validLen === -1) {
48712
48714
  validLen = len;
48713
48715
  }
48714
48716
 
48715
- var placeHoldersLen = validLen === len
48717
+ const placeHoldersLen = validLen === len
48716
48718
  ? 0
48717
48719
  : 4 - (validLen % 4);
48718
48720
 
48719
48721
  return [validLen, placeHoldersLen];
48720
48722
  }
48721
48723
 
48722
- // base64 is 4/3 + up to two characters of the original data
48723
-
48724
- function _byteLength(b64, validLen, placeHoldersLen) {
48724
+ /**
48725
+ * base64 is 4/3 + up to two characters of the original data
48726
+ * @param {number} validLen
48727
+ * @param {number} placeHoldersLen
48728
+ */
48729
+ function _byteLength(validLen, placeHoldersLen) {
48725
48730
  return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen;
48726
48731
  }
48727
48732
 
48733
+ /**
48734
+ *
48735
+ * @param {string} b64
48736
+ * @return {Uint8Array}
48737
+ */
48728
48738
  function toByteArray(b64) {
48729
- var tmp;
48730
- var lens = getLens(b64);
48731
- var validLen = lens[0];
48732
- var placeHoldersLen = lens[1];
48739
+ let tmp;
48740
+ const lens = getLens(b64);
48741
+ const validLen = lens[0];
48742
+ const placeHoldersLen = lens[1];
48733
48743
 
48734
- var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen));
48744
+ const arr = new Uint8Array(_byteLength(validLen, placeHoldersLen));
48735
48745
 
48736
- var curByte = 0;
48746
+ let curByte = 0;
48737
48747
 
48738
48748
  // if there are placeholders, only get up to the last complete 4 chars
48739
- var len = placeHoldersLen > 0
48749
+ const len = placeHoldersLen > 0
48740
48750
  ? validLen - 4
48741
48751
  : validLen;
48742
48752
 
48743
- var i;
48744
- for (i = 0; i < len; i += 4) {
48753
+ let i = 0;
48754
+
48755
+ for (; i < len; i += 4) {
48756
+ const char_0 = b64.charCodeAt(i);
48757
+ const char_1 = b64.charCodeAt(i + 1);
48758
+ const char_2 = b64.charCodeAt(i + 2);
48759
+ const char_3 = b64.charCodeAt(i + 3);
48760
+
48745
48761
  tmp =
48746
- (revLookup[b64.charCodeAt(i)] << 18) |
48747
- (revLookup[b64.charCodeAt(i + 1)] << 12) |
48748
- (revLookup[b64.charCodeAt(i + 2)] << 6) |
48749
- revLookup[b64.charCodeAt(i + 3)];
48762
+ (revLookup[char_0] << 18) |
48763
+ (revLookup[char_1] << 12) |
48764
+ (revLookup[char_2] << 6) |
48765
+ revLookup[char_3];
48766
+
48750
48767
  arr[curByte++] = (tmp >> 16) & 0xFF;
48751
48768
  arr[curByte++] = (tmp >> 8) & 0xFF;
48752
48769
  arr[curByte++] = tmp & 0xFF;
48753
48770
  }
48754
48771
 
48755
48772
  if (placeHoldersLen === 2) {
48773
+ const char_0 = b64.charCodeAt(i);
48774
+ const char_1 = b64.charCodeAt(i + 1);
48775
+
48756
48776
  tmp =
48757
- (revLookup[b64.charCodeAt(i)] << 2) |
48758
- (revLookup[b64.charCodeAt(i + 1)] >> 4);
48777
+ (revLookup[char_0] << 2) |
48778
+ (revLookup[char_1] >> 4);
48779
+
48759
48780
  arr[curByte++] = tmp & 0xFF;
48760
48781
  }
48761
48782
 
48762
48783
  if (placeHoldersLen === 1) {
48784
+ const char_0 = b64.charCodeAt(i);
48785
+ const char_1 = b64.charCodeAt(i + 1);
48786
+ const char_2 = b64.charCodeAt(i + 2);
48787
+
48763
48788
  tmp =
48764
- (revLookup[b64.charCodeAt(i)] << 10) |
48765
- (revLookup[b64.charCodeAt(i + 1)] << 4) |
48766
- (revLookup[b64.charCodeAt(i + 2)] >> 2);
48789
+ (revLookup[char_0] << 10) |
48790
+ (revLookup[char_1] << 4) |
48791
+ (revLookup[char_2] >> 2);
48792
+
48767
48793
  arr[curByte++] = (tmp >> 8) & 0xFF;
48768
48794
  arr[curByte++] = tmp & 0xFF;
48769
48795
  }
@@ -48771,6 +48797,11 @@ function toByteArray(b64) {
48771
48797
  return arr;
48772
48798
  }
48773
48799
 
48800
+ /**
48801
+ *
48802
+ * @param {number} num
48803
+ * @return {string}
48804
+ */
48774
48805
  function tripletToBase64(num) {
48775
48806
  return lookup[num >> 18 & 0x3F]
48776
48807
  + lookup[num >> 12 & 0x3F]
@@ -48801,24 +48832,29 @@ function encodeChunk(uint8, start, end) {
48801
48832
  return output.join('');
48802
48833
  }
48803
48834
 
48835
+ /**
48836
+ * must be multiple of 3
48837
+ */
48838
+ const MAX_CHUNK_LENGTH = 16383;
48839
+
48804
48840
  /**
48805
48841
  *
48806
48842
  * @param {Uint8Array} uint8
48807
48843
  * @return {string}
48808
48844
  */
48809
48845
  function fromByteArray(uint8) {
48810
- let tmp;
48811
48846
 
48812
48847
  const len = uint8.length;
48848
+
48813
48849
  const extraBytes = len % 3; // if we have 1 byte left, pad 2 bytes
48850
+
48814
48851
  const parts = [];
48815
- const maxChunkLength = 16383; // must be multiple of 3
48816
48852
 
48817
48853
  // go through the array every three bytes, we'll deal with trailing stuff later
48818
48854
  const len2 = len - extraBytes;
48819
48855
 
48820
- for (let i = 0; i < len2; i += maxChunkLength) {
48821
- const end = (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength);
48856
+ for (let i = 0; i < len2; i += MAX_CHUNK_LENGTH) {
48857
+ const end = (i + MAX_CHUNK_LENGTH) > len2 ? len2 : (i + MAX_CHUNK_LENGTH);
48822
48858
 
48823
48859
  const chunk = encodeChunk(uint8, i, end);
48824
48860
 
@@ -48827,20 +48863,26 @@ function fromByteArray(uint8) {
48827
48863
 
48828
48864
  // pad the end with zeros, but make sure to not forget the extra bytes
48829
48865
  if (extraBytes === 1) {
48830
- tmp = uint8[len - 1];
48866
+
48867
+ const tmp = uint8[len - 1];
48868
+
48831
48869
  parts.push(
48832
48870
  lookup[tmp >> 2] +
48833
48871
  lookup[(tmp << 4) & 0x3F] +
48834
48872
  '=='
48835
48873
  );
48874
+
48836
48875
  } else if (extraBytes === 2) {
48837
- tmp = (uint8[len - 2] << 8) + uint8[len - 1];
48876
+
48877
+ const tmp = (uint8[len - 2] << 8) + uint8[len - 1];
48878
+
48838
48879
  parts.push(
48839
48880
  lookup[tmp >> 10] +
48840
48881
  lookup[(tmp >> 4) & 0x3F] +
48841
48882
  lookup[(tmp << 2) & 0x3F] +
48842
48883
  '='
48843
48884
  );
48885
+
48844
48886
  }
48845
48887
 
48846
48888
  return parts.join('');
@@ -53284,11 +53326,12 @@ function min3(a, b, c) {
53284
53326
 
53285
53327
  /**
53286
53328
  * Convert a decimal value to hex
53287
- * @param {number} c generally expects b byte value, 0-255
53329
+ * @param {number} x generally expects b byte value, 0-255
53288
53330
  * @returns {string} zero-padded value, for example instead of "0", will return "00" and instead of "F" will return "0F"
53289
53331
  */
53290
- function dec2hex(c) {
53291
- const hex = Math.round(c).toString(16);
53332
+ function dec2hex(x) {
53333
+
53334
+ const hex = Math.round(x).toString(16);
53292
53335
  return hex.length === 1 ? "0" + hex : hex;
53293
53336
  }
53294
53337
 
@@ -61313,7 +61356,7 @@ function objectsEqual(a, b) {
61313
61356
  * @param {T[]} array
61314
61357
  * @param {T} element
61315
61358
  * @param {function(a:T,b:T):boolean} equals
61316
- * @returns {number}
61359
+ * @returns {number} index of first match or -1 if no matches found
61317
61360
  */
61318
61361
  function arrayIndexByEquality(array, element, equals) {
61319
61362
  const n = array.length;
@@ -61391,17 +61434,19 @@ class List {
61391
61434
  */
61392
61435
  on = {
61393
61436
  /**
61437
+ * @readonly
61394
61438
  * @type {Signal<T,number>}
61395
61439
  */
61396
61440
  added: new Signal(),
61397
61441
  /**
61442
+ * @readonly
61398
61443
  * @type {Signal<T,number>}
61399
61444
  */
61400
61445
  removed: new Signal()
61401
61446
  };
61402
61447
 
61403
61448
  /**
61404
- *
61449
+ * @readonly
61405
61450
  * @type {T[]}
61406
61451
  */
61407
61452
  data = []
@@ -61468,6 +61513,7 @@ class List {
61468
61513
  /**
61469
61514
  *
61470
61515
  * @param {T} el
61516
+ * @returns {this}
61471
61517
  */
61472
61518
  add(el) {
61473
61519
  this.data.push(el);
@@ -61485,7 +61531,7 @@ class List {
61485
61531
  * Note that this operation is rather slow as it triggers a linear scan
61486
61532
  * If the list gets large - consider using a {@link Set} class instead
61487
61533
  * @param {T} el
61488
- * @return {boolean}
61534
+ * @return {boolean} true if element was added, false if element already existed in the list
61489
61535
  */
61490
61536
  addUnique(el) {
61491
61537
  if (this.contains(el)) {
@@ -62252,7 +62298,9 @@ class List {
62252
62298
 
62253
62299
  for (let i = 0; i < length; i++) {
62254
62300
  const datum = this.data[i];
62301
+
62255
62302
  const singleValue = datum.hash();
62303
+
62256
62304
  hash = ((hash << 5) - hash) + singleValue;
62257
62305
  hash |= 0; // Convert to 32bit integer
62258
62306
  }
@@ -63183,12 +63231,24 @@ class Line {
63183
63231
  *
63184
63232
  * @param {string} text
63185
63233
  * @param {number} indent
63186
- * @constructor
63187
63234
  */
63188
63235
  constructor(text, indent) {
63236
+
63237
+ /**
63238
+ *
63239
+ * @type {string}
63240
+ */
63189
63241
  this.text = text;
63242
+ /**
63243
+ *
63244
+ * @type {number}
63245
+ */
63190
63246
  this.indentation = indent;
63191
63247
  }
63248
+
63249
+ toString() {
63250
+ return `Line{ indentation=${this.indentation}, text="${this.text}" }`
63251
+ }
63192
63252
  }
63193
63253
 
63194
63254
  const DEFAULT_INDENT_SPACES = 4;
@@ -63205,13 +63265,13 @@ class LineBuilder {
63205
63265
  #lines = [];
63206
63266
 
63207
63267
  /**
63208
- *
63268
+ * Current indent level
63209
63269
  * @type {number}
63210
63270
  */
63211
63271
  #indentation = 0;
63212
63272
 
63213
63273
  /**
63214
- *
63274
+ * TODO replace with indent string, that is tab, space or any combination or something else entirely
63215
63275
  * @type {number}
63216
63276
  */
63217
63277
  indentSpaces = DEFAULT_INDENT_SPACES;
@@ -63230,8 +63290,10 @@ class LineBuilder {
63230
63290
  * @param {string} term
63231
63291
  */
63232
63292
  containsSubstring(term) {
63293
+
63233
63294
  const lines = this.#lines;
63234
63295
  const n = lines.length;
63296
+
63235
63297
  for (let i = 0; i < n; i++) {
63236
63298
  const line = lines[i];
63237
63299
 
@@ -63259,6 +63321,7 @@ class LineBuilder {
63259
63321
  * @returns {LineBuilder}
63260
63322
  */
63261
63323
  dedent() {
63324
+
63262
63325
  this.#indentation--;
63263
63326
  return this;
63264
63327
  }
@@ -63329,14 +63392,15 @@ class LineBuilder {
63329
63392
  }
63330
63393
 
63331
63394
  /**
63332
- *
63333
63395
  * @param {string} text
63396
+ * @param {string} [line_separator] defaults to new-line character
63334
63397
  * @returns {LineBuilder}
63335
63398
  */
63336
- static fromText(text) {
63399
+ static fromText(text, line_separator = '\n') {
63400
+
63337
63401
  const r = new LineBuilder();
63338
63402
 
63339
- const lines = text.split('\n');
63403
+ const lines = text.split(line_separator);
63340
63404
 
63341
63405
  const n = lines.length;
63342
63406
 
@@ -63352,6 +63416,10 @@ class LineBuilder {
63352
63416
 
63353
63417
  return r;
63354
63418
  }
63419
+
63420
+ toString() {
63421
+ return this.build();
63422
+ }
63355
63423
  }
63356
63424
 
63357
63425
  /**
@@ -63912,6 +63980,7 @@ class OffsetScaleTransform2D {
63912
63980
  * @return {boolean}
63913
63981
  */
63914
63982
  function array_push_if_unique(array, element) {
63983
+
63915
63984
  const i = array.indexOf(element);
63916
63985
 
63917
63986
  if (i === -1) {
@@ -69157,7 +69226,8 @@ class ResourceAccessSpecification {
69157
69226
  * @param {number|ResourceAccessKind} access
69158
69227
  * @returns {ResourceAccessSpecification<R>}
69159
69228
  */
69160
- static from(resource, access = DEFAULT_ACCESS){
69229
+ static from(resource, access = DEFAULT_ACCESS) {
69230
+
69161
69231
  const r = new ResourceAccessSpecification();
69162
69232
 
69163
69233
  r.access = access;
@@ -70809,11 +70879,12 @@ const EntityFlags = {
70809
70879
 
70810
70880
  /**
70811
70881
  * Align to the nearest number divisible by 32, rounding up
70812
- * @param {number} n
70882
+ * @param {number} x must be a non-negative integer
70813
70883
  * @returns {number}
70814
70884
  */
70815
- function align_32(n) {
70816
- return ((n + 31) >>> 5) << 5
70885
+ function align_32(x) {
70886
+
70887
+ return ((x + 31) >>> 5) << 5
70817
70888
  }
70818
70889
 
70819
70890
  /**
@@ -71168,22 +71239,20 @@ class BitSet {
71168
71239
 
71169
71240
  /**
71170
71241
  *
71171
- * @param {int} bitIndex
71242
+ * @param {int} bit_index
71172
71243
  * @param {boolean} value
71173
71244
  */
71174
- set(bitIndex, value) {
71175
- //assert.ok(typeof bitIndex, 'number', `bitIndex must be a number, instead was '${typeof bitIndex}'`);
71176
- //assert.ok(typeof value, 'boolean', `value must be a boolean, instead was '${typeof bitIndex}'`);
71245
+ set(bit_index, value) {
71177
71246
 
71178
- const word_offset = bitIndex >> 5;
71179
- const bit_offset = bitIndex & 31;
71247
+ const word_offset = bit_index >> 5;
71248
+ const bit_offset = bit_index & 31;
71180
71249
 
71181
71250
  //const oldLength = this.__length;
71182
71251
 
71183
71252
  const word_mask = 1 << bit_offset;
71184
71253
 
71185
71254
  if (value) {
71186
- const bitIndexInc = bitIndex + 1;
71255
+ const bitIndexInc = bit_index + 1;
71187
71256
 
71188
71257
  if (bitIndexInc > this.__length) {
71189
71258
  // ensure capacity
@@ -71194,7 +71263,7 @@ class BitSet {
71194
71263
  this.__data_uint32[word_offset] |= word_mask;
71195
71264
 
71196
71265
 
71197
- } else if (bitIndex < this.__length) {
71266
+ } else if (bit_index < this.__length) {
71198
71267
  //clear
71199
71268
  this.__data_uint32[word_offset] &= ~word_mask;
71200
71269
 
@@ -83657,44 +83726,48 @@ class Localization {
83657
83726
  }
83658
83727
  }
83659
83728
 
83729
+ /**
83730
+ * @template T
83731
+ */
83660
83732
  class ModuleRegistry {
83661
83733
 
83662
83734
  /**
83663
83735
  *
83664
- * @type {Map<string, *>}
83736
+ * @type {Map<string, T>}
83665
83737
  */
83666
83738
  #modules = new Map();
83667
83739
  /**
83668
83740
  *
83669
- * @type {Map<*,Array<string>>}
83741
+ * @type {Map<T,Array<string>>}
83670
83742
  */
83671
83743
  #reverse_lookup = new Map();
83672
83744
 
83673
- constructor() {
83674
-
83675
- this.proxy = new Proxy(this, {
83676
- /**
83677
- *
83678
- * @param target
83679
- * @param {string} p
83680
- * @param receiver
83681
- * @returns {Class}
83682
- */
83683
- get(target, p, receiver) {
83684
- const module = target.get(p);
83685
-
83686
- if (module === undefined) {
83687
- throw new Error(`Module '${p}' not found in the registry`);
83688
- }
83745
+ /**
83746
+ * @readonly
83747
+ * @type {ModuleRegistry}
83748
+ */
83749
+ proxy = new Proxy(this, {
83750
+ /**
83751
+ *
83752
+ * @param target
83753
+ * @param {string} p
83754
+ * @param receiver
83755
+ * @returns {Class}
83756
+ */
83757
+ get(target, p, receiver) {
83758
+ const module = target.get(p);
83689
83759
 
83690
- return module;
83760
+ if (module === undefined) {
83761
+ throw new Error(`Module '${p}' not found in the registry`);
83691
83762
  }
83692
- });
83693
- }
83763
+
83764
+ return module;
83765
+ }
83766
+ });
83694
83767
 
83695
83768
  /**
83696
83769
  *
83697
- * @param {function(name:string,module:*):void} visitor
83770
+ * @param {function(name:string,module:T):void} visitor
83698
83771
  */
83699
83772
  traverse(visitor) {
83700
83773
  this.#modules.forEach((klass, name) => visitor(name, klass));
@@ -83702,9 +83775,9 @@ class ModuleRegistry {
83702
83775
 
83703
83776
 
83704
83777
  /**
83705
- * @template T
83778
+ * @template {T} M
83706
83779
  * @param {String} name
83707
- * @returns {T}
83780
+ * @returns {M}
83708
83781
  */
83709
83782
  get(name) {
83710
83783
  return this.#modules.get(name);
@@ -83720,9 +83793,9 @@ class ModuleRegistry {
83720
83793
  }
83721
83794
 
83722
83795
  /**
83723
- * @template T
83796
+ * @template {T} M
83724
83797
  * @param {string} name
83725
- * @param {T} module
83798
+ * @param {M} module
83726
83799
  * @returns {boolean}
83727
83800
  */
83728
83801
  add(name, module) {
@@ -83750,8 +83823,8 @@ class ModuleRegistry {
83750
83823
 
83751
83824
  /**
83752
83825
  * Find all names associated with the given module
83753
- * @template T
83754
- * @param {T} module
83826
+ * @template {T} M
83827
+ * @param {M} module
83755
83828
  * @returns {string[]}
83756
83829
  * @throws if module is not registered
83757
83830
  */
@@ -97459,6 +97532,13 @@ class SimpleLifecycle {
97459
97532
  }
97460
97533
 
97461
97534
  class LinearValue {
97535
+
97536
+ /**
97537
+ * @readonly
97538
+ * @type {Signal}
97539
+ */
97540
+ onChanged = new Signal();
97541
+
97462
97542
  /**
97463
97543
  *
97464
97544
  * @param {number} [x = 0]
@@ -97466,24 +97546,24 @@ class LinearValue {
97466
97546
  * @param {number} [b = 1]
97467
97547
  * @constructor
97468
97548
  */
97469
- constructor(x, a, b) {
97549
+ constructor(x = 0, a = 0, b = 1) {
97550
+
97470
97551
  /**
97471
97552
  *
97472
97553
  * @type {number}
97473
97554
  */
97474
- this.x = x !== undefined ? x : 0;
97555
+ this.x = x;
97475
97556
  /**
97476
97557
  *
97477
97558
  * @type {number}
97478
97559
  */
97479
- this.a = a !== undefined ? a : 0;
97560
+ this.a = a;
97480
97561
  /**
97481
97562
  *
97482
97563
  * @type {number}
97483
97564
  */
97484
- this.b = b !== undefined ? b : 1;
97565
+ this.b = b;
97485
97566
 
97486
- this.onChanged = new Signal();
97487
97567
  }
97488
97568
 
97489
97569
  /**
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "description": "Fully featured ECS game engine written in JavaScript",
6
6
  "type": "module",
7
7
  "author": "Alexander Goldring",
8
- "version": "2.113.6",
8
+ "version": "2.113.8",
9
9
  "main": "build/meep.module.js",
10
10
  "module": "build/meep.module.js",
11
11
  "exports": {
@@ -1 +1 @@
1
- {"version":3,"file":"Base64.d.ts","sourceRoot":"","sources":["../../../../src/core/binary/Base64.js"],"names":[],"mappings":"AAsLA;IACI;;;;OAIG;IACH,qBAHW,WAAW,GACT,MAAM,CAOlB;IAED;;;;OAIG;IACH,qBAHW,MAAM,GACJ,WAAW,CAUvB;CACJ"}
1
+ {"version":3,"file":"Base64.d.ts","sourceRoot":"","sources":["../../../../src/core/binary/Base64.js"],"names":[],"mappings":"AAgOA;IACI;;;;OAIG;IACH,qBAHW,WAAW,GACT,MAAM,CAOlB;IAED;;;;OAIG;IACH,qBAHW,MAAM,GACJ,WAAW,CAUvB;CACJ"}