@canonical/motion-control 0.0.0-stage → 0.47.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 (310) hide show
  1. package/README.md +300 -2
  2. package/cast.schema.json +101 -0
  3. package/dist/esm/cli.js +30 -0
  4. package/dist/esm/cli.js.map +1 -0
  5. package/dist/esm/global.js +7 -0
  6. package/dist/esm/global.js.map +1 -0
  7. package/dist/esm/index.js +2 -0
  8. package/dist/esm/index.js.map +1 -0
  9. package/dist/esm/lib/cast/checkCasts.js +34 -0
  10. package/dist/esm/lib/cast/checkCasts.js.map +1 -0
  11. package/dist/esm/lib/cast/checkScene.js +58 -0
  12. package/dist/esm/lib/cast/checkScene.js.map +1 -0
  13. package/dist/esm/lib/cast/checkStep.js +73 -0
  14. package/dist/esm/lib/cast/checkStep.js.map +1 -0
  15. package/dist/esm/lib/cast/constants.js +53 -0
  16. package/dist/esm/lib/cast/constants.js.map +1 -0
  17. package/dist/esm/lib/cast/formatReport.js +22 -0
  18. package/dist/esm/lib/cast/formatReport.js.map +1 -0
  19. package/dist/esm/lib/cast/index.js +10 -0
  20. package/dist/esm/lib/cast/index.js.map +1 -0
  21. package/dist/esm/lib/cast/listFrameNames.js +19 -0
  22. package/dist/esm/lib/cast/listFrameNames.js.map +1 -0
  23. package/dist/esm/lib/cast/measureScene.js +11 -0
  24. package/dist/esm/lib/cast/measureScene.js.map +1 -0
  25. package/dist/esm/lib/cast/measureStep.js +21 -0
  26. package/dist/esm/lib/cast/measureStep.js.map +1 -0
  27. package/dist/esm/lib/cast/measureTyping.js +13 -0
  28. package/dist/esm/lib/cast/measureTyping.js.map +1 -0
  29. package/dist/esm/lib/cast/types.js +2 -0
  30. package/dist/esm/lib/cast/types.js.map +1 -0
  31. package/dist/esm/lib/gif/compressLzw.js +61 -0
  32. package/dist/esm/lib/gif/compressLzw.js.map +1 -0
  33. package/dist/esm/lib/gif/constants.js +9 -0
  34. package/dist/esm/lib/gif/constants.js.map +1 -0
  35. package/dist/esm/lib/gif/encodeGif.js +45 -0
  36. package/dist/esm/lib/gif/encodeGif.js.map +1 -0
  37. package/dist/esm/lib/gif/index.js +6 -0
  38. package/dist/esm/lib/gif/index.js.map +1 -0
  39. package/dist/esm/lib/gif/mergeStills.js +32 -0
  40. package/dist/esm/lib/gif/mergeStills.js.map +1 -0
  41. package/dist/esm/lib/gif/quantizePictures.js +75 -0
  42. package/dist/esm/lib/gif/quantizePictures.js.map +1 -0
  43. package/dist/esm/lib/gif/types.js +2 -0
  44. package/dist/esm/lib/gif/types.js.map +1 -0
  45. package/dist/esm/lib/index.js +3 -0
  46. package/dist/esm/lib/index.js.map +1 -0
  47. package/dist/esm/lib/moment/constants.js +33 -0
  48. package/dist/esm/lib/moment/constants.js.map +1 -0
  49. package/dist/esm/lib/moment/describeAction.js +20 -0
  50. package/dist/esm/lib/moment/describeAction.js.map +1 -0
  51. package/dist/esm/lib/moment/describeKeyRun.js +53 -0
  52. package/dist/esm/lib/moment/describeKeyRun.js.map +1 -0
  53. package/dist/esm/lib/moment/describeMoment.js +323 -0
  54. package/dist/esm/lib/moment/describeMoment.js.map +1 -0
  55. package/dist/esm/lib/moment/easeInOut.js +12 -0
  56. package/dist/esm/lib/moment/easeInOut.js.map +1 -0
  57. package/dist/esm/lib/moment/index.js +8 -0
  58. package/dist/esm/lib/moment/index.js.map +1 -0
  59. package/dist/esm/lib/moment/resolveStates.js +82 -0
  60. package/dist/esm/lib/moment/resolveStates.js.map +1 -0
  61. package/dist/esm/lib/moment/takeSpan.js +12 -0
  62. package/dist/esm/lib/moment/takeSpan.js.map +1 -0
  63. package/dist/esm/lib/moment/types.js +2 -0
  64. package/dist/esm/lib/moment/types.js.map +1 -0
  65. package/dist/esm/lib/player/Player.js +498 -0
  66. package/dist/esm/lib/player/Player.js.map +1 -0
  67. package/dist/esm/lib/player/announceHeight.js +30 -0
  68. package/dist/esm/lib/player/announceHeight.js.map +1 -0
  69. package/dist/esm/lib/player/applyMoment.js +155 -0
  70. package/dist/esm/lib/player/applyMoment.js.map +1 -0
  71. package/dist/esm/lib/player/assertPresent.js +14 -0
  72. package/dist/esm/lib/player/assertPresent.js.map +1 -0
  73. package/dist/esm/lib/player/collectFrames.js +30 -0
  74. package/dist/esm/lib/player/collectFrames.js.map +1 -0
  75. package/dist/esm/lib/player/collectStyles.js +24 -0
  76. package/dist/esm/lib/player/collectStyles.js.map +1 -0
  77. package/dist/esm/lib/player/constants.js +101 -0
  78. package/dist/esm/lib/player/constants.js.map +1 -0
  79. package/dist/esm/lib/player/defaultProfile.js +50 -0
  80. package/dist/esm/lib/player/defaultProfile.js.map +1 -0
  81. package/dist/esm/lib/player/drawMarkup.js +36 -0
  82. package/dist/esm/lib/player/drawMarkup.js.map +1 -0
  83. package/dist/esm/lib/player/drawScene.js +32 -0
  84. package/dist/esm/lib/player/drawScene.js.map +1 -0
  85. package/dist/esm/lib/player/drawSprites.js +122 -0
  86. package/dist/esm/lib/player/drawSprites.js.map +1 -0
  87. package/dist/esm/lib/player/fitEmbeds.js +42 -0
  88. package/dist/esm/lib/player/fitEmbeds.js.map +1 -0
  89. package/dist/esm/lib/player/fitSlide.js +27 -0
  90. package/dist/esm/lib/player/fitSlide.js.map +1 -0
  91. package/dist/esm/lib/player/formatKey.js +13 -0
  92. package/dist/esm/lib/player/formatKey.js.map +1 -0
  93. package/dist/esm/lib/player/formatKeySign.js +12 -0
  94. package/dist/esm/lib/player/formatKeySign.js.map +1 -0
  95. package/dist/esm/lib/player/formatSpeed.js +11 -0
  96. package/dist/esm/lib/player/formatSpeed.js.map +1 -0
  97. package/dist/esm/lib/player/formatTime.js +18 -0
  98. package/dist/esm/lib/player/formatTime.js.map +1 -0
  99. package/dist/esm/lib/player/index.js +30 -0
  100. package/dist/esm/lib/player/index.js.map +1 -0
  101. package/dist/esm/lib/player/installStateRules.js +25 -0
  102. package/dist/esm/lib/player/installStateRules.js.map +1 -0
  103. package/dist/esm/lib/player/listHidden.js +24 -0
  104. package/dist/esm/lib/player/listHidden.js.map +1 -0
  105. package/dist/esm/lib/player/makeElement.js +15 -0
  106. package/dist/esm/lib/player/makeElement.js.map +1 -0
  107. package/dist/esm/lib/player/mergeProfile.js +17 -0
  108. package/dist/esm/lib/player/mergeProfile.js.map +1 -0
  109. package/dist/esm/lib/player/mirrorStates.js +23 -0
  110. package/dist/esm/lib/player/mirrorStates.js.map +1 -0
  111. package/dist/esm/lib/player/mountScenes.js +100 -0
  112. package/dist/esm/lib/player/mountScenes.js.map +1 -0
  113. package/dist/esm/lib/player/readLayerBox.js +20 -0
  114. package/dist/esm/lib/player/readLayerBox.js.map +1 -0
  115. package/dist/esm/lib/player/recordGif.js +63 -0
  116. package/dist/esm/lib/player/recordGif.js.map +1 -0
  117. package/dist/esm/lib/player/recordVideo.js +114 -0
  118. package/dist/esm/lib/player/recordVideo.js.map +1 -0
  119. package/dist/esm/lib/player/renderLegend.js +27 -0
  120. package/dist/esm/lib/player/renderLegend.js.map +1 -0
  121. package/dist/esm/lib/player/saveFile.js +22 -0
  122. package/dist/esm/lib/player/saveFile.js.map +1 -0
  123. package/dist/esm/lib/player/serializeElement.js +36 -0
  124. package/dist/esm/lib/player/serializeElement.js.map +1 -0
  125. package/dist/esm/lib/player/types.js +2 -0
  126. package/dist/esm/lib/player/types.js.map +1 -0
  127. package/dist/esm/lib/player/wrapSlide.js +28 -0
  128. package/dist/esm/lib/player/wrapSlide.js.map +1 -0
  129. package/dist/esm/lib/timeline/advanceClock.js +24 -0
  130. package/dist/esm/lib/timeline/advanceClock.js.map +1 -0
  131. package/dist/esm/lib/timeline/buildTimeline.js +47 -0
  132. package/dist/esm/lib/timeline/buildTimeline.js.map +1 -0
  133. package/dist/esm/lib/timeline/constants.js +3 -0
  134. package/dist/esm/lib/timeline/constants.js.map +1 -0
  135. package/dist/esm/lib/timeline/findKeyframe.js +11 -0
  136. package/dist/esm/lib/timeline/findKeyframe.js.map +1 -0
  137. package/dist/esm/lib/timeline/index.js +7 -0
  138. package/dist/esm/lib/timeline/index.js.map +1 -0
  139. package/dist/esm/lib/timeline/locateTime.js +21 -0
  140. package/dist/esm/lib/timeline/locateTime.js.map +1 -0
  141. package/dist/esm/lib/timeline/stepKeyframe.js +20 -0
  142. package/dist/esm/lib/timeline/stepKeyframe.js.map +1 -0
  143. package/dist/esm/lib/timeline/types.js +2 -0
  144. package/dist/esm/lib/timeline/types.js.map +1 -0
  145. package/dist/esm/lib/video/constants.js +7 -0
  146. package/dist/esm/lib/video/constants.js.map +1 -0
  147. package/dist/esm/lib/video/index.js +4 -0
  148. package/dist/esm/lib/video/index.js.map +1 -0
  149. package/dist/esm/lib/video/types.js +2 -0
  150. package/dist/esm/lib/video/types.js.map +1 -0
  151. package/dist/esm/lib/video/writeBox.js +21 -0
  152. package/dist/esm/lib/video/writeBox.js.map +1 -0
  153. package/dist/esm/lib/video/writeMp4.js +45 -0
  154. package/dist/esm/lib/video/writeMp4.js.map +1 -0
  155. package/dist/motion.css +581 -0
  156. package/dist/motion.global.js +1534 -0
  157. package/dist/types/cli.d.ts +3 -0
  158. package/dist/types/cli.d.ts.map +1 -0
  159. package/dist/types/global.d.ts +2 -0
  160. package/dist/types/global.d.ts.map +1 -0
  161. package/dist/types/index.d.ts +17 -0
  162. package/dist/types/index.d.ts.map +1 -0
  163. package/dist/types/lib/cast/checkCasts.d.ts +15 -0
  164. package/dist/types/lib/cast/checkCasts.d.ts.map +1 -0
  165. package/dist/types/lib/cast/checkScene.d.ts +11 -0
  166. package/dist/types/lib/cast/checkScene.d.ts.map +1 -0
  167. package/dist/types/lib/cast/checkStep.d.ts +12 -0
  168. package/dist/types/lib/cast/checkStep.d.ts.map +1 -0
  169. package/dist/types/lib/cast/constants.d.ts +20 -0
  170. package/dist/types/lib/cast/constants.d.ts.map +1 -0
  171. package/dist/types/lib/cast/formatReport.d.ts +11 -0
  172. package/dist/types/lib/cast/formatReport.d.ts.map +1 -0
  173. package/dist/types/lib/cast/index.d.ts +11 -0
  174. package/dist/types/lib/cast/index.d.ts.map +1 -0
  175. package/dist/types/lib/cast/listFrameNames.d.ts +8 -0
  176. package/dist/types/lib/cast/listFrameNames.d.ts.map +1 -0
  177. package/dist/types/lib/cast/measureScene.d.ts +9 -0
  178. package/dist/types/lib/cast/measureScene.d.ts.map +1 -0
  179. package/dist/types/lib/cast/measureStep.d.ts +13 -0
  180. package/dist/types/lib/cast/measureStep.d.ts.map +1 -0
  181. package/dist/types/lib/cast/measureTyping.d.ts +12 -0
  182. package/dist/types/lib/cast/measureTyping.d.ts.map +1 -0
  183. package/dist/types/lib/cast/types.d.ts +87 -0
  184. package/dist/types/lib/cast/types.d.ts.map +1 -0
  185. package/dist/types/lib/gif/compressLzw.d.ts +9 -0
  186. package/dist/types/lib/gif/compressLzw.d.ts.map +1 -0
  187. package/dist/types/lib/gif/constants.d.ts +9 -0
  188. package/dist/types/lib/gif/constants.d.ts.map +1 -0
  189. package/dist/types/lib/gif/encodeGif.d.ts +13 -0
  190. package/dist/types/lib/gif/encodeGif.d.ts.map +1 -0
  191. package/dist/types/lib/gif/index.d.ts +7 -0
  192. package/dist/types/lib/gif/index.d.ts.map +1 -0
  193. package/dist/types/lib/gif/mergeStills.d.ts +12 -0
  194. package/dist/types/lib/gif/mergeStills.d.ts.map +1 -0
  195. package/dist/types/lib/gif/quantizePictures.d.ts +13 -0
  196. package/dist/types/lib/gif/quantizePictures.d.ts.map +1 -0
  197. package/dist/types/lib/gif/types.d.ts +22 -0
  198. package/dist/types/lib/gif/types.d.ts.map +1 -0
  199. package/dist/types/lib/index.d.ts +3 -0
  200. package/dist/types/lib/index.d.ts.map +1 -0
  201. package/dist/types/lib/moment/constants.d.ts +33 -0
  202. package/dist/types/lib/moment/constants.d.ts.map +1 -0
  203. package/dist/types/lib/moment/describeAction.d.ts +9 -0
  204. package/dist/types/lib/moment/describeAction.d.ts.map +1 -0
  205. package/dist/types/lib/moment/describeKeyRun.d.ts +18 -0
  206. package/dist/types/lib/moment/describeKeyRun.d.ts.map +1 -0
  207. package/dist/types/lib/moment/describeMoment.d.ts +16 -0
  208. package/dist/types/lib/moment/describeMoment.d.ts.map +1 -0
  209. package/dist/types/lib/moment/easeInOut.d.ts +8 -0
  210. package/dist/types/lib/moment/easeInOut.d.ts.map +1 -0
  211. package/dist/types/lib/moment/index.d.ts +9 -0
  212. package/dist/types/lib/moment/index.d.ts.map +1 -0
  213. package/dist/types/lib/moment/resolveStates.d.ts +18 -0
  214. package/dist/types/lib/moment/resolveStates.d.ts.map +1 -0
  215. package/dist/types/lib/moment/takeSpan.d.ts +10 -0
  216. package/dist/types/lib/moment/takeSpan.d.ts.map +1 -0
  217. package/dist/types/lib/moment/types.d.ts +187 -0
  218. package/dist/types/lib/moment/types.d.ts.map +1 -0
  219. package/dist/types/lib/player/Player.d.ts +134 -0
  220. package/dist/types/lib/player/Player.d.ts.map +1 -0
  221. package/dist/types/lib/player/announceHeight.d.ts +12 -0
  222. package/dist/types/lib/player/announceHeight.d.ts.map +1 -0
  223. package/dist/types/lib/player/applyMoment.d.ts +21 -0
  224. package/dist/types/lib/player/applyMoment.d.ts.map +1 -0
  225. package/dist/types/lib/player/assertPresent.d.ts +10 -0
  226. package/dist/types/lib/player/assertPresent.d.ts.map +1 -0
  227. package/dist/types/lib/player/collectFrames.d.ts +11 -0
  228. package/dist/types/lib/player/collectFrames.d.ts.map +1 -0
  229. package/dist/types/lib/player/collectStyles.d.ts +12 -0
  230. package/dist/types/lib/player/collectStyles.d.ts.map +1 -0
  231. package/dist/types/lib/player/constants.d.ts +80 -0
  232. package/dist/types/lib/player/constants.d.ts.map +1 -0
  233. package/dist/types/lib/player/defaultProfile.d.ts +8 -0
  234. package/dist/types/lib/player/defaultProfile.d.ts.map +1 -0
  235. package/dist/types/lib/player/drawMarkup.d.ts +15 -0
  236. package/dist/types/lib/player/drawMarkup.d.ts.map +1 -0
  237. package/dist/types/lib/player/drawScene.d.ts +23 -0
  238. package/dist/types/lib/player/drawScene.d.ts.map +1 -0
  239. package/dist/types/lib/player/drawSprites.d.ts +35 -0
  240. package/dist/types/lib/player/drawSprites.d.ts.map +1 -0
  241. package/dist/types/lib/player/fitEmbeds.d.ts +13 -0
  242. package/dist/types/lib/player/fitEmbeds.d.ts.map +1 -0
  243. package/dist/types/lib/player/fitSlide.d.ts +24 -0
  244. package/dist/types/lib/player/fitSlide.d.ts.map +1 -0
  245. package/dist/types/lib/player/formatKey.d.ts +9 -0
  246. package/dist/types/lib/player/formatKey.d.ts.map +1 -0
  247. package/dist/types/lib/player/formatKeySign.d.ts +9 -0
  248. package/dist/types/lib/player/formatKeySign.d.ts.map +1 -0
  249. package/dist/types/lib/player/formatSpeed.d.ts +9 -0
  250. package/dist/types/lib/player/formatSpeed.d.ts.map +1 -0
  251. package/dist/types/lib/player/formatTime.d.ts +12 -0
  252. package/dist/types/lib/player/formatTime.d.ts.map +1 -0
  253. package/dist/types/lib/player/index.d.ts +31 -0
  254. package/dist/types/lib/player/index.d.ts.map +1 -0
  255. package/dist/types/lib/player/installStateRules.d.ts +12 -0
  256. package/dist/types/lib/player/installStateRules.d.ts.map +1 -0
  257. package/dist/types/lib/player/listHidden.d.ts +12 -0
  258. package/dist/types/lib/player/listHidden.d.ts.map +1 -0
  259. package/dist/types/lib/player/makeElement.d.ts +10 -0
  260. package/dist/types/lib/player/makeElement.d.ts.map +1 -0
  261. package/dist/types/lib/player/mergeProfile.d.ts +9 -0
  262. package/dist/types/lib/player/mergeProfile.d.ts.map +1 -0
  263. package/dist/types/lib/player/mirrorStates.d.ts +12 -0
  264. package/dist/types/lib/player/mirrorStates.d.ts.map +1 -0
  265. package/dist/types/lib/player/mountScenes.d.ts +25 -0
  266. package/dist/types/lib/player/mountScenes.d.ts.map +1 -0
  267. package/dist/types/lib/player/readLayerBox.d.ts +23 -0
  268. package/dist/types/lib/player/readLayerBox.d.ts.map +1 -0
  269. package/dist/types/lib/player/recordGif.d.ts +16 -0
  270. package/dist/types/lib/player/recordGif.d.ts.map +1 -0
  271. package/dist/types/lib/player/recordVideo.d.ts +19 -0
  272. package/dist/types/lib/player/recordVideo.d.ts.map +1 -0
  273. package/dist/types/lib/player/renderLegend.d.ts +8 -0
  274. package/dist/types/lib/player/renderLegend.d.ts.map +1 -0
  275. package/dist/types/lib/player/saveFile.d.ts +13 -0
  276. package/dist/types/lib/player/saveFile.d.ts.map +1 -0
  277. package/dist/types/lib/player/serializeElement.d.ts +14 -0
  278. package/dist/types/lib/player/serializeElement.d.ts.map +1 -0
  279. package/dist/types/lib/player/types.d.ts +321 -0
  280. package/dist/types/lib/player/types.d.ts.map +1 -0
  281. package/dist/types/lib/player/wrapSlide.d.ts +17 -0
  282. package/dist/types/lib/player/wrapSlide.d.ts.map +1 -0
  283. package/dist/types/lib/timeline/advanceClock.d.ts +16 -0
  284. package/dist/types/lib/timeline/advanceClock.d.ts.map +1 -0
  285. package/dist/types/lib/timeline/buildTimeline.d.ts +15 -0
  286. package/dist/types/lib/timeline/buildTimeline.d.ts.map +1 -0
  287. package/dist/types/lib/timeline/constants.d.ts +3 -0
  288. package/dist/types/lib/timeline/constants.d.ts.map +1 -0
  289. package/dist/types/lib/timeline/findKeyframe.d.ts +10 -0
  290. package/dist/types/lib/timeline/findKeyframe.d.ts.map +1 -0
  291. package/dist/types/lib/timeline/index.d.ts +8 -0
  292. package/dist/types/lib/timeline/index.d.ts.map +1 -0
  293. package/dist/types/lib/timeline/locateTime.d.ts +10 -0
  294. package/dist/types/lib/timeline/locateTime.d.ts.map +1 -0
  295. package/dist/types/lib/timeline/stepKeyframe.d.ts +12 -0
  296. package/dist/types/lib/timeline/stepKeyframe.d.ts.map +1 -0
  297. package/dist/types/lib/timeline/types.d.ts +40 -0
  298. package/dist/types/lib/timeline/types.d.ts.map +1 -0
  299. package/dist/types/lib/video/constants.d.ts +5 -0
  300. package/dist/types/lib/video/constants.d.ts.map +1 -0
  301. package/dist/types/lib/video/index.d.ts +5 -0
  302. package/dist/types/lib/video/index.d.ts.map +1 -0
  303. package/dist/types/lib/video/types.d.ts +21 -0
  304. package/dist/types/lib/video/types.d.ts.map +1 -0
  305. package/dist/types/lib/video/writeBox.d.ts +9 -0
  306. package/dist/types/lib/video/writeBox.d.ts.map +1 -0
  307. package/dist/types/lib/video/writeMp4.d.ts +10 -0
  308. package/dist/types/lib/video/writeMp4.d.ts.map +1 -0
  309. package/package.json +105 -4
  310. package/skills/design-motion-frames/SKILL.md +183 -0
@@ -0,0 +1,321 @@
1
+ import type { Scene } from "../cast/index.js";
2
+ /** One frame of the page: a drawn state of a screen, with what the page says about it. */
3
+ export interface Frame {
4
+ /** The frame's name. */
5
+ id: string;
6
+ /** A short spoken name, such as a letter and a number. */
7
+ code: string;
8
+ /** The view the frame belongs to. */
9
+ view: string;
10
+ /** The state it shows. */
11
+ state: string;
12
+ /** Whether it is flagged as not part of the first version. */
13
+ later: boolean;
14
+ /** The name of the shell it is drawn in. */
15
+ device: string;
16
+ /** Its HTML. */
17
+ html: string;
18
+ }
19
+ /** The frames by every name they answer to: their id, and their code when they have one. */
20
+ export type Frames = Record<string, Frame>;
21
+ /** What a page may say about a frame beyond its own attributes. */
22
+ export type FrameMeta = Partial<Omit<Frame, "id" | "html" | "later">> & {
23
+ id: string;
24
+ };
25
+ /** A box that rolls with one part of it staying in place. */
26
+ export interface Stuck {
27
+ /** The element whose children roll. */
28
+ box: HTMLElement;
29
+ /** The child that stays. */
30
+ head: HTMLElement;
31
+ }
32
+ /** Where a figure's title stands: in a bar above the screen, or in the panel below it. */
33
+ export type TitlePlace = "above" | "below";
34
+ /**
35
+ * What a figure shows beside its screen. Each section shows whole when left out, is hidden whole when false, and
36
+ * can be given as its parts, each of which shows unless it is false.
37
+ */
38
+ export interface Shown {
39
+ /**
40
+ * The title's row: what the scene is (`kind`: Scene or Clip), its title, what it is about (`about`), and the
41
+ * three dots of the menu (`menu`). The title itself shows whenever the row does.
42
+ */
43
+ title?: boolean | {
44
+ kind?: boolean;
45
+ about?: boolean;
46
+ menu?: boolean;
47
+ };
48
+ /**
49
+ * The caption's rows: the code of the frame in view (`code`), its name (`frame`), the interaction while it
50
+ * happens (`interaction`), the count of steps or the chapter (`count`), and the caption's words (`words`).
51
+ */
52
+ caption?: boolean | {
53
+ code?: boolean;
54
+ frame?: boolean;
55
+ interaction?: boolean;
56
+ count?: boolean;
57
+ words?: boolean;
58
+ };
59
+ /**
60
+ * The controls' row: back, play and forward (`steps`), the bar to scrub (`bar`), the speed (`speed`) and the
61
+ * time (`time`).
62
+ */
63
+ timeline?: boolean | {
64
+ steps?: boolean;
65
+ bar?: boolean;
66
+ speed?: boolean;
67
+ time?: boolean;
68
+ };
69
+ }
70
+ /** The three readings of the time under a clip: how far in, how long in all, how much is left. */
71
+ export type TimeMode = "elapsed" | "total" | "remaining";
72
+ /** The words the player shows. */
73
+ export interface Words {
74
+ /** What the time reads, per reading, for the hint on the time itself. */
75
+ time: Record<TimeMode, string>;
76
+ play: string;
77
+ pause: string;
78
+ back: string;
79
+ forward: string;
80
+ speed: string;
81
+ /** What the panel says before the name of a step that waits for the reader. */
82
+ turn: string;
83
+ /** The name of the three dots that open a scene's menu. */
84
+ more: string;
85
+ /** The menu's entry that saves the scene as an animated GIF. */
86
+ gif: string;
87
+ /** The menu's entry that turns playing again at the end on and off. */
88
+ loop: string;
89
+ /** What the three dots say while a recording is being made. */
90
+ recording: string;
91
+ missing: string;
92
+ /** What a scene is called, at the head of its panel. */
93
+ scene: string;
94
+ /** What a clip is called, at the head of its panel. */
95
+ clip: string;
96
+ }
97
+ /** What the player needs to know about the frames it plays. */
98
+ export interface Profile {
99
+ /** The frame around the screen, per device. Each must hold one element with the class `mo-screen`. */
100
+ shells: Record<string, string>;
101
+ /** The class that flags a frame as not part of the first version. */
102
+ laterClass: string;
103
+ /** Says which shell a frame is drawn in, from its element. */
104
+ deviceOf: (frame: HTMLElement) => string;
105
+ /** Called each time a frame is put on the screen: the place to anchor things in a screen of fixed height. */
106
+ settle: (screen: HTMLElement) => void;
107
+ /** A selector for where typed words go. */
108
+ line: string;
109
+ /** Reads the words a frame already shows in its line. */
110
+ readLine: (line: HTMLElement) => string;
111
+ /** Writes a part of the words into the line. */
112
+ writeLine: (line: HTMLElement, text: string) => void;
113
+ /** Says what a slide carries with it, given the element it started on. */
114
+ slideTarget: (target: HTMLElement) => HTMLElement;
115
+ /** What rolls on a scroll, by touch and by wheel, as selectors inside the screen. */
116
+ scroll: {
117
+ touch: string;
118
+ wheel: string;
119
+ };
120
+ /** Says what stays in place inside a rolling element, if anything does. */
121
+ stick: (rolling: HTMLElement) => Stuck | undefined;
122
+ /**
123
+ * Called once content has rolled, to show what the design shows then. It may give back a function that takes
124
+ * its changes away again, for a frame that is not drawn afresh for each moment.
125
+ */
126
+ onScroll: (screen: HTMLElement) => void | (() => void);
127
+ /** Names a frame in the strip. */
128
+ describe: (frame: Pick<Frame, "id" | "state">) => string;
129
+ /** What the strip adds for a frame flagged as later. */
130
+ laterText: string;
131
+ /** The words the player shows. */
132
+ words: Words;
133
+ }
134
+ /** A profile given in part: what differs from the default. */
135
+ export type ProfileOptions = Partial<Omit<Profile, "shells" | "scroll" | "words">> & {
136
+ shells?: Record<string, string>;
137
+ scroll?: Partial<Profile["scroll"]>;
138
+ words?: Partial<Words>;
139
+ };
140
+ /** What `mountScenes` takes. */
141
+ export interface MountOptions {
142
+ /** The casts. */
143
+ scenes: Scene[];
144
+ /** The element that receives the figures. */
145
+ into: HTMLElement;
146
+ /** The frames; collected from the whole document when left out. */
147
+ frames?: Frames;
148
+ /** What differs from the default profile. */
149
+ profile?: ProfileOptions;
150
+ /** The id of the one scene to show; otherwise the page's `#hash` chooses. */
151
+ solo?: string;
152
+ /** Play while in view. Off when the reader asks for reduced motion. On when left out. */
153
+ autoplay?: boolean;
154
+ /** Set when the page is shown in an iframe: it then tells the embedding page how tall it is. See `fitEmbeds`. */
155
+ embedded?: boolean;
156
+ /**
157
+ * Where each figure's title stands. `above`, when left out: a bar over the screen. `below`: the first row of
158
+ * the panel under the screen. The menu's three dots end the title's row in both.
159
+ */
160
+ title?: TitlePlace;
161
+ /**
162
+ * What each figure shows beside its screen: the title's row, the caption's rows and the controls' row, whole
163
+ * or part by part. Everything, when left out. A scene with nothing shown beside it still plays.
164
+ */
165
+ show?: Shown;
166
+ /** How keys are shown over the frames: a sign, when left out, or the letters themselves. */
167
+ keys?: KeysMode;
168
+ /**
169
+ * What is outlined in the frame while a step acts on it: what keys go to, on when left out, and what a click
170
+ * or a tap presses, off when left out.
171
+ */
172
+ outline?: Outline;
173
+ /**
174
+ * Play for practice: a step the scene marks with `practice` waits for the reader to do it on the frame. Left
175
+ * out, every scene plays through as a demonstration.
176
+ */
177
+ practice?: boolean;
178
+ /** Called when the step in view of a scene changes, with the scene's id and the step's index. */
179
+ onStep?: (sceneId: string, index: number) => void;
180
+ /** Called when a scene reaches its end, whether it then starts again or stops, with the scene's id. */
181
+ onEnd?: (sceneId: string) => void;
182
+ /**
183
+ * The speeds a scene can be played at, as how many times faster than it was written: `[0.5, 1, 2]` when left
184
+ * out. A press of the speed goes through them slowest first, and 1, the speed a scene starts at, is always
185
+ * among them.
186
+ */
187
+ speeds?: number[];
188
+ /**
189
+ * Whether every scene starts again at its end, whatever its cast says. Each scene as its cast says when left
190
+ * out: again, unless it says `"loop": false`. The reader can still turn it on and off from the menu.
191
+ */
192
+ loop?: boolean;
193
+ /** An element to fill with the legend of symbols. */
194
+ legend?: HTMLElement;
195
+ }
196
+ /** What one player is made with: the frames, the profile, and the choices of the page. */
197
+ export interface PlayerContext {
198
+ /** The frames by name. */
199
+ frames: Frames;
200
+ /** What the page says about its frames. */
201
+ profile: Profile;
202
+ /** Where the title stands. */
203
+ title?: TitlePlace;
204
+ /** The speeds the scene can be played at. */
205
+ speeds?: number[];
206
+ /** What the figure shows beside its screen. */
207
+ show?: Shown;
208
+ /** How keys are shown over the frame. */
209
+ keys?: KeysMode;
210
+ /** What is outlined in the frame while a step acts on it. */
211
+ outline?: Outline;
212
+ /** Whether a step marked for practice waits for the reader. */
213
+ practice?: boolean;
214
+ /** Whether the scene starts again at its end. What the scene says when left out. */
215
+ loop?: boolean;
216
+ /** Called when the step in view changes, with its index. */
217
+ onStep?: (index: number) => void;
218
+ /** Called when the scene reaches its end. */
219
+ onEnd?: () => void;
220
+ }
221
+ /**
222
+ * How keys are shown over a frame. `sign`: a small sign that words are being typed, and a keycap in a corner
223
+ * for a named key. `letters`: a strip of keystrokes just over the frame's line, with the sign, the letters as
224
+ * they arrive, the newest marked, and a named key as a cap after the words typed so far.
225
+ */
226
+ export type KeysMode = "sign" | "letters";
227
+ /**
228
+ * What is outlined in the frame, in the colour of the interactions, while a step acts on it. `keys`: what typed
229
+ * words and pressed keys go to, the element in focus; on when left out. `click`: what a click or a tap presses,
230
+ * from the press to the end of the step; off when left out.
231
+ */
232
+ export interface Outline {
233
+ keys?: boolean;
234
+ click?: boolean;
235
+ }
236
+ /** What applying a moment to a frame gives back. */
237
+ export interface Applied {
238
+ /** Whether words are still arriving in the frame's line. */
239
+ typing: boolean;
240
+ /**
241
+ * What was typed and pressed on the frame so far, in order: letters as they are, keys by their sign, so a
242
+ * typo taken back reads `bikr⌫e`.
243
+ */
244
+ strokes: string;
245
+ /** The frame's line, where words are typed, when the frame has one. */
246
+ line: HTMLElement | null;
247
+ /** What the moment outlines: what keys go to, and what a click pressed when the page asked. */
248
+ outlined: HTMLElement[];
249
+ /** Takes back every change the moment made to the frame. */
250
+ undo: () => void;
251
+ }
252
+ /** What `drawMarkup` needs to draw markup as it would look in its page. */
253
+ export interface Drawing {
254
+ /** The markup, well formed as XML, as `serializeElement` writes it. */
255
+ markup: string;
256
+ /** The page's style rules, as `collectStyles` gathers them. */
257
+ styles: string;
258
+ /** The width of the picture, in pixels. */
259
+ width: number;
260
+ /** The height of the picture, in pixels. */
261
+ height: number;
262
+ /** The attributes of the page's root element, such as its theme, so rules written against the root match. */
263
+ root?: Record<string, string>;
264
+ }
265
+ /** What `recordGif` needs of a player: its figure, its length, and a way to show any moment of it. */
266
+ export interface Recordable {
267
+ /** The figure to record. */
268
+ root: HTMLElement;
269
+ /** How long the scene lasts, in milliseconds. */
270
+ total: number;
271
+ /** Shows the moment at a time from the start. */
272
+ poseAt: (time: number) => void;
273
+ /** Whether the scene starts again at its end. */
274
+ loop?: boolean;
275
+ }
276
+ /**
277
+ * A slide a scene is shown on, at the size of a deck's slides. `framed`: the whole figure, with its title and
278
+ * caption, centred. `bare`: the screen alone, with the symbols over it, centred and as large as it fits.
279
+ */
280
+ export interface Slide {
281
+ /** The slide's width, in pixels. */
282
+ width: number;
283
+ /** The slide's height, in pixels. */
284
+ height: number;
285
+ /** What of the figure the slide shows. `framed` when left out. */
286
+ mode?: "framed" | "bare";
287
+ /** A line over the scene, in the slide's own type. */
288
+ title?: string;
289
+ /** A line under the scene, in the slide's own type. */
290
+ caption?: string;
291
+ }
292
+ /** How a recording is made. */
293
+ export interface RecordOptions {
294
+ /** Pictures per second. Ten for a GIF and thirty for a video when left out. */
295
+ fps?: number;
296
+ /**
297
+ * How many times faster than written the scene plays in the recording: 2 makes a twenty-second scene a
298
+ * ten-second file. As written when left out.
299
+ */
300
+ speed?: number;
301
+ /**
302
+ * Whether a GIF plays again when it ends. As the recorded scene does when left out, and again if it does not
303
+ * say. A video has no such setting: the program that plays it decides.
304
+ */
305
+ loop?: boolean;
306
+ /** The size of the recording, in pixels. The recorded element's own when left out. */
307
+ size?: {
308
+ width: number;
309
+ height: number;
310
+ };
311
+ /**
312
+ * A slide to show the scene on, at the slide's size: the recording is then of the slide, with the figure or
313
+ * its screen centred on it. The size, when given too, is the slide's.
314
+ */
315
+ slide?: Slide;
316
+ /** Called after each moment with how far the recording is, from 0 to 1. */
317
+ onProgress?: (done: number) => void;
318
+ /** Draws markup to pixels. The browser's own way when left out. */
319
+ draw?: (drawing: Drawing) => Promise<Uint8ClampedArray | Uint8Array>;
320
+ }
321
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/lib/player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AC5B,IAAI,EAAE,WAAW,CAAC;IAClB,iDAAiD;IACjD,KAAK,EAAE,MAAM,CAAC;IACd,iDAAiD;IACjD,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/B,iDAAiD;IACjD,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED;;;GAGG;AACH,MAAM,WAAW,KAAK;IACpB,oCAAoC;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,qCAAqC;IACrC,MAAM,EAAE,MAAM,CAAC;IACf,kEAAkE;IAClE,IAAI,CAAC,EAAE,QAAQ,GAAG,MAAM,CAAC;IACzB,sDAAsD;IACtD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,uDAAuD;IACvD,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,+BAA+B;AAC/B,MAAM,WAAW,aAAa;IAC5B,+EAA+E;IAC/E,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,sFAAsF;IACtF,IAAI,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IACzC;;;OAGG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,2EAA2E;IAC3E,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACpC,mEAAmE;IACnE,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,OAAO,CAAC,iBAAiB,GAAG,UAAU,CAAC,CAAC;CACtE"}
@@ -0,0 +1,17 @@
1
+ import type { Slide } from "./types.js";
2
+ /**
3
+ * Sets a scene's markup on a slide: the slide at its size, its title over the stage and its caption under it,
4
+ * and the scene centred on the stage, scaled to fill it.
5
+ *
6
+ * @param markup - The scene's markup, as `serializeElement` writes it.
7
+ * @param slide - The slide's size, its mode, and its title and caption.
8
+ * @param natural - The scene's own size, in pixels.
9
+ * @param font - The font the page sets the scene in. A slide written to a file stands outside the page, so it is
10
+ * given the page's font for its own title and caption.
11
+ * @returns The slide's markup, well formed as XML.
12
+ */
13
+ export default function wrapSlide(markup: string, slide: Slide, natural: {
14
+ width: number;
15
+ height: number;
16
+ }, font?: string): string;
17
+ //# sourceMappingURL=wrapSlide.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wrapSlide.d.ts","sourceRoot":"","sources":["../../../../src/lib/player/wrapSlide.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AASxC;;;;;;;;;;GAUG;AACH,MAAM,CAAC,OAAO,UAAU,SAAS,CAC/B,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,EAC1C,IAAI,CAAC,EAAE,MAAM,GACZ,MAAM,CASR"}
@@ -0,0 +1,16 @@
1
+ import type { Ticked, Timeline } from "./types.js";
2
+ /**
3
+ * Moves a scene's clock on by the time that passed since it was last moved.
4
+ *
5
+ * A tab that was in the background reports a long time at once; no more than a short step is taken of it, so a
6
+ * scene carries on from where it was seen and does not jump.
7
+ *
8
+ * @param timeline - The scene laid out in time.
9
+ * @param clock - The time before, in milliseconds from the start.
10
+ * @param passed - The time that passed, in milliseconds.
11
+ * @param speed - How many times faster than written the scene plays.
12
+ * @returns The time after. At the end a scene that loops is at its start again; one that does not has ended,
13
+ * and stays just before its end.
14
+ */
15
+ export default function advanceClock(timeline: Timeline, clock: number, passed: number, speed: number): Ticked;
16
+ //# sourceMappingURL=advanceClock.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"advanceClock.d.ts","sourceRoot":"","sources":["../../../../src/lib/timeline/advanceClock.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEnD;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,OAAO,UAAU,YAAY,CAClC,QAAQ,EAAE,QAAQ,EAClB,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,GACZ,MAAM,CAQR"}
@@ -0,0 +1,15 @@
1
+ import { type Scene } from "../cast/index.js";
2
+ import type { Timeline } from "./types.js";
3
+ /**
4
+ * Lays a scene out in time.
5
+ *
6
+ * How long typing lasts depends on the words typed, and the words a frame shows in its line are in the frame,
7
+ * not in the scene. The caller says how to read them.
8
+ *
9
+ * @param scene - The scene. Its first step must show a frame.
10
+ * @param readLine - Gives the words a frame shows in its line, by the frame's name; empty when it has none.
11
+ * @returns The scene's steps with their durations, their starts, its keyframes and its chapters.
12
+ * @throws When the scene has no steps or does not start on a frame.
13
+ */
14
+ export default function buildTimeline(scene: Scene, readLine: (frameName: string) => string): Timeline;
15
+ //# sourceMappingURL=buildTimeline.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"buildTimeline.d.ts","sourceRoot":"","sources":["../../../../src/lib/timeline/buildTimeline.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,KAAK,EAEX,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAE3C;;;;;;;;;;GAUG;AACH,MAAM,CAAC,OAAO,UAAU,aAAa,CACnC,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,MAAM,GACtC,QAAQ,CAsCV"}
@@ -0,0 +1,3 @@
1
+ /** The longest time one tick of the clock may move a scene on, in milliseconds. */
2
+ export declare const MAX_TICK = 64;
3
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/lib/timeline/constants.ts"],"names":[],"mappings":"AAAA,mFAAmF;AACnF,eAAO,MAAM,QAAQ,KAAK,CAAC"}
@@ -0,0 +1,10 @@
1
+ import type { Timeline } from "./types.js";
2
+ /**
3
+ * Finds the frame a step is drawn on: the last keyframe at or before it.
4
+ *
5
+ * @param timeline - The scene laid out in time. Its first step is a keyframe, so every step has one.
6
+ * @param index - The step.
7
+ * @returns The index of the keyframe.
8
+ */
9
+ export default function findKeyframe(timeline: Timeline, index: number): number;
10
+ //# sourceMappingURL=findKeyframe.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"findKeyframe.d.ts","sourceRoot":"","sources":["../../../../src/lib/timeline/findKeyframe.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAE3C;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,YAAY,CAClC,QAAQ,EAAE,QAAQ,EAClB,KAAK,EAAE,MAAM,GACZ,MAAM,CAER"}
@@ -0,0 +1,8 @@
1
+ export { default as advanceClock } from "./advanceClock.js";
2
+ export { default as buildTimeline } from "./buildTimeline.js";
3
+ export { MAX_TICK } from "./constants.js";
4
+ export { default as findKeyframe } from "./findKeyframe.js";
5
+ export { default as locateTime } from "./locateTime.js";
6
+ export { default as stepKeyframe } from "./stepKeyframe.js";
7
+ export type { Position, Ticked, Timeline } from "./types.js";
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/timeline/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAC5D,YAAY,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC"}
@@ -0,0 +1,10 @@
1
+ import type { Position, Timeline } from "./types.js";
2
+ /**
3
+ * Finds the step a time falls in, and how far into it.
4
+ *
5
+ * @param timeline - The scene laid out in time.
6
+ * @param time - In milliseconds from the start. Past the end, the end of the last step is given.
7
+ * @returns The step and the progress within it.
8
+ */
9
+ export default function locateTime(timeline: Timeline, time: number): Position;
10
+ //# sourceMappingURL=locateTime.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"locateTime.d.ts","sourceRoot":"","sources":["../../../../src/lib/timeline/locateTime.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAErD;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,GAAG,QAAQ,CAY7E"}
@@ -0,0 +1,12 @@
1
+ import type { Timeline } from "./types.js";
2
+ /**
3
+ * Says which keyframe is next or previous from a step.
4
+ *
5
+ * @param timeline - The scene laid out in time.
6
+ * @param at - The step in view.
7
+ * @param direction - 1 for the next frame of the sequence, -1 for the previous one. Going back from the middle
8
+ * of an interaction returns first to the frame it started from. Both wrap at the ends.
9
+ * @returns The index of the keyframe to go to.
10
+ */
11
+ export default function stepKeyframe(timeline: Timeline, at: number, direction: 1 | -1): number;
12
+ //# sourceMappingURL=stepKeyframe.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stepKeyframe.d.ts","sourceRoot":"","sources":["../../../../src/lib/timeline/stepKeyframe.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAE3C;;;;;;;;GAQG;AACH,MAAM,CAAC,OAAO,UAAU,YAAY,CAClC,QAAQ,EAAE,QAAQ,EAClB,EAAE,EAAE,MAAM,EACV,SAAS,EAAE,CAAC,GAAG,CAAC,CAAC,GAChB,MAAM,CAQR"}
@@ -0,0 +1,40 @@
1
+ import type { Step } from "../cast/index.js";
2
+ /** A scene laid out in time: how long each step lasts, where each starts, and which steps are frames. */
3
+ export interface Timeline {
4
+ /** The steps of the scene, in order. */
5
+ steps: Step[];
6
+ /** How many characters each step types; 0 for a step that types nothing. */
7
+ chars: number[];
8
+ /** How long each step lasts, in milliseconds. */
9
+ durations: number[];
10
+ /** When each step starts, in milliseconds from the start of the scene. */
11
+ starts: number[];
12
+ /** How long the scene lasts, in milliseconds. */
13
+ total: number;
14
+ /** The indices of the steps that show a frame. */
15
+ keyframes: number[];
16
+ /** The chapters of the scene: each one's name and the step it opens with. */
17
+ chapters: {
18
+ name: string;
19
+ index: number;
20
+ }[];
21
+ /** Whether the scene starts again when it ends. */
22
+ loop: boolean;
23
+ }
24
+ /** A place in a scene: a step, and how far into it. */
25
+ export interface Position {
26
+ /** The step. */
27
+ index: number;
28
+ /** How far into the step, from 0 to 1. */
29
+ progress: number;
30
+ }
31
+ /** A clock after it was moved on. */
32
+ export interface Ticked {
33
+ /** The time, in milliseconds from the start of the scene. */
34
+ clock: number;
35
+ /** Whether the scene reached its end and does not start again. */
36
+ ended: boolean;
37
+ /** Whether the scene reached its end and started again. */
38
+ looped: boolean;
39
+ }
40
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/lib/timeline/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAE7C,yGAAyG;AACzG,MAAM,WAAW,QAAQ;IACvB,wCAAwC;IACxC,KAAK,EAAE,IAAI,EAAE,CAAC;IACd,4EAA4E;IAC5E,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,iDAAiD;IACjD,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,0EAA0E;IAC1E,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,iDAAiD;IACjD,KAAK,EAAE,MAAM,CAAC;IACd,kDAAkD;IAClD,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,6EAA6E;IAC7E,QAAQ,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAC5C,mDAAmD;IACnD,IAAI,EAAE,OAAO,CAAC;CACf;AAED,uDAAuD;AACvD,MAAM,WAAW,QAAQ;IACvB,gBAAgB;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,0CAA0C;IAC1C,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,qCAAqC;AACrC,MAAM,WAAW,MAAM;IACrB,6DAA6D;IAC7D,KAAK,EAAE,MAAM,CAAC;IACd,kEAAkE;IAClE,KAAK,EAAE,OAAO,CAAC;IACf,2DAA2D;IAC3D,MAAM,EAAE,OAAO,CAAC;CACjB"}
@@ -0,0 +1,5 @@
1
+ /** The units a second is cut into in the file: one that divides evenly by the usual picture rates. */
2
+ export declare const TIMESCALE = 90000;
3
+ /** The identity transformation a track and a movie carry, as the format writes it. */
4
+ export declare const IDENTITY_MATRIX: readonly [65536, 0, 0, 0, 65536, 0, 0, 0, 1073741824];
5
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/lib/video/constants.ts"],"names":[],"mappings":"AAAA,sGAAsG;AACtG,eAAO,MAAM,SAAS,QAAQ,CAAC;AAE/B,sFAAsF;AACtF,eAAO,MAAM,eAAe,YAC1B,KAAU,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,KAAU,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,UAAU,CAC5C,CAAC"}
@@ -0,0 +1,5 @@
1
+ export { IDENTITY_MATRIX, TIMESCALE } from "./constants.js";
2
+ export type { EncodedVideo, Sample } from "./types.js";
3
+ export { default as writeBox } from "./writeBox.js";
4
+ export { default as writeMp4 } from "./writeMp4.js";
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/video/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC5D,YAAY,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AACvD,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,eAAe,CAAC"}
@@ -0,0 +1,21 @@
1
+ /** One encoded picture of a video, as an encoder gives it. */
2
+ export interface Sample {
3
+ /** The picture's bytes, each unit of the stream prefixed with its length. */
4
+ data: Uint8Array;
5
+ /** Whether the picture can be decoded alone, so a player can start or seek there. */
6
+ key: boolean;
7
+ }
8
+ /** An encoded H.264 video, ready to be written as a file. */
9
+ export interface EncodedVideo {
10
+ /** The width of every picture, in pixels. */
11
+ width: number;
12
+ /** The height of every picture, in pixels. */
13
+ height: number;
14
+ /** Pictures per second; every picture lasts as long. */
15
+ fps: number;
16
+ /** The decoder's configuration record, as the encoder describes the stream. */
17
+ description: Uint8Array;
18
+ /** The pictures, in order. */
19
+ samples: Sample[];
20
+ }
21
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/lib/video/types.ts"],"names":[],"mappings":"AAAA,8DAA8D;AAC9D,MAAM,WAAW,MAAM;IACrB,6EAA6E;IAC7E,IAAI,EAAE,UAAU,CAAC;IACjB,qFAAqF;IACrF,GAAG,EAAE,OAAO,CAAC;CACd;AAED,6DAA6D;AAC7D,MAAM,WAAW,YAAY;IAC3B,6CAA6C;IAC7C,KAAK,EAAE,MAAM,CAAC;IACd,8CAA8C;IAC9C,MAAM,EAAE,MAAM,CAAC;IACf,wDAAwD;IACxD,GAAG,EAAE,MAAM,CAAC;IACZ,+EAA+E;IAC/E,WAAW,EAAE,UAAU,CAAC;IACxB,8BAA8B;IAC9B,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Writes one box of the ISO media file format: its size, its four-letter type, and what it holds.
3
+ *
4
+ * @param type - The box's type, four letters.
5
+ * @param parts - What the box holds, in order.
6
+ * @returns The box's bytes.
7
+ */
8
+ export default function writeBox(type: string, ...parts: Uint8Array[]): Uint8Array;
9
+ //# sourceMappingURL=writeBox.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"writeBox.d.ts","sourceRoot":"","sources":["../../../../src/lib/video/writeBox.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,QAAQ,CAC9B,IAAI,EAAE,MAAM,EACZ,GAAG,KAAK,EAAE,UAAU,EAAE,GACrB,UAAU,CAWZ"}
@@ -0,0 +1,10 @@
1
+ import type { EncodedVideo } from "./types.js";
2
+ /**
3
+ * Writes an encoded H.264 video as an MP4 file that plays in browsers, presentation software and video players:
4
+ * one track, every picture of the same duration, the index at the front so the file plays as it loads.
5
+ *
6
+ * @param video - The size, the rate, the decoder's configuration and the encoded pictures.
7
+ * @returns The bytes of the file.
8
+ */
9
+ export default function writeMp4(video: EncodedVideo): Uint8Array;
10
+ //# sourceMappingURL=writeMp4.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"writeMp4.d.ts","sourceRoot":"","sources":["../../../../src/lib/video/writeMp4.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AA4B/C;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,KAAK,EAAE,YAAY,GAAG,UAAU,CAkGhE"}