@flighthq/skeleton2d 0.5.1-next.973.788d3d7 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (232) hide show
  1. package/README.md +2 -2
  2. package/dist/.tsbuildinfo.contract +1 -0
  3. package/dist/.tsbuildinfo.runtime +1 -0
  4. package/dist/Attachment2D.d.ts +6 -0
  5. package/dist/Attachment2D.d.ts.map +1 -0
  6. package/dist/Attachment2D.js +2 -0
  7. package/dist/Attachment2D.js.map +1 -0
  8. package/dist/AttachmentSkin2D.d.ts +11 -0
  9. package/dist/AttachmentSkin2D.d.ts.map +1 -0
  10. package/dist/AttachmentSkin2D.js +2 -0
  11. package/dist/AttachmentSkin2D.js.map +1 -0
  12. package/dist/Bone2D.d.ts +15 -0
  13. package/dist/Bone2D.d.ts.map +1 -0
  14. package/dist/Bone2D.js +2 -0
  15. package/dist/Bone2D.js.map +1 -0
  16. package/dist/BoundingBoxAttachment2DContract.d.ts +10 -0
  17. package/dist/BoundingBoxAttachment2DContract.d.ts.map +1 -0
  18. package/dist/BoundingBoxAttachment2DContract.js +2 -0
  19. package/dist/BoundingBoxAttachment2DContract.js.map +1 -0
  20. package/dist/ClippingAttachment2DContract.d.ts +12 -0
  21. package/dist/ClippingAttachment2DContract.d.ts.map +1 -0
  22. package/dist/ClippingAttachment2DContract.js +2 -0
  23. package/dist/ClippingAttachment2DContract.js.map +1 -0
  24. package/dist/MeshAttachment2D.d.ts +11 -0
  25. package/dist/MeshAttachment2D.d.ts.map +1 -0
  26. package/dist/MeshAttachment2D.js +2 -0
  27. package/dist/MeshAttachment2D.js.map +1 -0
  28. package/dist/PathAttachment2D.d.ts +13 -0
  29. package/dist/PathAttachment2D.d.ts.map +1 -0
  30. package/dist/PathAttachment2D.js +2 -0
  31. package/dist/PathAttachment2D.js.map +1 -0
  32. package/dist/PointAttachment2DContract.d.ts +9 -0
  33. package/dist/PointAttachment2DContract.d.ts.map +1 -0
  34. package/dist/PointAttachment2DContract.js +2 -0
  35. package/dist/PointAttachment2DContract.js.map +1 -0
  36. package/dist/RegionAttachment2DContract.d.ts +12 -0
  37. package/dist/RegionAttachment2DContract.d.ts.map +1 -0
  38. package/dist/RegionAttachment2DContract.js +2 -0
  39. package/dist/RegionAttachment2DContract.js.map +1 -0
  40. package/dist/Skeleton2DAnimationPath.d.ts +14 -0
  41. package/dist/Skeleton2DAnimationPath.d.ts.map +1 -0
  42. package/dist/Skeleton2DAnimationPath.js +48 -0
  43. package/dist/Skeleton2DAnimationPath.js.map +1 -0
  44. package/dist/Skeleton2DAnimationTargetBinder.d.ts +14 -0
  45. package/dist/Skeleton2DAnimationTargetBinder.d.ts.map +1 -0
  46. package/dist/Skeleton2DAnimationTargetBinder.js +2 -0
  47. package/dist/Skeleton2DAnimationTargetBinder.js.map +1 -0
  48. package/dist/Skeleton2DAnimationTargetContract.d.ts +9 -0
  49. package/dist/Skeleton2DAnimationTargetContract.d.ts.map +1 -0
  50. package/dist/Skeleton2DAnimationTargetContract.js +2 -0
  51. package/dist/Skeleton2DAnimationTargetContract.js.map +1 -0
  52. package/dist/Skeleton2DAnimationTargetKind.d.ts +9 -0
  53. package/dist/Skeleton2DAnimationTargetKind.d.ts.map +1 -0
  54. package/dist/Skeleton2DAnimationTargetKind.js +20 -0
  55. package/dist/Skeleton2DAnimationTargetKind.js.map +1 -0
  56. package/dist/Skeleton2DConstraintContract.d.ts +37 -0
  57. package/dist/Skeleton2DConstraintContract.d.ts.map +1 -0
  58. package/dist/Skeleton2DConstraintContract.js +10 -0
  59. package/dist/Skeleton2DConstraintContract.js.map +1 -0
  60. package/dist/Skeleton2DContract.d.ts +13 -0
  61. package/dist/Skeleton2DContract.d.ts.map +1 -0
  62. package/dist/Skeleton2DContract.js +2 -0
  63. package/dist/Skeleton2DContract.js.map +1 -0
  64. package/dist/Skeleton2DDeformAnimationTarget.d.ts +22 -0
  65. package/dist/Skeleton2DDeformAnimationTarget.d.ts.map +1 -0
  66. package/dist/Skeleton2DDeformAnimationTarget.js +2 -0
  67. package/dist/Skeleton2DDeformAnimationTarget.js.map +1 -0
  68. package/dist/Skeleton2DDeformLengthExplanation.d.ts +21 -0
  69. package/dist/Skeleton2DDeformLengthExplanation.d.ts.map +1 -0
  70. package/dist/Skeleton2DDeformLengthExplanation.js +2 -0
  71. package/dist/Skeleton2DDeformLengthExplanation.js.map +1 -0
  72. package/dist/Skeleton2DDrawOrderAnimationTarget.d.ts +28 -0
  73. package/dist/Skeleton2DDrawOrderAnimationTarget.d.ts.map +1 -0
  74. package/dist/Skeleton2DDrawOrderAnimationTarget.js +2 -0
  75. package/dist/Skeleton2DDrawOrderAnimationTarget.js.map +1 -0
  76. package/dist/Skeleton2DDrawOrderTimeline.d.ts +24 -0
  77. package/dist/Skeleton2DDrawOrderTimeline.d.ts.map +1 -0
  78. package/dist/Skeleton2DDrawOrderTimeline.js +2 -0
  79. package/dist/Skeleton2DDrawOrderTimeline.js.map +1 -0
  80. package/dist/Skeleton2DGuardsContract.d.ts +38 -0
  81. package/dist/Skeleton2DGuardsContract.d.ts.map +1 -0
  82. package/dist/Skeleton2DGuardsContract.js +2 -0
  83. package/dist/Skeleton2DGuardsContract.js.map +1 -0
  84. package/dist/Skeleton2DIkConstraint.d.ts +29 -0
  85. package/dist/Skeleton2DIkConstraint.d.ts.map +1 -0
  86. package/dist/Skeleton2DIkConstraint.js +2 -0
  87. package/dist/Skeleton2DIkConstraint.js.map +1 -0
  88. package/dist/Skeleton2DPathConstraint.d.ts +53 -0
  89. package/dist/Skeleton2DPathConstraint.d.ts.map +1 -0
  90. package/dist/Skeleton2DPathConstraint.js +14 -0
  91. package/dist/Skeleton2DPathConstraint.js.map +1 -0
  92. package/dist/Skeleton2DSlotAnimationTarget.d.ts +15 -0
  93. package/dist/Skeleton2DSlotAnimationTarget.d.ts.map +1 -0
  94. package/dist/Skeleton2DSlotAnimationTarget.js +18 -0
  95. package/dist/Skeleton2DSlotAnimationTarget.js.map +1 -0
  96. package/dist/Skeleton2DSlotDeform.d.ts +29 -0
  97. package/dist/Skeleton2DSlotDeform.d.ts.map +1 -0
  98. package/dist/Skeleton2DSlotDeform.js +2 -0
  99. package/dist/Skeleton2DSlotDeform.js.map +1 -0
  100. package/dist/Skeleton2DTransformConstraint.d.ts +37 -0
  101. package/dist/Skeleton2DTransformConstraint.d.ts.map +1 -0
  102. package/dist/Skeleton2DTransformConstraint.js +2 -0
  103. package/dist/Skeleton2DTransformConstraint.js.map +1 -0
  104. package/dist/Skin2DContract.d.ts +6 -0
  105. package/dist/Skin2DContract.d.ts.map +1 -0
  106. package/dist/Skin2DContract.js +2 -0
  107. package/dist/Skin2DContract.js.map +1 -0
  108. package/dist/Slot2D.d.ts +10 -0
  109. package/dist/Slot2D.d.ts.map +1 -0
  110. package/dist/Slot2D.js +2 -0
  111. package/dist/Slot2D.js.map +1 -0
  112. package/dist/TransformInherit2D.d.ts +7 -0
  113. package/dist/TransformInherit2D.d.ts.map +1 -0
  114. package/dist/TransformInherit2D.js +2 -0
  115. package/dist/TransformInherit2D.js.map +1 -0
  116. package/dist/TransformMode2D.d.ts +33 -0
  117. package/dist/TransformMode2D.d.ts.map +1 -0
  118. package/dist/TransformMode2D.js +21 -0
  119. package/dist/TransformMode2D.js.map +1 -0
  120. package/dist/applyAnimationClipToSkeleton2D.d.ts +2 -1
  121. package/dist/applyAnimationClipToSkeleton2D.d.ts.map +1 -1
  122. package/dist/applyAnimationClipToSkeleton2D.js +1 -1
  123. package/dist/applyAnimationClipToSkeleton2D.js.map +1 -1
  124. package/dist/boundingBoxAttachment2D.d.ts +1 -1
  125. package/dist/boundingBoxAttachment2D.d.ts.map +1 -1
  126. package/dist/boundingBoxAttachment2D.js +1 -1
  127. package/dist/boundingBoxAttachment2D.js.map +1 -1
  128. package/dist/clippingAttachment2D.d.ts +1 -1
  129. package/dist/clippingAttachment2D.d.ts.map +1 -1
  130. package/dist/clippingAttachment2D.js +1 -1
  131. package/dist/clippingAttachment2D.js.map +1 -1
  132. package/dist/contract.d.ts +24 -25
  133. package/dist/contract.d.ts.map +1 -1
  134. package/dist/contract.js +24 -25
  135. package/dist/contract.js.map +1 -1
  136. package/dist/contract.skeleton2d-types.d.ts +30 -0
  137. package/dist/contract.skeleton2d-types.d.ts.map +1 -0
  138. package/dist/contract.skeleton2d-types.js +32 -0
  139. package/dist/contract.skeleton2d-types.js.map +1 -0
  140. package/dist/deformAnimationTarget2D.d.ts.map +1 -1
  141. package/dist/deformAnimationTarget2D.js +3 -3
  142. package/dist/deformAnimationTarget2D.js.map +1 -1
  143. package/dist/deformMeshAttachment2D.d.ts +1 -1
  144. package/dist/deformMeshAttachment2D.d.ts.map +1 -1
  145. package/dist/deformMeshAttachment2D.js +1 -1
  146. package/dist/deformMeshAttachment2D.js.map +1 -1
  147. package/dist/deformPathAttachment2D.d.ts +2 -1
  148. package/dist/deformPathAttachment2D.d.ts.map +1 -1
  149. package/dist/deformPathAttachment2D.js +1 -1
  150. package/dist/deformPathAttachment2D.js.map +1 -1
  151. package/dist/enableSkeleton2DGuards.d.ts +4 -1
  152. package/dist/enableSkeleton2DGuards.d.ts.map +1 -1
  153. package/dist/enableSkeleton2DGuards.js +11 -9
  154. package/dist/enableSkeleton2DGuards.js.map +1 -1
  155. package/dist/explainSkeleton2DChannel.d.ts +2 -1
  156. package/dist/explainSkeleton2DChannel.d.ts.map +1 -1
  157. package/dist/explainSkeleton2DChannel.js.map +1 -1
  158. package/dist/explainSkeleton2DDeformLength.d.ts +1 -1
  159. package/dist/explainSkeleton2DDeformLength.d.ts.map +1 -1
  160. package/dist/ikConstraint2D.d.ts +1 -1
  161. package/dist/ikConstraint2D.d.ts.map +1 -1
  162. package/dist/ikConstraint2D.js +4 -4
  163. package/dist/ikConstraint2D.js.map +1 -1
  164. package/dist/index.d.ts +23 -1
  165. package/dist/index.d.ts.map +1 -1
  166. package/dist/index.js +23 -1
  167. package/dist/index.js.map +1 -1
  168. package/dist/pathConstraint2D.d.ts +1 -1
  169. package/dist/pathConstraint2D.d.ts.map +1 -1
  170. package/dist/pathConstraint2D.js +5 -5
  171. package/dist/pathConstraint2D.js.map +1 -1
  172. package/dist/pointAttachment2D.d.ts +2 -1
  173. package/dist/pointAttachment2D.d.ts.map +1 -1
  174. package/dist/pointAttachment2D.js +1 -1
  175. package/dist/pointAttachment2D.js.map +1 -1
  176. package/dist/regionAttachment2D.d.ts +1 -1
  177. package/dist/regionAttachment2D.d.ts.map +1 -1
  178. package/dist/regionAttachment2D.js +1 -1
  179. package/dist/regionAttachment2D.js.map +1 -1
  180. package/dist/skeleton2d.d.ts +3 -1
  181. package/dist/skeleton2d.d.ts.map +1 -1
  182. package/dist/skeleton2d.js +4 -4
  183. package/dist/skeleton2d.js.map +1 -1
  184. package/dist/skeleton2dAnimationTarget.d.ts +2 -1
  185. package/dist/skeleton2dAnimationTarget.d.ts.map +1 -1
  186. package/dist/skeleton2dAnimationTarget.js +14 -14
  187. package/dist/skeleton2dAnimationTarget.js.map +1 -1
  188. package/dist/skeleton2dConstraint.d.ts +1 -1
  189. package/dist/skeleton2dConstraint.d.ts.map +1 -1
  190. package/dist/skeleton2dDrawOrderTarget.d.ts +7 -4
  191. package/dist/skeleton2dDrawOrderTarget.d.ts.map +1 -1
  192. package/dist/skeleton2dDrawOrderTarget.js +5 -5
  193. package/dist/skeleton2dDrawOrderTarget.js.map +1 -1
  194. package/dist/skeleton2dGuards.d.ts +1 -1
  195. package/dist/skeleton2dGuards.d.ts.map +1 -1
  196. package/dist/skin2D.d.ts +2 -1
  197. package/dist/skin2D.d.ts.map +1 -1
  198. package/dist/skin2D.js +2 -2
  199. package/dist/skin2D.js.map +1 -1
  200. package/dist/skinAttachment2DPoints.d.ts +1 -1
  201. package/dist/skinAttachment2DPoints.d.ts.map +1 -1
  202. package/dist/skinAttachment2DPoints.js +2 -2
  203. package/dist/skinAttachment2DPoints.js.map +1 -1
  204. package/dist/slotDeform2D.d.ts +1 -1
  205. package/dist/slotDeform2D.d.ts.map +1 -1
  206. package/dist/transformConstraint2D.d.ts +1 -1
  207. package/dist/transformConstraint2D.d.ts.map +1 -1
  208. package/dist/transformConstraint2D.js +4 -4
  209. package/dist/transformConstraint2D.js.map +1 -1
  210. package/package.json +12 -11
  211. package/src/applyAnimationClipToSkeleton2D.test.ts +9 -10
  212. package/src/boundingBoxAttachment2D.test.ts +7 -7
  213. package/src/clippingAttachment2D.test.ts +6 -6
  214. package/src/deformAnimationTarget2D.test.ts +10 -10
  215. package/src/deformMeshAttachment2D.test.ts +10 -10
  216. package/src/deformPathAttachment2D.test.ts +13 -10
  217. package/src/enableSkeleton2DGuards.test.ts +17 -16
  218. package/src/explainSkeleton2DChannel.test.ts +5 -2
  219. package/src/explainSkeleton2DDeformLength.test.ts +3 -3
  220. package/src/ikConstraint2D.test.ts +7 -7
  221. package/src/pathConstraint2D.test.ts +20 -14
  222. package/src/pointAttachment2D.test.ts +6 -6
  223. package/src/regionAttachment2D.test.ts +6 -6
  224. package/src/skeleton2d.test.ts +5 -5
  225. package/src/skeleton2dAnimationTarget.test.ts +7 -7
  226. package/src/skeleton2dConstraint.test.ts +7 -7
  227. package/src/skeleton2dDrawOrderTarget.test.ts +5 -4
  228. package/src/skeleton2dGuards.test.ts +2 -3
  229. package/src/skin2D.test.ts +2 -2
  230. package/src/skinAttachment2DPoints.test.ts +6 -6
  231. package/src/slotDeform2D.test.ts +6 -6
  232. package/src/transformConstraint2D.test.ts +7 -7
@@ -1,28 +1,29 @@
1
- import { clearLogOnceKeys, setLogSink } from '@flighthq/log/contract';
2
- import type { LogEntry } from '@flighthq/types/contract';
1
+ import type { LogState } from '@flighthq/log/contract';
2
+ import { createLogState, setLogSink } from '@flighthq/log/contract';
3
+ import type { LogEntry } from '@flighthq/log/contract';
3
4
 
4
- import { disableSkeleton2DGuards, enableSkeleton2DGuards } from './enableSkeleton2DGuards';
5
- import { reportSkeleton2DCoercedInterpolation, reportSkeleton2DDeformLengthMismatch } from './skeleton2dGuards';
5
+ import { disableSkeleton2DGuards, enableSkeleton2DGuards } from './enableSkeleton2DGuards.ts';
6
+ import { reportSkeleton2DCoercedInterpolation, reportSkeleton2DDeformLengthMismatch } from './skeleton2dGuards.ts';
6
7
 
7
- // Each case uses its own subject string. `logOnce` keys are process-wide with no reset, which is the
8
- // behaviour a shipped app wants — one warning per subject, not one per frame — but it means two cases
9
- // sharing a subject would have the second silently suppressed by the first.
8
+ // Each case uses its own subject string. `logOnce` keys last for the LogState's lifetime, which is the
9
+ // behaviour a shipped app wants — one warning per subject, not one per frame. Every case gets a fresh
10
+ // state here, so no case can be silently suppressed by another.
10
11
  const entries: LogEntry[] = [];
12
+ let logState: LogState;
11
13
 
12
14
  beforeEach(() => {
13
- clearLogOnceKeys();
15
+ logState = createLogState();
14
16
  entries.length = 0;
15
- setLogSink((entry) => void entries.push(entry));
17
+ setLogSink(logState, (entry) => void entries.push(entry));
16
18
  });
17
19
 
18
20
  afterEach(() => {
19
21
  disableSkeleton2DGuards();
20
- setLogSink(null);
21
22
  });
22
23
 
23
24
  describe('disableSkeleton2DGuards', () => {
24
25
  it('silences both cases again', () => {
25
- enableSkeleton2DGuards();
26
+ enableSkeleton2DGuards(logState, 0);
26
27
  disableSkeleton2DGuards();
27
28
 
28
29
  reportSkeleton2DCoercedInterpolation('DisabledChannel', 'Linear', 'Step');
@@ -40,7 +41,7 @@ describe('enableSkeleton2DGuards', () => {
40
41
  });
41
42
 
42
43
  it('names what was stated and what actually happens to a coerced channel', () => {
43
- enableSkeleton2DGuards();
44
+ enableSkeleton2DGuards(logState, 0);
44
45
 
45
46
  reportSkeleton2DCoercedInterpolation('StatedAndApplied', 'Linear', 'Step');
46
47
 
@@ -52,7 +53,7 @@ describe('enableSkeleton2DGuards', () => {
52
53
  });
53
54
 
54
55
  it('reports both lengths on a deform mismatch, and why nothing was applied', () => {
55
- enableSkeleton2DGuards();
56
+ enableSkeleton2DGuards(logState, 0);
56
57
 
57
58
  reportSkeleton2DDeformLengthMismatch('BothLengths', 6, 8);
58
59
 
@@ -63,7 +64,7 @@ describe('enableSkeleton2DGuards', () => {
63
64
  });
64
65
 
65
66
  it('keys the coercion message per subject, so two families both get heard', () => {
66
- enableSkeleton2DGuards();
67
+ enableSkeleton2DGuards(logState, 0);
67
68
 
68
69
  reportSkeleton2DCoercedInterpolation('PerSubjectOne', 'Linear', 'Step');
69
70
  reportSkeleton2DCoercedInterpolation('PerSubjectTwo', 'Linear', 'Step');
@@ -74,8 +75,8 @@ describe('enableSkeleton2DGuards', () => {
74
75
  });
75
76
 
76
77
  it('installs one guard however many times it is enabled', () => {
77
- enableSkeleton2DGuards();
78
- enableSkeleton2DGuards();
78
+ enableSkeleton2DGuards(logState, 0);
79
+ enableSkeleton2DGuards(logState, 0);
79
80
 
80
81
  reportSkeleton2DDeformLengthMismatch('EnabledTwice', 6, 8);
81
82
 
@@ -1,7 +1,10 @@
1
1
  import { createAnimationChannel, createAnimationTrack } from '@flighthq/animation/contract';
2
- import type { AnimationChannel, AnimationInterpolation } from '@flighthq/types/contract';
2
+ import type { AnimationChannel, AnimationInterpolation } from '@flighthq/animation/contract';
3
3
 
4
- import { explainSkeleton2DChannelInterpolation, isSkeleton2DSteppedChannelSubject } from './explainSkeleton2DChannel';
4
+ import {
5
+ explainSkeleton2DChannelInterpolation,
6
+ isSkeleton2DSteppedChannelSubject,
7
+ } from './explainSkeleton2DChannel.ts';
5
8
 
6
9
  describe('explainSkeleton2DChannelInterpolation', () => {
7
10
  it('reports the override a non-step attachment channel will receive', () => {
@@ -1,8 +1,8 @@
1
- import type { Skin2D } from '@flighthq/types/contract';
2
1
  import { describe, expect, it } from 'vitest';
3
2
 
4
- import { explainSkeleton2DDeformLength } from './explainSkeleton2DDeformLength';
5
- import { createSkin2D } from './skin2D';
3
+ import type { Skin2D } from './contract.skeleton2d-types.ts';
4
+ import { explainSkeleton2DDeformLength } from './explainSkeleton2DDeformLength.ts';
5
+ import { createSkin2D } from './skin2D.ts';
6
6
 
7
7
  // One vertex bound to two bones: eight floats of influence data, so the deform stream it parallels is
8
8
  // FOUR floats — twice what a per-vertex reading predicts.
@@ -1,16 +1,16 @@
1
- import { allocateEntity, finishEntity } from '@flighthq/entity/contract';
2
- import type { Bone2D, Skeleton2D, Skeleton2DIkConstraint } from '@flighthq/types/contract';
3
- import { Skeleton2DConstraintKind, TransformMode2D } from '@flighthq/types/contract';
1
+ import { allocateEntity } from '@flighthq/entity/contract';
4
2
  import { afterEach, describe, expect, it } from 'vitest';
5
3
 
6
- import { registerSkeleton2DIkConstraintSolver, solveSkeleton2DIkConstraint } from './ikConstraint2D';
7
- import { computeSkeleton2DWorldTransforms, createSkeleton2D } from './skeleton2d';
4
+ import type { Bone2D, Skeleton2D, Skeleton2DIkConstraint } from './contract.skeleton2d-types.ts';
5
+ import { Skeleton2DConstraintKind, TransformMode2D } from './contract.skeleton2d-types.ts';
6
+ import { registerSkeleton2DIkConstraintSolver, solveSkeleton2DIkConstraint } from './ikConstraint2D.ts';
7
+ import { computeSkeleton2DWorldTransforms, createSkeleton2D } from './skeleton2d.ts';
8
8
  import {
9
9
  getSkeleton2DConstraintSolver,
10
10
  registerSkeleton2DConstraintSolver,
11
11
  solveSkeleton2DConstraints,
12
12
  unregisterSkeleton2DConstraintSolver,
13
- } from './skeleton2dConstraint';
13
+ } from './skeleton2dConstraint.ts';
14
14
 
15
15
  function makeBone(overrides: Partial<Bone2D> = {}): Bone2D {
16
16
  return {
@@ -39,7 +39,7 @@ function ik(overrides: Partial<Skeleton2DIkConstraint> = {}): Skeleton2DIkConstr
39
39
  out.stretch = false;
40
40
  out.targetBoneIndex = 1;
41
41
  Object.assign(out, overrides);
42
- return finishEntity(out) as Skeleton2DIkConstraint;
42
+ return out as Skeleton2DIkConstraint;
43
43
  }
44
44
 
45
45
  // The world position of a bone's TIP — its origin plus its length along its own x axis. That is the point
@@ -1,23 +1,29 @@
1
- import { allocateEntity, finishEntity } from '@flighthq/entity/contract';
2
- import type { Bone2D, PathAttachment2D, Skeleton2D, Skeleton2DPathConstraint, Slot2D } from '@flighthq/types/contract';
1
+ import { allocateEntity } from '@flighthq/entity/contract';
2
+ import { PathCommand } from '@flighthq/path/contract';
3
+ import { afterEach, describe, expect, it } from 'vitest';
4
+
5
+ import type {
6
+ Bone2D,
7
+ PathAttachment2D,
8
+ Skeleton2D,
9
+ Skeleton2DPathConstraint,
10
+ Slot2D,
11
+ } from './contract.skeleton2d-types.ts';
3
12
  import {
4
13
  PathAttachment2DKind,
5
- PathCommand,
6
14
  Skeleton2DConstraintKind,
7
15
  Skeleton2DPathPositionMode,
8
16
  Skeleton2DPathRotateMode,
9
17
  Skeleton2DPathSpacingMode,
10
18
  TransformMode2D,
11
- } from '@flighthq/types/contract';
12
- import { afterEach, describe, expect, it } from 'vitest';
13
-
14
- import { registerSkeleton2DPathConstraintSolver, solveSkeleton2DPathConstraint } from './pathConstraint2D';
15
- import { computeSkeleton2DWorldTransforms, createSkeleton2D } from './skeleton2d';
19
+ } from './contract.skeleton2d-types.ts';
20
+ import { registerSkeleton2DPathConstraintSolver, solveSkeleton2DPathConstraint } from './pathConstraint2D.ts';
21
+ import { computeSkeleton2DWorldTransforms, createSkeleton2D } from './skeleton2d.ts';
16
22
  import {
17
23
  getSkeleton2DConstraintSolver,
18
24
  registerSkeleton2DConstraintSolver,
19
25
  unregisterSkeleton2DConstraintSolver,
20
- } from './skeleton2dConstraint';
26
+ } from './skeleton2dConstraint.ts';
21
27
 
22
28
  function makeBone(overrides: Partial<Bone2D> = {}): Bone2D {
23
29
  return {
@@ -46,7 +52,7 @@ function straightPath(): PathAttachment2D {
46
52
  out.skin = null;
47
53
  out.vertices = new Float32Array([0, 0, 100, 0]);
48
54
  out.winding = 'nonZero' as const;
49
- return finishEntity(out) as PathAttachment2D;
55
+ return out as PathAttachment2D;
50
56
  }
51
57
 
52
58
  function pathSlot(attachment: PathAttachment2D | null): Slot2D {
@@ -68,7 +74,7 @@ function constraint(overrides: Partial<Skeleton2DPathConstraint> = {}): Skeleton
68
74
  out.spacingMode = Skeleton2DPathSpacingMode.Fixed;
69
75
  out.targetSlotIndex = 0;
70
76
  Object.assign(out, overrides);
71
- return finishEntity(out) as Skeleton2DPathConstraint;
77
+ return out as Skeleton2DPathConstraint;
72
78
  }
73
79
 
74
80
  // Bone 0 carries the path slot; bones 1..n are the chain laid along it.
@@ -211,7 +217,7 @@ describe('solveSkeleton2DPathConstraint', () => {
211
217
  out.skin = null;
212
218
  out.vertices = new Float32Array([0, 0, 0, 100]);
213
219
  out.winding = 'nonZero' as const;
214
- return finishEntity(out) as PathAttachment2D;
220
+ return out as PathAttachment2D;
215
221
  })(),
216
222
  );
217
223
  skeleton.bones[1].x = 40;
@@ -236,7 +242,7 @@ describe('solveSkeleton2DPathConstraint', () => {
236
242
  out.skin = null;
237
243
  out.vertices = new Float32Array([0, 0, 0, 100]);
238
244
  out.winding = 'nonZero' as const;
239
- return finishEntity(out) as PathAttachment2D;
245
+ return out as PathAttachment2D;
240
246
  })(),
241
247
  );
242
248
 
@@ -257,7 +263,7 @@ describe('solveSkeleton2DPathConstraint', () => {
257
263
  out.skin = null;
258
264
  out.vertices = new Float32Array([0, 0, 50, 0, 50, 50]);
259
265
  out.winding = 'nonZero' as const;
260
- return finishEntity(out) as PathAttachment2D;
266
+ return out as PathAttachment2D;
261
267
  })(),
262
268
  );
263
269
 
@@ -1,13 +1,13 @@
1
- import { allocateEntity, finishEntity } from '@flighthq/entity/contract';
2
- import type { Bone2D, PointAttachment2D } from '@flighthq/types/contract';
3
- import { PointAttachment2DKind, TransformMode2D } from '@flighthq/types/contract';
1
+ import { allocateEntity } from '@flighthq/entity/contract';
4
2
  import { describe, expect, it } from 'vitest';
5
3
 
4
+ import type { Bone2D, PointAttachment2D } from './contract.skeleton2d-types.ts';
5
+ import { PointAttachment2DKind, TransformMode2D } from './contract.skeleton2d-types.ts';
6
6
  import {
7
7
  computeSkeleton2DPointAttachmentPosition,
8
8
  computeSkeleton2DPointAttachmentRotation,
9
- } from './pointAttachment2D';
10
- import { computeSkeleton2DWorldTransforms, createSkeleton2D } from './skeleton2d';
9
+ } from './pointAttachment2D.ts';
10
+ import { computeSkeleton2DWorldTransforms, createSkeleton2D } from './skeleton2d.ts';
11
11
 
12
12
  function makeBone(overrides: Partial<Bone2D> = {}): Bone2D {
13
13
  return {
@@ -32,7 +32,7 @@ function point(x: number, y: number, rotation: number): PointAttachment2D {
32
32
  out.rotation = rotation;
33
33
  out.x = x;
34
34
  out.y = y;
35
- return finishEntity(out) as PointAttachment2D;
35
+ return out as PointAttachment2D;
36
36
  }
37
37
 
38
38
  describe('computeSkeleton2DPointAttachmentPosition', () => {
@@ -1,10 +1,10 @@
1
- import { allocateEntity, finishEntity } from '@flighthq/entity/contract';
2
- import type { Bone2D, RegionAttachment2D } from '@flighthq/types/contract';
3
- import { RegionAttachment2DKind, TransformMode2D } from '@flighthq/types/contract';
1
+ import { allocateEntity } from '@flighthq/entity/contract';
4
2
  import { describe, expect, it } from 'vitest';
5
3
 
6
- import { computeSkeleton2DRegionAttachmentVertices } from './regionAttachment2D';
7
- import { computeSkeleton2DWorldTransforms, createSkeleton2D } from './skeleton2d';
4
+ import type { Bone2D, RegionAttachment2D } from './contract.skeleton2d-types.ts';
5
+ import { RegionAttachment2DKind, TransformMode2D } from './contract.skeleton2d-types.ts';
6
+ import { computeSkeleton2DRegionAttachmentVertices } from './regionAttachment2D.ts';
7
+ import { computeSkeleton2DWorldTransforms, createSkeleton2D } from './skeleton2d.ts';
8
8
 
9
9
  function makeBone(overrides: Partial<Bone2D> = {}): Bone2D {
10
10
  return {
@@ -34,7 +34,7 @@ function region(overrides: Partial<RegionAttachment2D> = {}): RegionAttachment2D
34
34
  out.x = 0;
35
35
  out.y = 0;
36
36
  Object.assign(out, overrides);
37
- return finishEntity(out) as RegionAttachment2D;
37
+ return out as RegionAttachment2D;
38
38
  }
39
39
 
40
40
  describe('computeSkeleton2DRegionAttachmentVertices', () => {
@@ -1,9 +1,9 @@
1
- import { allocateEntity, finishEntity } from '@flighthq/entity/contract';
1
+ import { allocateEntity } from '@flighthq/entity/contract';
2
2
  import { createMatrix } from '@flighthq/geometry/contract';
3
- import type { Bone2D, RegionAttachment2D, Slot2D } from '@flighthq/types/contract';
4
- import { RegionAttachment2DKind, TransformMode2D } from '@flighthq/types/contract';
5
3
  import { describe, expect, it } from 'vitest';
6
4
 
5
+ import type { Bone2D, RegionAttachment2D, Slot2D } from './contract.skeleton2d-types.ts';
6
+ import { RegionAttachment2DKind, TransformMode2D } from './contract.skeleton2d-types.ts';
7
7
  import {
8
8
  cloneSkeleton2D,
9
9
  computeSkeleton2DBoneMatrices,
@@ -20,7 +20,7 @@ import {
20
20
  setSkeleton2DBindPose,
21
21
  setSkeleton2DSkin,
22
22
  validateSkeleton2D,
23
- } from './skeleton2d';
23
+ } from './skeleton2d.ts';
24
24
 
25
25
  function makeBone(overrides: Partial<Bone2D> = {}): Bone2D {
26
26
  return {
@@ -514,7 +514,7 @@ function testRegion(name: string): RegionAttachment2D {
514
514
  out.width = 0;
515
515
  out.x = 0;
516
516
  out.y = 0;
517
- return finishEntity(out) as RegionAttachment2D;
517
+ return out as RegionAttachment2D;
518
518
  }
519
519
  describe('validateSkeleton2D', () => {
520
520
  it('returns null for a valid parent-before-child skeleton', () => {
@@ -1,15 +1,15 @@
1
1
  import { createAnimationChannel, createAnimationClip, createAnimationTrack } from '@flighthq/animation/contract';
2
- import type { Bone2D, Skeleton2D } from '@flighthq/types/contract';
2
+ import { describe, expect, it } from 'vitest';
3
+
4
+ import { applyAnimationClipToSkeleton2D } from './applyAnimationClipToSkeleton2D.ts';
5
+ import type { Bone2D, Skeleton2D } from './contract.skeleton2d-types.ts';
3
6
  import {
4
7
  Skeleton2DAnimationPath,
5
8
  Skeleton2DAnimationTargetKind,
6
9
  Skeleton2DSlotAnimationPath,
7
10
  TransformMode2D,
8
- } from '@flighthq/types/contract';
9
- import { describe, expect, it } from 'vitest';
10
-
11
- import { applyAnimationClipToSkeleton2D } from './applyAnimationClipToSkeleton2D';
12
- import { cloneSkeleton2D, createSkeleton2D } from './skeleton2d';
11
+ } from './contract.skeleton2d-types.ts';
12
+ import { cloneSkeleton2D, createSkeleton2D } from './skeleton2d.ts';
13
13
  import {
14
14
  createSkeleton2DBoneAnimationTarget,
15
15
  createSkeleton2DSlotAnimationTarget,
@@ -20,7 +20,7 @@ import {
20
20
  initializeSkeleton2DSlotAnimationTarget,
21
21
  registerSkeleton2DAnimationTargetBinder,
22
22
  unregisterSkeleton2DAnimationTargetBinder,
23
- } from './skeleton2dAnimationTarget';
23
+ } from './skeleton2dAnimationTarget.ts';
24
24
 
25
25
  describe('createSkeleton2DBoneAnimationTarget', () => {
26
26
  it('stamps the bone kind, which is what the binder dispatches on', () => {
@@ -1,15 +1,15 @@
1
- import { allocateEntity, finishEntity } from '@flighthq/entity/contract';
2
- import type { Bone2D, Skeleton2DConstraint } from '@flighthq/types/contract';
3
- import { Skeleton2DConstraintKind, TransformMode2D } from '@flighthq/types/contract';
1
+ import { allocateEntity } from '@flighthq/entity/contract';
4
2
  import { afterEach, describe, expect, it } from 'vitest';
5
3
 
6
- import { computeSkeleton2DWorldTransforms, createSkeleton2D } from './skeleton2d';
4
+ import type { Bone2D, Skeleton2DConstraint } from './contract.skeleton2d-types.ts';
5
+ import { Skeleton2DConstraintKind, TransformMode2D } from './contract.skeleton2d-types.ts';
6
+ import { computeSkeleton2DWorldTransforms, createSkeleton2D } from './skeleton2d.ts';
7
7
  import {
8
8
  getSkeleton2DConstraintSolver,
9
9
  registerSkeleton2DConstraintSolver,
10
10
  solveSkeleton2DConstraints,
11
11
  unregisterSkeleton2DConstraintSolver,
12
- } from './skeleton2dConstraint';
12
+ } from './skeleton2dConstraint.ts';
13
13
 
14
14
  function makeBone(overrides: Partial<Bone2D> = {}): Bone2D {
15
15
  return {
@@ -32,7 +32,7 @@ function constraint(kind: string): Skeleton2DConstraint {
32
32
  const out = allocateEntity<Skeleton2DConstraint>();
33
33
  out.kind = kind;
34
34
  out.mix = 1;
35
- return finishEntity(out) as Skeleton2DConstraint;
35
+ return out as Skeleton2DConstraint;
36
36
  }
37
37
 
38
38
  // The registry is a module GLOBAL, deliberately: last-write-wins is what lets a caller replace a built-in
@@ -109,7 +109,7 @@ describe('solveSkeleton2DConstraints', () => {
109
109
  out.kind = 'acme.Rope';
110
110
  out.mix = 0.25;
111
111
  out.slack = 3;
112
- return finishEntity(out) as Skeleton2DConstraint;
112
+ return out as Skeleton2DConstraint;
113
113
  })();
114
114
 
115
115
  solveSkeleton2DConstraints(skeleton, [rope]);
@@ -1,4 +1,5 @@
1
1
  import { createAnimationChannel, createAnimationTrack } from '@flighthq/animation/contract';
2
+ import type { AnimationChannel, AnimationInterpolation } from '@flighthq/animation/contract';
2
3
  import {
3
4
  addNodeChild,
4
5
  applyNodeOrderList,
@@ -6,17 +7,17 @@ import {
6
7
  createNodeOrderList,
7
8
  getNodeChildAt,
8
9
  } from '@flighthq/node/contract';
9
- import type { AnimationChannel, AnimationInterpolation, Node, NodeOrderList } from '@flighthq/types/contract';
10
+ import type { Node, NodeOrderList } from '@flighthq/node/contract';
10
11
 
11
- import { getSkeleton2DAnimationTargetBinder } from './skeleton2dAnimationTarget';
12
+ import { getSkeleton2DAnimationTargetBinder } from './skeleton2dAnimationTarget.ts';
12
13
  import {
13
14
  createSkeleton2DDrawOrderAnimationTarget,
14
15
  createSkeleton2DDrawOrderChannel,
15
16
  initializeSkeleton2DDrawOrderAnimationTarget,
16
17
  registerSkeleton2DDrawOrderAnimationBinder,
17
18
  unregisterSkeleton2DDrawOrderAnimationBinder,
18
- } from './skeleton2dDrawOrderTarget';
19
- import { setSkeleton2DCoercedInterpolationGuard } from './skeleton2dGuards';
19
+ } from './skeleton2dDrawOrderTarget.ts';
20
+ import { setSkeleton2DCoercedInterpolationGuard } from './skeleton2dGuards.ts';
20
21
 
21
22
  afterEach(() => {
22
23
  unregisterSkeleton2DDrawOrderAnimationBinder();
@@ -1,11 +1,10 @@
1
- import type { Skeleton2DCoercedInterpolation, Skeleton2DDeformLengthMismatch } from '@flighthq/types/contract';
2
-
1
+ import type { Skeleton2DCoercedInterpolation, Skeleton2DDeformLengthMismatch } from './contract.skeleton2d-types.ts';
3
2
  import {
4
3
  reportSkeleton2DCoercedInterpolation,
5
4
  reportSkeleton2DDeformLengthMismatch,
6
5
  setSkeleton2DCoercedInterpolationGuard,
7
6
  setSkeleton2DDeformLengthGuard,
8
- } from './skeleton2dGuards';
7
+ } from './skeleton2dGuards.ts';
9
8
 
10
9
  afterEach(() => {
11
10
  setSkeleton2DCoercedInterpolationGuard(null);
@@ -1,6 +1,6 @@
1
- import { EntityRuntimeKey } from '@flighthq/types/contract';
1
+ import { EntityRuntimeKey } from '@flighthq/entity/contract';
2
2
 
3
- import { createSkin2D, initializeSkin2D } from './skin2D';
3
+ import { createSkin2D, initializeSkin2D } from './skin2D.ts';
4
4
 
5
5
  describe('createSkin2D', () => {
6
6
  it('adopts the streams it is given rather than copying them', () => {
@@ -1,11 +1,11 @@
1
- import type { Bone2D, Skin2D } from '@flighthq/types/contract';
2
- import { TransformMode2D } from '@flighthq/types/contract';
3
1
  import { describe, expect, it } from 'vitest';
4
2
 
5
- import { computeSkeleton2DWorldTransforms, createSkeleton2D } from './skeleton2d';
6
- import { setSkeleton2DDeformLengthGuard } from './skeleton2dGuards';
7
- import { createSkin2D } from './skin2D';
8
- import { skinSkeleton2DAttachmentPoints } from './skinAttachment2DPoints';
3
+ import type { Bone2D, Skin2D } from './contract.skeleton2d-types.ts';
4
+ import { TransformMode2D } from './contract.skeleton2d-types.ts';
5
+ import { computeSkeleton2DWorldTransforms, createSkeleton2D } from './skeleton2d.ts';
6
+ import { setSkeleton2DDeformLengthGuard } from './skeleton2dGuards.ts';
7
+ import { createSkin2D } from './skin2D.ts';
8
+ import { skinSkeleton2DAttachmentPoints } from './skinAttachment2DPoints.ts';
9
9
 
10
10
  function makeBone(overrides: Partial<Bone2D> = {}): Bone2D {
11
11
  return {
@@ -1,10 +1,10 @@
1
- import { allocateEntity, finishEntity } from '@flighthq/entity/contract';
2
- import type { Attachment2D, MeshAttachment2D, Skin2D, Slot2D } from '@flighthq/types/contract';
3
- import { MeshAttachment2DKind } from '@flighthq/types/contract';
1
+ import { allocateEntity } from '@flighthq/entity/contract';
4
2
  import { describe, expect, it } from 'vitest';
5
3
 
6
- import { createSkin2D } from './skin2D';
7
- import { getSkeleton2DSlotDeformOffsets, setSkeleton2DSlotDeform } from './slotDeform2D';
4
+ import type { Attachment2D, MeshAttachment2D, Skin2D, Slot2D } from './contract.skeleton2d-types.ts';
5
+ import { MeshAttachment2DKind } from './contract.skeleton2d-types.ts';
6
+ import { createSkin2D } from './skin2D.ts';
7
+ import { getSkeleton2DSlotDeformOffsets, setSkeleton2DSlotDeform } from './slotDeform2D.ts';
8
8
 
9
9
  function slot(attachment: Attachment2D | null): Slot2D {
10
10
  return { attachment, boneIndex: 0, color: 0xffffffff, name: 's' };
@@ -19,7 +19,7 @@ function mesh(pointCount: number): MeshAttachment2D {
19
19
  out.uvs = new Float32Array(pointCount * 2);
20
20
  out.vertexCount = pointCount;
21
21
  out.vertices = null;
22
- return finishEntity(out) as MeshAttachment2D;
22
+ return out as MeshAttachment2D;
23
23
  }
24
24
 
25
25
  describe('getSkeleton2DSlotDeformOffsets', () => {
@@ -1,18 +1,18 @@
1
- import { allocateEntity, finishEntity } from '@flighthq/entity/contract';
2
- import type { Bone2D, Skeleton2DTransformConstraint } from '@flighthq/types/contract';
3
- import { Skeleton2DConstraintKind, TransformMode2D } from '@flighthq/types/contract';
1
+ import { allocateEntity } from '@flighthq/entity/contract';
4
2
  import { afterEach, describe, expect, it } from 'vitest';
5
3
 
6
- import { computeSkeleton2DWorldTransforms, createSkeleton2D } from './skeleton2d';
4
+ import type { Bone2D, Skeleton2DTransformConstraint } from './contract.skeleton2d-types.ts';
5
+ import { Skeleton2DConstraintKind, TransformMode2D } from './contract.skeleton2d-types.ts';
6
+ import { computeSkeleton2DWorldTransforms, createSkeleton2D } from './skeleton2d.ts';
7
7
  import {
8
8
  getSkeleton2DConstraintSolver,
9
9
  registerSkeleton2DConstraintSolver,
10
10
  unregisterSkeleton2DConstraintSolver,
11
- } from './skeleton2dConstraint';
11
+ } from './skeleton2dConstraint.ts';
12
12
  import {
13
13
  registerSkeleton2DTransformConstraintSolver,
14
14
  solveSkeleton2DTransformConstraint,
15
- } from './transformConstraint2D';
15
+ } from './transformConstraint2D.ts';
16
16
 
17
17
  function makeBone(overrides: Partial<Bone2D> = {}): Bone2D {
18
18
  return {
@@ -51,7 +51,7 @@ function transform(overrides: Partial<Skeleton2DTransformConstraint> = {}): Skel
51
51
  out.offsetY = 0;
52
52
  out.targetBoneIndex = 1;
53
53
  Object.assign(out, overrides);
54
- return finishEntity(out) as Skeleton2DTransformConstraint;
54
+ return out as Skeleton2DTransformConstraint;
55
55
  }
56
56
 
57
57
  // This file registers a built-in solver into a module-global registry, so it restores whatever it found