@configura/web-core 1.3.0-alpha.0 → 1.3.0-alpha.4

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 (166) hide show
  1. package/LICENSE +201 -201
  2. package/README.md +1 -1
  3. package/dist/cm/basic/Color.d.ts +16 -16
  4. package/dist/cm/basic/Color.js +18 -18
  5. package/dist/cm/basic/ColorF.d.ts +9 -9
  6. package/dist/cm/basic/ColorF.js +10 -10
  7. package/dist/cm/basic/boolean.d.ts +2 -2
  8. package/dist/cm/basic/boolean.js +11 -11
  9. package/dist/cm/basic/number.d.ts +3 -3
  10. package/dist/cm/basic/number.js +18 -18
  11. package/dist/cm/basic/string.d.ts +2 -2
  12. package/dist/cm/basic/string.js +11 -11
  13. package/dist/cm/core3D/ATriMeshF.d.ts +90 -90
  14. package/dist/cm/core3D/ATriMeshF.js +193 -193
  15. package/dist/cm/core3D/DummyUVMapper.d.ts +6 -6
  16. package/dist/cm/core3D/DummyUVMapper.js +6 -6
  17. package/dist/cm/core3D/GMaterial3D.d.ts +58 -58
  18. package/dist/cm/core3D/GMaterial3D.js +112 -112
  19. package/dist/cm/core3D/GMaterialClassic.d.ts +55 -55
  20. package/dist/cm/core3D/GMaterialClassic.js +171 -171
  21. package/dist/cm/core3D/GMaterialPBR.d.ts +71 -71
  22. package/dist/cm/core3D/GMaterialPBR.js +288 -288
  23. package/dist/cm/core3D/MultiGMaterial3D.d.ts +8 -8
  24. package/dist/cm/core3D/MultiGMaterial3D.js +17 -17
  25. package/dist/cm/core3D/UVMapEnv.d.ts +17 -17
  26. package/dist/cm/core3D/UVMapEnv.js +35 -35
  27. package/dist/cm/core3D/UVTransformer.d.ts +5 -5
  28. package/dist/cm/core3D/UVTransformer.js +5 -5
  29. package/dist/cm/core3D/instantiateUVMapper.d.ts +3 -3
  30. package/dist/cm/core3D/instantiateUVMapper.js +5 -5
  31. package/dist/cm/format/cmsym/InvalidationEnv.d.ts +9 -9
  32. package/dist/cm/format/cmsym/InvalidationEnv.js +13 -13
  33. package/dist/cm/format/cmsym/SymImportEnv.d.ts +9 -9
  34. package/dist/cm/format/cmsym/SymImportEnv.js +9 -9
  35. package/dist/cm/format/cmsym/SymInv.d.ts +8 -8
  36. package/dist/cm/format/cmsym/SymInv.js +15 -15
  37. package/dist/cm/format/cmsym/SymNode.d.ts +85 -85
  38. package/dist/cm/format/cmsym/SymNode.js +577 -577
  39. package/dist/cm/format/cmsym/components/SymBox.d.ts +14 -14
  40. package/dist/cm/format/cmsym/components/SymBox.js +34 -34
  41. package/dist/cm/format/cmsym/components/SymComponent.d.ts +29 -29
  42. package/dist/cm/format/cmsym/components/SymComponent.js +54 -54
  43. package/dist/cm/format/cmsym/components/SymConnector.d.ts +5 -5
  44. package/dist/cm/format/cmsym/components/SymConnector.js +10 -10
  45. package/dist/cm/format/cmsym/components/SymDexObj.d.ts +11 -11
  46. package/dist/cm/format/cmsym/components/SymDexObj.js +10 -10
  47. package/dist/cm/format/cmsym/components/SymGFX.d.ts +11 -11
  48. package/dist/cm/format/cmsym/components/SymGFX.js +20 -20
  49. package/dist/cm/format/cmsym/components/SymGMaterial.d.ts +19 -19
  50. package/dist/cm/format/cmsym/components/SymGMaterial.js +88 -88
  51. package/dist/cm/format/cmsym/components/SymGMaterialSelector.d.ts +12 -12
  52. package/dist/cm/format/cmsym/components/SymGMaterialSelector.js +20 -20
  53. package/dist/cm/format/cmsym/components/SymGetMeshEnv.d.ts +9 -9
  54. package/dist/cm/format/cmsym/components/SymGetMeshEnv.js +9 -9
  55. package/dist/cm/format/cmsym/components/SymLODGroup.d.ts +9 -9
  56. package/dist/cm/format/cmsym/components/SymLODGroup.js +11 -11
  57. package/dist/cm/format/cmsym/components/SymLight.d.ts +8 -8
  58. package/dist/cm/format/cmsym/components/SymLight.js +10 -10
  59. package/dist/cm/format/cmsym/components/SymLines2D.d.ts +5 -5
  60. package/dist/cm/format/cmsym/components/SymLines2D.js +7 -7
  61. package/dist/cm/format/cmsym/components/SymMeasure.d.ts +34 -34
  62. package/dist/cm/format/cmsym/components/SymMeasure.js +158 -158
  63. package/dist/cm/format/cmsym/components/SymMesh.d.ts +29 -29
  64. package/dist/cm/format/cmsym/components/SymMesh.js +130 -130
  65. package/dist/cm/format/cmsym/components/SymMeshLight.d.ts +8 -8
  66. package/dist/cm/format/cmsym/components/SymMeshLight.js +10 -10
  67. package/dist/cm/format/cmsym/components/SymMultiSelector.d.ts +13 -13
  68. package/dist/cm/format/cmsym/components/SymMultiSelector.js +49 -49
  69. package/dist/cm/format/cmsym/components/SymParams.d.ts +4 -4
  70. package/dist/cm/format/cmsym/components/SymParams.js +7 -7
  71. package/dist/cm/format/cmsym/components/SymPlane.d.ts +14 -14
  72. package/dist/cm/format/cmsym/components/SymPlane.js +27 -27
  73. package/dist/cm/format/cmsym/components/SymPlaneDivider.d.ts +4 -4
  74. package/dist/cm/format/cmsym/components/SymPlaneDivider.js +7 -7
  75. package/dist/cm/format/cmsym/components/SymPrimitive2D.d.ts +3 -3
  76. package/dist/cm/format/cmsym/components/SymPrimitive2D.js +3 -3
  77. package/dist/cm/format/cmsym/components/SymProgs.d.ts +4 -4
  78. package/dist/cm/format/cmsym/components/SymProgs.js +7 -7
  79. package/dist/cm/format/cmsym/components/SymProps.d.ts +54 -54
  80. package/dist/cm/format/cmsym/components/SymProps.js +170 -170
  81. package/dist/cm/format/cmsym/components/SymRep.d.ts +13 -13
  82. package/dist/cm/format/cmsym/components/SymRep.js +28 -28
  83. package/dist/cm/format/cmsym/components/SymReps.d.ts +36 -36
  84. package/dist/cm/format/cmsym/components/SymReps.js +229 -229
  85. package/dist/cm/format/cmsym/components/SymShape.d.ts +10 -10
  86. package/dist/cm/format/cmsym/components/SymShape.js +14 -14
  87. package/dist/cm/format/cmsym/components/SymSphere.d.ts +16 -16
  88. package/dist/cm/format/cmsym/components/SymSphere.js +30 -30
  89. package/dist/cm/format/cmsym/components/SymSpotlight.d.ts +8 -8
  90. package/dist/cm/format/cmsym/components/SymSpotlight.js +10 -10
  91. package/dist/cm/format/cmsym/components/SymTags.d.ts +11 -11
  92. package/dist/cm/format/cmsym/components/SymTags.js +20 -20
  93. package/dist/cm/format/cmsym/components/SymText2D.d.ts +4 -4
  94. package/dist/cm/format/cmsym/components/SymText2D.js +8 -8
  95. package/dist/cm/format/cmsym/components/SymText3D.d.ts +4 -4
  96. package/dist/cm/format/cmsym/components/SymText3D.js +8 -8
  97. package/dist/cm/format/cmsym/components/SymTransform.d.ts +23 -23
  98. package/dist/cm/format/cmsym/components/SymTransform.js +101 -101
  99. package/dist/cm/format/cmsym/components/SymUVMapper.d.ts +13 -13
  100. package/dist/cm/format/cmsym/components/SymUVMapper.js +50 -50
  101. package/dist/cm/format/cmsym/components/instantiate.d.ts +2 -2
  102. package/dist/cm/format/cmsym/components/instantiate.js +121 -121
  103. package/dist/cm/format/cmsym/components/legacy.d.ts +7 -7
  104. package/dist/cm/format/cmsym/components/legacy.js +27 -27
  105. package/dist/cm/format/cmsym/components/mesh.d.ts +8 -8
  106. package/dist/cm/format/cmsym/components/mesh.js +28 -28
  107. package/dist/cm/format/cmsym/invalidation.d.ts +4 -4
  108. package/dist/cm/format/cmsym/invalidation.js +72 -72
  109. package/dist/cm/format/dex/DexIRef.d.ts +9 -9
  110. package/dist/cm/format/dex/DexIRef.js +18 -18
  111. package/dist/cm/format/dex/DexInt.d.ts +11 -11
  112. package/dist/cm/format/dex/DexInt.js +18 -18
  113. package/dist/cm/format/dex/DexInternalizedXRef.d.ts +19 -19
  114. package/dist/cm/format/dex/DexInternalizedXRef.js +64 -64
  115. package/dist/cm/format/dex/DexLoader.d.ts +8 -8
  116. package/dist/cm/format/dex/DexLoader.js +12 -12
  117. package/dist/cm/format/dex/DexManager.d.ts +20 -20
  118. package/dist/cm/format/dex/DexManager.js +78 -78
  119. package/dist/cm/format/dex/DexObj.d.ts +15 -15
  120. package/dist/cm/format/dex/DexObj.js +86 -86
  121. package/dist/cm/format/dex/DexReader.d.ts +86 -86
  122. package/dist/cm/format/dex/DexReader.js +492 -492
  123. package/dist/cm/format/dex/DexRef.d.ts +6 -6
  124. package/dist/cm/format/dex/DexRef.js +8 -8
  125. package/dist/cm/format/dex/DexReplacedXRefs.d.ts +8 -8
  126. package/dist/cm/format/dex/DexReplacedXRefs.js +22 -22
  127. package/dist/cm/format/dex/DexURL.d.ts +4 -4
  128. package/dist/cm/format/dex/DexURL.js +5 -5
  129. package/dist/cm/format/dex/DexVersion.d.ts +15 -15
  130. package/dist/cm/format/dex/DexVersion.js +53 -53
  131. package/dist/cm/format/dex/DexXRef.d.ts +18 -18
  132. package/dist/cm/format/dex/DexXRef.js +51 -51
  133. package/dist/cm/format/dex/DexXRefTargetFilter.d.ts +4 -4
  134. package/dist/cm/format/dex/DexXRefTargetFilter.js +5 -5
  135. package/dist/cm/geometry/Angle.d.ts +9 -9
  136. package/dist/cm/geometry/Angle.js +18 -18
  137. package/dist/cm/geometry/AngleF.d.ts +5 -5
  138. package/dist/cm/geometry/AngleF.js +8 -8
  139. package/dist/cm/geometry/Box.d.ts +7 -7
  140. package/dist/cm/geometry/Box.js +9 -9
  141. package/dist/cm/geometry/DetailMask.d.ts +32 -32
  142. package/dist/cm/geometry/DetailMask.js +112 -112
  143. package/dist/cm/geometry/LayerExpr.d.ts +2 -2
  144. package/dist/cm/geometry/LayerExpr.js +2 -2
  145. package/dist/cm/geometry/Matrix22.d.ts +6 -6
  146. package/dist/cm/geometry/Matrix22.js +6 -6
  147. package/dist/cm/geometry/Matrix33.d.ts +42 -42
  148. package/dist/cm/geometry/Matrix33.js +124 -124
  149. package/dist/cm/geometry/Orientation.d.ts +7 -7
  150. package/dist/cm/geometry/Orientation.js +7 -7
  151. package/dist/cm/geometry/Plane.d.ts +8 -8
  152. package/dist/cm/geometry/Plane.js +14 -14
  153. package/dist/cm/geometry/Point.d.ts +18 -18
  154. package/dist/cm/geometry/Point.js +56 -56
  155. package/dist/cm/geometry/Point2D.d.ts +8 -8
  156. package/dist/cm/geometry/Point2D.js +20 -20
  157. package/dist/cm/geometry/PointF.d.ts +11 -11
  158. package/dist/cm/geometry/PointF.js +27 -27
  159. package/dist/cm/geometry/Transform.d.ts +11 -11
  160. package/dist/cm/geometry/Transform.js +61 -61
  161. package/dist/cm/geometry/Transform2D.d.ts +7 -7
  162. package/dist/cm/geometry/Transform2D.js +6 -6
  163. package/dist/cm/io/Semver.d.ts +17 -17
  164. package/dist/cm/io/Semver.js +58 -58
  165. package/dist/index.js +1 -1
  166. package/package.json +4 -4
@@ -1,13 +1,13 @@
1
- import { Logger } from "@configura/web-utilities";
2
- import { GMaterial3D } from "../../../core3D/GMaterial3D.js";
3
- import { DexObj } from "../../dex/DexObj.js";
4
- import { SymImportEnv } from "../SymImportEnv.js";
5
- import { SymComponent, SymComponentKey } from "./SymComponent.js";
6
- import { SymGMaterial } from "./SymGMaterial.js";
7
- export declare class SymGMaterialSelector extends SymComponent {
8
- id: SymComponentKey;
9
- gm?: GMaterial3D;
10
- symGMaterial?: SymGMaterial;
11
- load(logger: Logger, obj: DexObj, _env: SymImportEnv): void;
12
- }
1
+ import { Logger } from "@configura/web-utilities";
2
+ import { GMaterial3D } from "../../../core3D/GMaterial3D.js";
3
+ import { DexObj } from "../../dex/DexObj.js";
4
+ import { SymImportEnv } from "../SymImportEnv.js";
5
+ import { SymComponent, SymComponentKey } from "./SymComponent.js";
6
+ import { SymGMaterial } from "./SymGMaterial.js";
7
+ export declare class SymGMaterialSelector extends SymComponent {
8
+ id: SymComponentKey;
9
+ gm?: GMaterial3D;
10
+ symGMaterial?: SymGMaterial;
11
+ load(logger: Logger, obj: DexObj, _env: SymImportEnv): void;
12
+ }
13
13
  //# sourceMappingURL=SymGMaterialSelector.d.ts.map
@@ -1,20 +1,20 @@
1
- import { SymComponent } from "./SymComponent.js";
2
- import { SymGMaterial } from "./SymGMaterial.js";
3
- /// The specification says that the last option is the default / fallback if there isn't any
4
- /// match among the layers, so we only load and use that one.
5
- /// http://web.git.configura.com/webteam/docs/cmsym/#SymGMaterialSelector
6
- export class SymGMaterialSelector extends SymComponent {
7
- constructor() {
8
- super(...arguments);
9
- this.id = "symGMaterialSelector";
10
- }
11
- load(logger, obj, _env) {
12
- const options = obj.get("options");
13
- if (Array.isArray(options) && options.length > 0) {
14
- const last = new SymGMaterial();
15
- last.load(logger, options[options.length - 1], _env);
16
- this.gm = last.gm;
17
- this.symGMaterial = last;
18
- }
19
- }
20
- }
1
+ import { SymComponent } from "./SymComponent.js";
2
+ import { SymGMaterial } from "./SymGMaterial.js";
3
+ /// The specification says that the last option is the default / fallback if there isn't any
4
+ /// match among the layers, so we only load and use that one.
5
+ /// http://web.git.configura.com/webteam/docs/cmsym/#SymGMaterialSelector
6
+ export class SymGMaterialSelector extends SymComponent {
7
+ constructor() {
8
+ super(...arguments);
9
+ this.id = "symGMaterialSelector";
10
+ }
11
+ load(logger, obj, _env) {
12
+ const options = obj.get("options");
13
+ if (Array.isArray(options) && options.length > 0) {
14
+ const last = new SymGMaterial();
15
+ last.load(logger, options[options.length - 1], _env);
16
+ this.gm = last.gm;
17
+ this.symGMaterial = last;
18
+ }
19
+ }
20
+ }
@@ -1,10 +1,10 @@
1
- import { SymRep } from "./SymRep.js";
2
- export declare class SymGetMeshEnv {
3
- rep?: SymRep | undefined;
4
- load: boolean;
5
- doubleSided: boolean;
6
- requiresUVs: boolean;
7
- insideOut: boolean;
8
- constructor(rep?: SymRep | undefined, load?: boolean, doubleSided?: boolean, requiresUVs?: boolean, insideOut?: boolean);
9
- }
1
+ import { SymRep } from "./SymRep.js";
2
+ export declare class SymGetMeshEnv {
3
+ rep?: SymRep | undefined;
4
+ load: boolean;
5
+ doubleSided: boolean;
6
+ requiresUVs: boolean;
7
+ insideOut: boolean;
8
+ constructor(rep?: SymRep | undefined, load?: boolean, doubleSided?: boolean, requiresUVs?: boolean, insideOut?: boolean);
9
+ }
10
10
  //# sourceMappingURL=SymGetMeshEnv.d.ts.map
@@ -1,9 +1,9 @@
1
- export class SymGetMeshEnv {
2
- constructor(rep, load = true, doubleSided = false, requiresUVs = false, insideOut = false) {
3
- this.rep = rep;
4
- this.load = load;
5
- this.doubleSided = doubleSided;
6
- this.requiresUVs = requiresUVs;
7
- this.insideOut = insideOut;
8
- }
9
- }
1
+ export class SymGetMeshEnv {
2
+ constructor(rep, load = true, doubleSided = false, requiresUVs = false, insideOut = false) {
3
+ this.rep = rep;
4
+ this.load = load;
5
+ this.doubleSided = doubleSided;
6
+ this.requiresUVs = requiresUVs;
7
+ this.insideOut = insideOut;
8
+ }
9
+ }
@@ -1,10 +1,10 @@
1
- import { Logger } from "@configura/web-utilities";
2
- import { DexObj } from "../../dex/DexObj.js";
3
- import { SymImportEnv } from "../SymImportEnv.js";
4
- import { SymComponent, SymComponentKey } from "./SymComponent.js";
5
- export declare class SymLODGroup extends SymComponent {
6
- id: SymComponentKey;
7
- load(logger: Logger, obj: DexObj, env: SymImportEnv, force?: boolean): void;
8
- level(): number;
9
- }
1
+ import { Logger } from "@configura/web-utilities";
2
+ import { DexObj } from "../../dex/DexObj.js";
3
+ import { SymImportEnv } from "../SymImportEnv.js";
4
+ import { SymComponent, SymComponentKey } from "./SymComponent.js";
5
+ export declare class SymLODGroup extends SymComponent {
6
+ id: SymComponentKey;
7
+ load(logger: Logger, obj: DexObj, env: SymImportEnv, force?: boolean): void;
8
+ level(): number;
9
+ }
10
10
  //# sourceMappingURL=SymLODGroup.d.ts.map
@@ -1,11 +1,11 @@
1
- import { SymComponent } from "./SymComponent.js";
2
- export class SymLODGroup extends SymComponent {
3
- constructor() {
4
- super(...arguments);
5
- this.id = "symLODGroup";
6
- }
7
- load(logger, obj, env, force = false) { }
8
- level() {
9
- return 1;
10
- }
11
- }
1
+ import { SymComponent } from "./SymComponent.js";
2
+ export class SymLODGroup extends SymComponent {
3
+ constructor() {
4
+ super(...arguments);
5
+ this.id = "symLODGroup";
6
+ }
7
+ load(logger, obj, env, force = false) { }
8
+ level() {
9
+ return 1;
10
+ }
11
+ }
@@ -1,9 +1,9 @@
1
- import { Logger } from "@configura/web-utilities";
2
- import { DexObj } from "../../dex/DexObj.js";
3
- import { SymImportEnv } from "../SymImportEnv.js";
4
- import { SymComponent, SymComponentKey } from "./SymComponent.js";
5
- export declare class SymLight extends SymComponent {
6
- id: SymComponentKey;
7
- load(logger: Logger, _obj: DexObj, _env: SymImportEnv, _force?: boolean): void;
8
- }
1
+ import { Logger } from "@configura/web-utilities";
2
+ import { DexObj } from "../../dex/DexObj.js";
3
+ import { SymImportEnv } from "../SymImportEnv.js";
4
+ import { SymComponent, SymComponentKey } from "./SymComponent.js";
5
+ export declare class SymLight extends SymComponent {
6
+ id: SymComponentKey;
7
+ load(logger: Logger, _obj: DexObj, _env: SymImportEnv, _force?: boolean): void;
8
+ }
9
9
  //# sourceMappingURL=SymLight.d.ts.map
@@ -1,10 +1,10 @@
1
- import { SymComponent } from "./SymComponent.js";
2
- export class SymLight extends SymComponent {
3
- constructor() {
4
- super(...arguments);
5
- this.id = "symLight";
6
- }
7
- load(logger, _obj, _env, _force = false) {
8
- logger.warn("Mesh light source not supported.", "SymLight is not yet implemented and will be ignored.");
9
- }
10
- }
1
+ import { SymComponent } from "./SymComponent.js";
2
+ export class SymLight extends SymComponent {
3
+ constructor() {
4
+ super(...arguments);
5
+ this.id = "symLight";
6
+ }
7
+ load(logger, _obj, _env, _force = false) {
8
+ logger.warn("Mesh light source not supported.", "SymLight is not yet implemented and will be ignored.");
9
+ }
10
+ }
@@ -1,6 +1,6 @@
1
- import { SymComponentKey } from "./SymComponent.js";
2
- import { SymPrimitive2D } from "./SymPrimitive2D.js";
3
- export declare class SymLines2D extends SymPrimitive2D {
4
- id: SymComponentKey;
5
- }
1
+ import { SymComponentKey } from "./SymComponent.js";
2
+ import { SymPrimitive2D } from "./SymPrimitive2D.js";
3
+ export declare class SymLines2D extends SymPrimitive2D {
4
+ id: SymComponentKey;
5
+ }
6
6
  //# sourceMappingURL=SymLines2D.d.ts.map
@@ -1,7 +1,7 @@
1
- import { SymPrimitive2D } from "./SymPrimitive2D.js";
2
- export class SymLines2D extends SymPrimitive2D {
3
- constructor() {
4
- super(...arguments);
5
- this.id = "symLines2D";
6
- }
7
- }
1
+ import { SymPrimitive2D } from "./SymPrimitive2D.js";
2
+ export class SymLines2D extends SymPrimitive2D {
3
+ constructor() {
4
+ super(...arguments);
5
+ this.id = "symLines2D";
6
+ }
7
+ }
@@ -1,35 +1,35 @@
1
- import { Logger } from "@configura/web-utilities";
2
- import { DexObj } from "../../dex/DexObj.js";
3
- import { SymImportEnv } from "../SymImportEnv.js";
4
- import { SymComponent, SymComponentKey } from "./SymComponent.js";
5
- import { SymMultiSelector } from "./SymMultiSelector.js";
6
- import { SymRep } from "./SymRep.js";
7
- export declare class SymMeasure extends SymComponent {
8
- id: SymComponentKey;
9
- private _sections;
10
- private _dividerSubpaths;
11
- private _originalLength;
12
- private _measureParam;
13
- private _spOffsetParam;
14
- private _stretchingEPParam;
15
- load(logger: Logger, obj: DexObj, _env: SymImportEnv, force?: boolean): void;
16
- get measureParam(): string | undefined;
17
- get originalLength(): number | undefined;
18
- get spOffsetParam(): string | undefined;
19
- get stretchingEPParam(): string | undefined;
20
- get sections(): SymMeasureSection[];
21
- get dividerSubpaths(): SymMeasureDivider[];
22
- }
23
- export declare class SymMeasureDivider {
24
- readonly repToPath: Map<SymRep, string>;
25
- readonly currentStretch: number;
26
- constructor(obj: DexObj, logger: Logger);
27
- }
28
- export declare class SymMeasureSection {
29
- readonly sizeChange: number;
30
- readonly move: boolean;
31
- readonly currentStretch: number;
32
- readonly repToSelector: Map<SymRep, SymMultiSelector>;
33
- constructor(obj: DexObj, logger: Logger);
34
- }
1
+ import { Logger } from "@configura/web-utilities";
2
+ import { DexObj } from "../../dex/DexObj.js";
3
+ import { SymImportEnv } from "../SymImportEnv.js";
4
+ import { SymComponent, SymComponentKey } from "./SymComponent.js";
5
+ import { SymMultiSelector } from "./SymMultiSelector.js";
6
+ import { SymRep } from "./SymRep.js";
7
+ export declare class SymMeasure extends SymComponent {
8
+ id: SymComponentKey;
9
+ private _sections;
10
+ private _dividerSubpaths;
11
+ private _originalLength;
12
+ private _measureParam;
13
+ private _spOffsetParam;
14
+ private _stretchingEPParam;
15
+ load(logger: Logger, obj: DexObj, _env: SymImportEnv, force?: boolean): void;
16
+ get measureParam(): string | undefined;
17
+ get originalLength(): number | undefined;
18
+ get spOffsetParam(): string | undefined;
19
+ get stretchingEPParam(): string | undefined;
20
+ get sections(): SymMeasureSection[];
21
+ get dividerSubpaths(): SymMeasureDivider[];
22
+ }
23
+ export declare class SymMeasureDivider {
24
+ readonly repToPath: Map<SymRep, string>;
25
+ readonly currentStretch: number;
26
+ constructor(obj: DexObj, logger: Logger);
27
+ }
28
+ export declare class SymMeasureSection {
29
+ readonly sizeChange: number;
30
+ readonly move: boolean;
31
+ readonly currentStretch: number;
32
+ readonly repToSelector: Map<SymRep, SymMultiSelector>;
33
+ constructor(obj: DexObj, logger: Logger);
34
+ }
35
35
  //# sourceMappingURL=SymMeasure.d.ts.map
@@ -1,158 +1,158 @@
1
- import { DexObj } from "../../dex/DexObj.js";
2
- import { SymComponent } from "./SymComponent.js";
3
- import { SymMultiSelector } from "./SymMultiSelector.js";
4
- import { SymRep } from "./SymRep.js";
5
- export class SymMeasure extends SymComponent {
6
- constructor() {
7
- super(...arguments);
8
- this.id = "symMeasure";
9
- this._sections = [];
10
- this._dividerSubpaths = [];
11
- }
12
- load(logger, obj, _env, force = false) {
13
- const sections = obj.get("sections");
14
- const dividers = obj.get("dividers");
15
- const measureParam = obj.get("measureParam");
16
- const originalLength = obj.get("originalLength");
17
- const spOffsetParam = obj.get("spOffsetParam");
18
- const stretchingEPParam = obj.get("stretchingEPParam");
19
- if (!(sections instanceof Array &&
20
- dividers instanceof Array &&
21
- typeof measureParam === "string" &&
22
- typeof originalLength === "number" &&
23
- (typeof spOffsetParam === "string" || typeof stretchingEPParam === "string"))) {
24
- logger.warn("SymMeasure loading error", "data not structured as expected");
25
- return;
26
- }
27
- this._measureParam = measureParam;
28
- this._originalLength = originalLength;
29
- this._spOffsetParam = typeof spOffsetParam === "string" ? spOffsetParam : undefined;
30
- this._stretchingEPParam =
31
- typeof stretchingEPParam === "string" ? stretchingEPParam : undefined;
32
- for (const divide of dividers) {
33
- if (!(divide instanceof DexObj)) {
34
- logger.warn("SymMeasure loading error", "divider has wrong type");
35
- continue;
36
- }
37
- this._dividerSubpaths.push(new SymMeasureDivider(divide, logger));
38
- }
39
- for (const section of sections) {
40
- if (!(section instanceof DexObj)) {
41
- logger.warn("SymMeasure loading error", "section has wrong type");
42
- continue;
43
- }
44
- this._sections.push(new SymMeasureSection(section, logger));
45
- }
46
- // logger.info(
47
- // `SymMeasure`,
48
- // `originalLength ${this.originalLength}`,
49
- // `measureParam ${this.measureParam}`,
50
- // `spOffsetParam ${this.spOffsetParam}`,
51
- // `stretchingEPParam ${this._stretchingEPParam}`,
52
- // "sections:",
53
- // this.sections,
54
- // "dividerSubpaths",
55
- // this.dividerSubpaths
56
- // );
57
- }
58
- get measureParam() {
59
- return this._measureParam;
60
- }
61
- get originalLength() {
62
- return this._originalLength;
63
- }
64
- get spOffsetParam() {
65
- return this._spOffsetParam;
66
- }
67
- get stretchingEPParam() {
68
- return this._stretchingEPParam;
69
- }
70
- get sections() {
71
- return this._sections;
72
- }
73
- get dividerSubpaths() {
74
- return this._dividerSubpaths;
75
- }
76
- }
77
- export class SymMeasureDivider {
78
- constructor(obj, logger) {
79
- this.repToPath = new Map();
80
- const currentStretch = obj.get("currentStretch");
81
- this.currentStretch = typeof currentStretch === "number" ? currentStretch : 0;
82
- for (const key of obj.props.keys()) {
83
- // skipping static keys
84
- if (key === "currentStretch") {
85
- continue;
86
- }
87
- const subPath = obj.get(key);
88
- if (!(subPath instanceof DexObj)) {
89
- logger.warn("SymMeasureDivider loading error", "unexpected type in top object");
90
- continue;
91
- }
92
- const rep = subPath.get("rep");
93
- const path = subPath.get("path");
94
- if (!(rep instanceof DexObj)) {
95
- logger.warn("SymMeasureDivider loading error", "rep is not DexObj");
96
- continue;
97
- }
98
- const symRep = SymRep.load(rep);
99
- if (!(symRep instanceof SymRep && typeof path === "string")) {
100
- logger.warn("SymMeasureDivider loading error", "SymRep or path not correct type");
101
- continue;
102
- }
103
- this.repToPath.set(symRep, path);
104
- }
105
- // logger.info(
106
- // `SymMeasureDivider`,
107
- // `currentStretch ${this.currentStretch}`,
108
- // "repToPath:",
109
- // this.repToPath
110
- // );
111
- }
112
- }
113
- export class SymMeasureSection {
114
- constructor(obj, logger) {
115
- this.repToSelector = new Map();
116
- const sizeChange = obj.get("sizeChange");
117
- const move = obj.get("move");
118
- const currentStretch = obj.get("currentStretch");
119
- if (typeof sizeChange !== "number" || typeof move !== "boolean") {
120
- logger.warn("SymMeasureSection loading error", "required fields missing or incorrect");
121
- }
122
- this.sizeChange = typeof sizeChange === "number" ? sizeChange : 0;
123
- this.move = typeof move === "boolean" ? move : false;
124
- this.currentStretch = typeof currentStretch === "number" ? currentStretch : 0;
125
- for (const key of obj.props.keys()) {
126
- // skipping static keys
127
- if (key === "sizeChange" || key === "move" || key === "currentStretch") {
128
- continue;
129
- }
130
- const repToSelector = obj.get(key);
131
- if (!(repToSelector instanceof DexObj)) {
132
- logger.warn("SymMeasureSection loading error", "repToSelector not of type DexObj");
133
- continue;
134
- }
135
- const rep = repToSelector.get("rep");
136
- const selector = repToSelector.get("selector");
137
- if (!(selector instanceof DexObj && rep instanceof DexObj)) {
138
- logger.warn("SymMeasureSection loading error", "rep or selector not of type DexObj");
139
- continue;
140
- }
141
- const symRep = SymRep.load(rep);
142
- const symMultiSelector = new SymMultiSelector(selector, logger);
143
- if (!(symRep instanceof SymRep)) {
144
- logger.warn("SymMeasureSection loading error", "SymRep failed to load");
145
- continue;
146
- }
147
- this.repToSelector.set(symRep, symMultiSelector);
148
- }
149
- // logger.info(
150
- // `SymMeasureSection`,
151
- // `sizeChange ${this.sizeChange}`,
152
- // `move ${this.move}`,
153
- // `currentStretch ${this.currentStretch}`,
154
- // "repToSelector:",
155
- // this.repToSelector
156
- // );
157
- }
158
- }
1
+ import { DexObj } from "../../dex/DexObj.js";
2
+ import { SymComponent } from "./SymComponent.js";
3
+ import { SymMultiSelector } from "./SymMultiSelector.js";
4
+ import { SymRep } from "./SymRep.js";
5
+ export class SymMeasure extends SymComponent {
6
+ constructor() {
7
+ super(...arguments);
8
+ this.id = "symMeasure";
9
+ this._sections = [];
10
+ this._dividerSubpaths = [];
11
+ }
12
+ load(logger, obj, _env, force = false) {
13
+ const sections = obj.get("sections");
14
+ const dividers = obj.get("dividers");
15
+ const measureParam = obj.get("measureParam");
16
+ const originalLength = obj.get("originalLength");
17
+ const spOffsetParam = obj.get("spOffsetParam");
18
+ const stretchingEPParam = obj.get("stretchingEPParam");
19
+ if (!(sections instanceof Array &&
20
+ dividers instanceof Array &&
21
+ typeof measureParam === "string" &&
22
+ typeof originalLength === "number" &&
23
+ (typeof spOffsetParam === "string" || typeof stretchingEPParam === "string"))) {
24
+ logger.warn("SymMeasure loading error", "data not structured as expected");
25
+ return;
26
+ }
27
+ this._measureParam = measureParam;
28
+ this._originalLength = originalLength;
29
+ this._spOffsetParam = typeof spOffsetParam === "string" ? spOffsetParam : undefined;
30
+ this._stretchingEPParam =
31
+ typeof stretchingEPParam === "string" ? stretchingEPParam : undefined;
32
+ for (const divide of dividers) {
33
+ if (!(divide instanceof DexObj)) {
34
+ logger.warn("SymMeasure loading error", "divider has wrong type");
35
+ continue;
36
+ }
37
+ this._dividerSubpaths.push(new SymMeasureDivider(divide, logger));
38
+ }
39
+ for (const section of sections) {
40
+ if (!(section instanceof DexObj)) {
41
+ logger.warn("SymMeasure loading error", "section has wrong type");
42
+ continue;
43
+ }
44
+ this._sections.push(new SymMeasureSection(section, logger));
45
+ }
46
+ // logger.info(
47
+ // `SymMeasure`,
48
+ // `originalLength ${this.originalLength}`,
49
+ // `measureParam ${this.measureParam}`,
50
+ // `spOffsetParam ${this.spOffsetParam}`,
51
+ // `stretchingEPParam ${this._stretchingEPParam}`,
52
+ // "sections:",
53
+ // this.sections,
54
+ // "dividerSubpaths",
55
+ // this.dividerSubpaths
56
+ // );
57
+ }
58
+ get measureParam() {
59
+ return this._measureParam;
60
+ }
61
+ get originalLength() {
62
+ return this._originalLength;
63
+ }
64
+ get spOffsetParam() {
65
+ return this._spOffsetParam;
66
+ }
67
+ get stretchingEPParam() {
68
+ return this._stretchingEPParam;
69
+ }
70
+ get sections() {
71
+ return this._sections;
72
+ }
73
+ get dividerSubpaths() {
74
+ return this._dividerSubpaths;
75
+ }
76
+ }
77
+ export class SymMeasureDivider {
78
+ constructor(obj, logger) {
79
+ this.repToPath = new Map();
80
+ const currentStretch = obj.get("currentStretch");
81
+ this.currentStretch = typeof currentStretch === "number" ? currentStretch : 0;
82
+ for (const key of obj.props.keys()) {
83
+ // skipping static keys
84
+ if (key === "currentStretch") {
85
+ continue;
86
+ }
87
+ const subPath = obj.get(key);
88
+ if (!(subPath instanceof DexObj)) {
89
+ logger.warn("SymMeasureDivider loading error", "unexpected type in top object");
90
+ continue;
91
+ }
92
+ const rep = subPath.get("rep");
93
+ const path = subPath.get("path");
94
+ if (!(rep instanceof DexObj)) {
95
+ logger.warn("SymMeasureDivider loading error", "rep is not DexObj");
96
+ continue;
97
+ }
98
+ const symRep = SymRep.load(rep);
99
+ if (!(symRep instanceof SymRep && typeof path === "string")) {
100
+ logger.warn("SymMeasureDivider loading error", "SymRep or path not correct type");
101
+ continue;
102
+ }
103
+ this.repToPath.set(symRep, path);
104
+ }
105
+ // logger.info(
106
+ // `SymMeasureDivider`,
107
+ // `currentStretch ${this.currentStretch}`,
108
+ // "repToPath:",
109
+ // this.repToPath
110
+ // );
111
+ }
112
+ }
113
+ export class SymMeasureSection {
114
+ constructor(obj, logger) {
115
+ this.repToSelector = new Map();
116
+ const sizeChange = obj.get("sizeChange");
117
+ const move = obj.get("move");
118
+ const currentStretch = obj.get("currentStretch");
119
+ if (typeof sizeChange !== "number" || typeof move !== "boolean") {
120
+ logger.warn("SymMeasureSection loading error", "required fields missing or incorrect");
121
+ }
122
+ this.sizeChange = typeof sizeChange === "number" ? sizeChange : 0;
123
+ this.move = typeof move === "boolean" ? move : false;
124
+ this.currentStretch = typeof currentStretch === "number" ? currentStretch : 0;
125
+ for (const key of obj.props.keys()) {
126
+ // skipping static keys
127
+ if (key === "sizeChange" || key === "move" || key === "currentStretch") {
128
+ continue;
129
+ }
130
+ const repToSelector = obj.get(key);
131
+ if (!(repToSelector instanceof DexObj)) {
132
+ logger.warn("SymMeasureSection loading error", "repToSelector not of type DexObj");
133
+ continue;
134
+ }
135
+ const rep = repToSelector.get("rep");
136
+ const selector = repToSelector.get("selector");
137
+ if (!(selector instanceof DexObj && rep instanceof DexObj)) {
138
+ logger.warn("SymMeasureSection loading error", "rep or selector not of type DexObj");
139
+ continue;
140
+ }
141
+ const symRep = SymRep.load(rep);
142
+ const symMultiSelector = new SymMultiSelector(selector, logger);
143
+ if (!(symRep instanceof SymRep)) {
144
+ logger.warn("SymMeasureSection loading error", "SymRep failed to load");
145
+ continue;
146
+ }
147
+ this.repToSelector.set(symRep, symMultiSelector);
148
+ }
149
+ // logger.info(
150
+ // `SymMeasureSection`,
151
+ // `sizeChange ${this.sizeChange}`,
152
+ // `move ${this.move}`,
153
+ // `currentStretch ${this.currentStretch}`,
154
+ // "repToSelector:",
155
+ // this.repToSelector
156
+ // );
157
+ }
158
+ }