@automovie/viewer 0.3.4 → 0.4.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 (387) hide show
  1. package/README.md +8 -87
  2. package/lib/IAutoMovieViewerCompletedFrame.d.ts +19 -11
  3. package/lib/IAutoMovieViewerDisplayMetadata.d.ts +0 -5
  4. package/lib/IAutoMovieViewerHandle.d.ts +3 -25
  5. package/lib/IMountViewerOptions.d.ts +24 -38
  6. package/lib/IViewerCameraStateSnapshot.d.ts +0 -5
  7. package/lib/IViewerFrameTransfer.d.ts +11 -0
  8. package/lib/IViewerFrameTransfer.js +3 -0
  9. package/lib/IViewerFrameTransfer.js.map +1 -0
  10. package/lib/IViewerFrameTransfer.mjs +0 -0
  11. package/lib/applyCaptureCanvasSize.d.ts +9 -10
  12. package/lib/applyCaptureCanvasSize.js +7 -13
  13. package/lib/applyCaptureCanvasSize.js.map +1 -1
  14. package/lib/applyCaptureCanvasSize.mjs +7 -10
  15. package/lib/applyCaptureCanvasSize.mjs.map +1 -1
  16. package/lib/audio/IAutoMovieAudioCue.d.ts +3 -8
  17. package/lib/audio/planAutoMovieAudioPlayback.d.ts +8 -21
  18. package/lib/audio/planAutoMovieAudioPlayback.js +8 -14
  19. package/lib/audio/planAutoMovieAudioPlayback.js.map +1 -1
  20. package/lib/audio/planAutoMovieAudioPlayback.mjs +8 -14
  21. package/lib/audio/planAutoMovieAudioPlayback.mjs.map +1 -1
  22. package/lib/audio/playAutoMovieAudioCues.d.ts +4 -11
  23. package/lib/audio/playAutoMovieAudioCues.js +4 -11
  24. package/lib/audio/playAutoMovieAudioCues.js.map +1 -1
  25. package/lib/audio/playAutoMovieAudioCues.mjs +4 -11
  26. package/lib/audio/playAutoMovieAudioCues.mjs.map +1 -1
  27. package/lib/createViewerCameraState.d.ts +3 -11
  28. package/lib/createViewerCameraState.js +80 -121
  29. package/lib/createViewerCameraState.js.map +1 -1
  30. package/lib/createViewerCameraState.mjs +46 -98
  31. package/lib/createViewerCameraState.mjs.map +1 -1
  32. package/lib/createViewerDisplayClock.d.ts +2 -10
  33. package/lib/createViewerDisplayClock.js +4 -12
  34. package/lib/createViewerDisplayClock.js.map +1 -1
  35. package/lib/createViewerDisplayClock.mjs +3 -11
  36. package/lib/createViewerDisplayClock.mjs.map +1 -1
  37. package/lib/createViewerDisplayPublication.d.ts +7 -15
  38. package/lib/createViewerDisplayPublication.js +7 -15
  39. package/lib/createViewerDisplayPublication.js.map +1 -1
  40. package/lib/createViewerDisplayPublication.mjs +7 -15
  41. package/lib/createViewerDisplayPublication.mjs.map +1 -1
  42. package/lib/createViewerDisplaySave.d.ts +8 -16
  43. package/lib/createViewerDisplaySave.js +8 -16
  44. package/lib/createViewerDisplaySave.js.map +1 -1
  45. package/lib/createViewerDisplaySave.mjs +8 -16
  46. package/lib/createViewerDisplaySave.mjs.map +1 -1
  47. package/lib/createViewerFrameControl.d.ts +8 -10
  48. package/lib/createViewerFrameControl.js +3 -15
  49. package/lib/createViewerFrameControl.js.map +1 -1
  50. package/lib/createViewerFrameControl.mjs +3 -12
  51. package/lib/createViewerFrameControl.mjs.map +1 -1
  52. package/lib/createViewerViewportResize.d.ts +4 -12
  53. package/lib/createViewerViewportResize.js +7 -20
  54. package/lib/createViewerViewportResize.js.map +1 -1
  55. package/lib/createViewerViewportResize.mjs +6 -14
  56. package/lib/createViewerViewportResize.mjs.map +1 -1
  57. package/lib/index.d.ts +1 -0
  58. package/lib/index.js +1 -0
  59. package/lib/index.js.map +1 -1
  60. package/lib/index.mjs +6 -1
  61. package/lib/inspector/AutoMovieInspector.d.ts +33 -13
  62. package/lib/inspector/AutoMovieInspector.js +110 -19
  63. package/lib/inspector/AutoMovieInspector.js.map +1 -1
  64. package/lib/inspector/AutoMovieInspector.mjs +121 -18
  65. package/lib/inspector/AutoMovieInspector.mjs.map +1 -1
  66. package/lib/inspector/AutoMovieInspectorBeauty.d.ts +41 -0
  67. package/lib/inspector/AutoMovieInspectorBeauty.js +56 -0
  68. package/lib/inspector/AutoMovieInspectorBeauty.js.map +1 -0
  69. package/lib/inspector/AutoMovieInspectorBeauty.mjs +55 -0
  70. package/lib/inspector/AutoMovieInspectorBeauty.mjs.map +1 -0
  71. package/lib/inspector/AutoMovieInspectorDiagnosticLog.d.ts +48 -0
  72. package/lib/inspector/AutoMovieInspectorDiagnosticLog.js +186 -0
  73. package/lib/inspector/AutoMovieInspectorDiagnosticLog.js.map +1 -0
  74. package/lib/inspector/AutoMovieInspectorDiagnosticLog.mjs +171 -0
  75. package/lib/inspector/AutoMovieInspectorDiagnosticLog.mjs.map +1 -0
  76. package/lib/inspector/AutoMovieInspectorDiagnosticsPanel.d.ts +23 -0
  77. package/lib/inspector/AutoMovieInspectorDiagnosticsPanel.js +37 -0
  78. package/lib/inspector/AutoMovieInspectorDiagnosticsPanel.js.map +1 -0
  79. package/lib/inspector/AutoMovieInspectorDiagnosticsPanel.mjs +85 -0
  80. package/lib/inspector/AutoMovieInspectorDiagnosticsPanel.mjs.map +1 -0
  81. package/lib/inspector/AutoMovieInspectorMarksPanel.d.ts +4 -10
  82. package/lib/inspector/AutoMovieInspectorMarksPanel.js +18 -35
  83. package/lib/inspector/AutoMovieInspectorMarksPanel.js.map +1 -1
  84. package/lib/inspector/AutoMovieInspectorMarksPanel.mjs +32 -38
  85. package/lib/inspector/AutoMovieInspectorMarksPanel.mjs.map +1 -1
  86. package/lib/inspector/AutoMovieInspectorPlayhead.d.ts +35 -96
  87. package/lib/inspector/AutoMovieInspectorPlayhead.js +41 -101
  88. package/lib/inspector/AutoMovieInspectorPlayhead.js.map +1 -1
  89. package/lib/inspector/AutoMovieInspectorPlayhead.mjs +44 -98
  90. package/lib/inspector/AutoMovieInspectorPlayhead.mjs.map +1 -1
  91. package/lib/inspector/AutoMovieInspectorRequestPanel.d.ts +9 -10
  92. package/lib/inspector/AutoMovieInspectorRequestPanel.js +18 -12
  93. package/lib/inspector/AutoMovieInspectorRequestPanel.js.map +1 -1
  94. package/lib/inspector/AutoMovieInspectorRequestPanel.mjs +32 -14
  95. package/lib/inspector/AutoMovieInspectorRequestPanel.mjs.map +1 -1
  96. package/lib/inspector/AutoMovieInspectorSelectionPanel.d.ts +0 -8
  97. package/lib/inspector/AutoMovieInspectorSelectionPanel.js +0 -8
  98. package/lib/inspector/AutoMovieInspectorSelectionPanel.js.map +1 -1
  99. package/lib/inspector/AutoMovieInspectorSelectionPanel.mjs +0 -8
  100. package/lib/inspector/AutoMovieInspectorSelectionPanel.mjs.map +1 -1
  101. package/lib/inspector/AutoMovieInspectorShadePanel.d.ts +2 -9
  102. package/lib/inspector/AutoMovieInspectorShadePanel.js +18 -25
  103. package/lib/inspector/AutoMovieInspectorShadePanel.js.map +1 -1
  104. package/lib/inspector/AutoMovieInspectorShadePanel.mjs +18 -27
  105. package/lib/inspector/AutoMovieInspectorShadePanel.mjs.map +1 -1
  106. package/lib/inspector/AutoMovieInspectorTimePanel.d.ts +0 -8
  107. package/lib/inspector/AutoMovieInspectorTimePanel.js +0 -8
  108. package/lib/inspector/AutoMovieInspectorTimePanel.js.map +1 -1
  109. package/lib/inspector/AutoMovieInspectorTimePanel.mjs +0 -8
  110. package/lib/inspector/AutoMovieInspectorTimePanel.mjs.map +1 -1
  111. package/lib/inspector/AutoMovieInspectorTimeReadout.d.ts +0 -8
  112. package/lib/inspector/AutoMovieInspectorTimeReadout.js +4 -10
  113. package/lib/inspector/AutoMovieInspectorTimeReadout.js.map +1 -1
  114. package/lib/inspector/AutoMovieInspectorTimeReadout.mjs +3 -12
  115. package/lib/inspector/AutoMovieInspectorTimeReadout.mjs.map +1 -1
  116. package/lib/inspector/AutoMovieInspectorTransition.d.ts +79 -0
  117. package/lib/inspector/AutoMovieInspectorTransition.js +131 -0
  118. package/lib/inspector/AutoMovieInspectorTransition.js.map +1 -0
  119. package/lib/inspector/AutoMovieInspectorTransition.mjs +119 -0
  120. package/lib/inspector/AutoMovieInspectorTransition.mjs.map +1 -0
  121. package/lib/inspector/AutoMovieInspectorViewPanel.d.ts +0 -8
  122. package/lib/inspector/AutoMovieInspectorViewPanel.js +0 -8
  123. package/lib/inspector/AutoMovieInspectorViewPanel.js.map +1 -1
  124. package/lib/inspector/AutoMovieInspectorViewPanel.mjs +0 -8
  125. package/lib/inspector/AutoMovieInspectorViewPanel.mjs.map +1 -1
  126. package/lib/inspector/IAutoMovieInspectorAction.d.ts +54 -95
  127. package/lib/inspector/IAutoMovieInspectorLive.d.ts +43 -0
  128. package/lib/inspector/IAutoMovieInspectorLive.js +3 -0
  129. package/lib/inspector/IAutoMovieInspectorLive.js.map +1 -0
  130. package/lib/inspector/IAutoMovieInspectorLive.mjs +0 -0
  131. package/lib/inspector/IAutoMovieInspectorPathNode.d.ts +14 -9
  132. package/lib/inspector/IAutoMovieInspectorProps.d.ts +3 -14
  133. package/lib/inspector/IAutoMovieInspectorScene.d.ts +96 -100
  134. package/lib/inspector/IAutoMovieInspectorSceneHost.d.ts +37 -102
  135. package/lib/inspector/IAutoMovieInspectorState.d.ts +6 -7
  136. package/lib/inspector/assertAutoMovieInspectorRaster.d.ts +7 -0
  137. package/lib/inspector/assertAutoMovieInspectorRaster.js +19 -0
  138. package/lib/inspector/assertAutoMovieInspectorRaster.js.map +1 -0
  139. package/lib/inspector/assertAutoMovieInspectorRaster.mjs +17 -0
  140. package/lib/inspector/assertAutoMovieInspectorRaster.mjs.map +1 -0
  141. package/lib/inspector/buildAutoMovieInspectorPathTree.d.ts +9 -10
  142. package/lib/inspector/buildAutoMovieInspectorPathTree.js +9 -10
  143. package/lib/inspector/buildAutoMovieInspectorPathTree.js.map +1 -1
  144. package/lib/inspector/buildAutoMovieInspectorPathTree.mjs +9 -10
  145. package/lib/inspector/buildAutoMovieInspectorPathTree.mjs.map +1 -1
  146. package/lib/inspector/changesAutoMovieObservedScene.d.ts +16 -0
  147. package/lib/inspector/changesAutoMovieObservedScene.js +28 -0
  148. package/lib/inspector/changesAutoMovieObservedScene.js.map +1 -0
  149. package/lib/inspector/changesAutoMovieObservedScene.mjs +21 -0
  150. package/lib/inspector/changesAutoMovieObservedScene.mjs.map +1 -0
  151. package/lib/inspector/createAutoMovieInspectorAddressWriter.d.ts +13 -11
  152. package/lib/inspector/createAutoMovieInspectorAddressWriter.js +13 -11
  153. package/lib/inspector/createAutoMovieInspectorAddressWriter.js.map +1 -1
  154. package/lib/inspector/createAutoMovieInspectorAddressWriter.mjs +13 -11
  155. package/lib/inspector/createAutoMovieInspectorAddressWriter.mjs.map +1 -1
  156. package/lib/inspector/createAutoMovieInspectorCanvasHost.d.ts +7 -10
  157. package/lib/inspector/createAutoMovieInspectorCanvasHost.js +14 -11
  158. package/lib/inspector/createAutoMovieInspectorCanvasHost.js.map +1 -1
  159. package/lib/inspector/createAutoMovieInspectorCanvasHost.mjs +17 -14
  160. package/lib/inspector/createAutoMovieInspectorCanvasHost.mjs.map +1 -1
  161. package/lib/inspector/createAutoMovieInspectorState.d.ts +3 -9
  162. package/lib/inspector/createAutoMovieInspectorState.js +3 -9
  163. package/lib/inspector/createAutoMovieInspectorState.js.map +1 -1
  164. package/lib/inspector/createAutoMovieInspectorState.mjs +3 -9
  165. package/lib/inspector/createAutoMovieInspectorState.mjs.map +1 -1
  166. package/lib/inspector/firstAutoMovieInspectorSecond.d.ts +6 -0
  167. package/lib/inspector/firstAutoMovieInspectorSecond.js +13 -0
  168. package/lib/inspector/firstAutoMovieInspectorSecond.js.map +1 -0
  169. package/lib/inspector/firstAutoMovieInspectorSecond.mjs +11 -0
  170. package/lib/inspector/firstAutoMovieInspectorSecond.mjs.map +1 -0
  171. package/lib/inspector/followAutoMovieInspectorSize.d.ts +11 -0
  172. package/lib/inspector/followAutoMovieInspectorSize.js +26 -0
  173. package/lib/inspector/followAutoMovieInspectorSize.js.map +1 -0
  174. package/lib/inspector/followAutoMovieInspectorSize.mjs +26 -0
  175. package/lib/inspector/followAutoMovieInspectorSize.mjs.map +1 -0
  176. package/lib/inspector/formatAutoMovieInspectorAddress.d.ts +11 -10
  177. package/lib/inspector/formatAutoMovieInspectorAddress.js +15 -11
  178. package/lib/inspector/formatAutoMovieInspectorAddress.js.map +1 -1
  179. package/lib/inspector/formatAutoMovieInspectorAddress.mjs +15 -11
  180. package/lib/inspector/formatAutoMovieInspectorAddress.mjs.map +1 -1
  181. package/lib/inspector/formatAutoMovieInspectorCommand.d.ts +20 -14
  182. package/lib/inspector/formatAutoMovieInspectorCommand.js +33 -14
  183. package/lib/inspector/formatAutoMovieInspectorCommand.js.map +1 -1
  184. package/lib/inspector/formatAutoMovieInspectorCommand.mjs +26 -15
  185. package/lib/inspector/formatAutoMovieInspectorCommand.mjs.map +1 -1
  186. package/lib/inspector/handleAutoMovieInspectorKey.d.ts +24 -15
  187. package/lib/inspector/handleAutoMovieInspectorKey.js +27 -16
  188. package/lib/inspector/handleAutoMovieInspectorKey.js.map +1 -1
  189. package/lib/inspector/handleAutoMovieInspectorKey.mjs +27 -16
  190. package/lib/inspector/handleAutoMovieInspectorKey.mjs.map +1 -1
  191. package/lib/inspector/index.d.ts +5 -0
  192. package/lib/inspector/index.js +5 -0
  193. package/lib/inspector/index.js.map +1 -1
  194. package/lib/inspector/index.mjs +6 -1
  195. package/lib/inspector/inspectAutoMovieInspectorRequest.d.ts +19 -0
  196. package/lib/inspector/inspectAutoMovieInspectorRequest.js +20 -0
  197. package/lib/inspector/inspectAutoMovieInspectorRequest.js.map +1 -0
  198. package/lib/inspector/inspectAutoMovieInspectorRequest.mjs +20 -0
  199. package/lib/inspector/inspectAutoMovieInspectorRequest.mjs.map +1 -0
  200. package/lib/inspector/installAutoMovieInspectorRequest.d.ts +20 -0
  201. package/lib/inspector/installAutoMovieInspectorRequest.js +36 -0
  202. package/lib/inspector/installAutoMovieInspectorRequest.js.map +1 -0
  203. package/lib/inspector/installAutoMovieInspectorRequest.mjs +35 -0
  204. package/lib/inspector/installAutoMovieInspectorRequest.mjs.map +1 -0
  205. package/lib/inspector/locateAutoMovieInspectorFinding.d.ts +19 -0
  206. package/lib/inspector/locateAutoMovieInspectorFinding.js +34 -0
  207. package/lib/inspector/locateAutoMovieInspectorFinding.js.map +1 -0
  208. package/lib/inspector/locateAutoMovieInspectorFinding.mjs +37 -0
  209. package/lib/inspector/locateAutoMovieInspectorFinding.mjs.map +1 -0
  210. package/lib/inspector/messageOfAutoMovieInspectorError.d.ts +2 -0
  211. package/lib/inspector/messageOfAutoMovieInspectorError.js +8 -0
  212. package/lib/inspector/messageOfAutoMovieInspectorError.js.map +1 -0
  213. package/lib/inspector/messageOfAutoMovieInspectorError.mjs +8 -0
  214. package/lib/inspector/messageOfAutoMovieInspectorError.mjs.map +1 -0
  215. package/lib/inspector/mountAutoMovieInspectorPage.d.ts +5 -8
  216. package/lib/inspector/mountAutoMovieInspectorPage.js +3 -9
  217. package/lib/inspector/mountAutoMovieInspectorPage.js.map +1 -1
  218. package/lib/inspector/mountAutoMovieInspectorPage.mjs +4 -9
  219. package/lib/inspector/mountAutoMovieInspectorPage.mjs.map +1 -1
  220. package/lib/inspector/mountAutoMovieInspectorScene.d.ts +55 -12
  221. package/lib/inspector/mountAutoMovieInspectorScene.js +238 -164
  222. package/lib/inspector/mountAutoMovieInspectorScene.js.map +1 -1
  223. package/lib/inspector/mountAutoMovieInspectorScene.mjs +223 -149
  224. package/lib/inspector/mountAutoMovieInspectorScene.mjs.map +1 -1
  225. package/lib/inspector/placeAutoMovieInspectorLabels.d.ts +29 -0
  226. package/lib/inspector/placeAutoMovieInspectorLabels.js +33 -0
  227. package/lib/inspector/placeAutoMovieInspectorLabels.js.map +1 -0
  228. package/lib/inspector/placeAutoMovieInspectorLabels.mjs +32 -0
  229. package/lib/inspector/placeAutoMovieInspectorLabels.mjs.map +1 -0
  230. package/lib/inspector/readAutoMovieInspectorAddress.d.ts +8 -11
  231. package/lib/inspector/readAutoMovieInspectorAddress.js +8 -11
  232. package/lib/inspector/readAutoMovieInspectorAddress.js.map +1 -1
  233. package/lib/inspector/readAutoMovieInspectorAddress.mjs +8 -11
  234. package/lib/inspector/readAutoMovieInspectorAddress.mjs.map +1 -1
  235. package/lib/inspector/readAutoMovieInspectorFacts.d.ts +17 -0
  236. package/lib/inspector/readAutoMovieInspectorFacts.js +34 -0
  237. package/lib/inspector/readAutoMovieInspectorFacts.js.map +1 -0
  238. package/lib/inspector/readAutoMovieInspectorFacts.mjs +28 -0
  239. package/lib/inspector/readAutoMovieInspectorFacts.mjs.map +1 -0
  240. package/lib/inspector/readsAutoMovieInspectorPlacedScene.d.ts +9 -0
  241. package/lib/inspector/readsAutoMovieInspectorPlacedScene.js +14 -0
  242. package/lib/inspector/readsAutoMovieInspectorPlacedScene.js.map +1 -0
  243. package/lib/inspector/readsAutoMovieInspectorPlacedScene.mjs +14 -0
  244. package/lib/inspector/readsAutoMovieInspectorPlacedScene.mjs.map +1 -0
  245. package/lib/inspector/reduceAutoMovieInspectorState.d.ts +10 -10
  246. package/lib/inspector/reduceAutoMovieInspectorState.js +17 -11
  247. package/lib/inspector/reduceAutoMovieInspectorState.js.map +1 -1
  248. package/lib/inspector/reduceAutoMovieInspectorState.mjs +16 -11
  249. package/lib/inspector/reduceAutoMovieInspectorState.mjs.map +1 -1
  250. package/lib/inspector/releaseAutoMovieInspectorSteps.d.ts +6 -0
  251. package/lib/inspector/releaseAutoMovieInspectorSteps.js +23 -0
  252. package/lib/inspector/releaseAutoMovieInspectorSteps.js.map +1 -0
  253. package/lib/inspector/releaseAutoMovieInspectorSteps.mjs +19 -0
  254. package/lib/inspector/releaseAutoMovieInspectorSteps.mjs.map +1 -0
  255. package/lib/inspector/reportAutoMovieInspectorLabels.d.ts +21 -0
  256. package/lib/inspector/reportAutoMovieInspectorLabels.js +27 -0
  257. package/lib/inspector/reportAutoMovieInspectorLabels.js.map +1 -0
  258. package/lib/inspector/reportAutoMovieInspectorLabels.mjs +30 -0
  259. package/lib/inspector/reportAutoMovieInspectorLabels.mjs.map +1 -0
  260. package/lib/inspector/resolveAutoMovieInspectorCamera.d.ts +22 -0
  261. package/lib/inspector/resolveAutoMovieInspectorCamera.js +34 -0
  262. package/lib/inspector/resolveAutoMovieInspectorCamera.js.map +1 -0
  263. package/lib/inspector/resolveAutoMovieInspectorCamera.mjs +34 -0
  264. package/lib/inspector/resolveAutoMovieInspectorCamera.mjs.map +1 -0
  265. package/lib/inspector/showAutoMovieInspectorFinding.d.ts +25 -0
  266. package/lib/inspector/showAutoMovieInspectorFinding.js +26 -0
  267. package/lib/inspector/showAutoMovieInspectorFinding.js.map +1 -0
  268. package/lib/inspector/showAutoMovieInspectorFinding.mjs +26 -0
  269. package/lib/inspector/showAutoMovieInspectorFinding.mjs.map +1 -0
  270. package/lib/inspector/stopAutoMovieInspectorTime.d.ts +11 -0
  271. package/lib/inspector/stopAutoMovieInspectorTime.js +17 -0
  272. package/lib/inspector/stopAutoMovieInspectorTime.js.map +1 -0
  273. package/lib/inspector/stopAutoMovieInspectorTime.mjs +18 -0
  274. package/lib/inspector/stopAutoMovieInspectorTime.mjs.map +1 -0
  275. package/lib/inspector/writeAutoMovieInspectorInspection.d.ts +6 -0
  276. package/lib/inspector/writeAutoMovieInspectorInspection.js +12 -0
  277. package/lib/inspector/writeAutoMovieInspectorInspection.js.map +1 -0
  278. package/lib/inspector/writeAutoMovieInspectorInspection.mjs +12 -0
  279. package/lib/inspector/writeAutoMovieInspectorInspection.mjs.map +1 -0
  280. package/lib/internal.d.ts +7 -0
  281. package/lib/internal.js +25 -0
  282. package/lib/internal.js.map +1 -0
  283. package/lib/internal.mjs +8 -0
  284. package/lib/mountViewer.d.ts +16 -10
  285. package/lib/mountViewer.js +17 -14
  286. package/lib/mountViewer.js.map +1 -1
  287. package/lib/mountViewer.mjs +18 -12
  288. package/lib/mountViewer.mjs.map +1 -1
  289. package/lib/publishViewerCompletedFrame.d.ts +12 -10
  290. package/lib/publishViewerCompletedFrame.js +11 -9
  291. package/lib/publishViewerCompletedFrame.js.map +1 -1
  292. package/lib/publishViewerCompletedFrame.mjs +11 -9
  293. package/lib/publishViewerCompletedFrame.mjs.map +1 -1
  294. package/lib/redrawViewerCompletedFrame.d.ts +2 -10
  295. package/lib/redrawViewerCompletedFrame.js +4 -12
  296. package/lib/redrawViewerCompletedFrame.js.map +1 -1
  297. package/lib/redrawViewerCompletedFrame.mjs +3 -11
  298. package/lib/redrawViewerCompletedFrame.mjs.map +1 -1
  299. package/lib/releaseMountedViewer.d.ts +5 -9
  300. package/lib/releaseMountedViewer.js +5 -9
  301. package/lib/releaseMountedViewer.js.map +1 -1
  302. package/lib/releaseMountedViewer.mjs +5 -9
  303. package/lib/releaseMountedViewer.mjs.map +1 -1
  304. package/lib/transport/AutoMovieViewerTransport.d.ts +13 -122
  305. package/lib/transport/AutoMovieViewerTransport.js +10 -74
  306. package/lib/transport/AutoMovieViewerTransport.js.map +1 -1
  307. package/lib/transport/AutoMovieViewerTransport.mjs +10 -65
  308. package/lib/transport/AutoMovieViewerTransport.mjs.map +1 -1
  309. package/lib/transport/readAutoMovieReviewInterval.d.ts +3 -10
  310. package/lib/transport/readAutoMovieReviewInterval.js +11 -16
  311. package/lib/transport/readAutoMovieReviewInterval.js.map +1 -1
  312. package/lib/transport/readAutoMovieReviewInterval.mjs +8 -14
  313. package/lib/transport/readAutoMovieReviewInterval.mjs.map +1 -1
  314. package/package.json +12 -8
  315. package/src/IAutoMovieViewerCompletedFrame.ts +21 -11
  316. package/src/IAutoMovieViewerDisplayMetadata.ts +0 -5
  317. package/src/IAutoMovieViewerHandle.ts +3 -25
  318. package/src/IMountViewerOptions.ts +24 -38
  319. package/src/IViewerCameraStateSnapshot.ts +0 -5
  320. package/src/IViewerFrameTransfer.ts +13 -0
  321. package/src/applyCaptureCanvasSize.ts +9 -18
  322. package/src/audio/IAutoMovieAudioCue.ts +3 -8
  323. package/src/audio/planAutoMovieAudioPlayback.ts +9 -23
  324. package/src/audio/playAutoMovieAudioCues.ts +4 -11
  325. package/src/createViewerCameraState.ts +119 -175
  326. package/src/createViewerDisplayClock.ts +4 -12
  327. package/src/createViewerDisplayPublication.ts +7 -15
  328. package/src/createViewerDisplaySave.ts +8 -16
  329. package/src/createViewerFrameControl.ts +16 -24
  330. package/src/createViewerViewportResize.ts +7 -23
  331. package/src/index.ts +1 -0
  332. package/src/inspector/AutoMovieInspector.tsx +183 -20
  333. package/src/inspector/AutoMovieInspectorBeauty.ts +89 -0
  334. package/src/inspector/AutoMovieInspectorDiagnosticLog.ts +235 -0
  335. package/src/inspector/AutoMovieInspectorDiagnosticsPanel.tsx +118 -0
  336. package/src/inspector/AutoMovieInspectorMarksPanel.tsx +26 -34
  337. package/src/inspector/AutoMovieInspectorPlayhead.ts +53 -110
  338. package/src/inspector/AutoMovieInspectorRequestPanel.tsx +57 -29
  339. package/src/inspector/AutoMovieInspectorSelectionPanel.tsx +0 -8
  340. package/src/inspector/AutoMovieInspectorShadePanel.tsx +24 -29
  341. package/src/inspector/AutoMovieInspectorTimePanel.tsx +0 -8
  342. package/src/inspector/AutoMovieInspectorTimeReadout.tsx +4 -10
  343. package/src/inspector/AutoMovieInspectorTransition.ts +178 -0
  344. package/src/inspector/AutoMovieInspectorViewPanel.tsx +0 -8
  345. package/src/inspector/IAutoMovieInspectorAction.ts +57 -94
  346. package/src/inspector/IAutoMovieInspectorLive.ts +62 -0
  347. package/src/inspector/IAutoMovieInspectorPathNode.ts +14 -9
  348. package/src/inspector/IAutoMovieInspectorProps.ts +4 -14
  349. package/src/inspector/IAutoMovieInspectorScene.ts +104 -99
  350. package/src/inspector/IAutoMovieInspectorSceneHost.ts +43 -102
  351. package/src/inspector/IAutoMovieInspectorState.ts +6 -7
  352. package/src/inspector/assertAutoMovieInspectorRaster.ts +23 -0
  353. package/src/inspector/buildAutoMovieInspectorPathTree.ts +9 -10
  354. package/src/inspector/changesAutoMovieObservedScene.ts +30 -0
  355. package/src/inspector/createAutoMovieInspectorAddressWriter.ts +13 -11
  356. package/src/inspector/createAutoMovieInspectorCanvasHost.ts +14 -12
  357. package/src/inspector/createAutoMovieInspectorState.ts +3 -9
  358. package/src/inspector/firstAutoMovieInspectorSecond.ts +13 -0
  359. package/src/inspector/followAutoMovieInspectorSize.ts +32 -0
  360. package/src/inspector/formatAutoMovieInspectorAddress.ts +15 -11
  361. package/src/inspector/formatAutoMovieInspectorCommand.ts +44 -15
  362. package/src/inspector/handleAutoMovieInspectorKey.ts +27 -16
  363. package/src/inspector/index.ts +5 -0
  364. package/src/inspector/inspectAutoMovieInspectorRequest.ts +37 -0
  365. package/src/inspector/installAutoMovieInspectorRequest.ts +50 -0
  366. package/src/inspector/locateAutoMovieInspectorFinding.ts +40 -0
  367. package/src/inspector/messageOfAutoMovieInspectorError.ts +4 -0
  368. package/src/inspector/mountAutoMovieInspectorPage.tsx +7 -8
  369. package/src/inspector/mountAutoMovieInspectorScene.ts +290 -232
  370. package/src/inspector/placeAutoMovieInspectorLabels.ts +53 -0
  371. package/src/inspector/readAutoMovieInspectorAddress.ts +8 -11
  372. package/src/inspector/readAutoMovieInspectorFacts.ts +50 -0
  373. package/src/inspector/readsAutoMovieInspectorPlacedScene.ts +16 -0
  374. package/src/inspector/reduceAutoMovieInspectorState.ts +17 -11
  375. package/src/inspector/releaseAutoMovieInspectorSteps.ts +19 -0
  376. package/src/inspector/reportAutoMovieInspectorLabels.ts +45 -0
  377. package/src/inspector/resolveAutoMovieInspectorCamera.ts +50 -0
  378. package/src/inspector/showAutoMovieInspectorFinding.ts +40 -0
  379. package/src/inspector/stopAutoMovieInspectorTime.ts +19 -0
  380. package/src/inspector/writeAutoMovieInspectorInspection.ts +12 -0
  381. package/src/internal.ts +9 -0
  382. package/src/mountViewer.ts +17 -14
  383. package/src/publishViewerCompletedFrame.ts +14 -10
  384. package/src/redrawViewerCompletedFrame.ts +3 -12
  385. package/src/releaseMountedViewer.ts +5 -9
  386. package/src/transport/AutoMovieViewerTransport.ts +17 -144
  387. package/src/transport/readAutoMovieReviewInterval.ts +15 -16
@@ -1 +1 @@
1
- {"version":3,"file":"AutoMovieViewerTransport.mjs","names":[],"sources":["../../src/transport/AutoMovieViewerTransport.ts"],"sourcesContent":["/**\n * One authoritative review clock for a deterministic film producer: exact\n * seeks, interval playback at a review speed, optional synchronized sound and\n * capture freezes, all through one synchronous `place(seconds)` producer.\n *\n * A placement commits the displayed second only after the producer succeeds,\n * so a failed draw never masquerades as a sought frame. Playback anchors one\n * wall-clock origin (no integrated render deltas), snaps to the frame grid of\n * `fps` and draws the interval's exact end before pausing. Sound starts\n * before the anchor and a generation token cancels a start that a later\n * pause, seek or speed change superseded. The clock source is injectable, so\n * the logic runs in milliseconds without a browser.\n *\n * @evidence contracts/development/common.md#meaningful-documentation Gives the purpose (One authoritative review clock for a deterministic film producer: exact seeks, interval playback at a review speed, optional synchronized sound and capture freezes, all through one synchronous `place(seconds)` producer) and documents 21 documented members as stated in this comment.\n * @evidence contracts/development/design.md#principled-representation Represents One authoritative review clock for a deterministic film producer: exact seeks, interval playback at a review speed, optional synchronized sound and capture freezes, all through one synchronous `place(seconds)` producer: class of 21 members (`seconds`, `playing`, `sound`, `error`, `interval`, `available`, ...); units and frames named in its text: second, seconds, milliseconds, frame. It has no optional member, so no absent-value state combines with another. 2 members are readonly.\n * @evidence contracts/development/design.md#minimal-and-owned-surface Owned by the module that declares `AutoMovieViewerTransport` in packages/viewer/src/transport/AutoMovieViewerTransport.ts; its surface is the 21 members listed and the text shows 3 other files naming it, mostly packages/viewer (2), test (1), so no member is declared for a presumed future need.\n * @evidence contracts/development/design.md#prohibited-design-shortcuts Scanning the declaration finds no `any`, a use of `unknown`, no index signature and no cast; it duplicates no type that another owner declares as far as a name search shows. The widening above is the remaining shortcut and is not justified here.\n */\nexport class AutoMovieViewerTransport {\n /** Last successfully displayed second. */\n public seconds: number;\n\n /** Whether the clock is running. */\n public playing: boolean = false;\n\n /** Whether playback starts the sound source. */\n public sound: boolean = true;\n\n /** Last producer or sound refusal. */\n public error: string | null = null;\n\n /** Closed playback interval inside the available range. */\n public interval: [number, number];\n\n /** The source's available range; review bounds cannot widen it. */\n public readonly available: readonly [number, number];\n\n /** Current review speed. */\n private rate: number = 1;\n\n /** Wall anchor, milliseconds. */\n private wall: number = 0;\n\n /** Film second at the anchor. */\n private origin: number = 0;\n\n /** Pending start generation. */\n private generation: number = 0;\n\n /** Borrowed collaborators and settings. */\n private readonly options: AutoMovieViewerTransport.IOptions;\n\n /**\n * A transport over a producer.\n *\n * @param options Producer, range, frame rate, speeds, sound and clock.\n */\n public constructor(options: AutoMovieViewerTransport.IOptions) {\n const available: readonly [number, number] = options.available;\n if (\n !available.every(Number.isFinite) ||\n available[0] < 0 ||\n available[0] >= available[1] ||\n !(options.fps > 0)\n )\n throw new Error(\"Invalid transport range or frame rate\");\n this.options = options;\n this.available = Object.freeze([available[0], available[1]] as [\n number,\n number,\n ]);\n this.seconds = available[0];\n this.interval = [available[0], available[1]];\n }\n\n /** Current review speed, film seconds per wall second. */\n public get speed(): number {\n return this.rate;\n }\n\n /** Replace the review speed; pauses first, and refuses an unsupported speed. */\n public set speed(value: number) {\n if (!(this.options.speeds ?? [0.25, 0.5, 1]).includes(value))\n throw new Error(`Unsupported review speed ${value}`);\n this.pause();\n this.rate = value;\n }\n\n /**\n * Start playback from the committed second, after the sound starts.\n *\n * @returns When the clock is anchored, or the start was superseded.\n *\n * @evidence contracts/development/common.md#meaningful-documentation Documents the member contract in its own summary: Start playback from the committed second, after the sound starts.\n * @evidence contracts/development/implementation.md#principled-implementation Implements the documented behavior (Start playback from the committed second, after the sound starts) directly over its typed inputs as a fixed number of statements with no loop or recursion in the body, delegating to `String`; the premises are the units, frames and ranges stated in its parameter documentation, enforced only where the body throws (1 throw site). Apart from structural 0, 1 and 2 the body uses no numeric literal.\n * @evidence contracts/development/implementation.md#clear-and-simple-structure One async operation of 20 lines and 5 top-level statements that reuses `String` from their owners instead of copying them; it adds no option, layer or abstraction beyond its documented parameters.\n * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts Scanning the body finds no `any`, type assertion, non-null assertion, suppression directive or TODO, and no branch keyed on a consumer, fixture or expected answer; values come from its parameters.\n * @evidence contracts/development/implementation.md#efficient-algorithms Cost is driven by the sizes of its inputs; the dominant cost is a fixed number of statements with no loop or recursion in the body, performed once per call. No speedup is claimed and none is measured.\n * @evidence contracts/development/implementation.md#reuse-equivalent-work Awaits 1 call per invocation and shares no result or in-flight work between invocations: equivalence of effectful calls is not decided here, so every call repeats its effects.\n * @evidence contracts/development/implementation.md#bound-retention-and-release-resources The body awaits asynchronous work; it retains nothing after it settles beyond its result, and any handle it opens is owned and released by the call or by its callees.\n */\n public async play(): Promise<void> {\n this.pause();\n if (this.seconds < this.interval[0] || this.seconds >= this.interval[1])\n this.seek(this.interval[0]);\n const generation: number = ++this.generation;\n this.error = null;\n try {\n if (this.sound && this.options.audio)\n await this.options.audio.play(this.seconds, this.rate);\n if (generation !== this.generation) return;\n this.wall = this.now();\n this.origin = this.seconds;\n this.playing = true;\n } catch (error: unknown) {\n if (generation !== this.generation) return;\n this.error = error instanceof Error ? error.message : String(error);\n this.pause();\n throw error;\n }\n }\n\n /**\n * Stop playback and sound without moving the displayed second.\n *\n * @evidence contracts/development/common.md#meaningful-documentation Documents the member contract in its own summary: Stop playback and sound without moving the displayed second.\n * @evidence contracts/development/implementation.md#principled-implementation Implements the documented behavior (Stop playback and sound without moving the displayed second) directly over its typed inputs as a fixed number of statements with no loop or recursion in the body; the premises are the units, frames and ranges stated in its parameter documentation, enforced only where the body performs no validation and relies on its callers. Apart from structural 0, 1 and 2 the body uses no numeric literal.\n * @evidence contracts/development/implementation.md#clear-and-simple-structure One operation of 5 lines and 3 top-level statements that calls no other named helper; it adds no option, layer or abstraction beyond its documented parameters.\n * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts Scanning the body finds no `any`, type assertion, non-null assertion, suppression directive or TODO, and no branch keyed on a consumer, fixture or expected answer; values come from its parameters.\n * @evidence contracts/development/implementation.md#efficient-algorithms Cost is driven by the sizes of its inputs; the dominant cost is a fixed number of statements with no loop or recursion in the body, performed once per call. No speedup is claimed and none is measured.\n * @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work The operation coordinates no requests, phases or consumers and holds no cache: each call recomputes from its arguments and shares nothing, which is correct because its result depends only on them.\n * @evidenceExclude contracts/development/implementation.md#bound-retention-and-release-resources The function acquires no handle, timer, listener or task and keeps no state between calls; its 0 allocation sites become the returned value or die with the call, so nothing grows.\n */\n public pause(): void {\n this.generation++;\n this.playing = false;\n this.options.audio?.pause();\n }\n\n /**\n * Place an exact second inside the available range.\n *\n * @param seconds The second.\n *\n * @evidence contracts/development/common.md#meaningful-documentation Documents the member contract in its own summary: Place an exact second inside the available range.\n * @evidence contracts/development/implementation.md#principled-implementation Implements the documented behavior (Place an exact second inside the available range) directly over its typed inputs (`seconds`) as a fixed number of statements with no loop or recursion in the body, delegating to `Number.isFinite`, `String`; the premises are the units, frames and ranges stated in its parameter documentation, enforced only where the body throws (2 throw sites). Apart from structural 0, 1 and 2 the body uses no numeric literal.\n * @evidence contracts/development/implementation.md#clear-and-simple-structure One operation of 19 lines and 3 top-level statements that reuses `Number.isFinite`, `String` from their owners instead of copying them; it adds no option, layer or abstraction beyond its documented parameters.\n * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts Scanning the body finds no `any`, type assertion, non-null assertion, suppression directive or TODO, and no branch keyed on a consumer, fixture or expected answer; values come from its parameters.\n * @evidence contracts/development/implementation.md#efficient-algorithms Cost is driven by the sizes of `seconds`; the dominant cost is a fixed number of statements with no loop or recursion in the body, performed once per call with 1 allocation site (literals and constructed values). No speedup is claimed and none is measured.\n * @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work The operation coordinates no requests, phases or consumers and holds no cache: each call recomputes from its arguments and shares nothing, which is correct because its result depends only on them.\n * @evidenceExclude contracts/development/implementation.md#bound-retention-and-release-resources The function acquires no handle, timer, listener or task and keeps no state between calls; its 1 allocation site become the returned value or die with the call, so nothing grows.\n */\n public seek(seconds: number): void {\n if (\n !Number.isFinite(seconds) ||\n seconds < this.available[0] ||\n seconds > this.available[1]\n )\n throw new Error(\n `Seek must remain inside [${this.available[0]},${this.available[1]}]`,\n );\n this.pause();\n try {\n this.options.place(seconds);\n this.seconds = seconds;\n this.error = null;\n } catch (error: unknown) {\n this.error = error instanceof Error ? error.message : String(error);\n throw error;\n }\n }\n\n /**\n * Advance a running clock to the frame due now; call once per display frame.\n *\n * @returns Whether a new frame was placed.\n *\n * @evidence contracts/development/common.md#meaningful-documentation Documents the member contract in its own summary: Advance a running clock to the frame due now; call once per display frame.\n * @evidence contracts/development/implementation.md#principled-implementation Implements the documented behavior (Advance a running clock to the frame due now; call once per display frame) directly over its typed inputs as a fixed number of statements with no loop or recursion in the body, delegating to `Math.min`, `Math.max`, `Math.floor`, `String`; the premises are the units, frames and ranges stated in its parameter documentation, enforced only where the body throws (1 throw site). Beyond structural 0, 1 and 2 the body uses the literal 1000, whose basis this answer does not independently establish and a reviewer must confirm.\n * @evidence contracts/development/implementation.md#clear-and-simple-structure One operation of 26 lines and 6 top-level statements that reuses `Math.min`, `Math.max`, `Math.floor`, `String` from their owners instead of copying them; it adds no option, layer or abstraction beyond its documented parameters.\n * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts Scanning the body finds no `any`, type assertion, non-null assertion, suppression directive or TODO, and no branch keyed on a consumer, fixture or expected answer; values come from its parameters. Literal caveat: 1000 are not independently sourced here.\n * @evidence contracts/development/implementation.md#efficient-algorithms Cost is driven by the sizes of its inputs; the dominant cost is a fixed number of statements with no loop or recursion in the body, performed once per call. No speedup is claimed and none is measured.\n * @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work The operation coordinates no requests, phases or consumers and holds no cache: each call recomputes from its arguments and shares nothing, which is correct because its result depends only on them.\n * @evidenceExclude contracts/development/implementation.md#bound-retention-and-release-resources The function acquires no handle, timer, listener or task and keeps no state between calls; its 0 allocation sites become the returned value or die with the call, so nothing grows.\n */\n public tick(): boolean {\n if (!this.playing) return false;\n const fps: number = this.options.fps;\n const actual: number = Math.min(\n this.interval[1],\n this.origin + ((this.now() - this.wall) * this.rate) / 1000,\n );\n const seconds: number =\n actual === this.interval[1]\n ? actual\n : Math.max(this.origin, Math.floor(actual * fps) / fps);\n let changed: boolean = false;\n try {\n if (seconds !== this.seconds) {\n this.options.place(seconds);\n this.seconds = seconds;\n changed = true;\n }\n if (actual === this.interval[1]) this.pause();\n return changed;\n } catch (error: unknown) {\n this.error = error instanceof Error ? error.message : String(error);\n this.pause();\n throw error;\n }\n }\n\n /**\n * Select a playback interval by placing its start first.\n *\n * @param start Start second.\n * @param end End second, after the start.\n *\n * @evidence contracts/development/common.md#meaningful-documentation Documents the member contract in its own summary: Select a playback interval by placing its start first.\n * @evidence contracts/development/implementation.md#principled-implementation Implements the documented behavior (Select a playback interval by placing its start first) directly over its typed inputs (`start`, `end`) as a fixed number of statements with no loop or recursion in the body, delegating to `Number.isFinite`; the premises are the units, frames and ranges stated in its parameter documentation, enforced only where the body throws (1 throw site). Apart from structural 0, 1 and 2 the body uses no numeric literal.\n * @evidence contracts/development/implementation.md#clear-and-simple-structure One operation of 14 lines and 3 top-level statements that reuses `Number.isFinite` from their owners instead of copying them; it adds no option, layer or abstraction beyond its documented parameters.\n * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts Scanning the body finds no `any`, type assertion, non-null assertion, suppression directive or TODO, and no branch keyed on a consumer, fixture or expected answer; values come from its parameters.\n * @evidence contracts/development/implementation.md#efficient-algorithms Cost is driven by the sizes of `start`, `end`; the dominant cost is a fixed number of statements with no loop or recursion in the body, performed once per call with 2 allocation sites (literals and constructed values). No speedup is claimed and none is measured.\n * @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work The operation coordinates no requests, phases or consumers and holds no cache: each call recomputes from its arguments and shares nothing, which is correct because its result depends only on them.\n * @evidenceExclude contracts/development/implementation.md#bound-retention-and-release-resources The function acquires no handle, timer, listener or task and keeps no state between calls; its 2 allocation sites become the returned value or die with the call, so nothing grows.\n */\n public setInterval(start: number, end: number): void {\n if (\n !Number.isFinite(start) ||\n !Number.isFinite(end) ||\n start < this.available[0] ||\n end > this.available[1] ||\n end <= start\n )\n throw new Error(\n `Review interval must remain inside [${this.available[0]},${this.available[1]}]`,\n );\n this.seek(start);\n this.interval = [start, end];\n }\n\n /**\n * Pause for a capture and return a once-only release that may resume.\n *\n * @returns The release; `true` resumes a formerly playing clock.\n *\n * @evidence contracts/development/common.md#meaningful-documentation Documents the member contract in its own summary: Pause for a capture and return a once-only release that may resume.\n * @evidence contracts/development/implementation.md#principled-implementation Implements the documented behavior (Pause for a capture and return a once-only release that may resume) directly over its typed inputs as a fixed number of statements with no loop or recursion in the body; the premises are the units, frames and ranges stated in its parameter documentation, enforced only where the body performs no validation and relies on its callers. Apart from structural 0, 1 and 2 the body uses no numeric literal.\n * @evidence contracts/development/implementation.md#clear-and-simple-structure One operation of 10 lines and 4 top-level statements that calls no other named helper; it adds no option, layer or abstraction beyond its documented parameters.\n * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts Scanning the body finds no `any`, type assertion, non-null assertion, suppression directive or TODO, and no branch keyed on a consumer, fixture or expected answer; values come from its parameters.\n * @evidence contracts/development/implementation.md#efficient-algorithms Cost is driven by the sizes of its inputs; the dominant cost is a fixed number of statements with no loop or recursion in the body, performed once per call. No speedup is claimed and none is measured.\n * @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work The operation coordinates no requests, phases or consumers and holds no cache: each call recomputes from its arguments and shares nothing, which is correct because its result depends only on them.\n * @evidenceExclude contracts/development/implementation.md#bound-retention-and-release-resources The function acquires no handle, timer, listener or task and keeps no state between calls; its 0 allocation sites become the returned value or die with the call, so nothing grows.\n */\n public freeze(): (resume: boolean) => void {\n const playing: boolean = this.playing;\n this.pause();\n let released: boolean = false;\n return (resume: boolean): void => {\n if (released) return;\n released = true;\n if (resume && playing) void this.play().catch((): void => {});\n };\n }\n\n /** The injected or performance clock, milliseconds. */\n private now(): number {\n return this.options.now?.() ?? performance.now();\n }\n}\n/** Companion types of {@link AutoMovieViewerTransport}. */\nexport namespace AutoMovieViewerTransport {\n /**\n * A synchronized sound source.\n *\n * @evidence contracts/development/common.md#meaningful-documentation Documents the member contract in its own summary: A synchronized sound source.\n * @evidence contracts/development/design.md#principled-representation Represents A synchronized sound source: interface of 2 members (`play`, `pause`); units and frames named in its text: second, seconds. It has no optional member, so no absent-value state combines with another.\n * @evidence contracts/development/design.md#minimal-and-owned-surface Owned by the module that declares `IAudio` in packages/viewer/src/transport/AutoMovieViewerTransport.ts; its surface is the 2 members listed and the text shows 0 other files naming it, so no member is declared for a presumed future need.\n * @evidence contracts/development/design.md#prohibited-design-shortcuts Scanning the declaration finds no `any`, no `unknown`, no index signature and no cast; it duplicates no type that another owner declares as far as a name search shows.\n */\n export interface IAudio {\n /**\n * Start from a film second at a speed; resolves once sounding.\n *\n * @evidence contracts/development/common.md#meaningful-documentation Documents the member contract in its own summary: Start from a film second at a speed; resolves once sounding.\n * @evidenceExclude contracts/development/implementation.md#principled-implementation Signature only: this declaration has no body, so it carries no method of its own and each implementation answers for its own algorithm, structure and resources; the contract it fixes is: Start from a film second at a speed; resolves once sounding.\n * @evidenceExclude contracts/development/implementation.md#clear-and-simple-structure Signature only: this declaration has no body, so it carries no method of its own and each implementation answers for its own algorithm, structure and resources; it declares one operation and adds no layer.\n * @evidenceExclude contracts/development/implementation.md#prohibited-implementation-shortcuts Signature only: this declaration has no body, so it carries no method of its own and each implementation answers for its own algorithm, structure and resources; nothing here can special-case a value.\n * @evidenceExclude contracts/development/implementation.md#efficient-algorithms Signature only: this declaration has no body, so it carries no method of its own and each implementation answers for its own algorithm, structure and resources; the cost an implementation may incur is not constrained by this signature.\n * @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work Signature only: this declaration has no body, so it carries no method of its own and each implementation answers for its own algorithm, structure and resources; it coordinates no work itself.\n * @evidenceExclude contracts/development/implementation.md#bound-retention-and-release-resources Signature only: this declaration has no body, so it carries no method of its own and each implementation answers for its own algorithm, structure and resources; it owns no state, handle or task.\n */\n play(seconds: number, rate: number): Promise<void>;\n\n /**\n * Stop any current sound.\n *\n * @evidence contracts/development/common.md#meaningful-documentation Documents the member contract in its own summary: Stop any current sound.\n * @evidenceExclude contracts/development/implementation.md#principled-implementation Signature only: this declaration has no body, so it carries no method of its own and each implementation answers for its own algorithm, structure and resources; the contract it fixes is: Stop any current sound.\n * @evidenceExclude contracts/development/implementation.md#clear-and-simple-structure Signature only: this declaration has no body, so it carries no method of its own and each implementation answers for its own algorithm, structure and resources; it declares one operation and adds no layer.\n * @evidenceExclude contracts/development/implementation.md#prohibited-implementation-shortcuts Signature only: this declaration has no body, so it carries no method of its own and each implementation answers for its own algorithm, structure and resources; nothing here can special-case a value.\n * @evidenceExclude contracts/development/implementation.md#efficient-algorithms Signature only: this declaration has no body, so it carries no method of its own and each implementation answers for its own algorithm, structure and resources; the cost an implementation may incur is not constrained by this signature.\n * @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work Signature only: this declaration has no body, so it carries no method of its own and each implementation answers for its own algorithm, structure and resources; it coordinates no work itself.\n * @evidenceExclude contracts/development/implementation.md#bound-retention-and-release-resources Signature only: this declaration has no body, so it carries no method of its own and each implementation answers for its own algorithm, structure and resources; it owns no state, handle or task.\n */\n pause(): void;\n }\n\n /**\n * Transport settings and collaborators.\n *\n * @evidence contracts/development/common.md#meaningful-documentation Documents the member contract in its own summary: Transport settings and collaborators.\n * @evidence contracts/development/design.md#principled-representation Represents Transport settings and collaborators: interface of 6 members (`place`, `available`, `fps`, `speeds`, `audio`, `now`); units and frames named in its text: second, seconds, frame, frames, milliseconds. Optional members `speeds`, `audio`, `now` express documented absence, and the ranges its member docs state are left to runtime validation.\n * @evidence contracts/development/design.md#minimal-and-owned-surface Owned by the module that declares `IOptions` in packages/viewer/src/transport/AutoMovieViewerTransport.ts; its surface is the 6 members listed and the text shows 14 other files naming it, mostly packages/human (10), test (3), packages/engine (1), so no member is declared for a presumed future need.\n * @evidence contracts/development/design.md#prohibited-design-shortcuts Scanning the declaration finds no `any`, no `unknown`, no index signature and no cast; 3 optional members (`speeds`, `audio`, `now`) are independent fields rather than alternatives of one another as far as their docs state; it duplicates no type that another owner declares as far as a name search shows.\n */\n export interface IOptions {\n /**\n * The synchronous producer that displays a second; throws on failure.\n *\n * @evidence contracts/development/common.md#meaningful-documentation Documents the member contract in its own summary: The synchronous producer that displays a second; throws on failure.\n * @evidenceExclude contracts/development/implementation.md#principled-implementation Signature only: this declaration has no body, so it carries no method of its own and each implementation answers for its own algorithm, structure and resources; the contract it fixes is: The synchronous producer that displays a second; throws on failure.\n * @evidenceExclude contracts/development/implementation.md#clear-and-simple-structure Signature only: this declaration has no body, so it carries no method of its own and each implementation answers for its own algorithm, structure and resources; it declares one operation and adds no layer.\n * @evidenceExclude contracts/development/implementation.md#prohibited-implementation-shortcuts Signature only: this declaration has no body, so it carries no method of its own and each implementation answers for its own algorithm, structure and resources; nothing here can special-case a value.\n * @evidenceExclude contracts/development/implementation.md#efficient-algorithms Signature only: this declaration has no body, so it carries no method of its own and each implementation answers for its own algorithm, structure and resources; the cost an implementation may incur is not constrained by this signature.\n * @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work Signature only: this declaration has no body, so it carries no method of its own and each implementation answers for its own algorithm, structure and resources; it coordinates no work itself.\n * @evidenceExclude contracts/development/implementation.md#bound-retention-and-release-resources Signature only: this declaration has no body, so it carries no method of its own and each implementation answers for its own algorithm, structure and resources; it owns no state, handle or task.\n */\n place(seconds: number): void;\n\n /** Available source range, seconds. */\n available: readonly [number, number];\n\n /** Frame grid of playback, frames per second. */\n fps: number;\n\n /** Supported review speeds; 0.25, 0.5 and 1 by default. */\n speeds?: readonly number[];\n\n /** Optional sound source. */\n audio?: IAudio;\n\n /**\n * Clock in milliseconds; `performance.now` by default.\n *\n * @evidence contracts/development/common.md#meaningful-documentation Documents the member contract in its own summary: Clock in milliseconds; `performance.now` by default.\n * @evidenceExclude contracts/development/implementation.md#principled-implementation Signature only: this declaration has no body, so it carries no method of its own and each implementation answers for its own algorithm, structure and resources; the contract it fixes is: Clock in milliseconds; `performance.now` by default.\n * @evidenceExclude contracts/development/implementation.md#clear-and-simple-structure Signature only: this declaration has no body, so it carries no method of its own and each implementation answers for its own algorithm, structure and resources; it declares one operation and adds no layer.\n * @evidenceExclude contracts/development/implementation.md#prohibited-implementation-shortcuts Signature only: this declaration has no body, so it carries no method of its own and each implementation answers for its own algorithm, structure and resources; nothing here can special-case a value.\n * @evidenceExclude contracts/development/implementation.md#efficient-algorithms Signature only: this declaration has no body, so it carries no method of its own and each implementation answers for its own algorithm, structure and resources; the cost an implementation may incur is not constrained by this signature.\n * @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work Signature only: this declaration has no body, so it carries no method of its own and each implementation answers for its own algorithm, structure and resources; it coordinates no work itself.\n * @evidenceExclude contracts/development/implementation.md#bound-retention-and-release-resources Signature only: this declaration has no body, so it carries no method of its own and each implementation answers for its own algorithm, structure and resources; it owns no state, handle or task.\n */\n now?(): number;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAkBA,IAAa,2BAAb,MAAsC;;CAEpC;;CAGA,UAA0B;;CAG1B,QAAwB;;CAGxB,QAA8B;;CAG9B;;CAGA;;CAGA,OAAuB;;CAGvB,OAAuB;;CAGvB,SAAyB;;CAGzB,aAA6B;;CAG7B;;;;;;CAOA,YAAmB,SAA4C;EAC7D,MAAM,YAAuC,QAAQ;EACrD,IACE,CAAC,UAAU,MAAM,OAAO,QAAQ,KAChC,UAAU,KAAK,KACf,UAAU,MAAM,UAAU,MAC1B,EAAE,QAAQ,MAAM,IAEhB,MAAM,IAAI,MAAM,uCAAuC;EACzD,KAAK,UAAU;EACf,KAAK,YAAY,OAAO,OAAO,CAAC,UAAU,IAAI,UAAU,EAAE,CAGzD;EACD,KAAK,UAAU,UAAU;EACzB,KAAK,WAAW,CAAC,UAAU,IAAI,UAAU,EAAE;CAC7C;;CAGA,IAAW,QAAgB;EACzB,OAAO,KAAK;CACd;;CAGA,IAAW,MAAM,OAAe;EAC9B,IAAI,EAAE,KAA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[],"sources":["../../src/transport/AutoMovieViewerTransport.ts"],"sourcesContent":["/**\n * One authoritative review clock for a deterministic film producer: exact\n * seeks, interval playback at a review speed, optional synchronized sound and\n * capture freezes, all through one synchronous `place(seconds)` producer.\n *\n * A placement commits the displayed second only after the producer succeeds, so\n * a failed draw never masquerades as a sought frame. Playback anchors one\n * wall-clock origin (no integrated render deltas), snaps to the frame grid of\n * `fps` and draws the interval's exact end before pausing. Sound starts before\n * the anchor and a generation token cancels a start that a later pause, seek or\n * speed change superseded. The clock source is injectable, so the logic runs in\n * milliseconds without a browser.\n */\nexport class AutoMovieViewerTransport {\n /** Last successfully displayed second. */\n public seconds: number;\n\n /** Whether the clock is running. */\n public playing: boolean = false;\n\n /** Whether playback starts the sound source. */\n public sound: boolean = true;\n\n /** Last producer or sound refusal. */\n public error: string | null = null;\n\n /** Closed playback interval inside the available range. */\n public interval: [number, number];\n\n /** The source's available range; review bounds cannot widen it. */\n public readonly available: readonly [number, number];\n\n /** Current review speed. */\n private rate: number = 1;\n\n /** Wall anchor, milliseconds. */\n private wall: number = 0;\n\n /** Film second at the anchor. */\n private origin: number = 0;\n\n /** Pending start generation. */\n private generation: number = 0;\n\n /** Borrowed collaborators and settings. */\n private readonly options: AutoMovieViewerTransport.IOptions;\n\n /**\n * A transport over a producer.\n *\n * @param options Producer, range, frame rate, speeds, sound and clock.\n */\n public constructor(options: AutoMovieViewerTransport.IOptions) {\n const available: readonly [number, number] = options.available;\n if (available[0] < 0 || available[0] >= available[1] || !(options.fps > 0))\n throw new Error(\"Invalid transport range or frame rate\");\n this.options = options;\n this.available = Object.freeze([available[0], available[1]]);\n this.seconds = available[0];\n this.interval = [available[0], available[1]];\n }\n\n /** Current review speed, film seconds per wall second. */\n public get speed(): number {\n return this.rate;\n }\n\n /** Replace the review speed; pauses first, and refuses an unsupported speed. */\n public set speed(value: number) {\n if (!(this.options.speeds ?? [0.25, 0.5, 1]).includes(value))\n throw new Error(`Unsupported review speed ${value}`);\n this.pause();\n this.rate = value;\n }\n\n /**\n * Start playback from the committed second, after the sound starts.\n *\n * @returns When the clock is anchored, or the start was superseded.\n */\n public async play(): Promise<void> {\n this.pause();\n if (this.seconds < this.interval[0] || this.seconds >= this.interval[1])\n this.seek(this.interval[0]);\n const generation: number = ++this.generation;\n this.error = null;\n try {\n if (this.sound && this.options.audio)\n await this.options.audio.play(this.seconds, this.rate);\n if (generation !== this.generation) return;\n this.wall = this.now();\n this.origin = this.seconds;\n this.playing = true;\n } catch (error: unknown) {\n if (generation !== this.generation) return;\n this.error = error instanceof Error ? error.message : String(error);\n this.pause();\n throw error;\n }\n }\n\n /** Stop playback and sound without moving the displayed second. */\n public pause(): void {\n this.generation++;\n this.playing = false;\n this.options.audio?.pause();\n }\n\n /**\n * Place an exact second inside the available range.\n *\n * @param seconds The second.\n */\n public seek(seconds: number): void {\n if (seconds < this.available[0] || seconds > this.available[1])\n throw new Error(\n `Seek must remain inside [${this.available[0]},${this.available[1]}]`,\n );\n this.pause();\n try {\n this.options.place(seconds);\n this.seconds = seconds;\n this.error = null;\n } catch (error: unknown) {\n this.error = error instanceof Error ? error.message : String(error);\n throw error;\n }\n }\n\n /**\n * Advance a running clock to the frame due now; call once per display frame.\n *\n * @returns Whether a new frame was placed.\n */\n public tick(): boolean {\n if (!this.playing) return false;\n const fps: number = this.options.fps;\n const actual: number = Math.min(\n this.interval[1],\n this.origin + ((this.now() - this.wall) * this.rate) / 1000,\n );\n const seconds: number =\n actual === this.interval[1]\n ? actual\n : Math.max(this.origin, Math.floor(actual * fps) / fps);\n let changed: boolean = false;\n try {\n if (seconds !== this.seconds) {\n this.options.place(seconds);\n this.seconds = seconds;\n changed = true;\n }\n if (actual === this.interval[1]) this.pause();\n return changed;\n } catch (error: unknown) {\n this.error = error instanceof Error ? error.message : String(error);\n this.pause();\n throw error;\n }\n }\n\n /**\n * Select a playback interval by placing its start first.\n *\n * @param start Start second.\n * @param end End second, after the start.\n */\n public setInterval(start: number, end: number): void {\n if (start < this.available[0] || end > this.available[1] || end <= start)\n throw new Error(\n `Review interval must remain inside [${this.available[0]},${this.available[1]}]`,\n );\n this.seek(start);\n this.interval = [start, end];\n }\n\n /**\n * Pause for a capture and return a once-only release that may resume.\n *\n * @returns The release; `true` resumes a formerly playing clock.\n */\n public freeze(): (resume: boolean) => void {\n const playing: boolean = this.playing;\n this.pause();\n let released: boolean = false;\n return (resume: boolean): void => {\n if (released) return;\n released = true;\n if (resume && playing) void this.play().catch((): void => {});\n };\n }\n\n /** The injected or performance clock, milliseconds. */\n private now(): number {\n return this.options.now?.() ?? performance.now();\n }\n}\n/** Companion types of {@link AutoMovieViewerTransport}. */\nexport namespace AutoMovieViewerTransport {\n /** A synchronized sound source. */\n export interface IAudio {\n /** Start from a film second at a speed; resolves once sounding. */\n play(seconds: number, rate: number): Promise<void>;\n\n /** Stop any current sound. */\n pause(): void;\n }\n\n /** Transport settings and collaborators. */\n export interface IOptions {\n /** The synchronous producer that displays a second; throws on failure. */\n place(seconds: number): void;\n\n /** Available source range, seconds. */\n available: readonly [number, number];\n\n /** Frame grid of playback, frames per second. */\n fps: number;\n\n /** Supported review speeds; 0.25, 0.5 and 1 by default. */\n speeds?: readonly number[];\n\n /** Optional sound source. */\n audio?: IAudio;\n\n /** Clock in milliseconds; `performance.now` by default. */\n now?(): number;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;AAaA,IAAa,2BAAb,MAAsC;;CAEpC;;CAGA,UAA0B;;CAG1B,QAAwB;;CAGxB,QAA8B;;CAG9B;;CAGA;;CAGA,OAAuB;;CAGvB,OAAuB;;CAGvB,SAAyB;;CAGzB,aAA6B;;CAG7B;;;;;;CAOA,YAAmB,SAA4C;EAC7D,MAAM,YAAuC,QAAQ;EACrD,IAAI,UAAU,KAAK,KAAK,UAAU,MAAM,UAAU,MAAM,EAAE,QAAQ,MAAM,IACtE,MAAM,IAAI,MAAM,uCAAuC;EACzD,KAAK,UAAU;EACf,KAAK,YAAY,OAAO,OAAO,CAAC,UAAU,IAAI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}
@@ -1,20 +1,13 @@
1
1
  /**
2
2
  * The review interval and speed a URL requests, read only after the source's
3
- * available range is known: missing bounds select the available range and
4
- * speed 1, while an empty, nonfinite or out-of-range value refuses instead
5
- * of being clamped.
3
+ * available range is known: missing bounds select the available range and speed
4
+ * 1, while an empty, non-decimal or out-of-range value refuses instead of being
5
+ * clamped.
6
6
  *
7
7
  * @param params The URL's search parameters `start`, `end` and `speed`.
8
8
  * @param available The available range, seconds.
9
9
  * @param speeds Supported speeds; 0.25, 0.5 and 1 by default.
10
10
  * @returns The interval and speed.
11
- * @evidence contracts/development/common.md#meaningful-documentation Gives the purpose (The review interval and speed a URL requests, read only after the source's available range is known: missing bounds select the available range and speed 1, while an empty, nonfinite or out-of-range value refuses instead of being clamped) and documents parameters `params`, `available`, `speeds`, the returned value as stated in this comment.
12
- * @evidence contracts/development/implementation.md#principled-implementation Implements the documented behavior (The review interval and speed a URL requests, read only after the source's available range is known: missing bounds select the available range and speed 1, while an empty, nonfinite or out-of-range value refuses instead of being clamped) directly over its typed inputs (`params`, `available`, `speeds`) as a fixed number of statements with no loop or recursion in the body, delegating to `params.get`, `text.trim`, `Number`, `Number.isFinite`, `read`; the premises are the units, frames and ranges stated in its parameter documentation, enforced only where the body throws (3 throw sites). Apart from structural 0, 1 and 2 the body uses no numeric literal.
13
- * @evidence contracts/development/implementation.md#clear-and-simple-structure One operation of 23 lines and 6 top-level statements that reuses `params.get`, `text.trim`, `Number`, `Number.isFinite`, `read` from their owners instead of copying them; it adds no option, layer or abstraction beyond its documented parameters.
14
- * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts Scanning the body finds no `any`, type assertion, non-null assertion, suppression directive or TODO, and no branch keyed on a consumer, fixture or expected answer; values come from its parameters.
15
- * @evidence contracts/development/implementation.md#efficient-algorithms Cost is driven by the sizes of `params`, `available`, `speeds`; the dominant cost is a fixed number of statements with no loop or recursion in the body, performed once per call with 4 allocation sites (literals and constructed values). No speedup is claimed and none is measured.
16
- * @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work The operation coordinates no requests, phases or consumers and holds no cache: each call recomputes from its arguments and shares nothing, which is correct because its result depends only on them.
17
- * @evidenceExclude contracts/development/implementation.md#bound-retention-and-release-resources The function acquires no handle, timer, listener or task and keeps no state between calls; its 4 allocation sites become the returned value or die with the call, so nothing grows.
18
11
  */
19
12
  export declare function readAutoMovieReviewInterval(params: URLSearchParams, available: readonly [number, number], speeds?: readonly number[]): {
20
13
  start: number;
@@ -3,31 +3,24 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.readAutoMovieReviewInterval = readAutoMovieReviewInterval;
4
4
  /**
5
5
  * The review interval and speed a URL requests, read only after the source's
6
- * available range is known: missing bounds select the available range and
7
- * speed 1, while an empty, nonfinite or out-of-range value refuses instead
8
- * of being clamped.
6
+ * available range is known: missing bounds select the available range and speed
7
+ * 1, while an empty, non-decimal or out-of-range value refuses instead of being
8
+ * clamped.
9
9
  *
10
10
  * @param params The URL's search parameters `start`, `end` and `speed`.
11
11
  * @param available The available range, seconds.
12
12
  * @param speeds Supported speeds; 0.25, 0.5 and 1 by default.
13
13
  * @returns The interval and speed.
14
- * @evidence contracts/development/common.md#meaningful-documentation Gives the purpose (The review interval and speed a URL requests, read only after the source's available range is known: missing bounds select the available range and speed 1, while an empty, nonfinite or out-of-range value refuses instead of being clamped) and documents parameters `params`, `available`, `speeds`, the returned value as stated in this comment.
15
- * @evidence contracts/development/implementation.md#principled-implementation Implements the documented behavior (The review interval and speed a URL requests, read only after the source's available range is known: missing bounds select the available range and speed 1, while an empty, nonfinite or out-of-range value refuses instead of being clamped) directly over its typed inputs (`params`, `available`, `speeds`) as a fixed number of statements with no loop or recursion in the body, delegating to `params.get`, `text.trim`, `Number`, `Number.isFinite`, `read`; the premises are the units, frames and ranges stated in its parameter documentation, enforced only where the body throws (3 throw sites). Apart from structural 0, 1 and 2 the body uses no numeric literal.
16
- * @evidence contracts/development/implementation.md#clear-and-simple-structure One operation of 23 lines and 6 top-level statements that reuses `params.get`, `text.trim`, `Number`, `Number.isFinite`, `read` from their owners instead of copying them; it adds no option, layer or abstraction beyond its documented parameters.
17
- * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts Scanning the body finds no `any`, type assertion, non-null assertion, suppression directive or TODO, and no branch keyed on a consumer, fixture or expected answer; values come from its parameters.
18
- * @evidence contracts/development/implementation.md#efficient-algorithms Cost is driven by the sizes of `params`, `available`, `speeds`; the dominant cost is a fixed number of statements with no loop or recursion in the body, performed once per call with 4 allocation sites (literals and constructed values). No speedup is claimed and none is measured.
19
- * @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work The operation coordinates no requests, phases or consumers and holds no cache: each call recomputes from its arguments and shares nothing, which is correct because its result depends only on them.
20
- * @evidenceExclude contracts/development/implementation.md#bound-retention-and-release-resources The function acquires no handle, timer, listener or task and keeps no state between calls; its 4 allocation sites become the returned value or die with the call, so nothing grows.
21
14
  */
22
15
  function readAutoMovieReviewInterval(params, available, speeds = [0.25, 0.5, 1]) {
23
16
  const read = (name, fallback) => {
24
17
  const text = params.get(name);
25
- if (text !== null && !text.trim())
26
- throw new Error(`URL ${name} must contain a number`);
27
- const value = text === null ? fallback : Number(text);
28
- if (!Number.isFinite(value))
29
- throw new Error(`URL ${name} must be finite`);
30
- return value;
18
+ if (text === null)
19
+ return fallback;
20
+ // A decimal spells a number; an overflowing one leaves the range below.
21
+ if (!DECIMAL.test(text))
22
+ throw new Error(`URL ${name} must contain a decimal number`);
23
+ return Number(text);
31
24
  };
32
25
  const start = read("start", available[0]);
33
26
  const end = read("end", available[1]);
@@ -39,4 +32,6 @@ function readAutoMovieReviewInterval(params, available, speeds = [0.25, 0.5, 1])
39
32
  throw new Error(`URL requires ${available[0]} <= start < end <= ${available[1]} and a speed of ${speeds.join(", ")}`);
40
33
  return { start, end, speed };
41
34
  }
35
+ /** A decimal number, optionally signed, with an optional exponent. */
36
+ const DECIMAL = /^\s*[+-]?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?\s*$/iu;
42
37
  //# sourceMappingURL=readAutoMovieReviewInterval.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"readAutoMovieReviewInterval.js","sourceRoot":"","sources":["../../src/transport/readAutoMovieReviewInterval.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,qCACE,MAAuB,EACvB,SAAoC,EACpC,MAAM,GAAsB,CAAC,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC;IAE1C,MAAM,IAAI,GAAG,CAAC,IAAY,EAAE,QAAgB,EAAU,EAAE;QACtD,MAAM,IAAI,GAAkB,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QAC7C,IAAI,IAAI,KAAK,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE;YAC/B,MAAM,IAAI,KAAK,CAAC,OAAO,IAAI,wBAAwB,CAAC,CAAC;QACvD,MAAM,KAAK,GAAW,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QAC9D,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC;YAAE,MAAM,IAAI,KAAK,CAAC,OAAO,IAAI,iBAAiB,CAAC,CAAC;QAC3E,OAAO,KAAK,CAAC;IACf,CAAC,CAAC;IACF,MAAM,KAAK,GAAW,IAAI,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;IAClD,MAAM,GAAG,GAAW,IAAI,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;IAC9C,MAAM,KAAK,GAAW,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;IACvC,IACE,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC;QACvB,KAAK,GAAG,SAAS,CAAC,CAAC,CAAC;QACpB,GAAG,GAAG,SAAS,CAAC,CAAC,CAAC;QAClB,KAAK,IAAI,GAAG;Q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,IAAI,KAAK,CACb,gBAAgB,SAAS,CAAC,CAAC,CAAC,sBAAsB,SAAS,CAAC,CAAC,CAAC,mBAAmB,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CACrG,CAAC;IACJ,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC;AAC/B,CAAC;AAED,sEAAsE;AACtE,MAAM,OAAO,GAAW,kDAAkD,CAAC"}
@@ -1,21 +1,14 @@
1
1
  // src/transport/readAutoMovieReviewInterval.ts
2
2
  /**
3
3
  * The review interval and speed a URL requests, read only after the source's
4
- * available range is known: missing bounds select the available range and
5
- * speed 1, while an empty, nonfinite or out-of-range value refuses instead
6
- * of being clamped.
4
+ * available range is known: missing bounds select the available range and speed
5
+ * 1, while an empty, non-decimal or out-of-range value refuses instead of being
6
+ * clamped.
7
7
  *
8
8
  * @param params The URL's search parameters `start`, `end` and `speed`.
9
9
  * @param available The available range, seconds.
10
10
  * @param speeds Supported speeds; 0.25, 0.5 and 1 by default.
11
11
  * @returns The interval and speed.
12
- * @evidence contracts/development/common.md#meaningful-documentation Gives the purpose (The review interval and speed a URL requests, read only after the source's available range is known: missing bounds select the available range and speed 1, while an empty, nonfinite or out-of-range value refuses instead of being clamped) and documents parameters `params`, `available`, `speeds`, the returned value as stated in this comment.
13
- * @evidence contracts/development/implementation.md#principled-implementation Implements the documented behavior (The review interval and speed a URL requests, read only after the source's available range is known: missing bounds select the available range and speed 1, while an empty, nonfinite or out-of-range value refuses instead of being clamped) directly over its typed inputs (`params`, `available`, `speeds`) as a fixed number of statements with no loop or recursion in the body, delegating to `params.get`, `text.trim`, `Number`, `Number.isFinite`, `read`; the premises are the units, frames and ranges stated in its parameter documentation, enforced only where the body throws (3 throw sites). Apart from structural 0, 1 and 2 the body uses no numeric literal.
14
- * @evidence contracts/development/implementation.md#clear-and-simple-structure One operation of 23 lines and 6 top-level statements that reuses `params.get`, `text.trim`, `Number`, `Number.isFinite`, `read` from their owners instead of copying them; it adds no option, layer or abstraction beyond its documented parameters.
15
- * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts Scanning the body finds no `any`, type assertion, non-null assertion, suppression directive or TODO, and no branch keyed on a consumer, fixture or expected answer; values come from its parameters.
16
- * @evidence contracts/development/implementation.md#efficient-algorithms Cost is driven by the sizes of `params`, `available`, `speeds`; the dominant cost is a fixed number of statements with no loop or recursion in the body, performed once per call with 4 allocation sites (literals and constructed values). No speedup is claimed and none is measured.
17
- * @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work The operation coordinates no requests, phases or consumers and holds no cache: each call recomputes from its arguments and shares nothing, which is correct because its result depends only on them.
18
- * @evidenceExclude contracts/development/implementation.md#bound-retention-and-release-resources The function acquires no handle, timer, listener or task and keeps no state between calls; its 4 allocation sites become the returned value or die with the call, so nothing grows.
19
12
  */
20
13
  function readAutoMovieReviewInterval(params, available, speeds = [
21
14
  .25,
@@ -24,10 +17,9 @@ function readAutoMovieReviewInterval(params, available, speeds = [
24
17
  ]) {
25
18
  const read = (name, fallback) => {
26
19
  const text = params.get(name);
27
- if (text !== null && !text.trim()) throw new Error(`URL ${name} must contain a number`);
28
- const value = text === null ? fallback : Number(text);
29
- if (!Number.isFinite(value)) throw new Error(`URL ${name} must be finite`);
30
- return value;
20
+ if (text === null) return fallback;
21
+ if (!DECIMAL.test(text)) throw new Error(`URL ${name} must contain a decimal number`);
22
+ return Number(text);
31
23
  };
32
24
  const start = read("start", available[0]);
33
25
  const end = read("end", available[1]);
@@ -39,6 +31,8 @@ function readAutoMovieReviewInterval(params, available, speeds = [
39
31
  speed
40
32
  };
41
33
  }
34
+ /** A decimal number, optionally signed, with an optional exponent. */
35
+ const DECIMAL = /^\s*[+-]?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?\s*$/iu;
42
36
  export { readAutoMovieReviewInterval };
43
37
 
44
38
  //# sourceMappingURL=readAutoMovieReviewInterval.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"readAutoMovieReviewInterval.mjs","names":[],"sources":["../../src/transport/readAutoMovieReviewInterval.ts"],"sourcesContent":["/**\n * The review interval and speed a URL requests, read only after the source's\n * available range is known: missing bounds select the available range and\n * speed 1, while an empty, nonfinite or out-of-range value refuses instead\n * of being clamped.\n *\n * @param params The URL's search parameters `start`, `end` and `speed`.\n * @param available The available range, seconds.\n * @param speeds Supported speeds; 0.25, 0.5 and 1 by default.\n * @returns The interval and speed.\n * @evidence contracts/development/common.md#meaningful-documentation Gives the purpose (The review interval and speed a URL requests, read only after the source's available range is known: missing bounds select the available range and speed 1, while an empty, nonfinite or out-of-range value refuses instead of being clamped) and documents parameters `params`, `available`, `speeds`, the returned value as stated in this comment.\n * @evidence contracts/development/implementation.md#principled-implementation Implements the documented behavior (The review interval and speed a URL requests, read only after the source's available range is known: missing bounds select the available range and speed 1, while an empty, nonfinite or out-of-range value refuses instead of being clamped) directly over its typed inputs (`params`, `available`, `speeds`) as a fixed number of statements with no loop or recursion in the body, delegating to `params.get`, `text.trim`, `Number`, `Number.isFinite`, `read`; the premises are the units, frames and ranges stated in its parameter documentation, enforced only where the body throws (3 throw sites). Apart from structural 0, 1 and 2 the body uses no numeric literal.\n * @evidence contracts/development/implementation.md#clear-and-simple-structure One operation of 23 lines and 6 top-level statements that reuses `params.get`, `text.trim`, `Number`, `Number.isFinite`, `read` from their owners instead of copying them; it adds no option, layer or abstraction beyond its documented parameters.\n * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts Scanning the body finds no `any`, type assertion, non-null assertion, suppression directive or TODO, and no branch keyed on a consumer, fixture or expected answer; values come from its parameters.\n * @evidence contracts/development/implementation.md#efficient-algorithms Cost is driven by the sizes of `params`, `available`, `speeds`; the dominant cost is a fixed number of statements with no loop or recursion in the body, performed once per call with 4 allocation sites (literals and constructed values). No speedup is claimed and none is measured.\n * @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work The operation coordinates no requests, phases or consumers and holds no cache: each call recomputes from its arguments and shares nothing, which is correct because its result depends only on them.\n * @evidenceExclude contracts/development/implementation.md#bound-retention-and-release-resources The function acquires no handle, timer, listener or task and keeps no state between calls; its 4 allocation sites become the returned value or die with the call, so nothing grows.\n */\nexport function readAutoMovieReviewInterval(\n params: URLSearchParams,\n available: readonly [number, number],\n speeds: readonly number[] = [0.25, 0.5, 1],\n): { start: number; end: number; speed: number } {\n const read = (name: string, fallback: number): number => {\n const text: string | null = params.get(name);\n if (text !== null && !text.trim())\n throw new Error(`URL ${name} must contain a number`);\n const value: number = text === null ? fallback : Number(text);\n if (!Number.isFinite(value)) throw new Error(`URL ${name} must be finite`);\n return value;\n };\n const start: number = read(\"start\", available[0]);\n const end: number = read(\"end\", available[1]);\n const speed: number = read(\"speed\", 1);\n if (\n !speeds.includes(speed) ||\n start < available[0] ||\n end > available[1] ||\n start >= end\n )\n throw new Error(\n `URL requires ${available[0]} <= start < end <= ${available[1]} and a speed of ${speeds.join(\", \")}`,\n );\n return { start, end, speed };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAkBA,SAAgB,4BACd,QACA,WACA,SAA4B;CAAC;CAAM;CAAK;AAAC,GACM;CAC/C,MAAM,QAAQ,MAAc,aAA6B;EACvD,MAAM,OAAsB,OAAO,IAAI,IAAI;EAC3C,IAAI,SAAS,QAAQ,CAAC,KAAK,KAAK,GAC9B,MAAM,IAAI,MAAM,OAAO,KAAK,uBAAuB;EACrD,MAAM,QAAgB,SAAS,OAAO,WAAW,OAAO,IAAI;EAC5D,IAAI,CAAC,OAAO,SAAS,KAAK,GAAG,MAAM,IAAI,MAAM,OAAO,KAAK,gBAAgB;EACzE,OAAO;CACT;CACA,MAAM,QAAgB,KAAK,SAAS,UAAU,EAAE;CAChD,MAAM,MAAc,KAAK,OAAO,UAAU,EAAE;CAC5C,MAAM,QAAgB,KAAK,SAAS,CAAC;CACrC,IACE,CAAC,OAAO,SAAS,KAAK,KACtB,QAAQ,UAAU,MAClB,MAAM,UAAU,MAChB,SAAS,KAET,MAAM,IAAI,MACR,gBAAgB,UAAU,GAAG,qBAAqB,UAAU,GAAG,kBAAkB,OAAO,KAAK,IAAI,GACnG;CACF,OAAO;EAAE;EAAO;EAAK;CAAM;AAC7B"}
1
+ {"version":3,"file":"readAutoMovieReviewInterval.mjs","names":[],"sources":["../../src/transport/readAutoMovieReviewInterval.ts"],"sourcesContent":["/**\n * The review interval and speed a URL requests, read only after the source's\n * available range is known: missing bounds select the available range and speed\n * 1, while an empty, non-decimal or out-of-range value refuses instead of being\n * clamped.\n *\n * @param params The URL's search parameters `start`, `end` and `speed`.\n * @param available The available range, seconds.\n * @param speeds Supported speeds; 0.25, 0.5 and 1 by default.\n * @returns The interval and speed.\n */\nexport function readAutoMovieReviewInterval(\n params: URLSearchParams,\n available: readonly [number, number],\n speeds: readonly number[] = [0.25, 0.5, 1],\n): { start: number; end: number; speed: number } {\n const read: (name: string, fallback: number) => number = (\n name: string,\n fallback: number,\n ): number => {\n const text: string | null = params.get(name);\n if (text === null) return fallback;\n // A decimal spells a number; an overflowing one leaves the range below.\n if (!DECIMAL.test(text))\n throw new Error(`URL ${name} must contain a decimal number`);\n return Number(text);\n };\n const start: number = read(\"start\", available[0]);\n const end: number = read(\"end\", available[1]);\n const speed: number = read(\"speed\", 1);\n if (\n !speeds.includes(speed) ||\n start < available[0] ||\n end > available[1] ||\n start >= end\n )\n throw new Error(\n `URL requires ${available[0]} <= start < end <= ${available[1]} and a speed of ${speeds.join(\", \")}`,\n );\n return { start, end, speed };\n}\n\n/** A decimal number, optionally signed, with an optional exponent. */\nconst DECIMAL: RegExp = /^\\s*[+-]?(?:\\d+\\.?\\d*|\\.\\d+)(?:e[+-]?\\d+)?\\s*$/iu;\n"],"mappings":";;;;;;;;;;;;AAWA,SAAgB,4BACd,QACA,WACA,SAA4B;CAAC;CAAM;CAAK;AAAC,GACM;CAC/C,MAAM,QACJ,MACA,aACW;EACX,MAAM,OAAsB,OAAO,IAAI,IAAI;EAC3C,IAAI,SAAS,MAAM,OAAO;EAE1B,IAAI,CAAC,QAAQ,KAAK,IAAI,GACpB,MAAM,IAAI,MAAM,OAAO,KAAK,+BAA+B;EAC7D,OAAO,OAAO,IAAI;CACpB;CACA,MAAM,QAAgB,KAAK,SAAS,UAAU,EAAE;CAChD,MAAM,MAAc,KAAK,OAAO,UAAU,EAAE;CAC5C,MAAM,QAAgB,KAAK,SAAS,CAAC;CACrC,IACE,CAAC,OAAO,SAAS,KAAK,KACtB,QAAQ,UAAU,MAClB,MAAM,UAAU,MAChB,SAAS,KAET,MAAM,IAAI,MACR,gBAAgB,UAAU,GAAG,qBAAqB,UAAU,GAAG,kBAAkB,OAAO,KAAK,IAAI,GACnG;CACF,OAAO;EAAE;EAAO;EAAK;CAAM;AAC7B;;AAGA,MAAM,UAAkB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@automovie/viewer",
3
- "version": "0.3.4",
3
+ "version": "0.4.0",
4
4
  "description": "automovie viewer: the interactive display, a React inspector and an imperative mount over the render package's three.js scene (not an editor)",
5
5
  "main": "lib/index.js",
6
6
  "exports": {
@@ -9,6 +9,10 @@
9
9
  "import": "./lib/index.mjs",
10
10
  "default": "./lib/index.js"
11
11
  },
12
+ "./internal": {
13
+ "types": "./lib/internal.d.ts",
14
+ "default": "./lib/internal.js"
15
+ },
12
16
  "./package.json": "./package.json"
13
17
  },
14
18
  "files": [
@@ -29,8 +33,8 @@
29
33
  "url": "https://github.com/samchon/automovie"
30
34
  },
31
35
  "dependencies": {
32
- "@automovie/render": "^0.3.4",
33
- "three": "^0.186.0"
36
+ "@automovie/render": "^0.4.0",
37
+ "three": "^0.187.0"
34
38
  },
35
39
  "peerDependencies": {
36
40
  "react": "^19.2.0",
@@ -39,16 +43,16 @@
39
43
  "devDependencies": {
40
44
  "@types/react": "^19.2.0",
41
45
  "@types/react-dom": "^19.2.0",
42
- "@types/three": "^0.186.0",
46
+ "@types/three": "^0.187.0",
43
47
  "react": "^19.2.0",
44
48
  "react-dom": "^19.2.0",
45
49
  "rimraf": "^6.0.1",
46
50
  "rolldown": "^1.1.5",
47
- "ttsc": "^0.37.1",
51
+ "ttsc": "^0.38.1",
48
52
  "typescript": "^7.0.2",
49
- "@ttsc/lint": "^0.37.1",
50
- "@wrtnlabs/evidence": "^0.8.2",
51
- "@ttsc/evidence": "^0.37.1",
53
+ "@ttsc/lint": "^0.38.1",
54
+ "@wrtnlabs/evidence": "^0.11.1",
55
+ "@ttsc/evidence": "^0.38.1",
52
56
  "@types/node": "^22.19.17"
53
57
  },
54
58
  "engines": {
@@ -1,17 +1,17 @@
1
1
  import type * as THREE from "three";
2
2
 
3
+ import type { IViewerFrameTransfer } from "./IViewerFrameTransfer.js";
4
+
3
5
  /**
4
- * The original scene/camera at an owning producer's completed draw boundary.
5
- * A controller, when supplied, owns typed state capture/restoration. Consumers
6
+ * The original scene/camera at an owning producer's completed draw boundary. A
7
+ * controller, when supplied, owns typed state capture/restoration. Consumers
6
8
  * observe synchronously and must not treat requested state as rendered facts.
7
- *
8
- * @evidence contracts/development/design.md#principled-representation Carries original draw-completion scene/camera/pass and optional observed clock, with an application-owned state controller for capture, restoration, explicit redraw and clock freezing; composite layer facts remain separate from original native objects.
9
- * @evidence contracts/development/design.md#minimal-and-owned-surface The producer publishes one completion record while numerical application admission and transport consumers retain their own responsibilities; optional fields distinguish unavailable observations from false or zero values.
10
- * @evidence contracts/development/design.md#prohibited-design-shortcuts Requested state never substitutes for completed rendering; changed=false preserves idle facts, absent changed preserves eager saving and application-document changes still require fresh display facts.
11
- * @evidence contracts/development/common.md#meaningful-documentation Defines native versus composite objects, optional time semantics, numerical application prerequisite, idle/change classification and controller ownership.
12
9
  */
13
10
  export interface IAutoMovieViewerCompletedFrame {
14
- /** Native camera used by the original draw; composite layer cameras belong in facts. */
11
+ /**
12
+ * Native camera used by the original draw; composite layer cameras belong in
13
+ * facts.
14
+ */
15
15
  camera: THREE.Camera;
16
16
 
17
17
  /** Original drawn scene; composite facts retain each layer's observed objects. */
@@ -44,10 +44,10 @@ export interface IAutoMovieViewerCompletedFrame {
44
44
  /** Actual application controller; its state is serialized only by its owner. */
45
45
  control?: {
46
46
  /** Capture application-owned state corresponding to the live completed view. */
47
- capture: () => unknown;
47
+ capture: () => IViewerFrameTransfer;
48
48
 
49
- /** Restore only states admitted by this application's controller. */
50
- restore: (state: unknown) => void;
49
+ /** Restore a state this controller captured. */
50
+ restore: (state: IViewerFrameTransfer) => void;
51
51
 
52
52
  /** Synchronously redraw through the original producer or report failure. */
53
53
  redraw?: () => void;
@@ -60,3 +60,13 @@ export interface IAutoMovieViewerCompletedFrame {
60
60
  freeze?: () => () => void;
61
61
  };
62
62
  }
63
+
64
+ declare global {
65
+ interface HTMLElementEventMap {
66
+ /**
67
+ * A frame the viewer completed, sent to a canvas whose
68
+ * `data-automovie-frame-observer` attribute is `on`.
69
+ */
70
+ "automovie:completed-frame": CustomEvent<IAutoMovieViewerCompletedFrame>;
71
+ }
72
+ }
@@ -2,11 +2,6 @@
2
2
  * Facts from the owner of an actually completed interactive display.
3
3
  * Application identity and requested values remain separate from observations.
4
4
  * This transport record establishes no review acceptance.
5
- *
6
- * @evidence contracts/development/design.md#principled-representation Records loaded revision, actual native renderer and completed display address/camera as observations, keeping application requests separate from the facts of a drawn viewport.
7
- * @evidence contracts/development/design.md#minimal-and-owned-surface Required provenance fields give the display transport a shared minimum while the unknown-valued index signature permits application-owned facts without pretending they are a universal schema.
8
- * @evidence contracts/development/design.md#prohibited-design-shortcuts Metadata cannot substitute requested camera or document state for completed observations and makes no visual-review acceptance claim.
9
- * @evidence contracts/development/common.md#meaningful-documentation Identifies actual loaded source, native device, displayed application identity, observed camera and the distinction between transport facts and review acceptance.
10
5
  */
11
6
  export interface IAutoMovieViewerDisplayMetadata {
12
7
  /** Actual loaded application source identity. */
@@ -3,43 +3,21 @@ import type * as THREE from "three";
3
3
  /**
4
4
  * Handle returned by {@link mountViewer}; call `stop()` to end the loop and
5
5
  * release the renderer, including any dissolve GPU state the frames created.
6
- *
7
- * @evidence contracts/development/design.md#principled-representation Pairs the mount-owned renderer with original external-draw completion and complete loop/resource shutdown, allowing explicit host draws to publish actual frame time without inventing a second render owner.
8
- * @evidence contracts/development/design.md#minimal-and-owned-surface The handle exposes only renderer access, completion publication and lifecycle end; mountViewer retains loop timing, camera transfer and observer details.
9
- * @evidence contracts/development/design.md#prohibited-design-shortcuts Completion follows the original draw rather than an extra capture-only render, and guide redraws preserve the last completed clock when no new time is supplied.
10
- * @evidence contracts/development/common.md#meaningful-documentation Documents mount-owned renderer, external draw-completion ordering, optional playback seconds and failure-propagating cleanup categories.
11
6
  */
12
7
  export interface IAutoMovieViewerHandle {
13
- /**
14
- * Renderer allocated by this mount and shared with the host's explicit draws.
15
- */
8
+ /** Renderer allocated by this mount and shared with the host's explicit draws. */
16
9
  renderer: THREE.WebGLRenderer;
17
10
 
18
11
  /**
19
12
  * Publish immediately after this handle's original external draw completes.
20
13
  * Optional seconds are that draw's actual playback time; a guide redraw
21
14
  * preserves the completed clock when no new time is supplied.
22
- *
23
- * @evidence contracts/development/implementation.md#principled-implementation Notifies observers immediately after an original external draw, using supplied actual seconds or the preserved completed clock rather than advancing playback for a guide capture.
24
- * @evidence contracts/development/implementation.md#clear-and-simple-structure External producers call the mount's existing completion path so handled and ordinary frames share timing and state transfer.
25
- * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts Publication does not replace WebGLRenderer.render or create a synthetic verification draw; the calling original producer owns completion truth.
26
- * @evidence contracts/development/common.md#meaningful-documentation States draw-before-publication ordering and optional time meaning for seek versus guide redraw.
27
- * @evidence contracts/development/implementation.md#efficient-algorithms Completion records and synchronous subscriber delivery have cost proportional to observer work, without walking scene meshes or reading pixels in this callback.
28
- * @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work Explicit original draws remain meaningful events even when state facts match, so completion effects are not shared blindly.
29
- * @evidenceExclude contracts/development/implementation.md#bound-retention-and-release-resources Completion publication borrows current scene and camera and starts no new renderer or animation task.
30
15
  */
31
16
  completeFrame: (elapsedSeconds?: number) => void;
32
17
 
33
18
  /**
34
- * Stop the mounted loop and attempt each owned shadow, compositor and renderer retirement; cleanup failures propagate.
35
- *
36
- * @evidence contracts/development/implementation.md#principled-implementation Ends the mount's loop and delegates independent scene-shadow, compositor and renderer retirement to releaseMountedViewer, preserving cleanup causes after all owners are attempted.
37
- * @evidence contracts/development/implementation.md#clear-and-simple-structure One stop callback is the mount lifetime boundary; resource-specific disposal remains with the existing release helpers.
38
- * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts A throwing listener cannot certify successful shutdown or authorize disposing caller-owned scene model materials.
39
- * @evidence contracts/development/common.md#meaningful-documentation Names the loop, shadow, compositor and renderer retirement obligations and failure propagation.
40
- * @evidence contracts/development/implementation.md#efficient-algorithms Retirement scans scene shadow lights and a fixed number of renderer/compositor owners, without rebuilding or resampling scene geometry.
41
- * @evidence contracts/development/implementation.md#reuse-equivalent-work The mount's sticky synchronous restoration guard starts stop once and preserves its original failure for repeated callers; renderer-specific compositor guards own their separate retirement outcomes.
42
- * @evidence contracts/development/implementation.md#bound-retention-and-release-resources Stops scheduling mounted work and attempts owned native release while leaving model-resource lifetime with the host; a failed retirement remains a reported uncertainty.
19
+ * Stop the mounted loop and attempt each owned shadow, compositor and
20
+ * renderer retirement; cleanup failures propagate.
43
21
  */
44
22
  stop: () => void;
45
23
  }
@@ -1,33 +1,33 @@
1
1
  import type { IAutoMovieViewerCompletedFrame } from "./IAutoMovieViewerCompletedFrame.js";
2
2
 
3
3
  /**
4
- * Context creation and original-producer completion settings for one mounted viewer. These values configure output conditions; they do not independently certify cross-hardware pixel equality or actual rendered appearance.
5
- *
6
- * @evidence contracts/development/design.md#principled-representation Per-mount antialiasing and buffer preservation belong to context creation, pixel ratio controls output dimensions and handled-frame hooks preserve the original producer's completed facts.
7
- * @evidence contracts/development/design.md#minimal-and-owned-surface One options shape keeps native context settings separate from the mount's loop and the producer's actual completed-frame observation.
8
- * @evidence contracts/development/design.md#prohibited-design-shortcuts Disabling antialiasing avoids blended structural boundaries but is not a claim of GPU-independent output; handled draws need original completion rather than an invented verification render.
9
- * @evidence contracts/development/common.md#meaningful-documentation Members describe defaults, creation-only settings, output sizing and required handled-frame completion/redraw ownership.
4
+ * Context creation and original-producer completion settings for one mounted
5
+ * viewer. These values configure output conditions; they do not independently
6
+ * certify cross-hardware pixel equality or actual rendered appearance.
10
7
  */
11
8
  export interface IMountViewerOptions {
12
- /** Creation-time multisample antialiasing, true by default; false avoids segment-edge blending without proving cross-GPU byte equality. */
9
+ /**
10
+ * Creation-time multisample antialiasing, true by default; false avoids
11
+ * segment-edge blending without proving cross-GPU byte equality.
12
+ */
13
13
  antialias?: boolean;
14
14
 
15
- /** Fixed canvas pixel ratio; absence follows the current device ratio. Capture hosts pin one for fixed output dimensions. CSS layout owns the logical canvas dimensions. */
15
+ /**
16
+ * Fixed canvas pixel ratio; absence follows the current device ratio. Capture
17
+ * hosts pin one for fixed output dimensions. CSS layout owns the logical
18
+ * canvas dimensions.
19
+ */
16
20
  pixelRatio?: number;
17
21
 
18
- /** Creation-time native buffer preservation, false by default; an explicit readback host must choose its required lifetime. */
22
+ /**
23
+ * Creation-time native buffer preservation, false by default; an explicit
24
+ * readback host must choose its required lifetime.
25
+ */
19
26
  preserveDrawingBuffer?: boolean;
20
27
 
21
28
  /**
22
- * Return the original handled producer's completed scene/camera/pass, or undefined when it has no completed observation.
23
- *
24
- * @evidence contracts/development/implementation.md#principled-implementation The hook exposes the producer's actual completed draw rather than a requested display state or nominal scene passed to mount.
25
- * @evidence contracts/development/implementation.md#clear-and-simple-structure Handled composites retain completion ownership while mount attaches its clock/control to the supplied record.
26
- * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts An absent handled completion is not replaced with a fabricated ordinary beauty observation.
27
- * @evidence contracts/development/common.md#meaningful-documentation The member documents original-producer facts and explicit unavailable observation.
28
- * @evidenceExclude contracts/development/implementation.md#efficient-algorithms This observation capability selects no scene rendering or composition algorithm.
29
- * @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work Record identity suppresses idle ordinary publication in mount but is not by itself canonical pixel/source equivalence.
30
- * @evidenceExclude contracts/development/implementation.md#bound-retention-and-release-resources The hook borrows producer state; the mounted owner retains its callback for that mount's lifetime.
29
+ * Return the original handled producer's completed scene/camera/pass, or
30
+ * undefined when it has no completed observation.
31
31
  */
32
32
  completedFrame?: () =>
33
33
  | Omit<IAutoMovieViewerCompletedFrame, "control">
@@ -37,16 +37,9 @@ export interface IMountViewerOptions {
37
37
  * Redraw the handled frame at the requested seconds through its original
38
38
  * producer and complete that draw synchronously. Restore supplies the saved
39
39
  * production time; ordinary redraw supplies the last completed time. Refusal
40
- * throws. Call completeFrame after the draw, or expose a distinct new producer
41
- * record through completedFrame; retaining the previous record is not completion.
42
- *
43
- * @evidence contracts/development/implementation.md#principled-implementation Explicit redraw delegates the requested completed seconds to the same producer that owns the handled frame and mount checks that a completion was published. A producer with its own clock restores that clock before drawing.
44
- * @evidence contracts/development/implementation.md#clear-and-simple-structure The mount supplies preserved clock/control while the producer retains its composite render sequence.
45
- * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts Redraw does not substitute the nominal scene for an unobserved composite or relabel a previous producer record. Explicit completion or a newly exposed producer record must attest the requested time; refusal throws.
46
- * @evidence contracts/development/common.md#meaningful-documentation The member states original-producer redraw, requested seconds for restoration versus ordinary redraw, and synchronous completion responsibility.
47
- * @evidenceExclude contracts/development/implementation.md#efficient-algorithms This redraw capability chooses no multipass or guide rendering strategy.
48
- * @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work Redraw is an individual render effect under the current completed clock and cannot be cached by matching options.
49
- * @evidenceExclude contracts/development/implementation.md#bound-retention-and-release-resources The callback borrows its producer's resources; that producer owns pass restoration and mount owns renderer/loop lifetime.
40
+ * throws. Call completeFrame after the draw, or expose a distinct new
41
+ * producer record through completedFrame; retaining the previous record is
42
+ * not completion.
50
43
  */
51
44
  redrawCompleted?: (elapsedSeconds: number) => void;
52
45
 
@@ -54,16 +47,9 @@ export interface IMountViewerOptions {
54
47
  * Pause an independently owned producer clock/audio for the outermost freeze.
55
48
  * Return synchronous cleanup: resume=true on the last normal release and
56
49
  * resume=false when the mount stops. Nested freezes share this lease. The
57
- * mount suppresses animation ticks while frozen; explicit redraw/restore still
58
- * completes through the original producer. A throwing acquisition owns rollback.
59
- *
60
- * @evidence contracts/development/implementation.md#principled-implementation Delegates independent clock/audio pause to their actual producer owner and distinguishes resumption from terminal release; mount keeps nested lease accounting and animation suppression.
61
- * @evidence contracts/development/implementation.md#clear-and-simple-structure One optional producer lease complements original redraw ownership without making Viewer own media playback or a production clock.
62
- * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts Ordinary mount-clock producers need no callback; independently advancing state is paused through its owner rather than a substituted time argument.
63
- * @evidence contracts/development/common.md#meaningful-documentation States outermost acquisition, final and terminal release flags, synchronous ownership, nested behavior, explicit draws and failed-acquisition rollback.
64
- * @evidenceExclude contracts/development/implementation.md#efficient-algorithms This callback type performs no playback calculation itself.
65
- * @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work The controller shares the outer producer lease; this declaration retains no cache.
66
- * @evidence contracts/development/implementation.md#bound-retention-and-release-resources A mounted controller retains at most one acquired producer cleanup and consumes it on final release or terminal disposal; the producer owns any async tasks it starts during resumption.
50
+ * mount suppresses animation ticks while frozen; explicit redraw/restore
51
+ * still completes through the original producer. A throwing acquisition owns
52
+ * rollback.
67
53
  */
68
54
  freezeCompleted?: () => (resume: boolean) => void;
69
55
  }
@@ -3,11 +3,6 @@ import type * as THREE from "three";
3
3
  /**
4
4
  * Detached native camera state admitted by createViewerCameraState.restore.
5
5
  * Vectors and lens values are local native camera data, not a world hierarchy.
6
- *
7
- * @evidence contracts/development/design.md#principled-representation The record contains copied native lens, TRS, layers and projection state for detached auto-updating PerspectiveCamera or OrthographicCamera. Unknown restore input is checked against a native candidate; this interface itself performs no runtime admission.
8
- * @evidence contracts/development/design.md#minimal-and-owned-surface One named transfer record exposes the existing camera payload so another exported transfer can name its return type. It introduces no alternate camera solver or new fields.
9
- * @evidence contracts/development/design.md#prohibited-design-shortcuts Lens discriminants retain the two supported native classes; projection arrays are not accepted as a shortcut around lens parity, and parent relationships are not guessed.
10
- * @evidence contracts/development/common.md#meaningful-documentation Fields state local vector and quaternion order, metre/millimetre/degree units, layer mask and view offset optionality. The comment identifies the runtime admission owner.
11
6
  */
12
7
  export interface IViewerCameraStateSnapshot {
13
8
  /** Native camera class identity; restore requires the same current class. */
@@ -0,0 +1,13 @@
1
+ import type { IViewerCameraStateSnapshot } from "./IViewerCameraStateSnapshot.js";
2
+
3
+ /**
4
+ * A mounted frame's transfer state, captured and restored by its frame
5
+ * controller: the native camera and the scene time it was drawn at.
6
+ */
7
+ export interface IViewerFrameTransfer {
8
+ /** Native camera state of the completed view. */
9
+ camera: IViewerCameraStateSnapshot;
10
+
11
+ /** Scene seconds of the completed view, finite and nonnegative. */
12
+ elapsedSeconds: number;
13
+ }