@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
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Skeleton2DAnimationPath.js","sourceRoot":"","sources":["../src/Skeleton2DAnimationPath.ts"],"names":[],"mappings":"AAAA,sGAAsG;AACtG,mGAAmG;AACnG,yGAAyG;AACzG,iBAAiB;AACjB,EAAE;AACF,yEAAyE;AACzE,wEAAwE;AACxE,yEAAyE;AACzE,yEAAyE;AACzE,EAAE;AACF,qGAAqG;AACrG,wGAAwG;AACxG,kGAAkG;AAClG,wGAAwG;AACxG,wBAAwB;AACxB,EAAE;AACF,sFAAsF;AACtF,sFAAsF;AACtF,sFAAsF;AACtF,EAAE;AACF,sGAAsG;AACtG,sGAAsG;AACtG,+BAA+B;AAC/B,EAAE;AACF,yGAAyG;AACzG,sGAAsG;AACtG,uGAAuG;AACvG,uGAAuG;AACvG,wGAAwG;AACxG,0GAA0G;AAC1G,EAAE;AACF,2GAA2G;AAC3G,yGAAyG;AACzG,yGAAyG;AACzG,2DAA2D;AAC3D,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACrC,WAAW,EAAE,aAAa;IAC1B,YAAY,EAAE,cAAc;IAC5B,YAAY,EAAE,cAAc;IAC5B,QAAQ,EAAE,UAAU;IACpB,KAAK,EAAE,OAAO;IACd,MAAM,EAAE,QAAQ;IAChB,MAAM,EAAE,QAAQ;IAChB,KAAK,EAAE,OAAO;IACd,MAAM,EAAE,QAAQ;IAChB,MAAM,EAAE,QAAQ;CACR,CAAC"}
@@ -0,0 +1,14 @@
1
+ import type { AnimationChannel } from '@flighthq/animation/contract';
2
+ import type { Skeleton2D } from './Skeleton2DContract.ts';
3
+ /**
4
+ * What one target kind does with a channel. `applyAnimationClipToSkeleton2D` looks the channel's target
5
+ * kind up in the binder registry and hands the whole channel over, so a family this package does not own
6
+ * poses through the same single pass as bones and slots.
7
+ *
8
+ * `target` is the channel's `targetRef`, already known to carry the kind the binder registered for; a
9
+ * binder casts it to its own target type. `setup` is the immutable rest pose and `pose` is what gets
10
+ * written — they are never the same object. A binder that cannot use what it is given returns without
11
+ * writing, because a channel it cannot honor is an expected condition rather than an error.
12
+ */
13
+ export type Skeleton2DAnimationTargetBinder = (channel: Readonly<AnimationChannel>, setup: Readonly<Skeleton2D>, pose: Skeleton2D, target: unknown, time: number) => void;
14
+ //# sourceMappingURL=Skeleton2DAnimationTargetBinder.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Skeleton2DAnimationTargetBinder.d.ts","sourceRoot":"","sources":["../src/Skeleton2DAnimationTargetBinder.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAErE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAE1D;;;;;;;;;GASG;AACH,MAAM,MAAM,+BAA+B,GAAG,CAC5C,OAAO,EAAE,QAAQ,CAAC,gBAAgB,CAAC,EACnC,KAAK,EAAE,QAAQ,CAAC,UAAU,CAAC,EAC3B,IAAI,EAAE,UAAU,EAChB,MAAM,EAAE,OAAO,EACf,IAAI,EAAE,MAAM,KACT,IAAI,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=Skeleton2DAnimationTargetBinder.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Skeleton2DAnimationTargetBinder.js","sourceRoot":"","sources":["../src/Skeleton2DAnimationTargetBinder.ts"],"names":[],"mappings":""}
@@ -0,0 +1,9 @@
1
+ import type { Entity } from '@flighthq/entity/contract';
2
+ import type { Skeleton2DAnimationPath } from './Skeleton2DAnimationPath.ts';
3
+ import type { Skeleton2DAnimationTargetKind } from './Skeleton2DAnimationTargetKind.ts';
4
+ export interface Skeleton2DAnimationTarget extends Entity {
5
+ boneIndex: number;
6
+ kind: Skeleton2DAnimationTargetKind;
7
+ path: Skeleton2DAnimationPath;
8
+ }
9
+ //# sourceMappingURL=Skeleton2DAnimationTargetContract.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Skeleton2DAnimationTargetContract.d.ts","sourceRoot":"","sources":["../src/Skeleton2DAnimationTargetContract.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AAExD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AAC5E,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,oCAAoC,CAAC;AAUxF,MAAM,WAAW,yBAA0B,SAAQ,MAAM;IACvD,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,6BAA6B,CAAC;IACpC,IAAI,EAAE,uBAAuB,CAAC;CAC/B"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=Skeleton2DAnimationTargetContract.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Skeleton2DAnimationTargetContract.js","sourceRoot":"","sources":["../src/Skeleton2DAnimationTargetContract.ts"],"names":[],"mappings":""}
@@ -0,0 +1,9 @@
1
+ export declare const Skeleton2DAnimationTargetKind: {
2
+ readonly Bone: 'Skeleton2D.BoneTarget';
3
+ readonly Constraint: 'Skeleton2D.ConstraintTarget';
4
+ readonly Deform: 'Skeleton2D.DeformTarget';
5
+ readonly DrawOrder: 'Skeleton2D.DrawOrderTarget';
6
+ readonly Slot: 'Skeleton2D.SlotTarget';
7
+ };
8
+ export type Skeleton2DAnimationTargetKind = string;
9
+ //# sourceMappingURL=Skeleton2DAnimationTargetKind.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Skeleton2DAnimationTargetKind.d.ts","sourceRoot":"","sources":["../src/Skeleton2DAnimationTargetKind.ts"],"names":[],"mappings":"AAYA,eAAO,MAAM,6BAA6B;aACxC,IAAI,EAAE,uBAAuB;aAC7B,UAAU,EAAE,6BAA6B;aACzC,MAAM,EAAE,yBAAyB;aACjC,SAAS,EAAE,4BAA4B;aACvC,IAAI,EAAE,uBAAuB;CACrB,CAAC;AAEX,MAAM,MAAM,6BAA6B,GAAG,MAAM,CAAC"}
@@ -0,0 +1,20 @@
1
+ // Which family of a Skeleton2D an AnimationChannel's target addresses. It is the registry key
2
+ // `applyAnimationClipToSkeleton2D` dispatches on, exactly as a `*Kind` keys a renderer, an effect runner or
3
+ // a decompressor — a plain string, so the key, the serialized form and the vocabulary are one value.
4
+ //
5
+ // The kind exists because the family is OPEN and already large. The two 2D-skeletal formats animate eight
6
+ // things that are not bone transforms — slot attachment, slot colour, IK, transform, path, deform, draw
7
+ // order and event — and both binary parsers already walk every one of those records. Dispatching on target
8
+ // SHAPE (`typeof target.boneIndex === 'number'`) is legible for two families and an order-dependent probe
9
+ // at eight, where adding one target whose fields happen to overlap another silently reroutes it.
10
+ //
11
+ // A third-party target carries a vendor-prefixed kind (`'acme.RopeTarget'`) and registers its own binder,
12
+ // so an unused family costs a consumer nothing.
13
+ export const Skeleton2DAnimationTargetKind = {
14
+ Bone: 'Skeleton2D.BoneTarget',
15
+ Constraint: 'Skeleton2D.ConstraintTarget',
16
+ Deform: 'Skeleton2D.DeformTarget',
17
+ DrawOrder: 'Skeleton2D.DrawOrderTarget',
18
+ Slot: 'Skeleton2D.SlotTarget',
19
+ };
20
+ //# sourceMappingURL=Skeleton2DAnimationTargetKind.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Skeleton2DAnimationTargetKind.js","sourceRoot":"","sources":["../src/Skeleton2DAnimationTargetKind.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,4GAA4G;AAC5G,qGAAqG;AACrG,EAAE;AACF,0GAA0G;AAC1G,wGAAwG;AACxG,2GAA2G;AAC3G,0GAA0G;AAC1G,iGAAiG;AACjG,EAAE;AACF,0GAA0G;AAC1G,gDAAgD;AAChD,MAAM,CAAC,MAAM,6BAA6B,GAAG;IAC3C,IAAI,EAAE,uBAAuB;IAC7B,UAAU,EAAE,6BAA6B;IACzC,MAAM,EAAE,yBAAyB;IACjC,SAAS,EAAE,4BAA4B;IACvC,IAAI,EAAE,uBAAuB;CACrB,CAAC"}
@@ -0,0 +1,37 @@
1
+ import type { Entity } from '@flighthq/entity/contract';
2
+ import type { Skeleton2D } from './Skeleton2DContract.ts';
3
+ /**
4
+ * A pose rule applied after the bones are placed and before they are drawn — inverse kinematics, transform
5
+ * copying, and later path following. Constraints are plain data carrying a `kind`, and a solver is
6
+ * registered against that kind, so a rig that uses only IK never bundles the others.
7
+ *
8
+ * `mix` is the blend from the unconstrained pose to the solved one: 0 leaves the bone exactly as animation
9
+ * posed it, 1 applies the constraint fully. It is the field that lets a constraint be faded in and out by
10
+ * an animation rather than being all-or-nothing, which is how both Spine and DragonBones author them.
11
+ */
12
+ export interface Skeleton2DConstraint extends Entity {
13
+ kind: Skeleton2DConstraintKind;
14
+ mix: number;
15
+ }
16
+ /**
17
+ * What solves a constraint. `solveSkeleton2DConstraints` looks the kind up and hands the whole constraint
18
+ * over, so a family this package does not own solves in the same pass as the built-in ones.
19
+ *
20
+ * A solver READS `skeleton.worldMatrices` (the caller must have filled them) and WRITES bone LOCAL
21
+ * transforms, then refreshes the world matrices of the bones it moved so a later constraint in the same
22
+ * pass sees them. It does not propagate to descendants — the caller re-runs
23
+ * `computeSkeleton2DWorldTransforms` once after the whole pass, which is one walk rather than one per
24
+ * constraint.
25
+ */
26
+ export type Skeleton2DConstraintSolver = (skeleton: Skeleton2D, constraint: Readonly<Skeleton2DConstraint>) => void;
27
+ /**
28
+ * The registry key for a constraint family, on the same terms as every other `*Kind` in the SDK: a plain
29
+ * string, PascalCase, vendor-prefixed when it is not Flight's own.
30
+ */
31
+ export declare const Skeleton2DConstraintKind: {
32
+ readonly Ik: 'Skeleton2D.IkConstraint';
33
+ readonly Path: 'Skeleton2D.PathConstraint';
34
+ readonly Transform: 'Skeleton2D.TransformConstraint';
35
+ };
36
+ export type Skeleton2DConstraintKind = string;
37
+ //# sourceMappingURL=Skeleton2DConstraintContract.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Skeleton2DConstraintContract.d.ts","sourceRoot":"","sources":["../src/Skeleton2DConstraintContract.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AAExD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAE1D;;;;;;;;GAQG;AACH,MAAM,WAAW,oBAAqB,SAAQ,MAAM;IAClD,IAAI,EAAE,wBAAwB,CAAC;IAC/B,GAAG,EAAE,MAAM,CAAC;CACb;AAED;;;;;;;;;GASG;AACH,MAAM,MAAM,0BAA0B,GAAG,CAAC,QAAQ,EAAE,UAAU,EAAE,UAAU,EAAE,QAAQ,CAAC,oBAAoB,CAAC,KAAK,IAAI,CAAC;AAEpH;;;GAGG;AACH,eAAO,MAAM,wBAAwB;aACnC,EAAE,EAAE,yBAAyB;aAC7B,IAAI,EAAE,2BAA2B;aACjC,SAAS,EAAE,gCAAgC;CACnC,CAAC;AAEX,MAAM,MAAM,wBAAwB,GAAG,MAAM,CAAC"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * The registry key for a constraint family, on the same terms as every other `*Kind` in the SDK: a plain
3
+ * string, PascalCase, vendor-prefixed when it is not Flight's own.
4
+ */
5
+ export const Skeleton2DConstraintKind = {
6
+ Ik: 'Skeleton2D.IkConstraint',
7
+ Path: 'Skeleton2D.PathConstraint',
8
+ Transform: 'Skeleton2D.TransformConstraint',
9
+ };
10
+ //# sourceMappingURL=Skeleton2DConstraintContract.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Skeleton2DConstraintContract.js","sourceRoot":"","sources":["../src/Skeleton2DConstraintContract.ts"],"names":[],"mappings":"AA8BA;;;GAGG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACtC,EAAE,EAAE,yBAAyB;IAC7B,IAAI,EAAE,2BAA2B;IACjC,SAAS,EAAE,gCAAgC;CACnC,CAAC"}
@@ -0,0 +1,13 @@
1
+ import type { Entity } from '@flighthq/entity/contract';
2
+ import type { AttachmentSkin2D } from './AttachmentSkin2D.ts';
3
+ import type { Bone2D } from './Bone2D.ts';
4
+ import type { Slot2D } from './Slot2D.ts';
5
+ export interface Skeleton2D extends Entity {
6
+ boneMatrices: Float32Array;
7
+ bones: Bone2D[];
8
+ inverseBindMatrices: Float32Array;
9
+ skins?: AttachmentSkin2D[] | null;
10
+ slots?: Slot2D[] | null;
11
+ worldMatrices: Float32Array;
12
+ }
13
+ //# sourceMappingURL=Skeleton2DContract.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Skeleton2DContract.d.ts","sourceRoot":"","sources":["../src/Skeleton2DContract.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AAExD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAsB1C,MAAM,WAAW,UAAW,SAAQ,MAAM;IACxC,YAAY,EAAE,YAAY,CAAC;IAC3B,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,mBAAmB,EAAE,YAAY,CAAC;IAClC,KAAK,CAAC,EAAE,gBAAgB,EAAE,GAAG,IAAI,CAAC;IAClC,KAAK,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IACxB,aAAa,EAAE,YAAY,CAAC;CAC7B"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=Skeleton2DContract.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Skeleton2DContract.js","sourceRoot":"","sources":["../src/Skeleton2DContract.ts"],"names":[],"mappings":""}
@@ -0,0 +1,22 @@
1
+ import type { Attachment2D } from './Attachment2D.ts';
2
+ import type { Skeleton2DAnimationTargetKind } from './Skeleton2DAnimationTargetKind.ts';
3
+ /**
4
+ * The binding target for a channel that animates an attachment's per-vertex offsets — a flag rippling, a
5
+ * cape settling, a mouth shape morphing between drawn keys.
6
+ *
7
+ * It names BOTH the slot and the attachment, because a deform timeline is authored per (slot, attachment)
8
+ * pair: the same slot showing a different attachment is a different timeline. The binder stamps
9
+ * `attachment` into the slot's `Skeleton2DSlotDeform` so the pull seam can tell whether the offsets it
10
+ * finds belong to the art currently shown.
11
+ *
12
+ * The track is an ordinary numeric `AnimationTrack` whose `components` is the whole offset stream length,
13
+ * so nothing in `@flighthq/animation` widens to carry this — and unlike an attachment-swap index, deform
14
+ * offsets DO interpolate, which is what makes a morph move rather than snap.
15
+ */
16
+ export interface Skeleton2DDeformAnimationTarget {
17
+ /** The attachment these offsets belong to; stamped onto the slot's deform record when bound. */
18
+ attachment: Attachment2D | null;
19
+ kind: Skeleton2DAnimationTargetKind;
20
+ slotIndex: number;
21
+ }
22
+ //# sourceMappingURL=Skeleton2DDeformAnimationTarget.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Skeleton2DDeformAnimationTarget.d.ts","sourceRoot":"","sources":["../src/Skeleton2DDeformAnimationTarget.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,oCAAoC,CAAC;AAExF;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,+BAA+B;IAC9C,gGAAgG;IAChG,UAAU,EAAE,YAAY,GAAG,IAAI,CAAC;IAChC,IAAI,EAAE,6BAA6B,CAAC;IACpC,SAAS,EAAE,MAAM,CAAC;CACnB"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=Skeleton2DDeformAnimationTarget.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Skeleton2DDeformAnimationTarget.js","sourceRoot":"","sources":["../src/Skeleton2DDeformAnimationTarget.ts"],"names":[],"mappings":""}
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Why a deform offset stream was applied or ignored, as plain data — the shakeable `explain*` query paired
3
+ * with the silent sentinel in `skinSkeleton2DAttachmentPoints`. The guard says a mismatch happened; this
4
+ * says what the correct length would have been, which is the part a caller needs to fix it.
5
+ *
6
+ * `addressed` is the float count the attachment's own storage implies. The number that surprises people is
7
+ * the weighted one: offsets are addressed per INFLUENCE, not per vertex, so a mesh whose vertices average
8
+ * three bones needs three times the stream a per-vertex reading predicts. `addressing` names which rule
9
+ * produced it, because reading the wrong one is the mistake this exists to catch.
10
+ */
11
+ export interface Skeleton2DDeformLengthExplanation {
12
+ /** True when the stream is long enough and the deform is applied. */
13
+ accepted: boolean;
14
+ /** `'weighted'` (per influence) or `'rigid'` (per vertex). */
15
+ addressing: string;
16
+ /** How many floats the attachment's storage addresses. */
17
+ addressed: number;
18
+ /** How many the offset stream carries. 0 for no stream at all. */
19
+ offsets: number;
20
+ }
21
+ //# sourceMappingURL=Skeleton2DDeformLengthExplanation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Skeleton2DDeformLengthExplanation.d.ts","sourceRoot":"","sources":["../src/Skeleton2DDeformLengthExplanation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,MAAM,WAAW,iCAAiC;IAChD,qEAAqE;IACrE,QAAQ,EAAE,OAAO,CAAC;IAClB,8DAA8D;IAC9D,UAAU,EAAE,MAAM,CAAC;IACnB,0DAA0D;IAC1D,SAAS,EAAE,MAAM,CAAC;IAClB,kEAAkE;IAClE,OAAO,EAAE,MAAM,CAAC;CACjB"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=Skeleton2DDeformLengthExplanation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Skeleton2DDeformLengthExplanation.js","sourceRoot":"","sources":["../src/Skeleton2DDeformLengthExplanation.ts"],"names":[],"mappings":""}
@@ -0,0 +1,28 @@
1
+ import type { Entity } from '@flighthq/entity/contract';
2
+ import type { Node, NodeFields, NodeOrderList } from '@flighthq/node/contract';
3
+ import type { Skeleton2DAnimationTargetKind } from './Skeleton2DAnimationTargetKind.ts';
4
+ /**
5
+ * The binding target an `AnimationChannel` carries when it reorders a rig's drawing rather than moving
6
+ * it — Spine's draw-order timeline, and the second consumer of the same structure Rive's
7
+ * `DrawRules`/`DrawTarget` already import through.
8
+ *
9
+ * **Ordering is caller-owned and never node state**, per [draw order model](draw-order-model.md), so the
10
+ * target carries the `NodeOrderList` it writes into rather than the binder reaching for one. The binder
11
+ * fills the list; applying it to the parent stays the caller's explicit step, exactly as posing bones
12
+ * leaves the world-transform pass to the caller.
13
+ *
14
+ * `nodes` maps a slot index to the display node that slot draws, or `null` where it draws nothing —
15
+ * a lookup table for the same reason `Skeleton2DSlotAnimationTarget` carries its attachments, since a
16
+ * `Slot2D` knows what it wears and not where it lands in someone else's scene.
17
+ *
18
+ * The channel's track holds one **full ordering per keyframe**: `components` is the slot count, and the
19
+ * value at each slot's offset is that slot's sort key on that frame. A draw order is walked as steps
20
+ * whatever the track states — interpolating two orderings yields fractional sort keys and a sequence
21
+ * nobody authored — and that coercion reports through `enableSkeleton2DGuards`.
22
+ */
23
+ export interface Skeleton2DDrawOrderAnimationTarget<Fields extends object = NodeFields> extends Entity {
24
+ kind: Skeleton2DAnimationTargetKind;
25
+ nodes: readonly (Node<Fields> | null)[];
26
+ orderList: NodeOrderList<Fields>;
27
+ }
28
+ //# sourceMappingURL=Skeleton2DDrawOrderAnimationTarget.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Skeleton2DDrawOrderAnimationTarget.d.ts","sourceRoot":"","sources":["../src/Skeleton2DDrawOrderAnimationTarget.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,KAAK,EAAE,IAAI,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAE/E,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,oCAAoC,CAAC;AAExF;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,WAAW,kCAAkC,CAAC,MAAM,SAAS,MAAM,GAAG,UAAU,CAAE,SAAQ,MAAM;IACpG,IAAI,EAAE,6BAA6B,CAAC;IACpC,KAAK,EAAE,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC;IACxC,SAAS,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;CAClC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=Skeleton2DDrawOrderAnimationTarget.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Skeleton2DDrawOrderAnimationTarget.js","sourceRoot":"","sources":["../src/Skeleton2DDrawOrderAnimationTarget.ts"],"names":[],"mappings":""}
@@ -0,0 +1,24 @@
1
+ /**
2
+ * A rig's draw-order timeline as the file states it, carried on the import rather than as a channel.
3
+ *
4
+ * **A target names what the file states.** A draw-order channel's target needs a `NodeOrderList` and a
5
+ * slot-index-to-display-node table, and neither is rig data — nodes do not exist until a caller builds
6
+ * a scene. So the parser reports the orderings here and a scene-side step turns them into channels once
7
+ * there are nodes to name, which is the same division `@flighthq/scene2d-formats` already uses for Rive:
8
+ * the codec reports `DrawRules` and the caller wires the `NodeOrderList`.
9
+ *
10
+ * `orderings` holds **one full ordering per keyframe**, flat, in keyframe order — `slotCount` sort keys
11
+ * per keyframe, where the value at a slot's offset is that slot's draw position on that frame. Spine
12
+ * states the wire form as (slot, offset) pairs applied in sequence to the previous order, which cannot
13
+ * answer "what is in effect at time t" from one keyframe alone; resolving those pairs into whole
14
+ * orderings is the parser's job, so a consumer reads a self-contained frame.
15
+ *
16
+ * `slotCount` is `orderings.length / times.length` and is not stored separately, so the two cannot
17
+ * disagree.
18
+ */
19
+ export interface Skeleton2DDrawOrderTimeline {
20
+ orderings: number[];
21
+ /** Seconds, one per keyframe, ascending. */
22
+ times: number[];
23
+ }
24
+ //# sourceMappingURL=Skeleton2DDrawOrderTimeline.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Skeleton2DDrawOrderTimeline.d.ts","sourceRoot":"","sources":["../src/Skeleton2DDrawOrderTimeline.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,WAAW,2BAA2B;IAC1C,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,4CAA4C;IAC5C,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=Skeleton2DDrawOrderTimeline.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Skeleton2DDrawOrderTimeline.js","sourceRoot":"","sources":["../src/Skeleton2DDrawOrderTimeline.ts"],"names":[],"mappings":""}
@@ -0,0 +1,38 @@
1
+ /**
2
+ * What a channel's stated interpolation was replaced with, and why it had to be.
3
+ *
4
+ * Some channels carry a value that cannot be blended: an attachment index blended between two table
5
+ * entries names art that was never authored, and a draw order blended between two orderings produces
6
+ * fractional sort keys and a sequence nobody wrote. Those channels are walked as steps whatever their
7
+ * track claims, which is correct — but a coercion nobody can see is indistinguishable from the file
8
+ * having been authored that way, so the override is reported rather than performed in silence.
9
+ */
10
+ export interface Skeleton2DCoercedInterpolation {
11
+ /** What the channel is actually walked as. Always `Step` today; stated so a reader need not assume. */
12
+ applied: string;
13
+ /** What the track claimed, which is what the author most likely set. */
14
+ stated: string;
15
+ /** Which channel family coerced — `Attachment` or `DrawOrder`. */
16
+ subject: string;
17
+ }
18
+ /**
19
+ * A deform offset stream that does not match the vertex stream it addresses.
20
+ *
21
+ * The offsets are ignored rather than partially applied: a stream of the wrong length has no correct
22
+ * prefix, so consuming what fits would deform some vertices and silently leave others behind. Reading
23
+ * past the buffer is never an option, and this is a sentinel rather than a throw because a malformed
24
+ * attachment is an asset fact.
25
+ */
26
+ export interface Skeleton2DDeformLengthMismatch {
27
+ /** How many values the addressed vertex stream needs. */
28
+ addressed: number;
29
+ /** How many the offset stream actually carries. */
30
+ offsets: number;
31
+ /** Which attachment or slot the mismatch was found on, for a caller that has to go and fix it. */
32
+ subject: string;
33
+ }
34
+ /** Installed by `enableSkeleton2DGuards`; called when a channel's interpolation is overridden. */
35
+ export type Skeleton2DCoercedInterpolationGuard = (report: Readonly<Skeleton2DCoercedInterpolation>) => void;
36
+ /** Installed by `enableSkeleton2DGuards`; called when a deform offset stream is the wrong length. */
37
+ export type Skeleton2DDeformLengthGuard = (report: Readonly<Skeleton2DDeformLengthMismatch>) => void;
38
+ //# sourceMappingURL=Skeleton2DGuardsContract.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Skeleton2DGuardsContract.d.ts","sourceRoot":"","sources":["../src/Skeleton2DGuardsContract.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,MAAM,WAAW,8BAA8B;IAC7C,uGAAuG;IACvG,OAAO,EAAE,MAAM,CAAC;IAChB,wEAAwE;IACxE,MAAM,EAAE,MAAM,CAAC;IACf,kEAAkE;IAClE,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,8BAA8B;IAC7C,yDAAyD;IACzD,SAAS,EAAE,MAAM,CAAC;IAClB,mDAAmD;IACnD,OAAO,EAAE,MAAM,CAAC;IAChB,kGAAkG;IAClG,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,kGAAkG;AAClG,MAAM,MAAM,mCAAmC,GAAG,CAAC,MAAM,EAAE,QAAQ,CAAC,8BAA8B,CAAC,KAAK,IAAI,CAAC;AAE7G,qGAAqG;AACrG,MAAM,MAAM,2BAA2B,GAAG,CAAC,MAAM,EAAE,QAAQ,CAAC,8BAA8B,CAAC,KAAK,IAAI,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=Skeleton2DGuardsContract.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Skeleton2DGuardsContract.js","sourceRoot":"","sources":["../src/Skeleton2DGuardsContract.ts"],"names":[],"mappings":""}
@@ -0,0 +1,29 @@
1
+ import type { Skeleton2DConstraint } from './Skeleton2DConstraintContract.ts';
2
+ /**
3
+ * Inverse kinematics over a one- or two-bone chain: rotate the chain so its tip reaches a target bone's
4
+ * world position, instead of animating each joint angle by hand.
5
+ *
6
+ * `boneIndices` is the chain in parent-to-child order — one bone (aim) or two (elbow/knee). Longer chains
7
+ * are a named deferral, not an oversight: both formats this models author one and two, and an N-bone
8
+ * solver is a different algorithm (iterative) rather than more of this one.
9
+ *
10
+ * `bendPositive` picks which of the two solutions a two-bone chain uses — the elbow that bends up or the
11
+ * one that bends down. It has no effect on a one-bone chain, which has a single solution.
12
+ *
13
+ * `stretch` lets a chain that cannot reach lengthen along its own axis instead of falling short, and
14
+ * `compress` lets a one-bone chain shorten when the target is nearer than its length. Both are scaled by
15
+ * `mix`, so a faded constraint stretches proportionally rather than snapping.
16
+ *
17
+ * Spine's `softness` (easing the last stretch of reach so a limb does not snap straight) is deliberately
18
+ * NOT a field here: carrying a field the solver does not honor is worse than not carrying it, so it is
19
+ * named as deferred rather than accepted and silently dropped.
20
+ */
21
+ export interface Skeleton2DIkConstraint extends Skeleton2DConstraint {
22
+ bendPositive: boolean;
23
+ boneIndices: readonly number[];
24
+ compress: boolean;
25
+ kind: 'Skeleton2D.IkConstraint';
26
+ stretch: boolean;
27
+ targetBoneIndex: number;
28
+ }
29
+ //# sourceMappingURL=Skeleton2DIkConstraint.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Skeleton2DIkConstraint.d.ts","sourceRoot":"","sources":["../src/Skeleton2DIkConstraint.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AAE9E;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,WAAW,sBAAuB,SAAQ,oBAAoB;IAClE,YAAY,EAAE,OAAO,CAAC;IACtB,WAAW,EAAE,SAAS,MAAM,EAAE,CAAC;IAC/B,QAAQ,EAAE,OAAO,CAAC;IAClB,IAAI,EAAE,yBAAyB,CAAC;IAChC,OAAO,EAAE,OAAO,CAAC;IACjB,eAAe,EAAE,MAAM,CAAC;CACzB"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=Skeleton2DIkConstraint.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Skeleton2DIkConstraint.js","sourceRoot":"","sources":["../src/Skeleton2DIkConstraint.ts"],"names":[],"mappings":""}
@@ -0,0 +1,53 @@
1
+ import type { Skeleton2DConstraint } from './Skeleton2DConstraintContract.ts';
2
+ /**
3
+ * Positions a chain of bones ALONG a vector path — a caterpillar track, a rope, a row of carriages
4
+ * following rails. The path is the attachment on a target slot, so the same `PathAttachment2D` that can
5
+ * be skinned by bones can also drive them.
6
+ *
7
+ * `position` is where along the path the first bone sits and `spacing` is the gap between successive
8
+ * bones; each is read in the units its mode names, which is why the modes exist rather than a single
9
+ * "distance" convention that would be wrong for half the rigs that use it.
10
+ *
11
+ * `rotateMode` decides what a bone's rotation follows: `Tangent` aims every bone along the path's own
12
+ * direction at its position, which is what a rope does; `Chain` aims each bone at the NEXT bone's
13
+ * position, which is what a linkage does and which keeps the chain rigid where the path is coarse.
14
+ *
15
+ * The three mixes are separate for the same reason the transform constraint's are: following a path's
16
+ * position while keeping authored rotation is a real authoring choice, not a degenerate case.
17
+ */
18
+ export interface Skeleton2DPathConstraint extends Skeleton2DConstraint {
19
+ boneIndices: readonly number[];
20
+ kind: 'Skeleton2D.PathConstraint';
21
+ mixRotate: number;
22
+ mixX: number;
23
+ mixY: number;
24
+ /** Arc-length units when `Fixed`, a 0..1 fraction of the whole path when `Percent`. */
25
+ position: number;
26
+ positionMode: Skeleton2DPathPositionMode;
27
+ rotateMode: Skeleton2DPathRotateMode;
28
+ /**
29
+ * Arc-length units when `Fixed`, a 0..1 fraction of the path when `Percent`, and a multiple of each
30
+ * bone's own `length` when `Length` — the mode that keeps a chain of unequal bones evenly jointed.
31
+ */
32
+ spacing: number;
33
+ spacingMode: Skeleton2DPathSpacingMode;
34
+ /** The slot whose attachment is the `PathAttachment2D` to follow. */
35
+ targetSlotIndex: number;
36
+ }
37
+ export declare const Skeleton2DPathPositionMode: {
38
+ readonly Fixed: 'Fixed';
39
+ readonly Percent: 'Percent';
40
+ };
41
+ export type Skeleton2DPathPositionMode = (typeof Skeleton2DPathPositionMode)[keyof typeof Skeleton2DPathPositionMode];
42
+ export declare const Skeleton2DPathRotateMode: {
43
+ readonly Chain: 'Chain';
44
+ readonly Tangent: 'Tangent';
45
+ };
46
+ export type Skeleton2DPathRotateMode = (typeof Skeleton2DPathRotateMode)[keyof typeof Skeleton2DPathRotateMode];
47
+ export declare const Skeleton2DPathSpacingMode: {
48
+ readonly Fixed: 'Fixed';
49
+ readonly Length: 'Length';
50
+ readonly Percent: 'Percent';
51
+ };
52
+ export type Skeleton2DPathSpacingMode = (typeof Skeleton2DPathSpacingMode)[keyof typeof Skeleton2DPathSpacingMode];
53
+ //# sourceMappingURL=Skeleton2DPathConstraint.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Skeleton2DPathConstraint.d.ts","sourceRoot":"","sources":["../src/Skeleton2DPathConstraint.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AAE9E;;;;;;;;;;;;;;;GAeG;AACH,MAAM,WAAW,wBAAyB,SAAQ,oBAAoB;IACpE,WAAW,EAAE,SAAS,MAAM,EAAE,CAAC;IAC/B,IAAI,EAAE,2BAA2B,CAAC;IAClC,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,uFAAuF;IACvF,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,0BAA0B,CAAC;IACzC,UAAU,EAAE,wBAAwB,CAAC;IACrC;;;OAGG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,yBAAyB,CAAC;IACvC,qEAAqE;IACrE,eAAe,EAAE,MAAM,CAAC;CACzB;AAED,eAAO,MAAM,0BAA0B;aACrC,KAAK,EAAE,OAAO;aACd,OAAO,EAAE,SAAS;CACV,CAAC;AAEX,MAAM,MAAM,0BAA0B,GAAG,CAAC,OAAO,0BAA0B,CAAC,CAAC,MAAM,OAAO,0BAA0B,CAAC,CAAC;AAEtH,eAAO,MAAM,wBAAwB;aACnC,KAAK,EAAE,OAAO;aACd,OAAO,EAAE,SAAS;CACV,CAAC;AAEX,MAAM,MAAM,wBAAwB,GAAG,CAAC,OAAO,wBAAwB,CAAC,CAAC,MAAM,OAAO,wBAAwB,CAAC,CAAC;AAEhH,eAAO,MAAM,yBAAyB;aACpC,KAAK,EAAE,OAAO;aACd,MAAM,EAAE,QAAQ;aAChB,OAAO,EAAE,SAAS;CACV,CAAC;AAEX,MAAM,MAAM,yBAAyB,GAAG,CAAC,OAAO,yBAAyB,CAAC,CAAC,MAAM,OAAO,yBAAyB,CAAC,CAAC"}
@@ -0,0 +1,14 @@
1
+ export const Skeleton2DPathPositionMode = {
2
+ Fixed: 'Fixed',
3
+ Percent: 'Percent',
4
+ };
5
+ export const Skeleton2DPathRotateMode = {
6
+ Chain: 'Chain',
7
+ Tangent: 'Tangent',
8
+ };
9
+ export const Skeleton2DPathSpacingMode = {
10
+ Fixed: 'Fixed',
11
+ Length: 'Length',
12
+ Percent: 'Percent',
13
+ };
14
+ //# sourceMappingURL=Skeleton2DPathConstraint.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Skeleton2DPathConstraint.js","sourceRoot":"","sources":["../src/Skeleton2DPathConstraint.ts"],"names":[],"mappings":"AAsCA,MAAM,CAAC,MAAM,0BAA0B,GAAG;IACxC,KAAK,EAAE,OAAO;IACd,OAAO,EAAE,SAAS;CACV,CAAC;AAIX,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACtC,KAAK,EAAE,OAAO;IACd,OAAO,EAAE,SAAS;CACV,CAAC;AAIX,MAAM,CAAC,MAAM,yBAAyB,GAAG;IACvC,KAAK,EAAE,OAAO;IACd,MAAM,EAAE,QAAQ;IAChB,OAAO,EAAE,SAAS;CACV,CAAC"}
@@ -0,0 +1,15 @@
1
+ import type { Entity } from '@flighthq/entity/contract';
2
+ import type { Attachment2D } from './Attachment2D.ts';
3
+ import type { Skeleton2DAnimationTargetKind } from './Skeleton2DAnimationTargetKind.ts';
4
+ export declare const Skeleton2DSlotAnimationPath: {
5
+ readonly Attachment: 'Attachment';
6
+ readonly Color: 'Color';
7
+ };
8
+ export type Skeleton2DSlotAnimationPath = (typeof Skeleton2DSlotAnimationPath)[keyof typeof Skeleton2DSlotAnimationPath];
9
+ export interface Skeleton2DSlotAnimationTarget extends Entity {
10
+ attachments?: readonly (Attachment2D | null)[] | null;
11
+ kind: Skeleton2DAnimationTargetKind;
12
+ path: Skeleton2DSlotAnimationPath;
13
+ slotIndex: number;
14
+ }
15
+ //# sourceMappingURL=Skeleton2DSlotAnimationTarget.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Skeleton2DSlotAnimationTarget.d.ts","sourceRoot":"","sources":["../src/Skeleton2DSlotAnimationTarget.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AAExD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,oCAAoC,CAAC;AAexF,eAAO,MAAM,2BAA2B;aACtC,UAAU,EAAE,YAAY;aACxB,KAAK,EAAE,OAAO;CACN,CAAC;AAEX,MAAM,MAAM,2BAA2B,GACrC,CAAC,OAAO,2BAA2B,CAAC,CAAC,MAAM,OAAO,2BAA2B,CAAC,CAAC;AAyBjF,MAAM,WAAW,6BAA8B,SAAQ,MAAM;IAC3D,WAAW,CAAC,EAAE,SAAS,CAAC,YAAY,GAAG,IAAI,CAAC,EAAE,GAAG,IAAI,CAAC;IACtD,IAAI,EAAE,6BAA6B,CAAC;IACpC,IAAI,EAAE,2BAA2B,CAAC;IAClC,SAAS,EAAE,MAAM,CAAC;CACnB"}
@@ -0,0 +1,18 @@
1
+ // Which part of a `Slot2D`'s appearance an AnimationChannel drives — the slot-side counterpart of
2
+ // `Skeleton2DAnimationPath`, which covers only bone transforms.
3
+ //
4
+ // Color — drives the packed `Slot2D.color` [Vector4 track, components 4, channels 0..1 R,G,B,A]
5
+ // Attachment — drives which attachment the slot shows [scalar STEP track of indices into `attachments`]
6
+ //
7
+ // Colour channels are NORMALIZED 0..1, not 0..255, even though `Slot2D.color` packs bytes. That is the space
8
+ // Spine authors its colour CURVE control points in, so a 0..255 track would rebase every colour easing
9
+ // against the wrong scale; the binder converts to bytes when it packs.
10
+ //
11
+ // Deliberately small. Spine's second ("dark") slot colour has no `Slot2D` representation at all, and
12
+ // draw-order timelines mutate the draw list rather than a value on a slot, so neither is modeled here; both
13
+ // are named deferrals rather than oversights (see agents/skeleton2d-animation-model.md).
14
+ export const Skeleton2DSlotAnimationPath = {
15
+ Attachment: 'Attachment',
16
+ Color: 'Color',
17
+ };
18
+ //# sourceMappingURL=Skeleton2DSlotAnimationTarget.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Skeleton2DSlotAnimationTarget.js","sourceRoot":"","sources":["../src/Skeleton2DSlotAnimationTarget.ts"],"names":[],"mappings":"AAKA,kGAAkG;AAClG,gEAAgE;AAChE,EAAE;AACF,wGAAwG;AACxG,0GAA0G;AAC1G,EAAE;AACF,6GAA6G;AAC7G,uGAAuG;AACvG,uEAAuE;AACvE,EAAE;AACF,qGAAqG;AACrG,4GAA4G;AAC5G,yFAAyF;AACzF,MAAM,CAAC,MAAM,2BAA2B,GAAG;IACzC,UAAU,EAAE,YAAY;IACxB,KAAK,EAAE,OAAO;CACN,CAAC"}
@@ -0,0 +1,29 @@
1
+ import type { Attachment2D } from './Attachment2D.ts';
2
+ /**
3
+ * The per-vertex offset stream in effect on a slot, together with THE ATTACHMENT IT WAS AUTHORED FOR.
4
+ *
5
+ * A deform belongs to a (slot, attachment) PAIR, not to a slot: the attachment is shared art, so two
6
+ * slots showing the same mesh deform independently, and one slot that SWAPS attachments must not carry
7
+ * the old one's offsets onto the new art. Pairing the offsets with their attachment here is what makes
8
+ * that impossible to express, rather than something a consumer has to remember to check.
9
+ *
10
+ * This is the invalidation doctrine's compare-identities rule applied literally: `attachment` is a
11
+ * reference-shaped field re-read at the pull seam (`getSkeleton2DSlotDeformOffsets`), and bare assignment
12
+ * is the API — nothing has to be invalidated when a swap happens, because the comparison catches it.
13
+ *
14
+ * A bare `Float32Array` on the slot was the alternative and it is unsafe in a way a length check cannot
15
+ * fix. Of the three ways a swap can change size, only ONE is detectable by length: swapping to a LARGER
16
+ * attachment leaves the buffer too short and is caught, while swapping to an EQUAL or SMALLER one passes
17
+ * a `>=` check and silently deforms the new art with the old offsets. Equal is also the common case, since
18
+ * matching point counts are what make a swap look continuous.
19
+ */
20
+ export interface Skeleton2DSlotDeform {
21
+ /** The attachment these offsets were authored against. Compared, never followed. */
22
+ attachment: Attachment2D | null;
23
+ /**
24
+ * The offset stream, addressed as the attachment stores its positions — two floats per INFLUENCE for a
25
+ * weighted attachment, two per VERTEX for a rigid one. See `explainSkeleton2DDeformLength`.
26
+ */
27
+ offsets: Float32Array;
28
+ }
29
+ //# sourceMappingURL=Skeleton2DSlotDeform.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Skeleton2DSlotDeform.d.ts","sourceRoot":"","sources":["../src/Skeleton2DSlotDeform.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEtD;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,WAAW,oBAAoB;IACnC,oFAAoF;IACpF,UAAU,EAAE,YAAY,GAAG,IAAI,CAAC;IAChC;;;OAGG;IACH,OAAO,EAAE,YAAY,CAAC;CACvB"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=Skeleton2DSlotDeform.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Skeleton2DSlotDeform.js","sourceRoot":"","sources":["../src/Skeleton2DSlotDeform.ts"],"names":[],"mappings":""}