@carbonenginejs/runtime-utils 0.1.1 → 0.1.3

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 (104) hide show
  1. package/LICENSE +21 -21
  2. package/NOTICE +23 -23
  3. package/README.md +69 -69
  4. package/THIRD-PARTY-NOTICES.md +64 -64
  5. package/docs/README.md +74 -73
  6. package/docs/architecture.md +101 -101
  7. package/docs/concepts/foundation-consolidation.md +85 -85
  8. package/docs/concepts/model-lifecycle.md +111 -0
  9. package/docs/const-kb.md +85 -87
  10. package/docs/core-types/DECORATOR-TODOS.md +25 -25
  11. package/docs/core-types/README.md +229 -168
  12. package/docs/reference/api.md +105 -102
  13. package/docs/reference/classes/README.md +135 -135
  14. package/package.json +139 -139
  15. package/src/arrays.js +5 -5
  16. package/src/audio/audioFormats.js +34 -34
  17. package/src/audio/index.js +1 -1
  18. package/src/box3.js +331 -331
  19. package/src/bytes.js +56 -56
  20. package/src/compression.js +56 -56
  21. package/src/constants/index.js +7 -7
  22. package/src/constants/trinity.js +13 -13
  23. package/src/constants.js +15 -15
  24. package/src/curve.js +79 -79
  25. package/src/d3d/dxgiFormats.js +46 -46
  26. package/src/d3d/index.js +2 -2
  27. package/src/d3d/primitiveTopology.js +11 -11
  28. package/src/document/CjsCarbonDocument.js +212 -212
  29. package/src/document/CjsClassRegistry.js +373 -373
  30. package/src/document/CjsDocumentDehydrator.js +142 -142
  31. package/src/document/CjsDocumentHydrator.js +156 -156
  32. package/src/document/CjsStructRegistry.js +348 -348
  33. package/src/document/hydrationAdapter.js +129 -129
  34. package/src/document/index.js +6 -6
  35. package/src/errors/CjsError.js +286 -286
  36. package/src/errors/index.js +5 -5
  37. package/src/geometry/box.js +22 -22
  38. package/src/geometry/cylinder.js +22 -22
  39. package/src/geometry/helpers/earcut.js +1 -1
  40. package/src/geometry/helpers/misc.js +3 -3
  41. package/src/geometry/index.js +8 -8
  42. package/src/geometry/json.js +67 -67
  43. package/src/geometry/lathe.js +44 -44
  44. package/src/geometry/plane.js +14 -14
  45. package/src/geometry/shape.js +4 -4
  46. package/src/geometry/sphere.js +24 -24
  47. package/src/geometry/torus.js +14 -14
  48. package/src/graphics/colorSpaces.js +22 -22
  49. package/src/graphics/index.js +4 -4
  50. package/src/graphics/pixelFormats.js +158 -158
  51. package/src/graphics/textureDimensions.js +22 -22
  52. package/src/graphics/trinityEnums.js +87 -87
  53. package/src/index.js +62 -62
  54. package/src/is.js +108 -46
  55. package/src/json.js +23 -23
  56. package/src/lifecycle/CjsLifecycleState.js +77 -77
  57. package/src/lifecycle/index.js +1 -1
  58. package/src/lne3.js +70 -70
  59. package/src/lookup.js +48 -48
  60. package/src/mat3.js +51 -51
  61. package/src/mat4.js +699 -699
  62. package/src/math/index.js +25 -25
  63. package/src/math/scalar.js +63 -63
  64. package/src/media/index.js +1 -1
  65. package/src/media/mediaTypes.js +50 -50
  66. package/src/mesh.js +424 -424
  67. package/src/model/CjsEventEmitter.js +333 -333
  68. package/src/model/CjsModel.js +1589 -1544
  69. package/src/model/CjsModelState.js +72 -72
  70. package/src/model/index.js +4 -4
  71. package/src/model/sourceRecordUtils.js +54 -54
  72. package/src/noise.js +310 -310
  73. package/src/num.js +827 -827
  74. package/src/object.js +39 -39
  75. package/src/path.js +53 -53
  76. package/src/pln.js +125 -125
  77. package/src/pool.js +9 -9
  78. package/src/quat.js +144 -144
  79. package/src/ray3.js +188 -188
  80. package/src/renderContext/formats.js +145 -145
  81. package/src/renderContext/index.js +5 -5
  82. package/src/renderContext/presentation.js +125 -125
  83. package/src/renderContext/resources.js +27 -27
  84. package/src/renderContext/upscaling.js +22 -22
  85. package/src/renderContext/window.js +20 -20
  86. package/src/runtime/CjsRuntimeState.js +50 -50
  87. package/src/schema/CjsSchema.js +555 -318
  88. package/src/schema/index.js +4 -4
  89. package/src/shader/index.js +1 -1
  90. package/src/shader/shaderStages.js +37 -37
  91. package/src/sph3.js +181 -181
  92. package/src/tangent.js +288 -288
  93. package/src/text.js +40 -40
  94. package/src/tri3.js +98 -98
  95. package/src/types/carbonTypes.js +635 -635
  96. package/src/types/index.js +2 -2
  97. package/src/utils.js +58 -58
  98. package/src/validation.js +46 -46
  99. package/src/vec2.js +229 -229
  100. package/src/vec3.js +1188 -1172
  101. package/src/vec4.js +347 -347
  102. package/src/vertex.js +108 -108
  103. package/src/webgpu/index.js +1 -1
  104. package/src/webgpu/textureFormats.js +121 -121
@@ -1,20 +1,20 @@
1
- // Ported from CarbonEngine (MIT, (c) 2026 CCP Games) - https://github.com/carbonengine/trinity
2
- // trinity/UI/Tr2MainWindow.h (Tr2WindowMode, Tr2WindowShowState, Tr2ImeState_MacOS namespaces)
3
-
4
- export const Tr2WindowMode = Object.freeze({
5
- FULL_SCREEN: 0,
6
- WINDOWED: 1,
7
- FIXED_WINDOW: 2
8
- });
9
-
10
- export const Tr2WindowShowState = Object.freeze({
11
- NORMAL: 0,
12
- MAXIMIZED: 1,
13
- MINIMIZED: 2
14
- });
15
-
16
- export const Tr2ImeState_MacOS = Object.freeze({
17
- DISABLED: 0,
18
- READY: 1,
19
- BLOCKING: 2
20
- });
1
+ // Ported from CarbonEngine (MIT, (c) 2026 CCP Games) - https://github.com/carbonengine/trinity
2
+ // trinity/UI/Tr2MainWindow.h (Tr2WindowMode, Tr2WindowShowState, Tr2ImeState_MacOS namespaces)
3
+
4
+ export const Tr2WindowMode = Object.freeze({
5
+ FULL_SCREEN: 0,
6
+ WINDOWED: 1,
7
+ FIXED_WINDOW: 2
8
+ });
9
+
10
+ export const Tr2WindowShowState = Object.freeze({
11
+ NORMAL: 0,
12
+ MAXIMIZED: 1,
13
+ MINIMIZED: 2
14
+ });
15
+
16
+ export const Tr2ImeState_MacOS = Object.freeze({
17
+ DISABLED: 0,
18
+ READY: 1,
19
+ BLOCKING: 2
20
+ });
@@ -1,50 +1,50 @@
1
- /**
2
- * Gets an object's own CarbonEngineJS runtime state without creating it.
3
- *
4
- * Runtime state is intentionally stored on the object for inspection while
5
- * remaining outside enumeration and serialization.
6
- *
7
- * @param {object|Function} target
8
- * @returns {object|null}
9
- */
10
- export function getRuntimeState(target)
11
- {
12
- assertRuntimeStateTarget(target);
13
- if (!Object.prototype.hasOwnProperty.call(target, "__state")) return null;
14
-
15
- const state = target.__state;
16
- if (!state || typeof state !== "object" || Array.isArray(state))
17
- {
18
- throw new TypeError("Existing __state must be an object.");
19
- }
20
- return state;
21
- }
22
-
23
- /**
24
- * Gets or creates an object's own non-enumerable runtime state.
25
- *
26
- * @param {object|Function} target
27
- * @returns {object}
28
- */
29
- export function ensureRuntimeState(target)
30
- {
31
- const existing = getRuntimeState(target);
32
- if (existing) return existing;
33
-
34
- const state = {};
35
- Object.defineProperty(target, "__state", {
36
- value: state,
37
- enumerable: false,
38
- configurable: false,
39
- writable: false
40
- });
41
- return state;
42
- }
43
-
44
- function assertRuntimeStateTarget(target)
45
- {
46
- if ((typeof target !== "object" || target === null) && typeof target !== "function")
47
- {
48
- throw new TypeError("Runtime state requires an object or function.");
49
- }
50
- }
1
+ /**
2
+ * Gets an object's own CarbonEngineJS runtime state without creating it.
3
+ *
4
+ * Runtime state is intentionally stored on the object for inspection while
5
+ * remaining outside enumeration and serialization.
6
+ *
7
+ * @param {object|Function} target
8
+ * @returns {object|null}
9
+ */
10
+ export function getRuntimeState(target)
11
+ {
12
+ assertRuntimeStateTarget(target);
13
+ if (!Object.prototype.hasOwnProperty.call(target, "__state")) return null;
14
+
15
+ const state = target.__state;
16
+ if (!state || typeof state !== "object" || Array.isArray(state))
17
+ {
18
+ throw new TypeError("Existing __state must be an object.");
19
+ }
20
+ return state;
21
+ }
22
+
23
+ /**
24
+ * Gets or creates an object's own non-enumerable runtime state.
25
+ *
26
+ * @param {object|Function} target
27
+ * @returns {object}
28
+ */
29
+ export function ensureRuntimeState(target)
30
+ {
31
+ const existing = getRuntimeState(target);
32
+ if (existing) return existing;
33
+
34
+ const state = {};
35
+ Object.defineProperty(target, "__state", {
36
+ value: state,
37
+ enumerable: false,
38
+ configurable: false,
39
+ writable: false
40
+ });
41
+ return state;
42
+ }
43
+
44
+ function assertRuntimeStateTarget(target)
45
+ {
46
+ if ((typeof target !== "object" || target === null) && typeof target !== "function")
47
+ {
48
+ throw new TypeError("Runtime state requires an object or function.");
49
+ }
50
+ }