@mathscan/geometry-engine 0.1.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 (380) hide show
  1. package/README.md +1101 -0
  2. package/dist/coordinates/grid.d.cts +8 -0
  3. package/dist/coordinates/grid.d.ts +9 -0
  4. package/dist/coordinates/grid.d.ts.map +1 -0
  5. package/dist/coordinates/lineClipping.d.cts +3 -0
  6. package/dist/coordinates/lineClipping.d.ts +4 -0
  7. package/dist/coordinates/lineClipping.d.ts.map +1 -0
  8. package/dist/coordinates/transform.d.cts +18 -0
  9. package/dist/coordinates/transform.d.ts +19 -0
  10. package/dist/coordinates/transform.d.ts.map +1 -0
  11. package/dist/core.cjs +1 -0
  12. package/dist/core.mjs +4 -0
  13. package/dist/entries/core.d.cts +16 -0
  14. package/dist/entries/core.d.ts +17 -0
  15. package/dist/entries/core.d.ts.map +1 -0
  16. package/dist/entries/react.d.cts +18 -0
  17. package/dist/entries/react.d.ts +19 -0
  18. package/dist/entries/react.d.ts.map +1 -0
  19. package/dist/entries/schemas.d.cts +14 -0
  20. package/dist/entries/schemas.d.ts +15 -0
  21. package/dist/entries/schemas.d.ts.map +1 -0
  22. package/dist/entries/validation.d.cts +12 -0
  23. package/dist/entries/validation.d.ts +13 -0
  24. package/dist/entries/validation.d.ts.map +1 -0
  25. package/dist/exercise.schema-BV2b7rtN.cjs +2 -0
  26. package/dist/exercise.schema-BV2b7rtN.cjs.map +1 -0
  27. package/dist/exercise.schema-ckVBW9XA.js +212 -0
  28. package/dist/exercise.schema-ckVBW9XA.js.map +1 -0
  29. package/dist/geometry/distance.d.cts +9 -0
  30. package/dist/geometry/distance.d.ts +10 -0
  31. package/dist/geometry/distance.d.ts.map +1 -0
  32. package/dist/geometry/entities/circle.d.cts +36 -0
  33. package/dist/geometry/entities/circle.d.ts +37 -0
  34. package/dist/geometry/entities/circle.d.ts.map +1 -0
  35. package/dist/geometry/entities/index.d.cts +60 -0
  36. package/dist/geometry/entities/index.d.ts +61 -0
  37. package/dist/geometry/entities/index.d.ts.map +1 -0
  38. package/dist/geometry/entities/line.d.cts +43 -0
  39. package/dist/geometry/entities/line.d.ts +44 -0
  40. package/dist/geometry/entities/line.d.ts.map +1 -0
  41. package/dist/geometry/entities/point.d.cts +27 -0
  42. package/dist/geometry/entities/point.d.ts +28 -0
  43. package/dist/geometry/entities/point.d.ts.map +1 -0
  44. package/dist/geometry/entities/relations.d.cts +27 -0
  45. package/dist/geometry/entities/relations.d.ts +28 -0
  46. package/dist/geometry/entities/relations.d.ts.map +1 -0
  47. package/dist/geometry/entities/segment.d.cts +45 -0
  48. package/dist/geometry/entities/segment.d.ts +46 -0
  49. package/dist/geometry/entities/segment.d.ts.map +1 -0
  50. package/dist/geometry/entityCapabilities.d.cts +2 -0
  51. package/dist/geometry/entityCapabilities.d.ts +3 -0
  52. package/dist/geometry/entityCapabilities.d.ts.map +1 -0
  53. package/dist/geometry/entityModel.d.cts +139 -0
  54. package/dist/geometry/entityModel.d.ts +140 -0
  55. package/dist/geometry/entityModel.d.ts.map +1 -0
  56. package/dist/geometry/entityRecord.d.cts +27 -0
  57. package/dist/geometry/entityRecord.d.ts +28 -0
  58. package/dist/geometry/entityRecord.d.ts.map +1 -0
  59. package/dist/geometry/evaluateGraph.d.cts +37 -0
  60. package/dist/geometry/evaluateGraph.d.ts +38 -0
  61. package/dist/geometry/evaluateGraph.d.ts.map +1 -0
  62. package/dist/geometry/geometryObject.d.cts +4 -0
  63. package/dist/geometry/geometryObject.d.ts +5 -0
  64. package/dist/geometry/geometryObject.d.ts.map +1 -0
  65. package/dist/geometry/goalCandidate.d.cts +8 -0
  66. package/dist/geometry/goalCandidate.d.ts +9 -0
  67. package/dist/geometry/goalCandidate.d.ts.map +1 -0
  68. package/dist/geometry/hitTest.d.cts +23 -0
  69. package/dist/geometry/hitTest.d.ts +24 -0
  70. package/dist/geometry/hitTest.d.ts.map +1 -0
  71. package/dist/geometry/point.d.cts +5 -0
  72. package/dist/geometry/point.d.ts +6 -0
  73. package/dist/geometry/point.d.ts.map +1 -0
  74. package/dist/geometry/pointOrigin.d.cts +5 -0
  75. package/dist/geometry/pointOrigin.d.ts +6 -0
  76. package/dist/geometry/pointOrigin.d.ts.map +1 -0
  77. package/dist/geometry/v1Bridge.d.cts +41 -0
  78. package/dist/geometry/v1Bridge.d.ts +42 -0
  79. package/dist/geometry/v1Bridge.d.ts.map +1 -0
  80. package/dist/geometryAttemptStatus-5L_q6-9l.js +184 -0
  81. package/dist/geometryAttemptStatus-5L_q6-9l.js.map +1 -0
  82. package/dist/geometryAttemptStatus-N_XHIkiS.cjs +2 -0
  83. package/dist/geometryAttemptStatus-N_XHIkiS.cjs.map +1 -0
  84. package/dist/geometryState.schema-D0ixyGYE.js +955 -0
  85. package/dist/geometryState.schema-D0ixyGYE.js.map +1 -0
  86. package/dist/geometryState.schema-DKQ-durx.cjs +2 -0
  87. package/dist/geometryState.schema-DKQ-durx.cjs.map +1 -0
  88. package/dist/goals-C3ZwbEh_.js +451 -0
  89. package/dist/goals-C3ZwbEh_.js.map +1 -0
  90. package/dist/goals-CxR5qPDC.cjs +2 -0
  91. package/dist/goals-CxR5qPDC.cjs.map +1 -0
  92. package/dist/index.cjs +1 -0
  93. package/dist/index.d.cts +4 -0
  94. package/dist/index.d.ts +5 -0
  95. package/dist/index.d.ts.map +1 -0
  96. package/dist/index.mjs +10 -0
  97. package/dist/measure/geometryAdapter.d.cts +26 -0
  98. package/dist/measure/geometryAdapter.d.ts +27 -0
  99. package/dist/measure/geometryAdapter.d.ts.map +1 -0
  100. package/dist/measure/kernel.d.cts +25 -0
  101. package/dist/measure/kernel.d.ts +26 -0
  102. package/dist/measure/kernel.d.ts.map +1 -0
  103. package/dist/numerics/policy.d.cts +17 -0
  104. package/dist/numerics/policy.d.ts +18 -0
  105. package/dist/numerics/policy.d.ts.map +1 -0
  106. package/dist/react-BEcdx1f6.js +1851 -0
  107. package/dist/react-BEcdx1f6.js.map +1 -0
  108. package/dist/react-Pp_VSk--.cjs +2 -0
  109. package/dist/react-Pp_VSk--.cjs.map +1 -0
  110. package/dist/react.cjs +1 -0
  111. package/dist/react.mjs +2 -0
  112. package/dist/renderer/GeometryCanvas.d.cts +14 -0
  113. package/dist/renderer/GeometryCanvas.d.ts +15 -0
  114. package/dist/renderer/GeometryCanvas.d.ts.map +1 -0
  115. package/dist/renderer/GeometryCompanion.d.cts +29 -0
  116. package/dist/renderer/GeometryCompanion.d.ts +30 -0
  117. package/dist/renderer/GeometryCompanion.d.ts.map +1 -0
  118. package/dist/renderer/GeometryGrid.d.cts +7 -0
  119. package/dist/renderer/GeometryGrid.d.ts +8 -0
  120. package/dist/renderer/GeometryGrid.d.ts.map +1 -0
  121. package/dist/renderer/GeometryInstruments.d.cts +7 -0
  122. package/dist/renderer/GeometryInstruments.d.ts +8 -0
  123. package/dist/renderer/GeometryInstruments.d.ts.map +1 -0
  124. package/dist/renderer/StudentGeometryCanvas.d.cts +11 -0
  125. package/dist/renderer/StudentGeometryCanvas.d.ts +12 -0
  126. package/dist/renderer/StudentGeometryCanvas.d.ts.map +1 -0
  127. package/dist/renderer/StudentGeometryExercise.d.cts +36 -0
  128. package/dist/renderer/StudentGeometryExercise.d.ts +37 -0
  129. package/dist/renderer/StudentGeometryExercise.d.ts.map +1 -0
  130. package/dist/renderer/Toolbar.d.cts +7 -0
  131. package/dist/renderer/Toolbar.d.ts +8 -0
  132. package/dist/renderer/Toolbar.d.ts.map +1 -0
  133. package/dist/renderer/deriveRenderableGeometry.d.cts +15 -0
  134. package/dist/renderer/deriveRenderableGeometry.d.ts +16 -0
  135. package/dist/renderer/deriveRenderableGeometry.d.ts.map +1 -0
  136. package/dist/renderer/deriveSemanticScene.d.cts +58 -0
  137. package/dist/renderer/deriveSemanticScene.d.ts +59 -0
  138. package/dist/renderer/deriveSemanticScene.d.ts.map +1 -0
  139. package/dist/renderer/entityDisplayName.d.cts +12 -0
  140. package/dist/renderer/entityDisplayName.d.ts +13 -0
  141. package/dist/renderer/entityDisplayName.d.ts.map +1 -0
  142. package/dist/renderer/gesturePolicy.d.cts +97 -0
  143. package/dist/renderer/gesturePolicy.d.ts +98 -0
  144. package/dist/renderer/gesturePolicy.d.ts.map +1 -0
  145. package/dist/renderer/shapes/CircleShape.d.cts +17 -0
  146. package/dist/renderer/shapes/CircleShape.d.ts +18 -0
  147. package/dist/renderer/shapes/CircleShape.d.ts.map +1 -0
  148. package/dist/renderer/shapes/EntityLabel.d.cts +14 -0
  149. package/dist/renderer/shapes/EntityLabel.d.ts +15 -0
  150. package/dist/renderer/shapes/EntityLabel.d.ts.map +1 -0
  151. package/dist/renderer/shapes/EntityShape.d.cts +18 -0
  152. package/dist/renderer/shapes/EntityShape.d.ts +19 -0
  153. package/dist/renderer/shapes/EntityShape.d.ts.map +1 -0
  154. package/dist/renderer/shapes/LineShape.d.cts +16 -0
  155. package/dist/renderer/shapes/LineShape.d.ts +17 -0
  156. package/dist/renderer/shapes/LineShape.d.ts.map +1 -0
  157. package/dist/renderer/shapes/PointShape.d.cts +17 -0
  158. package/dist/renderer/shapes/PointShape.d.ts +18 -0
  159. package/dist/renderer/shapes/PointShape.d.ts.map +1 -0
  160. package/dist/renderer/shapes/SegmentShape.d.cts +17 -0
  161. package/dist/renderer/shapes/SegmentShape.d.ts +18 -0
  162. package/dist/renderer/shapes/SegmentShape.d.ts.map +1 -0
  163. package/dist/renderer/shapes/SnapMarker.d.cts +8 -0
  164. package/dist/renderer/shapes/SnapMarker.d.ts +9 -0
  165. package/dist/renderer/shapes/SnapMarker.d.ts.map +1 -0
  166. package/dist/renderer/shapes/StrokedLine.d.cts +18 -0
  167. package/dist/renderer/shapes/StrokedLine.d.ts +19 -0
  168. package/dist/renderer/shapes/StrokedLine.d.ts.map +1 -0
  169. package/dist/renderer/studentExerciseSession.d.cts +71 -0
  170. package/dist/renderer/studentExerciseSession.d.ts +72 -0
  171. package/dist/renderer/studentExerciseSession.d.ts.map +1 -0
  172. package/dist/renderer/useConnectionPreview.d.cts +44 -0
  173. package/dist/renderer/useConnectionPreview.d.ts +45 -0
  174. package/dist/renderer/useConnectionPreview.d.ts.map +1 -0
  175. package/dist/renderer/usePlacementSnap.d.cts +28 -0
  176. package/dist/renderer/usePlacementSnap.d.ts +29 -0
  177. package/dist/renderer/usePlacementSnap.d.ts.map +1 -0
  178. package/dist/renderer/usePointerGestures.d.cts +46 -0
  179. package/dist/renderer/usePointerGestures.d.ts +47 -0
  180. package/dist/renderer/usePointerGestures.d.ts.map +1 -0
  181. package/dist/schemas/circle.schema.d.cts +8 -0
  182. package/dist/schemas/circle.schema.d.ts +9 -0
  183. package/dist/schemas/circle.schema.d.ts.map +1 -0
  184. package/dist/schemas/entityDefinition.schema.d.cts +69 -0
  185. package/dist/schemas/entityDefinition.schema.d.ts +70 -0
  186. package/dist/schemas/entityDefinition.schema.d.ts.map +1 -0
  187. package/dist/schemas/entityDocument.d.cts +95 -0
  188. package/dist/schemas/entityDocument.d.ts +96 -0
  189. package/dist/schemas/entityDocument.d.ts.map +1 -0
  190. package/dist/schemas/entityPresentation.schema.d.cts +12 -0
  191. package/dist/schemas/entityPresentation.schema.d.ts +13 -0
  192. package/dist/schemas/entityPresentation.schema.d.ts.map +1 -0
  193. package/dist/schemas/exercise.schema.d.cts +217 -0
  194. package/dist/schemas/exercise.schema.d.ts +218 -0
  195. package/dist/schemas/exercise.schema.d.ts.map +1 -0
  196. package/dist/schemas/exerciseProjection.d.cts +10 -0
  197. package/dist/schemas/exerciseProjection.d.ts +11 -0
  198. package/dist/schemas/exerciseProjection.d.ts.map +1 -0
  199. package/dist/schemas/exerciseV2.schema.d.cts +137 -0
  200. package/dist/schemas/exerciseV2.schema.d.ts +138 -0
  201. package/dist/schemas/exerciseV2.schema.d.ts.map +1 -0
  202. package/dist/schemas/exerciseV3.schema.d.cts +149 -0
  203. package/dist/schemas/exerciseV3.schema.d.ts +150 -0
  204. package/dist/schemas/exerciseV3.schema.d.ts.map +1 -0
  205. package/dist/schemas/geometryObject.schema.d.cts +17 -0
  206. package/dist/schemas/geometryObject.schema.d.ts +18 -0
  207. package/dist/schemas/geometryObject.schema.d.ts.map +1 -0
  208. package/dist/schemas/geometryState.schema.d.cts +64 -0
  209. package/dist/schemas/geometryState.schema.d.ts +65 -0
  210. package/dist/schemas/geometryState.schema.d.ts.map +1 -0
  211. package/dist/schemas/givenElement.schema.d.cts +24 -0
  212. package/dist/schemas/givenElement.schema.d.ts +25 -0
  213. package/dist/schemas/givenElement.schema.d.ts.map +1 -0
  214. package/dist/schemas/goals/createGoal.schema.d.cts +12 -0
  215. package/dist/schemas/goals/createGoal.schema.d.ts +13 -0
  216. package/dist/schemas/goals/createGoal.schema.d.ts.map +1 -0
  217. package/dist/schemas/goals/geometryGoal.schema.d.cts +58 -0
  218. package/dist/schemas/goals/geometryGoal.schema.d.ts +59 -0
  219. package/dist/schemas/goals/geometryGoal.schema.d.ts.map +1 -0
  220. package/dist/schemas/goals/goalKindDeclaration.d.cts +53 -0
  221. package/dist/schemas/goals/goalKindDeclaration.d.ts +54 -0
  222. package/dist/schemas/goals/goalKindDeclaration.d.ts.map +1 -0
  223. package/dist/schemas/goals/midpointGoal.schema.d.cts +9 -0
  224. package/dist/schemas/goals/midpointGoal.schema.d.ts +10 -0
  225. package/dist/schemas/goals/midpointGoal.schema.d.ts.map +1 -0
  226. package/dist/schemas/goals/parallelGoal.schema.d.cts +15 -0
  227. package/dist/schemas/goals/parallelGoal.schema.d.ts +16 -0
  228. package/dist/schemas/goals/parallelGoal.schema.d.ts.map +1 -0
  229. package/dist/schemas/goals/perpendicularGoal.schema.d.cts +15 -0
  230. package/dist/schemas/goals/perpendicularGoal.schema.d.ts +16 -0
  231. package/dist/schemas/goals/perpendicularGoal.schema.d.ts.map +1 -0
  232. package/dist/schemas/goals/segmentLengthGoal.schema.d.cts +9 -0
  233. package/dist/schemas/goals/segmentLengthGoal.schema.d.ts +10 -0
  234. package/dist/schemas/goals/segmentLengthGoal.schema.d.ts.map +1 -0
  235. package/dist/schemas/goals/throughPointsGoal.schema.d.cts +13 -0
  236. package/dist/schemas/goals/throughPointsGoal.schema.d.ts +14 -0
  237. package/dist/schemas/goals/throughPointsGoal.schema.d.ts.map +1 -0
  238. package/dist/schemas/identifier.schema.d.cts +2 -0
  239. package/dist/schemas/identifier.schema.d.ts +3 -0
  240. package/dist/schemas/identifier.schema.d.ts.map +1 -0
  241. package/dist/schemas/line.schema.d.cts +7 -0
  242. package/dist/schemas/line.schema.d.ts +8 -0
  243. package/dist/schemas/line.schema.d.ts.map +1 -0
  244. package/dist/schemas/migrate.d.cts +21 -0
  245. package/dist/schemas/migrate.d.ts +22 -0
  246. package/dist/schemas/migrate.d.ts.map +1 -0
  247. package/dist/schemas/objectTypeName.schema.d.cts +8 -0
  248. package/dist/schemas/objectTypeName.schema.d.ts +9 -0
  249. package/dist/schemas/objectTypeName.schema.d.ts.map +1 -0
  250. package/dist/schemas/point.schema.d.cts +15 -0
  251. package/dist/schemas/point.schema.d.ts +16 -0
  252. package/dist/schemas/point.schema.d.ts.map +1 -0
  253. package/dist/schemas/pointOrigin.schema.d.cts +25 -0
  254. package/dist/schemas/pointOrigin.schema.d.ts +26 -0
  255. package/dist/schemas/pointOrigin.schema.d.ts.map +1 -0
  256. package/dist/schemas/segment.schema.d.cts +8 -0
  257. package/dist/schemas/segment.schema.d.ts +9 -0
  258. package/dist/schemas/segment.schema.d.ts.map +1 -0
  259. package/dist/schemas/v1ToV2.d.cts +37 -0
  260. package/dist/schemas/v1ToV2.d.ts +38 -0
  261. package/dist/schemas/v1ToV2.d.ts.map +1 -0
  262. package/dist/schemas/v2ToV3.d.cts +37 -0
  263. package/dist/schemas/v2ToV3.d.ts +38 -0
  264. package/dist/schemas/v2ToV3.d.ts.map +1 -0
  265. package/dist/schemas/v3ToV4.d.cts +3 -0
  266. package/dist/schemas/v3ToV4.d.ts +4 -0
  267. package/dist/schemas/v3ToV4.d.ts.map +1 -0
  268. package/dist/schemas/viewport.schema.d.cts +3 -0
  269. package/dist/schemas/viewport.schema.d.ts +4 -0
  270. package/dist/schemas/viewport.schema.d.ts.map +1 -0
  271. package/dist/schemas.cjs +1 -0
  272. package/dist/schemas.mjs +3 -0
  273. package/dist/snapping/computeSnap.d.cts +30 -0
  274. package/dist/snapping/computeSnap.d.ts +31 -0
  275. package/dist/snapping/computeSnap.d.ts.map +1 -0
  276. package/dist/state/geometryContext.d.cts +40 -0
  277. package/dist/state/geometryContext.d.ts +41 -0
  278. package/dist/state/geometryContext.d.ts.map +1 -0
  279. package/dist/state/resolvePoints.d.cts +51 -0
  280. package/dist/state/resolvePoints.d.ts +52 -0
  281. package/dist/state/resolvePoints.d.ts.map +1 -0
  282. package/dist/store/attemptChange.d.cts +30 -0
  283. package/dist/store/attemptChange.d.ts +31 -0
  284. package/dist/store/attemptChange.d.ts.map +1 -0
  285. package/dist/store/constructionCommand.d.cts +35 -0
  286. package/dist/store/constructionCommand.d.ts +36 -0
  287. package/dist/store/constructionCommand.d.ts.map +1 -0
  288. package/dist/store/constructionIdentity.d.cts +21 -0
  289. package/dist/store/constructionIdentity.d.ts +22 -0
  290. package/dist/store/constructionIdentity.d.ts.map +1 -0
  291. package/dist/store/createStore.d.cts +6 -0
  292. package/dist/store/createStore.d.ts +7 -0
  293. package/dist/store/createStore.d.ts.map +1 -0
  294. package/dist/store/history.d.cts +2 -0
  295. package/dist/store/history.d.ts +3 -0
  296. package/dist/store/history.d.ts.map +1 -0
  297. package/dist/store/studentStore.d.cts +151 -0
  298. package/dist/store/studentStore.d.ts +152 -0
  299. package/dist/store/studentStore.d.ts.map +1 -0
  300. package/dist/store/teacherStore.d.cts +111 -0
  301. package/dist/store/teacherStore.d.ts +112 -0
  302. package/dist/store/teacherStore.d.ts.map +1 -0
  303. package/dist/store/useStoreState.d.cts +2 -0
  304. package/dist/store/useStoreState.d.ts +3 -0
  305. package/dist/store/useStoreState.d.ts.map +1 -0
  306. package/dist/studentStore-CEKTtMCh.js +1162 -0
  307. package/dist/studentStore-CEKTtMCh.js.map +1 -0
  308. package/dist/studentStore-DLftfFAl.cjs +2 -0
  309. package/dist/studentStore-DLftfFAl.cjs.map +1 -0
  310. package/dist/validation/checkGeometryAnswer.d.cts +63 -0
  311. package/dist/validation/checkGeometryAnswer.d.ts +64 -0
  312. package/dist/validation/checkGeometryAnswer.d.ts.map +1 -0
  313. package/dist/validation/deriveGeometryCanvasFeedback.d.cts +7 -0
  314. package/dist/validation/deriveGeometryCanvasFeedback.d.ts +8 -0
  315. package/dist/validation/deriveGeometryCanvasFeedback.d.ts.map +1 -0
  316. package/dist/validation/exerciseLoad.d.cts +29 -0
  317. package/dist/validation/exerciseLoad.d.ts +30 -0
  318. package/dist/validation/exerciseLoad.d.ts.map +1 -0
  319. package/dist/validation/geometryAttemptStatus.d.cts +23 -0
  320. package/dist/validation/geometryAttemptStatus.d.ts +24 -0
  321. package/dist/validation/geometryAttemptStatus.d.ts.map +1 -0
  322. package/dist/validation/getGeometryExerciseWarnings.d.cts +16 -0
  323. package/dist/validation/getGeometryExerciseWarnings.d.ts +17 -0
  324. package/dist/validation/getGeometryExerciseWarnings.d.ts.map +1 -0
  325. package/dist/validation/goals/create.d.cts +3 -0
  326. package/dist/validation/goals/create.d.ts +4 -0
  327. package/dist/validation/goals/create.d.ts.map +1 -0
  328. package/dist/validation/goals/goalContext.d.cts +44 -0
  329. package/dist/validation/goals/goalContext.d.ts +45 -0
  330. package/dist/validation/goals/goalContext.d.ts.map +1 -0
  331. package/dist/validation/goals/goalKindHandler.d.cts +26 -0
  332. package/dist/validation/goals/goalKindHandler.d.ts +27 -0
  333. package/dist/validation/goals/goalKindHandler.d.ts.map +1 -0
  334. package/dist/validation/goals/index.d.cts +14 -0
  335. package/dist/validation/goals/index.d.ts +15 -0
  336. package/dist/validation/goals/index.d.ts.map +1 -0
  337. package/dist/validation/goals/midpoint.d.cts +4 -0
  338. package/dist/validation/goals/midpoint.d.ts +5 -0
  339. package/dist/validation/goals/midpoint.d.ts.map +1 -0
  340. package/dist/validation/goals/parallel.d.cts +3 -0
  341. package/dist/validation/goals/parallel.d.ts +4 -0
  342. package/dist/validation/goals/parallel.d.ts.map +1 -0
  343. package/dist/validation/goals/perpendicular.d.cts +3 -0
  344. package/dist/validation/goals/perpendicular.d.ts +4 -0
  345. package/dist/validation/goals/perpendicular.d.ts.map +1 -0
  346. package/dist/validation/goals/previewGeometry.d.cts +9 -0
  347. package/dist/validation/goals/previewGeometry.d.ts +10 -0
  348. package/dist/validation/goals/previewGeometry.d.ts.map +1 -0
  349. package/dist/validation/goals/segmentLength.d.cts +3 -0
  350. package/dist/validation/goals/segmentLength.d.ts +4 -0
  351. package/dist/validation/goals/segmentLength.d.ts.map +1 -0
  352. package/dist/validation/goals/throughPoints.d.cts +5 -0
  353. package/dist/validation/goals/throughPoints.d.ts +6 -0
  354. package/dist/validation/goals/throughPoints.d.ts.map +1 -0
  355. package/dist/validation/gradingFingerprints.d.cts +4 -0
  356. package/dist/validation/gradingFingerprints.d.ts +5 -0
  357. package/dist/validation/gradingFingerprints.d.ts.map +1 -0
  358. package/dist/validation/revealGeometryAnswers.d.cts +3 -0
  359. package/dist/validation/revealGeometryAnswers.d.ts +4 -0
  360. package/dist/validation/revealGeometryAnswers.d.ts.map +1 -0
  361. package/dist/validation/revealGeometryAttempt.d.cts +36 -0
  362. package/dist/validation/revealGeometryAttempt.d.ts +37 -0
  363. package/dist/validation/revealGeometryAttempt.d.ts.map +1 -0
  364. package/dist/validation/types.d.cts +58 -0
  365. package/dist/validation/types.d.ts +59 -0
  366. package/dist/validation/types.d.ts.map +1 -0
  367. package/dist/validation/validateGeometryExercise.d.cts +30 -0
  368. package/dist/validation/validateGeometryExercise.d.ts +31 -0
  369. package/dist/validation/validateGeometryExercise.d.ts.map +1 -0
  370. package/dist/validation/validateGeometryState.d.cts +16 -0
  371. package/dist/validation/validateGeometryState.d.ts +17 -0
  372. package/dist/validation/validateGeometryState.d.ts.map +1 -0
  373. package/dist/validation/validateGeometryStateInput.d.cts +22 -0
  374. package/dist/validation/validateGeometryStateInput.d.ts +23 -0
  375. package/dist/validation/validateGeometryStateInput.d.ts.map +1 -0
  376. package/dist/validation.cjs +2 -0
  377. package/dist/validation.cjs.map +1 -0
  378. package/dist/validation.mjs +269 -0
  379. package/dist/validation.mjs.map +1 -0
  380. package/package.json +150 -0
@@ -0,0 +1,17 @@
1
+ import { GeometryExercise } from '../schemas/exercise.schema.js';
2
+ export interface GeometryExerciseWarning {
3
+ path: Array<string | number>;
4
+ message: string;
5
+ }
6
+ /**
7
+ * What is wrong with an exercise without being invalid. Today that is one rule:
8
+ * a given placed where the viewport cannot show it.
9
+ *
10
+ * Only a **free** point is checked. A derived point has no stored coordinates —
11
+ * it is wherever the graph puts it, which depends on the entities it is built
12
+ * on — so warning about it would mean resolving the whole exercise, and where
13
+ * an authoring warning belongs for a construction that lands off-screen is an
14
+ * M3 question about the authoring UI rather than about the document.
15
+ */
16
+ export declare function getGeometryExerciseWarnings(exercise: GeometryExercise): GeometryExerciseWarning[];
17
+ //# sourceMappingURL=getGeometryExerciseWarnings.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getGeometryExerciseWarnings.d.ts","sourceRoot":"","sources":["../../src/validation/getGeometryExerciseWarnings.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAA;AAElE,MAAM,WAAW,uBAAuB;IACtC,IAAI,EAAE,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,CAAA;IAC5B,OAAO,EAAE,MAAM,CAAA;CAChB;AAED;;;;;;;;;GASG;AACH,wBAAgB,2BAA2B,CAAC,QAAQ,EAAE,gBAAgB,GAAG,uBAAuB,EAAE,CAUjG"}
@@ -0,0 +1,3 @@
1
+ import { CreateGoal } from '../../schemas/goals/createGoal.schema.cjs';
2
+ import { GoalKindHandler } from './goalKindHandler.cjs';
3
+ export declare const createGoalHandler: GoalKindHandler<CreateGoal>;
@@ -0,0 +1,4 @@
1
+ import { CreateGoal } from '../../schemas/goals/createGoal.schema.js';
2
+ import { GoalKindHandler } from './goalKindHandler.js';
3
+ export declare const createGoalHandler: GoalKindHandler<CreateGoal>;
4
+ //# sourceMappingURL=create.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../../src/validation/goals/create.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uCAAuC,CAAA;AAEvE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAOxD,eAAO,MAAM,iBAAiB,EAAE,eAAe,CAAC,UAAU,CAgBzD,CAAA"}
@@ -0,0 +1,44 @@
1
+ import { GoalCandidate } from '../../geometry/goalCandidate.cjs';
2
+ import { ObjectTypeName } from '../../schemas/objectTypeName.schema.cjs';
3
+ import { Point, PointId } from '../../geometry/point.cjs';
4
+ import { ValidationContext } from '../types.cjs';
5
+ export declare function requirePoint(points: ReadonlyMap<string, Point>, id: string): Point;
6
+ export declare function requirePoints(points: ReadonlyMap<string, Point>, ids: [PointId, PointId]): [Point, Point];
7
+ /**
8
+ * The two live points a goal's reference object runs between.
9
+ *
10
+ * Every kind that names a reference wanted exactly this — the endpoint pair,
11
+ * resolved — so the lookup, the type test and the resolution are one call
12
+ * rather than three lines repeated in four handlers. It reads the exercise's
13
+ * entity record directly since M2.6.c.1: a given object is an
14
+ * `EntityDefinition` like any other and its endpoints are its parents, which
15
+ * is the reference API generalization M2.3.c made and the reason no handler
16
+ * has to know what a segment is made of.
17
+ *
18
+ * Throws, as the point lookups here do: a goal naming a reference the exercise
19
+ * does not declare — or one with no direction, a point or a circle — is refused
20
+ * by the schema, so reaching this is a bug rather than bad data.
21
+ */
22
+ export declare function requireReferenceEndpoints(ctx: ValidationContext, referenceObjectId: string): [Point, Point];
23
+ export declare function isConstructionOfType(candidate: GoalCandidate, objectType: ObjectTypeName): boolean;
24
+ /**
25
+ * The same, for the three kinds that measure a *direction* rather than a shape:
26
+ * the requested type must be one that has one.
27
+ *
28
+ * The exercise schema already refuses `objectType: 'circle'` on these kinds
29
+ * (M2.G.3). This repeats the test because grading takes its exercise from any
30
+ * caller — a host that migrated a stored document without parsing it, or a
31
+ * store in memory — and a circle read through `candidateEndpoints()` is graded
32
+ * as the segment from its centre to its through-point.
33
+ */
34
+ export declare function isDirectedConstructionOfType(candidate: GoalCandidate, objectType: ObjectTypeName): boolean;
35
+ /**
36
+ * The two points a candidate construction runs between — `endpointsOf()` over a
37
+ * v1 `GeometryObject`, asked of a definition instead (M2.6.c.2).
38
+ *
39
+ * A pair, because that is what the measurement seam takes: a length, an angle
40
+ * or a midpoint has nowhere to put a third parent, so a kind that names one or
41
+ * three is refused rather than silently truncated. A caller that merely asks
42
+ * *which* points a candidate names calls `parentsOfDefinition()`.
43
+ */
44
+ export declare function candidateEndpoints(candidate: GoalCandidate): [PointId, PointId];
@@ -0,0 +1,45 @@
1
+ import { GoalCandidate } from '../../geometry/goalCandidate.js';
2
+ import { ObjectTypeName } from '../../schemas/objectTypeName.schema.js';
3
+ import { Point, PointId } from '../../geometry/point.js';
4
+ import { ValidationContext } from '../types.js';
5
+ export declare function requirePoint(points: ReadonlyMap<string, Point>, id: string): Point;
6
+ export declare function requirePoints(points: ReadonlyMap<string, Point>, ids: [PointId, PointId]): [Point, Point];
7
+ /**
8
+ * The two live points a goal's reference object runs between.
9
+ *
10
+ * Every kind that names a reference wanted exactly this — the endpoint pair,
11
+ * resolved — so the lookup, the type test and the resolution are one call
12
+ * rather than three lines repeated in four handlers. It reads the exercise's
13
+ * entity record directly since M2.6.c.1: a given object is an
14
+ * `EntityDefinition` like any other and its endpoints are its parents, which
15
+ * is the reference API generalization M2.3.c made and the reason no handler
16
+ * has to know what a segment is made of.
17
+ *
18
+ * Throws, as the point lookups here do: a goal naming a reference the exercise
19
+ * does not declare — or one with no direction, a point or a circle — is refused
20
+ * by the schema, so reaching this is a bug rather than bad data.
21
+ */
22
+ export declare function requireReferenceEndpoints(ctx: ValidationContext, referenceObjectId: string): [Point, Point];
23
+ export declare function isConstructionOfType(candidate: GoalCandidate, objectType: ObjectTypeName): boolean;
24
+ /**
25
+ * The same, for the three kinds that measure a *direction* rather than a shape:
26
+ * the requested type must be one that has one.
27
+ *
28
+ * The exercise schema already refuses `objectType: 'circle'` on these kinds
29
+ * (M2.G.3). This repeats the test because grading takes its exercise from any
30
+ * caller — a host that migrated a stored document without parsing it, or a
31
+ * store in memory — and a circle read through `candidateEndpoints()` is graded
32
+ * as the segment from its centre to its through-point.
33
+ */
34
+ export declare function isDirectedConstructionOfType(candidate: GoalCandidate, objectType: ObjectTypeName): boolean;
35
+ /**
36
+ * The two points a candidate construction runs between — `endpointsOf()` over a
37
+ * v1 `GeometryObject`, asked of a definition instead (M2.6.c.2).
38
+ *
39
+ * A pair, because that is what the measurement seam takes: a length, an angle
40
+ * or a midpoint has nowhere to put a third parent, so a kind that names one or
41
+ * three is refused rather than silently truncated. A caller that merely asks
42
+ * *which* points a candidate names calls `parentsOfDefinition()`.
43
+ */
44
+ export declare function candidateEndpoints(candidate: GoalCandidate): [PointId, PointId];
45
+ //# sourceMappingURL=goalContext.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"goalContext.d.ts","sourceRoot":"","sources":["../../../src/validation/goals/goalContext.ts"],"names":[],"mappings":"AAKA,OAAO,EAAoB,KAAK,aAAa,EAAE,MAAM,8BAA8B,CAAA;AAEnF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAA;AACzE,OAAO,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAA;AAC1D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAA;AAEjD,wBAAgB,YAAY,CAAC,MAAM,EAAE,WAAW,CAAC,MAAM,EAAE,KAAK,CAAC,EAAE,EAAE,EAAE,MAAM,GAAG,KAAK,CAIlF;AAED,wBAAgB,aAAa,CAC3B,MAAM,EAAE,WAAW,CAAC,MAAM,EAAE,KAAK,CAAC,EAClC,GAAG,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,GACtB,CAAC,KAAK,EAAE,KAAK,CAAC,CAEhB;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,yBAAyB,CACvC,GAAG,EAAE,iBAAiB,EACtB,iBAAiB,EAAE,MAAM,GACxB,CAAC,KAAK,EAAE,KAAK,CAAC,CAUhB;AAID,wBAAgB,oBAAoB,CAClC,SAAS,EAAE,aAAa,EACxB,UAAU,EAAE,cAAc,GACzB,OAAO,CAET;AAED;;;;;;;;;GASG;AACH,wBAAgB,4BAA4B,CAC1C,SAAS,EAAE,aAAa,EACxB,UAAU,EAAE,cAAc,GACzB,OAAO,CAET;AAED;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,aAAa,GAAG,CAAC,OAAO,EAAE,OAAO,CAAC,CAS/E"}
@@ -0,0 +1,26 @@
1
+ import { GeometryGoal } from '../../schemas/goals/geometryGoal.schema.cjs';
2
+ import { GoalKindDeclaration } from '../../schemas/goals/goalKindDeclaration.cjs';
3
+ import { GoalCandidate } from '../../geometry/goalCandidate.cjs';
4
+ import { RevealContext, RevealedAnswerShape, ValidationContext } from '../types.cjs';
5
+ /**
6
+ * Everything a goal kind can answer: its declaration (kind, schema, referenced
7
+ * givens, authoring rules — see `schemas/goals/goalKindDeclaration.ts`) plus
8
+ * how it judges a student's work.
9
+ *
10
+ * `accepts()` is the precondition of the three members below it: a candidate a
11
+ * kind cannot be satisfied by is never measured, so `satisfies()` and
12
+ * `isRelevantAttempt()` are written for candidates of the shape the kind
13
+ * expects and must be reached through the registry's dispatchers
14
+ * (`goalSatisfiedBy()`, `isRelevantGoalAttempt()`), which apply it.
15
+ */
16
+ export interface GoalKindHandler<TGoal extends GeometryGoal = GeometryGoal, TCandidate extends GoalCandidate = GoalCandidate> extends GoalKindDeclaration<TGoal> {
17
+ accepts(candidate: GoalCandidate, goal: TGoal): candidate is TCandidate;
18
+ satisfies(candidate: TCandidate, goal: TGoal, ctx: ValidationContext): boolean;
19
+ isRelevantAttempt(candidate: TCandidate, goal: TGoal, ctx: ValidationContext): boolean;
20
+ buildRevealedAnswer(goal: TGoal, ctx: RevealContext): RevealedAnswerShape | null;
21
+ }
22
+ export type GoalKindRegistry = {
23
+ [K in GeometryGoal['type']]: GoalKindHandler<Extract<GeometryGoal, {
24
+ type: K;
25
+ }>>;
26
+ };
@@ -0,0 +1,27 @@
1
+ import { GeometryGoal } from '../../schemas/goals/geometryGoal.schema.js';
2
+ import { GoalKindDeclaration } from '../../schemas/goals/goalKindDeclaration.js';
3
+ import { GoalCandidate } from '../../geometry/goalCandidate.js';
4
+ import { RevealContext, RevealedAnswerShape, ValidationContext } from '../types.js';
5
+ /**
6
+ * Everything a goal kind can answer: its declaration (kind, schema, referenced
7
+ * givens, authoring rules — see `schemas/goals/goalKindDeclaration.ts`) plus
8
+ * how it judges a student's work.
9
+ *
10
+ * `accepts()` is the precondition of the three members below it: a candidate a
11
+ * kind cannot be satisfied by is never measured, so `satisfies()` and
12
+ * `isRelevantAttempt()` are written for candidates of the shape the kind
13
+ * expects and must be reached through the registry's dispatchers
14
+ * (`goalSatisfiedBy()`, `isRelevantGoalAttempt()`), which apply it.
15
+ */
16
+ export interface GoalKindHandler<TGoal extends GeometryGoal = GeometryGoal, TCandidate extends GoalCandidate = GoalCandidate> extends GoalKindDeclaration<TGoal> {
17
+ accepts(candidate: GoalCandidate, goal: TGoal): candidate is TCandidate;
18
+ satisfies(candidate: TCandidate, goal: TGoal, ctx: ValidationContext): boolean;
19
+ isRelevantAttempt(candidate: TCandidate, goal: TGoal, ctx: ValidationContext): boolean;
20
+ buildRevealedAnswer(goal: TGoal, ctx: RevealContext): RevealedAnswerShape | null;
21
+ }
22
+ export type GoalKindRegistry = {
23
+ [K in GeometryGoal['type']]: GoalKindHandler<Extract<GeometryGoal, {
24
+ type: K;
25
+ }>>;
26
+ };
27
+ //# sourceMappingURL=goalKindHandler.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"goalKindHandler.d.ts","sourceRoot":"","sources":["../../../src/validation/goals/goalKindHandler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yCAAyC,CAAA;AAC3E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yCAAyC,CAAA;AAClF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAA;AACjE,OAAO,KAAK,EAAE,aAAa,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAA;AAErF;;;;;;;;;;GAUG;AACH,MAAM,WAAW,eAAe,CAC9B,KAAK,SAAS,YAAY,GAAG,YAAY,EACzC,UAAU,SAAS,aAAa,GAAG,aAAa,CAChD,SAAQ,mBAAmB,CAAC,KAAK,CAAC;IAClC,OAAO,CAAC,SAAS,EAAE,aAAa,EAAE,IAAI,EAAE,KAAK,GAAG,SAAS,IAAI,UAAU,CAAA;IACvE,SAAS,CAAC,SAAS,EAAE,UAAU,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,iBAAiB,GAAG,OAAO,CAAA;IAC9E,iBAAiB,CAAC,SAAS,EAAE,UAAU,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,iBAAiB,GAAG,OAAO,CAAA;IACtF,mBAAmB,CAAC,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,aAAa,GAAG,mBAAmB,GAAG,IAAI,CAAA;CACjF;AAED,MAAM,MAAM,gBAAgB,GAAG;KAC5B,CAAC,IAAI,YAAY,CAAC,MAAM,CAAC,GAAG,eAAe,CAAC,OAAO,CAAC,YAAY,EAAE;QAAE,IAAI,EAAE,CAAC,CAAA;KAAE,CAAC,CAAC;CACjF,CAAA"}
@@ -0,0 +1,14 @@
1
+ import { GoalKindHandler, GoalKindRegistry } from './goalKindHandler.cjs';
2
+ import { GeometryGoal } from '../../schemas/goals/geometryGoal.schema.cjs';
3
+ import { GoalCandidate } from '../../geometry/goalCandidate.cjs';
4
+ import { RevealContext, RevealedAnswerShape, ValidationContext } from '../types.cjs';
5
+ export type { GoalKindHandler, GoalKindRegistry } from './goalKindHandler.cjs';
6
+ export declare const goalKindRegistry: GoalKindRegistry;
7
+ export declare function getGoalKindHandler(kind: string): GoalKindHandler;
8
+ /** Every given the goal names — what removing one of them would orphan. */
9
+ export declare function referencedGivenIds(goal: GeometryGoal): readonly string[];
10
+ /** Whether this candidate could satisfy this goal at all, before measuring. */
11
+ export declare function goalAcceptsCandidate(candidate: GoalCandidate, goal: GeometryGoal): boolean;
12
+ export declare function goalSatisfiedBy(candidate: GoalCandidate, goal: GeometryGoal, ctx: ValidationContext): boolean;
13
+ export declare function isRelevantGoalAttempt(candidate: GoalCandidate, goal: GeometryGoal, ctx: ValidationContext): boolean;
14
+ export declare function revealedAnswerFor(goal: GeometryGoal, ctx: RevealContext): RevealedAnswerShape | null;
@@ -0,0 +1,15 @@
1
+ import { GoalKindHandler, GoalKindRegistry } from './goalKindHandler.js';
2
+ import { GeometryGoal } from '../../schemas/goals/geometryGoal.schema.js';
3
+ import { GoalCandidate } from '../../geometry/goalCandidate.js';
4
+ import { RevealContext, RevealedAnswerShape, ValidationContext } from '../types.js';
5
+ export type { GoalKindHandler, GoalKindRegistry } from './goalKindHandler.js';
6
+ export declare const goalKindRegistry: GoalKindRegistry;
7
+ export declare function getGoalKindHandler(kind: string): GoalKindHandler;
8
+ /** Every given the goal names — what removing one of them would orphan. */
9
+ export declare function referencedGivenIds(goal: GeometryGoal): readonly string[];
10
+ /** Whether this candidate could satisfy this goal at all, before measuring. */
11
+ export declare function goalAcceptsCandidate(candidate: GoalCandidate, goal: GeometryGoal): boolean;
12
+ export declare function goalSatisfiedBy(candidate: GoalCandidate, goal: GeometryGoal, ctx: ValidationContext): boolean;
13
+ export declare function isRelevantGoalAttempt(candidate: GoalCandidate, goal: GeometryGoal, ctx: ValidationContext): boolean;
14
+ export declare function revealedAnswerFor(goal: GeometryGoal, ctx: RevealContext): RevealedAnswerShape | null;
15
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/validation/goals/index.ts"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAA;AAC1E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yCAAyC,CAAA;AAC3E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAA;AACjE,OAAO,KAAK,EAAE,aAAa,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAA;AAErF,YAAY,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAA;AAE1E,eAAO,MAAM,gBAAgB,EAAE,gBAO7B,CAAA;AAOF,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,eAAe,CAIhE;AAED,2EAA2E;AAC3E,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,YAAY,GAAG,SAAS,MAAM,EAAE,CAExE;AAED,+EAA+E;AAC/E,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,aAAa,EAAE,IAAI,EAAE,YAAY,GAAG,OAAO,CAE1F;AAED,wBAAgB,eAAe,CAC7B,SAAS,EAAE,aAAa,EACxB,IAAI,EAAE,YAAY,EAClB,GAAG,EAAE,iBAAiB,GACrB,OAAO,CAGT;AAED,wBAAgB,qBAAqB,CACnC,SAAS,EAAE,aAAa,EACxB,IAAI,EAAE,YAAY,EAClB,GAAG,EAAE,iBAAiB,GACrB,OAAO,CAGT;AAED,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,YAAY,EAClB,GAAG,EAAE,aAAa,GACjB,mBAAmB,GAAG,IAAI,CAE5B"}
@@ -0,0 +1,4 @@
1
+ import { CandidatePoint } from '../../geometry/goalCandidate.cjs';
2
+ import { MidpointGoal } from '../../schemas/goals/midpointGoal.schema.cjs';
3
+ import { GoalKindHandler } from './goalKindHandler.cjs';
4
+ export declare const midpointGoalHandler: GoalKindHandler<MidpointGoal, CandidatePoint>;
@@ -0,0 +1,5 @@
1
+ import { CandidatePoint } from '../../geometry/goalCandidate.js';
2
+ import { MidpointGoal } from '../../schemas/goals/midpointGoal.schema.js';
3
+ import { GoalKindHandler } from './goalKindHandler.js';
4
+ export declare const midpointGoalHandler: GoalKindHandler<MidpointGoal, CandidatePoint>;
5
+ //# sourceMappingURL=midpoint.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"midpoint.d.ts","sourceRoot":"","sources":["../../../src/validation/goals/midpoint.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,cAAc,EAEpB,MAAM,8BAA8B,CAAA;AAGrC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yCAAyC,CAAA;AAI3E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAUxD,eAAO,MAAM,mBAAmB,EAAE,eAAe,CAAC,YAAY,EAAE,cAAc,CAqB7E,CAAA"}
@@ -0,0 +1,3 @@
1
+ import { ParallelGoal } from '../../schemas/goals/parallelGoal.schema.cjs';
2
+ import { GoalKindHandler } from './goalKindHandler.cjs';
3
+ export declare const parallelGoalHandler: GoalKindHandler<ParallelGoal>;
@@ -0,0 +1,4 @@
1
+ import { ParallelGoal } from '../../schemas/goals/parallelGoal.schema.js';
2
+ import { GoalKindHandler } from './goalKindHandler.js';
3
+ export declare const parallelGoalHandler: GoalKindHandler<ParallelGoal>;
4
+ //# sourceMappingURL=parallel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parallel.d.ts","sourceRoot":"","sources":["../../../src/validation/goals/parallel.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yCAAyC,CAAA;AAY3E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAQxD,eAAO,MAAM,mBAAmB,EAAE,eAAe,CAAC,YAAY,CA6C7D,CAAA"}
@@ -0,0 +1,3 @@
1
+ import { PerpendicularGoal } from '../../schemas/goals/perpendicularGoal.schema.cjs';
2
+ import { GoalKindHandler } from './goalKindHandler.cjs';
3
+ export declare const perpendicularGoalHandler: GoalKindHandler<PerpendicularGoal>;
@@ -0,0 +1,4 @@
1
+ import { PerpendicularGoal } from '../../schemas/goals/perpendicularGoal.schema.js';
2
+ import { GoalKindHandler } from './goalKindHandler.js';
3
+ export declare const perpendicularGoalHandler: GoalKindHandler<PerpendicularGoal>;
4
+ //# sourceMappingURL=perpendicular.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"perpendicular.d.ts","sourceRoot":"","sources":["../../../src/validation/goals/perpendicular.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,8CAA8C,CAAA;AAYrF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAQxD,eAAO,MAAM,wBAAwB,EAAE,eAAe,CAAC,iBAAiB,CA0CvE,CAAA"}
@@ -0,0 +1,9 @@
1
+ import { ObjectTypeName } from '../../schemas/objectTypeName.schema.cjs';
2
+ import { MathViewport } from '../../schemas/viewport.schema.cjs';
3
+ import { Point } from '../../geometry/point.cjs';
4
+ import { RevealedAnswerShape } from '../types.cjs';
5
+ export declare function pointAtAngleAndLength(origin: Point, angleRadians: number, length: number): Point;
6
+ export declare function viewportVisibilityScore(point: Point, viewport: MathViewport): number;
7
+ export declare function mostVisibleInViewport(candidates: Point[], viewport: MathViewport): Point;
8
+ export declare function previewLength(viewport: MathViewport, referenceLength: number): number;
9
+ export declare function revealedShapeThrough(objectType: ObjectTypeName, from: Point, to: Point): RevealedAnswerShape;
@@ -0,0 +1,10 @@
1
+ import { ObjectTypeName } from '../../schemas/objectTypeName.schema.js';
2
+ import { MathViewport } from '../../schemas/viewport.schema.js';
3
+ import { Point } from '../../geometry/point.js';
4
+ import { RevealedAnswerShape } from '../types.js';
5
+ export declare function pointAtAngleAndLength(origin: Point, angleRadians: number, length: number): Point;
6
+ export declare function viewportVisibilityScore(point: Point, viewport: MathViewport): number;
7
+ export declare function mostVisibleInViewport(candidates: Point[], viewport: MathViewport): Point;
8
+ export declare function previewLength(viewport: MathViewport, referenceLength: number): number;
9
+ export declare function revealedShapeThrough(objectType: ObjectTypeName, from: Point, to: Point): RevealedAnswerShape;
10
+ //# sourceMappingURL=previewGeometry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"previewGeometry.d.ts","sourceRoot":"","sources":["../../../src/validation/goals/previewGeometry.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAA;AACzE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAA;AACjE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAA;AACjD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAA;AAEnD,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,KAAK,CAKhG;AAKD,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,YAAY,GAAG,MAAM,CAQpF;AAID,wBAAgB,qBAAqB,CAAC,UAAU,EAAE,KAAK,EAAE,EAAE,QAAQ,EAAE,YAAY,GAAG,KAAK,CAYxF;AAGD,wBAAgB,aAAa,CAAC,QAAQ,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,GAAG,MAAM,CAIrF;AAED,wBAAgB,oBAAoB,CAClC,UAAU,EAAE,cAAc,EAC1B,IAAI,EAAE,KAAK,EACX,EAAE,EAAE,KAAK,GACR,mBAAmB,CAIrB"}
@@ -0,0 +1,3 @@
1
+ import { SegmentLengthGoal } from '../../schemas/goals/segmentLengthGoal.schema.cjs';
2
+ import { GoalKindHandler } from './goalKindHandler.cjs';
3
+ export declare const segmentLengthGoalHandler: GoalKindHandler<SegmentLengthGoal>;
@@ -0,0 +1,4 @@
1
+ import { SegmentLengthGoal } from '../../schemas/goals/segmentLengthGoal.schema.js';
2
+ import { GoalKindHandler } from './goalKindHandler.js';
3
+ export declare const segmentLengthGoalHandler: GoalKindHandler<SegmentLengthGoal>;
4
+ //# sourceMappingURL=segmentLength.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"segmentLength.d.ts","sourceRoot":"","sources":["../../../src/validation/goals/segmentLength.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,8CAA8C,CAAA;AAKrF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAIxD,eAAO,MAAM,wBAAwB,EAAE,eAAe,CAAC,iBAAiB,CAoCvE,CAAA"}
@@ -0,0 +1,5 @@
1
+ import { Point } from '../../geometry/point.cjs';
2
+ import { ThroughPointsGoal } from '../../schemas/goals/throughPointsGoal.schema.cjs';
3
+ import { GoalKindHandler } from './goalKindHandler.cjs';
4
+ export declare function satisfiesThroughPoints(candidatePoints: Point[], goalPoints: Point[]): boolean;
5
+ export declare const throughPointsGoalHandler: GoalKindHandler<ThroughPointsGoal>;
@@ -0,0 +1,6 @@
1
+ import { Point } from '../../geometry/point.js';
2
+ import { ThroughPointsGoal } from '../../schemas/goals/throughPointsGoal.schema.js';
3
+ import { GoalKindHandler } from './goalKindHandler.js';
4
+ export declare function satisfiesThroughPoints(candidatePoints: Point[], goalPoints: Point[]): boolean;
5
+ export declare const throughPointsGoalHandler: GoalKindHandler<ThroughPointsGoal>;
6
+ //# sourceMappingURL=throughPoints.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"throughPoints.d.ts","sourceRoot":"","sources":["../../../src/validation/goals/throughPoints.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAA;AACjD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,8CAA8C,CAAA;AAKrF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAWxD,wBAAgB,sBAAsB,CAAC,eAAe,EAAE,KAAK,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE,GAAG,OAAO,CAW7F;AAED,eAAO,MAAM,wBAAwB,EAAE,eAAe,CAAC,iBAAiB,CA6BvE,CAAA"}
@@ -0,0 +1,4 @@
1
+ import { GeometryExercise } from '../schemas/exercise.schema.cjs';
2
+ import { GeometryState } from '../schemas/geometryState.schema.cjs';
3
+ export declare function fingerprintGeometryExercise(exercise: GeometryExercise): string;
4
+ export declare function fingerprintGeometryAttempt(attempt: GeometryState): string;
@@ -0,0 +1,5 @@
1
+ import { GeometryExercise } from '../schemas/exercise.schema.js';
2
+ import { GeometryState } from '../schemas/geometryState.schema.js';
3
+ export declare function fingerprintGeometryExercise(exercise: GeometryExercise): string;
4
+ export declare function fingerprintGeometryAttempt(attempt: GeometryState): string;
5
+ //# sourceMappingURL=gradingFingerprints.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gradingFingerprints.d.ts","sourceRoot":"","sources":["../../src/validation/gradingFingerprints.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAA;AAElE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAA;AAoDpE,wBAAgB,2BAA2B,CAAC,QAAQ,EAAE,gBAAgB,GAAG,MAAM,CAE9E;AAID,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,aAAa,GAAG,MAAM,CAEzE"}
@@ -0,0 +1,3 @@
1
+ import { GeometryExercise } from '../schemas/exercise.schema.cjs';
2
+ import { RevealedAnswer } from './types.cjs';
3
+ export declare function revealGeometryAnswers(exercise: GeometryExercise): RevealedAnswer[];
@@ -0,0 +1,4 @@
1
+ import { GeometryExercise } from '../schemas/exercise.schema.js';
2
+ import { RevealedAnswer } from './types.js';
3
+ export declare function revealGeometryAnswers(exercise: GeometryExercise): RevealedAnswer[];
4
+ //# sourceMappingURL=revealGeometryAnswers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"revealGeometryAnswers.d.ts","sourceRoot":"","sources":["../../src/validation/revealGeometryAnswers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAA;AAGlE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAE7C,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,gBAAgB,GAAG,cAAc,EAAE,CASlF"}
@@ -0,0 +1,36 @@
1
+ import { GeometryState } from '../schemas/geometryState.schema.cjs';
2
+ /**
3
+ * Why no canonical attempt came back, as a code rather than a sentence (RFC
4
+ * 0005 § Decision 4). The three are kept apart because a host acts on them
5
+ * differently: a broken exercise is the whole widget's problem, a missing or
6
+ * malformed solution is an authoring gap, and an incorrect one means the
7
+ * authored answer and the goals disagree.
8
+ */
9
+ export type RevealGeometryAttemptErrorCode = 'invalid-exercise' | 'invalid-canonical-attempt' | 'canonical-attempt-incorrect';
10
+ export interface RevealGeometryAttemptIssue {
11
+ code: RevealGeometryAttemptErrorCode;
12
+ path: Array<string | number>;
13
+ message: string;
14
+ }
15
+ export type RevealGeometryAttemptResult = {
16
+ success: true;
17
+ data: GeometryState;
18
+ errors: [];
19
+ } | {
20
+ success: false;
21
+ data: null;
22
+ errors: RevealGeometryAttemptIssue[];
23
+ };
24
+ /**
25
+ * The authored canonical attempt an exercise embeds, for a host's Reveal
26
+ * (ADR 0015). Synchronous and DOM-free, and safe on untrusted input: the
27
+ * exercise is migrated and parsed, then its `solution` is migrated, parsed and
28
+ * normalized as an attempt against that exercise, then graded under the
29
+ * exercise's own policy. Only a solution that grades correct is returned.
30
+ *
31
+ * Nothing is synthesized from goals and nothing is merged with student work:
32
+ * the host replaces its attempt value with `data`. Paths of a malformed
33
+ * solution are rooted at `solution`, so they point into the exercise document
34
+ * the host holds.
35
+ */
36
+ export declare function revealGeometryAttempt(exerciseInput: unknown): RevealGeometryAttemptResult;
@@ -0,0 +1,37 @@
1
+ import { GeometryState } from '../schemas/geometryState.schema.js';
2
+ /**
3
+ * Why no canonical attempt came back, as a code rather than a sentence (RFC
4
+ * 0005 § Decision 4). The three are kept apart because a host acts on them
5
+ * differently: a broken exercise is the whole widget's problem, a missing or
6
+ * malformed solution is an authoring gap, and an incorrect one means the
7
+ * authored answer and the goals disagree.
8
+ */
9
+ export type RevealGeometryAttemptErrorCode = 'invalid-exercise' | 'invalid-canonical-attempt' | 'canonical-attempt-incorrect';
10
+ export interface RevealGeometryAttemptIssue {
11
+ code: RevealGeometryAttemptErrorCode;
12
+ path: Array<string | number>;
13
+ message: string;
14
+ }
15
+ export type RevealGeometryAttemptResult = {
16
+ success: true;
17
+ data: GeometryState;
18
+ errors: [];
19
+ } | {
20
+ success: false;
21
+ data: null;
22
+ errors: RevealGeometryAttemptIssue[];
23
+ };
24
+ /**
25
+ * The authored canonical attempt an exercise embeds, for a host's Reveal
26
+ * (ADR 0015). Synchronous and DOM-free, and safe on untrusted input: the
27
+ * exercise is migrated and parsed, then its `solution` is migrated, parsed and
28
+ * normalized as an attempt against that exercise, then graded under the
29
+ * exercise's own policy. Only a solution that grades correct is returned.
30
+ *
31
+ * Nothing is synthesized from goals and nothing is merged with student work:
32
+ * the host replaces its attempt value with `data`. Paths of a malformed
33
+ * solution are rooted at `solution`, so they point into the exercise document
34
+ * the host holds.
35
+ */
36
+ export declare function revealGeometryAttempt(exerciseInput: unknown): RevealGeometryAttemptResult;
37
+ //# sourceMappingURL=revealGeometryAttempt.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"revealGeometryAttempt.d.ts","sourceRoot":"","sources":["../../src/validation/revealGeometryAttempt.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAA;AAIpE;;;;;;GAMG;AACH,MAAM,MAAM,8BAA8B,GACxC,kBAAkB,GAAG,2BAA2B,GAAG,6BAA6B,CAAA;AAElF,MAAM,WAAW,0BAA0B;IACzC,IAAI,EAAE,8BAA8B,CAAA;IACpC,IAAI,EAAE,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,CAAA;IAC5B,OAAO,EAAE,MAAM,CAAA;CAChB;AAED,MAAM,MAAM,2BAA2B,GACnC;IAAE,OAAO,EAAE,IAAI,CAAC;IAAC,IAAI,EAAE,aAAa,CAAC;IAAC,MAAM,EAAE,EAAE,CAAA;CAAE,GAClD;IAAE,OAAO,EAAE,KAAK,CAAC;IAAC,IAAI,EAAE,IAAI,CAAC;IAAC,MAAM,EAAE,0BAA0B,EAAE,CAAA;CAAE,CAAA;AAMxE;;;;;;;;;;;GAWG;AACH,wBAAgB,qBAAqB,CAAC,aAAa,EAAE,OAAO,GAAG,2BAA2B,CAkCzF"}
@@ -0,0 +1,58 @@
1
+ import { GeometryExercise } from '../schemas/exercise.schema.cjs';
2
+ import { EntityId } from '../geometry/entityModel.cjs';
3
+ import { Point, PointId } from '../geometry/point.cjs';
4
+ export type GoalStatus = 'correct' | 'incorrect';
5
+ export interface GoalResult {
6
+ id: string;
7
+ status: GoalStatus;
8
+ }
9
+ export interface ValidationResult {
10
+ status: GoalStatus;
11
+ goals: GoalResult[];
12
+ }
13
+ export interface GoalGeometryFeedback extends GoalResult {
14
+ constructionIds: string[];
15
+ pointIds: PointId[];
16
+ }
17
+ export interface GeometryValidationFeedback {
18
+ result: ValidationResult;
19
+ goals: GoalGeometryFeedback[];
20
+ }
21
+ export type DetailedGoalCode = 'goal-satisfied' | 'no-candidate' | 'unresolved-candidate' | 'goal-not-satisfied';
22
+ export interface DetailedGoalResult extends GoalResult {
23
+ code: DetailedGoalCode;
24
+ matchedEntityIds: EntityId[];
25
+ relevantEntityIds: EntityId[];
26
+ unresolvedEntityIds: EntityId[];
27
+ }
28
+ export type GeometryDiagnosticCode = 'no-goals' | 'unresolved-entity' | 'extra-objects';
29
+ export interface GeometryDiagnostic {
30
+ code: GeometryDiagnosticCode;
31
+ entityIds: EntityId[];
32
+ }
33
+ export interface DetailedGeometryFeedback {
34
+ feedback: GeometryValidationFeedback;
35
+ goals: DetailedGoalResult[];
36
+ diagnostics: GeometryDiagnostic[];
37
+ extraEntityIds: EntityId[];
38
+ }
39
+ export interface ValidationContext {
40
+ exercise: GeometryExercise;
41
+ points: ReadonlyMap<PointId, Point>;
42
+ }
43
+ export type RevealContext = ValidationContext;
44
+ export type RevealedAnswerShape = {
45
+ type: 'segment';
46
+ from: Point;
47
+ to: Point;
48
+ } | {
49
+ type: 'line';
50
+ through: [Point, Point];
51
+ } | {
52
+ type: 'point';
53
+ at: Point;
54
+ };
55
+ export interface RevealedAnswer {
56
+ id: string;
57
+ shape: RevealedAnswerShape | null;
58
+ }
@@ -0,0 +1,59 @@
1
+ import { GeometryExercise } from '../schemas/exercise.schema.js';
2
+ import { EntityId } from '../geometry/entityModel.js';
3
+ import { Point, PointId } from '../geometry/point.js';
4
+ export type GoalStatus = 'correct' | 'incorrect';
5
+ export interface GoalResult {
6
+ id: string;
7
+ status: GoalStatus;
8
+ }
9
+ export interface ValidationResult {
10
+ status: GoalStatus;
11
+ goals: GoalResult[];
12
+ }
13
+ export interface GoalGeometryFeedback extends GoalResult {
14
+ constructionIds: string[];
15
+ pointIds: PointId[];
16
+ }
17
+ export interface GeometryValidationFeedback {
18
+ result: ValidationResult;
19
+ goals: GoalGeometryFeedback[];
20
+ }
21
+ export type DetailedGoalCode = 'goal-satisfied' | 'no-candidate' | 'unresolved-candidate' | 'goal-not-satisfied';
22
+ export interface DetailedGoalResult extends GoalResult {
23
+ code: DetailedGoalCode;
24
+ matchedEntityIds: EntityId[];
25
+ relevantEntityIds: EntityId[];
26
+ unresolvedEntityIds: EntityId[];
27
+ }
28
+ export type GeometryDiagnosticCode = 'no-goals' | 'unresolved-entity' | 'extra-objects';
29
+ export interface GeometryDiagnostic {
30
+ code: GeometryDiagnosticCode;
31
+ entityIds: EntityId[];
32
+ }
33
+ export interface DetailedGeometryFeedback {
34
+ feedback: GeometryValidationFeedback;
35
+ goals: DetailedGoalResult[];
36
+ diagnostics: GeometryDiagnostic[];
37
+ extraEntityIds: EntityId[];
38
+ }
39
+ export interface ValidationContext {
40
+ exercise: GeometryExercise;
41
+ points: ReadonlyMap<PointId, Point>;
42
+ }
43
+ export type RevealContext = ValidationContext;
44
+ export type RevealedAnswerShape = {
45
+ type: 'segment';
46
+ from: Point;
47
+ to: Point;
48
+ } | {
49
+ type: 'line';
50
+ through: [Point, Point];
51
+ } | {
52
+ type: 'point';
53
+ at: Point;
54
+ };
55
+ export interface RevealedAnswer {
56
+ id: string;
57
+ shape: RevealedAnswerShape | null;
58
+ }
59
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/validation/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAA;AAClE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAA;AACvD,OAAO,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAEvD,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,WAAW,CAAA;AAEhD,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAA;IACV,MAAM,EAAE,UAAU,CAAA;CACnB;AAED,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,UAAU,CAAA;IAClB,KAAK,EAAE,UAAU,EAAE,CAAA;CACpB;AAED,MAAM,WAAW,oBAAqB,SAAQ,UAAU;IACtD,eAAe,EAAE,MAAM,EAAE,CAAA;IACzB,QAAQ,EAAE,OAAO,EAAE,CAAA;CACpB;AAED,MAAM,WAAW,0BAA0B;IACzC,MAAM,EAAE,gBAAgB,CAAA;IACxB,KAAK,EAAE,oBAAoB,EAAE,CAAA;CAC9B;AAUD,MAAM,MAAM,gBAAgB,GAC1B,gBAAgB,GAAG,cAAc,GAAG,sBAAsB,GAAG,oBAAoB,CAAA;AAEnF,MAAM,WAAW,kBAAmB,SAAQ,UAAU;IACpD,IAAI,EAAE,gBAAgB,CAAA;IAEtB,gBAAgB,EAAE,QAAQ,EAAE,CAAA;IAI5B,iBAAiB,EAAE,QAAQ,EAAE,CAAA;IAG7B,mBAAmB,EAAE,QAAQ,EAAE,CAAA;CAChC;AAED,MAAM,MAAM,sBAAsB,GAAG,UAAU,GAAG,mBAAmB,GAAG,eAAe,CAAA;AAEvF,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,sBAAsB,CAAA;IAC5B,SAAS,EAAE,QAAQ,EAAE,CAAA;CACtB;AAED,MAAM,WAAW,wBAAwB;IAGvC,QAAQ,EAAE,0BAA0B,CAAA;IACpC,KAAK,EAAE,kBAAkB,EAAE,CAAA;IAC3B,WAAW,EAAE,kBAAkB,EAAE,CAAA;IAKjC,cAAc,EAAE,QAAQ,EAAE,CAAA;CAC3B;AAKD,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,gBAAgB,CAAA;IAO1B,MAAM,EAAE,WAAW,CAAC,OAAO,EAAE,KAAK,CAAC,CAAA;CACpC;AAID,MAAM,MAAM,aAAa,GAAG,iBAAiB,CAAA;AAE7C,MAAM,MAAM,mBAAmB,GAC3B;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,IAAI,EAAE,KAAK,CAAC;IAAC,EAAE,EAAE,KAAK,CAAA;CAAE,GAC3C;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,CAAA;CAAE,GACzC;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,EAAE,EAAE,KAAK,CAAA;CAAE,CAAA;AAEhC,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,mBAAmB,GAAG,IAAI,CAAA;CAClC"}
@@ -0,0 +1,30 @@
1
+ import { GeometryExercise } from '../schemas/exercise.schema.cjs';
2
+ import { GeometryExerciseWarning } from './getGeometryExerciseWarnings.cjs';
3
+ export interface GeometryExerciseValidationIssue {
4
+ path: Array<string | number>;
5
+ message: string;
6
+ }
7
+ export type GeometryExerciseValidationResult = {
8
+ success: true;
9
+ data: GeometryExercise;
10
+ errors: [];
11
+ warnings: GeometryExerciseWarning[];
12
+ } | {
13
+ success: false;
14
+ data: null;
15
+ errors: GeometryExerciseValidationIssue[];
16
+ warnings: [];
17
+ };
18
+ /**
19
+ * The whole stored exercise, authored solution included. Stored exercises are
20
+ * brought up to the current version before their structure is checked, exactly
21
+ * as attempts are (M2.6.b), and an embedded `solution` is then migrated and
22
+ * checked against the exercise as an attempt (ADR 0015), with its issues rooted
23
+ * at `solution`. On success `data.solution` is that normalized attempt.
24
+ *
25
+ * Grading does not go through here: Check and the student component load the
26
+ * solution-free projection, so a broken solution never disables them. An
27
+ * authoring tool does, and learns about it at save time.
28
+ */
29
+ export declare function validateGeometryExercise(input: unknown): GeometryExerciseValidationResult;
30
+ export declare function validateGeometryExerciseJson(json: string): GeometryExerciseValidationResult;