@woosh/meep-engine 2.124.8 → 2.124.10

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/LICENSE CHANGED
@@ -7,6 +7,7 @@ For illustration purposes, this means that unless you have obtained a license, a
7
7
  * You are NOT permitted to re-distribute this package
8
8
  * You are NOT permitted to extend the code from this package
9
9
  * You are NOT permitted to make use of this package for any purpose, commercial or otherwise
10
+ * You are NOT permitted to copy any parts of the source code
10
11
 
11
12
  If you would like to use this package in any context, please contact me via email so we can arrange a license:
12
13
 
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "description": "Pure JavaScript game engine. Fully featured and production ready.",
6
6
  "type": "module",
7
7
  "author": "Alexander Goldring",
8
- "version": "2.124.8",
8
+ "version": "2.124.10",
9
9
  "main": "build/meep.module.js",
10
10
  "module": "build/meep.module.js",
11
11
  "exports": {
@@ -43,9 +43,11 @@ declare class ObservedBoolean extends Boolean {
43
43
  hashCode(): number;
44
44
  /**
45
45
  *
46
- * @param {function(boolean)} f
46
+ * @param {function(boolean,boolean)} f
47
+ * @param {*} [thisArg]
48
+ * @returns {this}
47
49
  */
48
- process(f: (arg0: boolean) => any): void;
50
+ process(f: (arg0: boolean, arg1: boolean) => any, thisArg?: any): this;
49
51
  /**
50
52
  *
51
53
  * @returns {Boolean}
@@ -1 +1 @@
1
- {"version":3,"file":"ObservedBoolean.d.ts","sourceRoot":"","sources":["../../../../src/core/model/ObservedBoolean.js"],"names":[],"mappings":";AAGA;IAQI;;;;OAIG;IACH,mBAHW,OAAO,EAcjB;IAtBD;;;OAGG;IACH,oBAFU,MAAM,CAAC,OAAO,EAAC,OAAO,CAAC,CAER;IAYrB;;;;OAIG;IACH,gBAAoB;IAmBxB;;;;OAIG;IACH,WAHW,OAAO,GACL,eAAe,CAa3B;IAED,gBAEC;IAED,iBAEC;IAED;;;OAGG;IACH,YAFW,eAAe,QAIzB;IAED;;;;OAIG;IACH,cAHW,eAAe,GACb,OAAO,CAInB;IAED;;;OAGG;IACH,YAFY,MAAM,CAIjB;IAED;;;OAGG;IACH,WAFW,CAAS,IAAO,EAAP,OAAO,QAAC,QAK3B;IAED;;;OAGG;IACH,oBAEC;IAED;;OAEG;IACH,eAEC;IAED,kBAEC;IAED,yBAEC;IAED;;;OAGG;IACH,uBAFW,YAAY,QAItB;IAED;;;OAGG;IACH,yBAFW,YAAY,QAKtB;IAeL;;;OAGG;IACH,4BAFU,OAAO,CAE0B;CAlB1C;;eAIS,eAAe;cAMf,eAAe;;mBAzJN,4BAA4B"}
1
+ {"version":3,"file":"ObservedBoolean.d.ts","sourceRoot":"","sources":["../../../../src/core/model/ObservedBoolean.js"],"names":[],"mappings":";AAGA;IAQI;;;;OAIG;IACH,mBAHW,OAAO,EAcjB;IAtBD;;;OAGG;IACH,oBAFU,MAAM,CAAC,OAAO,EAAC,OAAO,CAAC,CAER;IAYrB;;;;OAIG;IACH,gBAAoB;IAmBxB;;;;OAIG;IACH,WAHW,OAAO,GACL,eAAe,CAa3B;IAED,gBAEC;IAED,iBAEC;IAED;;;OAGG;IACH,YAFW,eAAe,QAIzB;IAED;;;;OAIG;IACH,cAHW,eAAe,GACb,OAAO,CAInB;IAED;;;OAGG;IACH,YAFY,MAAM,CAIjB;IAED;;;;;OAKG;IACH,WAJW,CAAS,IAAO,EAAP,OAAO,EAAC,IAAO,EAAP,OAAO,QAAC,YACzB,GAAC,GACC,IAAI,CAWhB;IAED;;;OAGG;IACH,oBAEC;IAED;;OAEG;IACH,eAEC;IAED,kBAEC;IAED,yBAEC;IAED;;;OAGG;IACH,uBAFW,YAAY,QAItB;IAED;;;OAGG;IACH,yBAFW,YAAY,QAKtB;IAeL;;;OAGG;IACH,4BAFU,OAAO,CAE0B;CAlB1C;;eAIS,eAAe;cAMf,eAAe;;mBAjKN,4BAA4B"}
@@ -96,11 +96,19 @@ class ObservedBoolean extends Boolean {
96
96
 
97
97
  /**
98
98
  *
99
- * @param {function(boolean)} f
99
+ * @param {function(boolean,boolean)} f
100
+ * @param {*} [thisArg]
101
+ * @returns {this}
100
102
  */
101
- process(f) {
102
- f(this.__value);
103
- this.onChanged.add(f);
103
+ process(f, thisArg) {
104
+
105
+ this.onChanged.add(f, thisArg);
106
+
107
+ const v = this.__value;
108
+
109
+ f.call(thisArg, v, v);
110
+
111
+ return this;
104
112
  }
105
113
 
106
114
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"ObservedEnum.d.ts","sourceRoot":"","sources":["../../../../src/core/model/ObservedEnum.js"],"names":[],"mappings":";AAGA;IACI;;;;;OAKG;IACH,mBAJW,CAAC;;OAiBX;IATG;;;;OAIG;IACH,gBAAoB;IACpB;;MAA0B;IAE1B,0DAA6B;IAGjC;;;OAGG;IACH;;MAEC;IAED;;;;OAIG;IACH,WAHW,CAAC,GACC,YAAY,CAYxB;IAED;;;;OAIG;IACH,OAJa,CAAC,SACH,YAAY,CAAC,CAAC,CAAC,GACb,OAAO,CAInB;IAED;;;OAGG;IACH,YAFW,YAAY,QAItB;IAED;;;OAGG;IACH,YAFa,CAAC,CAIb;IAED,eAEC;IAED;;;OAGG;IACH,mBAFW,CAAS,IAAC,EAAD,CAAC,EAAC,IAAC,EAAD,CAAC,QAAC,QAMvB;IAED,YAEC;IAED,yBAEC;CACJ;mBA/FkB,4BAA4B"}
1
+ {"version":3,"file":"ObservedEnum.d.ts","sourceRoot":"","sources":["../../../../src/core/model/ObservedEnum.js"],"names":[],"mappings":";AAGA;IACI;;;;;OAKG;IACH,mBAJW,CAAC;;OAiBX;IATG;;;;OAIG;IACH,gBAAoB;IACpB;;MAA0B;IAE1B,0DAA6B;IAGjC;;;OAGG;IACH;;MAEC;IAED;;;;OAIG;IACH,WAHW,CAAC,GACC,YAAY,CAYxB;IAED;;;;OAIG;IACH,OAJa,CAAC,SACH,YAAY,CAAC,CAAC,CAAC,GACb,OAAO,CAInB;IAED;;;OAGG;IACH,YAFW,YAAY,QAItB;IAED;;;OAGG;IACH,YAFa,CAAC,CAIb;IAED,eAEC;IAED;;;;;OAKG;IACH,mBAJW,CAAS,IAAC,EAAD,CAAC,EAAC,IAAC,EAAD,CAAC,QAAC,YACb,GAAC,GACC,IAAI,CAUhB;IAED,YAEC;IAED,yBAEC;CACJ;mBArGkB,4BAA4B"}
@@ -80,11 +80,17 @@ class ObservedEnum {
80
80
  /**
81
81
  *
82
82
  * @param {function(T,T)} processor
83
+ * @param {*} [thisArg]
84
+ * @returns {this}
83
85
  */
84
- process(processor) {
85
- this.onChanged.add(processor);
86
+ process(processor, thisArg) {
87
+ this.onChanged.add(processor, thisArg);
86
88
 
87
- processor(this.__value, this.__value);
89
+ const v = this.__value;
90
+
91
+ processor.call(thisArg, v, v);
92
+
93
+ return this;
88
94
  }
89
95
 
90
96
  toJSON() {
@@ -1,5 +1,14 @@
1
1
  export default ObservedString;
2
2
  /**
3
+ * Observable string container.
4
+ * Signals change via {@link onChanged}.
5
+ *
6
+ * @example
7
+ * const name = new ObservedString("Alice")
8
+ * name.onChanged((new_name, old_name) => console.log(`Name changed from ${old_name} to ${new_name}!`));
9
+ * ...
10
+ * name.set("Barbara"); // will print "Name changed from Alice to Barbara!" in console
11
+ * name.getValue() === "Barbara"
3
12
  *
4
13
  * @author Alex Goldring
5
14
  * @copyright Company Named Limited (c) 2025
@@ -7,20 +16,23 @@ export default ObservedString;
7
16
  declare class ObservedString extends String {
8
17
  /**
9
18
  *
10
- * @param {string} [value]
11
- * @constructor
19
+ * @param {string} [value=""]
12
20
  */
13
21
  constructor(value?: string);
14
22
  /**
15
23
  *
16
- * @type {String}
24
+ * @type {string}
17
25
  * @private
18
26
  */
19
27
  private __value;
20
- onChanged: Signal<any, any, any, any, any, any, any, any>;
21
28
  /**
22
29
  *
23
- * @param {String} value
30
+ * @type {Signal<string,string>}
31
+ */
32
+ onChanged: Signal<string, string>;
33
+ /**
34
+ *
35
+ * @param {string} value
24
36
  * @returns {ObservedString}
25
37
  */
26
38
  set(value: string): ObservedString;
@@ -30,33 +42,41 @@ declare class ObservedString extends String {
30
42
  */
31
43
  copy(other: ObservedString): void;
32
44
  /**
33
- *
34
- * @param {ObservedString} other
35
- * @returns {boolean}
45
+ * @return {ObservedString}
36
46
  */
37
- equals(other: ObservedString): boolean;
47
+ clone(): ObservedString;
38
48
  /**
39
49
  *
40
- * @returns {String}
50
+ * @returns {string}
41
51
  */
42
52
  getValue(): string;
43
53
  /**
44
54
  *
45
- * @param {function} f
55
+ * @param {function(string,string)} f
56
+ * @param {*} [thisArg]
57
+ * @returns {this}
46
58
  */
47
- process(f: Function): void;
48
- toJSON(): string;
49
- fromJSON(obj: any): void;
59
+ process(f: (arg0: string, arg1: string) => any, thisArg?: any): this;
50
60
  /**
51
- *
61
+ * @deprecated use {@link buffer.writeUTF8String} directly instead
52
62
  * @param {BinaryBuffer} buffer
53
63
  */
54
64
  toBinaryBuffer(buffer: BinaryBuffer): void;
55
65
  /**
56
- *
66
+ * @deprecated use {@link buffer.readUTF8String} directly instead
57
67
  * @param {BinaryBuffer} buffer
58
68
  */
59
69
  fromBinaryBuffer(buffer: BinaryBuffer): void;
70
+ /**
71
+ *
72
+ * @param {ObservedString} other
73
+ * @returns {boolean}
74
+ */
75
+ equals(other: ObservedString): boolean;
76
+ /**
77
+ *
78
+ * @return {number}
79
+ */
60
80
  hash(): number;
61
81
  /**
62
82
  * Used for optimized "instanceof" check
@@ -64,6 +84,11 @@ declare class ObservedString extends String {
64
84
  * @type {boolean}
65
85
  */
66
86
  readonly isObservedString: boolean;
87
+ toJSON: () => string;
88
+ fromJSON: (value: string) => ObservedString;
89
+ }
90
+ declare namespace ObservedString {
91
+ let typeName: string;
67
92
  }
68
93
  import Signal from "../events/signal/Signal.js";
69
94
  //# sourceMappingURL=ObservedString.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ObservedString.d.ts","sourceRoot":"","sources":["../../../../src/core/model/ObservedString.js"],"names":[],"mappings":";AAIA;;;;GAIG;AACH;IACI;;;;OAIG;IACH,oBAHW,MAAM,EAgBhB;IARG;;;;OAIG;IACH,gBAAoB;IAEpB,0DAA6B;IAmBjC;;;;OAIG;IACH,oBAFa,cAAc,CAa1B;IAED;;;OAGG;IACH,YAFW,cAAc,QAIxB;IAED;;;;OAIG;IACH,cAHW,cAAc,GACZ,OAAO,CAInB;IAED;;;OAGG;IACH,mBAEC;IAED;;;OAGG;IACH,2BAIC;IAED,iBAEC;IAED,yBAEC;IAED;;;OAGG;IACH,uBAFW,YAAY,QAItB;IAED;;;OAGG;IACH,yBAFW,YAAY,QAMtB;IAED,eAEC;IAGL;;;;OAIG;IACH,2BAFU,OAAO,CAEwB;CAPxC;mBA/HkB,4BAA4B"}
1
+ {"version":3,"file":"ObservedString.d.ts","sourceRoot":"","sources":["../../../../src/core/model/ObservedString.js"],"names":[],"mappings":";AAIA;;;;;;;;;;;;;GAaG;AACH;IACI;;;OAGG;IACH,oBAFW,MAAM,EAmBhB;IAZG;;;;OAIG;IACH,gBAAoB;IAEpB;;;OAGG;IACH,WAFU,MAAM,CAAC,MAAM,EAAC,MAAM,CAAC,CAEF;IAmBjC;;;;OAIG;IACH,WAHW,MAAM,GACJ,cAAc,CAa1B;IAED;;;OAGG;IACH,YAFW,cAAc,QAIxB;IAED;;OAEG;IACH,SAFY,cAAc,CAQzB;IAED;;;OAGG;IACH,YAFa,MAAM,CAIlB;IAED;;;;;OAKG;IACH,WAJW,CAAS,IAAM,EAAN,MAAM,EAAC,IAAM,EAAN,MAAM,QAAC,YACvB,GAAC,GACC,IAAI,CAUhB;IAED;;;OAGG;IACH,uBAFW,YAAY,QAItB;IAED;;;OAGG;IACH,yBAFW,YAAY,QAMtB;IAED;;;;OAIG;IACH,cAHW,cAAc,GACZ,OAAO,CAInB;IAED;;;OAGG;IACH,QAFY,MAAM,CAIjB;IAGL;;;;OAIG;IACH,2BAFU,OAAO,CAEwB;IAUzC,cAtHiB,MAAM,CAsHQ;IAC/B,kBA/Ge,MAAM,KACJ,cAAc,CA8GE;CAlBhC;;kBAWS,MAAM;;mBAnKG,4BAA4B"}
@@ -3,6 +3,15 @@ import Signal from "../events/signal/Signal.js";
3
3
  import { computeStringHash } from "../primitives/strings/computeStringHash.js";
4
4
 
5
5
  /**
6
+ * Observable string container.
7
+ * Signals change via {@link onChanged}.
8
+ *
9
+ * @example
10
+ * const name = new ObservedString("Alice")
11
+ * name.onChanged((new_name, old_name) => console.log(`Name changed from ${old_name} to ${new_name}!`));
12
+ * ...
13
+ * name.set("Barbara"); // will print "Name changed from Alice to Barbara!" in console
14
+ * name.getValue() === "Barbara"
6
15
  *
7
16
  * @author Alex Goldring
8
17
  * @copyright Company Named Limited (c) 2025
@@ -10,8 +19,7 @@ import { computeStringHash } from "../primitives/strings/computeStringHash.js";
10
19
  class ObservedString extends String {
11
20
  /**
12
21
  *
13
- * @param {string} [value]
14
- * @constructor
22
+ * @param {string} [value=""]
15
23
  */
16
24
  constructor(value = "") {
17
25
  super();
@@ -20,17 +28,21 @@ class ObservedString extends String {
20
28
 
21
29
  /**
22
30
  *
23
- * @type {String}
31
+ * @type {string}
24
32
  * @private
25
33
  */
26
34
  this.__value = value;
27
35
 
36
+ /**
37
+ *
38
+ * @type {Signal<string,string>}
39
+ */
28
40
  this.onChanged = new Signal();
29
41
  }
30
42
 
31
43
  /**
32
44
  *
33
- * @returns {String}
45
+ * @returns {string}
34
46
  */
35
47
  valueOf() {
36
48
  return this.__value;
@@ -38,7 +50,7 @@ class ObservedString extends String {
38
50
 
39
51
  /**
40
52
  *
41
- * @returns {String}
53
+ * @returns {string}
42
54
  */
43
55
  toString() {
44
56
  return this.__value;
@@ -46,7 +58,7 @@ class ObservedString extends String {
46
58
 
47
59
  /**
48
60
  *
49
- * @param {String} value
61
+ * @param {string} value
50
62
  * @returns {ObservedString}
51
63
  */
52
64
  set(value) {
@@ -71,17 +83,19 @@ class ObservedString extends String {
71
83
  }
72
84
 
73
85
  /**
74
- *
75
- * @param {ObservedString} other
76
- * @returns {boolean}
86
+ * @return {ObservedString}
77
87
  */
78
- equals(other) {
79
- return this.__value === other.__value;
88
+ clone() {
89
+ const r = new this.constructor();
90
+
91
+ r.copy(this);
92
+
93
+ return r;
80
94
  }
81
95
 
82
96
  /**
83
97
  *
84
- * @returns {String}
98
+ * @returns {string}
85
99
  */
86
100
  getValue() {
87
101
  return this.__value;
@@ -89,24 +103,22 @@ class ObservedString extends String {
89
103
 
90
104
  /**
91
105
  *
92
- * @param {function} f
106
+ * @param {function(string,string)} f
107
+ * @param {*} [thisArg]
108
+ * @returns {this}
93
109
  */
94
- process(f) {
95
- f(this.getValue());
110
+ process(f, thisArg) {
111
+ this.onChanged.add(f, thisArg);
96
112
 
97
- this.onChanged.add(f);
98
- }
113
+ const v = this.getValue();
99
114
 
100
- toJSON() {
101
- return this.__value;
102
- }
115
+ f.call(thisArg, v, v);
103
116
 
104
- fromJSON(obj) {
105
- this.set(obj);
117
+ return this;
106
118
  }
107
119
 
108
120
  /**
109
- *
121
+ * @deprecated use {@link buffer.writeUTF8String} directly instead
110
122
  * @param {BinaryBuffer} buffer
111
123
  */
112
124
  toBinaryBuffer(buffer) {
@@ -114,7 +126,7 @@ class ObservedString extends String {
114
126
  }
115
127
 
116
128
  /**
117
- *
129
+ * @deprecated use {@link buffer.readUTF8String} directly instead
118
130
  * @param {BinaryBuffer} buffer
119
131
  */
120
132
  fromBinaryBuffer(buffer) {
@@ -123,6 +135,19 @@ class ObservedString extends String {
123
135
  this.set(value);
124
136
  }
125
137
 
138
+ /**
139
+ *
140
+ * @param {ObservedString} other
141
+ * @returns {boolean}
142
+ */
143
+ equals(other) {
144
+ return this.__value === other.__value;
145
+ }
146
+
147
+ /**
148
+ *
149
+ * @return {number}
150
+ */
126
151
  hash() {
127
152
  return computeStringHash(this.__value);
128
153
  }
@@ -135,4 +160,15 @@ class ObservedString extends String {
135
160
  */
136
161
  ObservedString.prototype.isObservedString = true;
137
162
 
163
+ /**
164
+ * @readonly
165
+ * @type {string}
166
+ */
167
+ ObservedString.typeName = "ObservedString";
168
+
169
+ // JSON methods
170
+
171
+ ObservedString.prototype.toJSON = ObservedString.prototype.toString;
172
+ ObservedString.prototype.fromJSON = ObservedString.prototype.set;
173
+
138
174
  export default ObservedString;
@@ -49,9 +49,10 @@ declare class ObservedValue {
49
49
  /**
50
50
  * Convenience method, invoked given function with current value and registers onChanged callback
51
51
  * @param {function} processor
52
+ * @param {*} [thisArg]
52
53
  * @returns {ObservedValue.<T>}
53
54
  */
54
- process(processor: Function): ObservedValue<T>;
55
+ process(processor: Function, thisArg?: any): ObservedValue<T>;
55
56
  toString(): string;
56
57
  toJSON(): T;
57
58
  fromJSON(value: any): void;
@@ -1 +1 @@
1
- {"version":3,"file":"ObservedValue.d.ts","sourceRoot":"","sources":["../../../../src/core/model/ObservedValue.js"],"names":[],"mappings":";AAEA;IACI;;;;;OAKG;IACH,eAHW,CAAC,EAWX;IAPG,0DAA6B;IAC7B,WAAgB;IAChB;;;OAGG;IACH,UAFU,CAAC,MAAY,CAAC,CAAC,CAEkB;IAG/C;;;OAGG;IACH,WAFW,CAAC,QAQX;IAED;;;;OAIG;IACH,iBAHW,CAAC,QAKX;IAED;;;OAGG;IACH,OAFa,CAAC,CAIb;IAED;;;OAGG;IACH,YAFW,aAAa,QAIvB;IAED;;;;OAIG;IACH,cAHW,aAAa,GACX,OAAO,CAInB;IAED;;;OAGG;IACH,SAFa,aAAa,CAAE,CAAC,CAAC,CAI7B;IAED;;;;OAIG;IACH,8BAFa,aAAa,CAAE,CAAC,CAAC,CAM7B;IAED,mBAIC;IAED,YAEC;IAED,2BAEC;CACJ;mBAjGkB,4BAA4B"}
1
+ {"version":3,"file":"ObservedValue.d.ts","sourceRoot":"","sources":["../../../../src/core/model/ObservedValue.js"],"names":[],"mappings":";AAEA;IACI;;;;;OAKG;IACH,eAHW,CAAC,EAWX;IAPG,0DAA6B;IAC7B,WAAgB;IAChB;;;OAGG;IACH,UAFU,CAAC,MAAY,CAAC,CAAC,CAEkB;IAG/C;;;OAGG;IACH,WAFW,CAAC,QAQX;IAED;;;;OAIG;IACH,iBAHW,CAAC,QAKX;IAED;;;OAGG;IACH,OAFa,CAAC,CAIb;IAED;;;OAGG;IACH,YAFW,aAAa,QAIvB;IAED;;;;OAIG;IACH,cAHW,aAAa,GACX,OAAO,CAInB;IAED;;;OAGG;IACH,SAFa,aAAa,CAAE,CAAC,CAAC,CAI7B;IAED;;;;;OAKG;IACH,uCAHW,GAAC,GACC,aAAa,CAAE,CAAC,CAAC,CAU7B;IAED,mBAIC;IAED,YAEC;IAED,2BAEC;CACJ;mBAtGkB,4BAA4B"}
@@ -74,11 +74,16 @@ class ObservedValue {
74
74
  /**
75
75
  * Convenience method, invoked given function with current value and registers onChanged callback
76
76
  * @param {function} processor
77
+ * @param {*} [thisArg]
77
78
  * @returns {ObservedValue.<T>}
78
79
  */
79
- process(processor) {
80
- processor(this.__value);
81
- this.onChanged.add(processor);
80
+ process(processor, thisArg) {
81
+ this.onChanged.add(processor, thisArg);
82
+
83
+ const v = this.__value;
84
+
85
+ processor.call(thisArg, v, v);
86
+
82
87
  return this;
83
88
  }
84
89
 
@@ -1 +1 @@
1
- {"version":3,"file":"ReactiveExpression.d.ts","sourceRoot":"","sources":["../../../../../../src/core/model/reactive/model/ReactiveExpression.js"],"names":[],"mappings":"AAIA;;GAEG;AACH,gCAFa,CAAC;IAIN,0DAA6B;IAGjC,uBAEC;IAED,cAEC;IAED;;;;OAIG;IACH,wCAFa,OAAO,CAQnB;IAED;;;OAGG;IACH,UAFa,MAAM,CAIlB;IAED;;;OAGG;IACH,QAFa,MAAM,CAIlB;IAED;;OAEG;IACH,YAFa,CAAC,GAAC,OAAO,GAAC,MAAM,GAAC,MAAM,CAInC;IAED;;;;OAIG;IACH,iCAFW,GAAC,QAIX;IAED;;;OAGG;IACH,mBAFY,MAAM,CAQjB;IAED;;;OAGG;IACH,iCAIC;IAED;;;;OAIG;IACH,sBAFa,OAAO,GAAC,MAAM,GAAC,MAAM,CAIjC;IAGL,cAAqC;IAErC;;;OAGG;IACH,+BAFU,OAAO,CAEgC;CARhD;mBA/FkB,kCAAkC"}
1
+ {"version":3,"file":"ReactiveExpression.d.ts","sourceRoot":"","sources":["../../../../../../src/core/model/reactive/model/ReactiveExpression.js"],"names":[],"mappings":"AAIA;;GAEG;AACH,gCAFa,CAAC;IAIV;;;OAGG;IACH,oBAFU,MAAM,CAAC,CAAC,EAAC,CAAC,CAAC,CAEI;IAGzB,uBAEC;IAED,cAEC;IAED;;;;OAIG;IACH,wCAFa,OAAO,CAQnB;IAED;;;OAGG;IACH,UAFa,MAAM,CAIlB;IAED;;;OAGG;IACH,QAFa,MAAM,CAIlB;IAED;;OAEG;IACH,YAFa,CAAC,GAAC,OAAO,GAAC,MAAM,GAAC,MAAM,CAInC;IAED;;;;OAIG;IACH,iCAFW,GAAC,QAIX;IAED;;;OAGG;IACH,mBAFY,MAAM,CAQjB;IAED;;;;;OAKG;IACH,iBAJW,CAAS,IAAC,EAAD,CAAC,EAAC,IAAC,EAAD,CAAC,QAAC,YACb,GAAC,GACC,IAAI,CAUhB;IAED;;;;OAIG;IACH,sBAFa,OAAO,GAAC,MAAM,GAAC,MAAM,CAIjC;IAGL,cAAqC;IAErC;;;OAGG;IACH,+BAFU,OAAO,CAEgC;CARhD;mBAzGkB,kCAAkC"}
@@ -6,9 +6,13 @@ import { computeStringHash } from "../../../primitives/strings/computeStringHash
6
6
  * @template T
7
7
  */
8
8
  export class ReactiveExpression {
9
- constructor() {
10
- this.onChanged = new Signal();
11
- }
9
+
10
+ /**
11
+ * @readonly
12
+ * @type {Signal<T,T>}
13
+ */
14
+ onChanged = new Signal();
15
+
12
16
 
13
17
  copy(other) {
14
18
  throw new Error('Not Implemented');
@@ -77,12 +81,18 @@ export class ReactiveExpression {
77
81
 
78
82
  /**
79
83
  *
80
- * @param {function} handler
84
+ * @param {function(T,T)} handler
85
+ * @param {*} [thisArg]
86
+ * @returns {this}
81
87
  */
82
- process(handler) {
83
- handler(this.getValue());
88
+ process(handler, thisArg) {
89
+ this.onChanged.add(handler, thisArg);
90
+
91
+ const v = this.getValue();
92
+
93
+ handler.call(thisArg, v, v);
84
94
 
85
- this.onChanged.add(handler);
95
+ return this;
86
96
  }
87
97
 
88
98
  /**
@@ -1,2 +1,6 @@
1
- export const PATH_SEPARATOR: "/";
1
+ /**
2
+ * Separator used for file paths and URLs
3
+ * @type {string}
4
+ */
5
+ export const PATH_SEPARATOR: string;
2
6
  //# sourceMappingURL=PATH_SEPARATOR.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"PATH_SEPARATOR.d.ts","sourceRoot":"","sources":["../../../../src/core/path/PATH_SEPARATOR.js"],"names":[],"mappings":"AAAA,6BAA8B,GAAG,CAAC"}
1
+ {"version":3,"file":"PATH_SEPARATOR.d.ts","sourceRoot":"","sources":["../../../../src/core/path/PATH_SEPARATOR.js"],"names":[],"mappings":"AAAA;;;GAGG;AACH,6BAFU,MAAM,CAEkB"}
@@ -1 +1,5 @@
1
+ /**
2
+ * Separator used for file paths and URLs
3
+ * @type {string}
4
+ */
1
5
  export const PATH_SEPARATOR = '/';
@@ -15,7 +15,9 @@
15
15
  * const id_b = UUID.v1();
16
16
  *
17
17
  * id_a.equals(id_b); // false
18
-
18
+ *
19
+ * @author Alex Goldring
20
+ * @copyright Company Named Limited (c) 2025
19
21
  */
20
22
  export class UUID {
21
23
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"UUID.d.ts","sourceRoot":"","sources":["../../../../../src/engine/ecs/guid/UUID.js"],"names":[],"mappings":"AAyBA;;;;;;;;;;;;;;;;;;GAkBG;AACH;IA2HI;;;OAGG;IACH,aAFY,IAAI,CAQf;IA2BD;;;OAGG;IACH,aAFa,IAAI,CAQhB;IAED;;;;OAIG;IACH,iBAFY,MAAM,CAIjB;IA6CD;;;;OAIG;IACH,qBAHW,MAAM,GACL,IAAI,CAQf;IAxOD;;;OAGG;IACH,gBAFW,MAAM,EAAE,GAAC,UAAU,GAAC,SAAS,CAAC,MAAM,CAAC,EAO/C;IAED;;;OAGG;IACH,YAFa,UAAU,CAItB;IAED;;;;;;;;OAQG;IACH,eALY,MAAM,CAUjB;IAED;;;;OAIG;IACH,OAFa,IAAI,CAIhB;IAED;;;OAGG;IACH,MAFa,IAAI,CAwEhB;IAcD;;;OAGG;IACH,MAFa,IAAI,CAqBhB;IAuBD;;;OAGG;IACH,cAFW,MAAM,QAuChB;IAeD;;;;;;OAMG;IACH,YAFa,MAAM,CA2BlB;IAED;;;OAGG;IACH,YAFW,IAAI,QAId;IAED;;;;OAIG;IACH,cAHW,IAAI,GACF,OAAO,CAcnB;IAED;;;OAGG;IACH,QAFa,MAAM,CAYlB;IAIL;;OAEG;IACH,uBA7EiB,MAAM,CA6EF;IAErB;;OAEG;IACH,4BA7Ie,MAAM,UA6IE;IAQvB;;;OAGG;IACH,iBAFU,OAAO,CAEI;;CAtBpB;;kBAcS,MAAM"}
1
+ {"version":3,"file":"UUID.d.ts","sourceRoot":"","sources":["../../../../../src/engine/ecs/guid/UUID.js"],"names":[],"mappings":"AAyBA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH;IA2HI;;;OAGG;IACH,aAFY,IAAI,CAQf;IA2BD;;;OAGG;IACH,aAFa,IAAI,CAQhB;IAED;;;;OAIG;IACH,iBAFY,MAAM,CAIjB;IA6CD;;;;OAIG;IACH,qBAHW,MAAM,GACL,IAAI,CAQf;IAxOD;;;OAGG;IACH,gBAFW,MAAM,EAAE,GAAC,UAAU,GAAC,SAAS,CAAC,MAAM,CAAC,EAO/C;IAED;;;OAGG;IACH,YAFa,UAAU,CAItB;IAED;;;;;;;;OAQG;IACH,eALY,MAAM,CAUjB;IAED;;;;OAIG;IACH,OAFa,IAAI,CAIhB;IAED;;;OAGG;IACH,MAFa,IAAI,CAwEhB;IAcD;;;OAGG;IACH,MAFa,IAAI,CAqBhB;IAuBD;;;OAGG;IACH,cAFW,MAAM,QAuChB;IAeD;;;;;;OAMG;IACH,YAFa,MAAM,CA2BlB;IAED;;;OAGG;IACH,YAFW,IAAI,QAId;IAED;;;;OAIG;IACH,cAHW,IAAI,GACF,OAAO,CAcnB;IAED;;;OAGG;IACH,QAFa,MAAM,CAYlB;IAIL;;OAEG;IACH,uBA7EiB,MAAM,CA6EF;IAErB;;OAEG;IACH,4BA7Ie,MAAM,UA6IE;IAQvB;;;OAGG;IACH,iBAFU,OAAO,CAEI;;CAtBpB;;kBAcS,MAAM"}
@@ -7,21 +7,21 @@ import { randomUint8 } from "../../../core/math/random/randomUint8.js";
7
7
  import { seededRandom } from "../../../core/math/random/seededRandom.js";
8
8
 
9
9
  // Previous uuid creation time
10
- let _lastMSecs = 0;
11
- let _lastNSecs = 0;
10
+ let _last_milliseconds = 0;
11
+ let _last_nanoseconds = 0;
12
12
 
13
13
  // seed random with current time to lower potential correlation
14
14
  const random = seededRandom(Date.now());
15
15
 
16
16
  // node and clockseq need to be initialized to random values.
17
- const _nodeId = new Uint8Array(6);
17
+ const _node_id = new Uint8Array(6);
18
18
 
19
19
  // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)
20
- randomBytes(_nodeId, 0, random, 6);
21
- _nodeId[0] |= 0x01;
20
+ randomBytes(_node_id, 0, random, 6);
21
+ _node_id[0] |= 0x01;
22
22
 
23
23
  // Per 4.2.2, randomize (14 bit) clockseq
24
- let _clockseq = ((randomUint8(random) << 8) | randomUint8(random)) & 0x3fff;
24
+ let _clock_seq = ((randomUint8(random) << 8) | randomUint8(random)) & 0x3fff;
25
25
 
26
26
  /**
27
27
  * Universally Unique Identifier (UUID), a 128 bit label used to uniquely identify resources.
@@ -40,7 +40,9 @@ let _clockseq = ((randomUint8(random) << 8) | randomUint8(random)) & 0x3fff;
40
40
  * const id_b = UUID.v1();
41
41
  *
42
42
  * id_a.equals(id_b); // false
43
-
43
+ *
44
+ * @author Alex Goldring
45
+ * @copyright Company Named Limited (c) 2025
44
46
  */
45
47
  export class UUID {
46
48
  #data = new Uint8Array(16);
@@ -98,7 +100,7 @@ export class UUID {
98
100
 
99
101
  const b = this.#data;
100
102
 
101
- let clockseq = _clockseq;
103
+ let clock_seq = _clock_seq;
102
104
 
103
105
  // UUID timestamps are 100 nano-second units since the Gregorian epoch,
104
106
  // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so
@@ -108,37 +110,37 @@ export class UUID {
108
110
 
109
111
  // Per 4.2.1.2, use count of uuid's generated during the current clock
110
112
  // cycle to simulate higher resolution clock
111
- let nsecs = _lastNSecs + 1;
113
+ let nanoseconds = _last_nanoseconds + 1;
112
114
 
113
115
  // Time since last uuid creation (in msecs)
114
- const dt = msecs - _lastMSecs + (nsecs - _lastNSecs) / 10000;
116
+ const dt = msecs - _last_milliseconds + (nanoseconds - _last_nanoseconds) / 10000;
115
117
 
116
118
  // Per 4.2.1.2, Bump clockseq on clock regression
117
119
  if (dt < 0) {
118
- clockseq = (clockseq + 1) & 0x3fff;
120
+ clock_seq = (clock_seq + 1) & 0x3fff;
119
121
  }
120
122
 
121
123
  // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new
122
124
  // time interval
123
- if ((dt < 0 || msecs > _lastMSecs)) {
124
- nsecs = 0;
125
+ if ((dt < 0 || msecs > _last_milliseconds)) {
126
+ nanoseconds = 0;
125
127
  }
126
128
 
127
129
  // Per 4.2.1.2 Throw error if too many uuids are requested
128
- if (nsecs >= 10000) {
130
+ if (nanoseconds >= 10000) {
129
131
  throw new Error(".v1(): Can't create more than 10M uuids/sec");
130
132
  }
131
133
 
132
- _lastMSecs = msecs;
133
- _lastNSecs = nsecs;
134
- _clockseq = clockseq;
134
+ _last_milliseconds = msecs;
135
+ _last_nanoseconds = nanoseconds;
136
+ _clock_seq = clock_seq;
135
137
 
136
138
  // Per 4.1.4 - Convert from unix epoch to Gregorian epoch
137
139
  msecs += 12219292800000;
138
140
 
139
141
  let i = 0
140
142
  // `time_low`
141
- const tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000;
143
+ const tl = ((msecs & 0xfffffff) * 10000 + nanoseconds) % 0x100000000;
142
144
  b[i++] = (tl >>> 24) & 0xff;
143
145
  b[i++] = (tl >>> 16) & 0xff;
144
146
  b[i++] = (tl >>> 8) & 0xff;
@@ -154,14 +156,14 @@ export class UUID {
154
156
  b[i++] = (tmh >>> 16) & 0xff;
155
157
 
156
158
  // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)
157
- b[i++] = (clockseq >>> 8) | 0x80;
159
+ b[i++] = (clock_seq >>> 8) | 0x80;
158
160
 
159
161
  // `clock_seq_low`
160
- b[i++] = clockseq & 0xff;
162
+ b[i++] = clock_seq & 0xff;
161
163
 
162
164
  // `node`
163
165
  for (let n = 0; n < 6; ++n) {
164
- b[i + n] = _nodeId[n];
166
+ b[i + n] = _node_id[n];
165
167
  }
166
168
  }
167
169
 
@@ -1,20 +1,13 @@
1
- export default Name;
2
- declare class Name extends ObservedString {
3
- /**
4
- *
5
- * @returns {string}
6
- */
7
- getLocalizationKey(): string;
1
+ export class Name extends ObservedString {
8
2
  /**
9
- *
10
- * @param {Localization} localization
11
- * @returns {string}
3
+ * @readonly
4
+ * @type {boolean}
12
5
  */
13
- getLocalizedValue(localization: Localization): string;
14
- clone(): Name;
6
+ readonly isName: boolean;
15
7
  }
16
- declare namespace Name {
8
+ export namespace Name {
17
9
  let typeName: string;
18
10
  }
11
+ export default Name;
19
12
  import ObservedString from "../../../core/model/ObservedString.js";
20
13
  //# sourceMappingURL=Name.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Name.d.ts","sourceRoot":"","sources":["../../../../../src/engine/ecs/name/Name.js"],"names":[],"mappings":";AAEA;IASI;;;OAGG;IACH,sBAFa,MAAM,CAIlB;IAED;;;;OAIG;IACH,gCAHW,YAAY,GACV,MAAM,CAIlB;IAED,cAMC;CACJ;;;;2BAnC0B,uCAAuC"}
1
+ {"version":3,"file":"Name.d.ts","sourceRoot":"","sources":["../../../../../src/engine/ecs/name/Name.js"],"names":[],"mappings":"AAEA;IAiBA;;;OAGG;IACH,iBAFU,OAAO,CAEI;CAZpB;;kBAIS,MAAM;;;2BAfW,uCAAuC"}
@@ -1,6 +1,6 @@
1
1
  import ObservedString from "../../../core/model/ObservedString.js";
2
2
 
3
- class Name extends ObservedString {
3
+ export class Name extends ObservedString {
4
4
  /**
5
5
  *
6
6
  * @param {string} [value]
@@ -9,34 +9,20 @@ class Name extends ObservedString {
9
9
  super(value);
10
10
  }
11
11
 
12
- /**
13
- *
14
- * @returns {string}
15
- */
16
- getLocalizationKey() {
17
- return `component.name.${this.getValue()}`;
18
- }
19
-
20
- /**
21
- *
22
- * @param {Localization} localization
23
- * @returns {string}
24
- */
25
- getLocalizedValue(localization) {
26
- return localization.getString(this.getLocalizationKey());
27
- }
28
-
29
- clone() {
30
- const clone = new Name();
31
-
32
- clone.copy(this);
33
-
34
- return clone;
35
- }
36
12
  }
37
13
 
14
+ /**
15
+ * @readonly
16
+ * @type {string}
17
+ */
38
18
  Name.typeName = "Name";
39
19
 
20
+ /**
21
+ * @readonly
22
+ * @type {boolean}
23
+ */
24
+ Name.prototype.isName = true;
40
25
 
26
+ // prefer named import instead
41
27
  export default Name;
42
28