@allyhub/sdk 0.8.0 → 0.10.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 (497) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/NOTICE +46 -49
  3. package/dist/dom.d.ts +1 -209
  4. package/dist/dom.js +1 -1
  5. package/dist/image.d.ts +2 -0
  6. package/dist/image.js +2 -0
  7. package/dist/index.d.ts +1 -21
  8. package/dist/index.js +1 -1
  9. package/dist/media.d.ts +1 -5
  10. package/dist/media.js +1 -1
  11. package/dist/node_modules/@allyhub/audio/dist/levels.d.ts +4 -5
  12. package/dist/node_modules/@allyhub/audio/dist/levels.js +1 -1
  13. package/dist/node_modules/@allyhub/audio/dist/node/ffmpeg.d.ts +1 -6
  14. package/dist/node_modules/@allyhub/audio/dist/node/ffmpeg.js +1 -1
  15. package/dist/node_modules/@allyhub/audio/package.json +1 -1
  16. package/dist/node_modules/@allyhub/chart/dist/chart-file.js +1 -1
  17. package/dist/node_modules/@allyhub/chart/dist/chart-xml.d.ts +4 -1
  18. package/dist/node_modules/@allyhub/chart/dist/chart-xml.js +2 -2
  19. package/dist/node_modules/@allyhub/chart/dist/chart.d.ts +22 -0
  20. package/dist/node_modules/@allyhub/chart/dist/chart.js +1 -1
  21. package/dist/node_modules/@allyhub/chart/package.json +1 -1
  22. package/dist/node_modules/@allyhub/diagnostics/LICENSE +241 -0
  23. package/dist/node_modules/@allyhub/diagnostics/dist/fact.d.ts +37 -0
  24. package/dist/node_modules/@allyhub/diagnostics/dist/fact.js +2 -0
  25. package/dist/node_modules/@allyhub/diagnostics/dist/index.d.ts +4 -0
  26. package/dist/node_modules/@allyhub/diagnostics/dist/index.js +2 -0
  27. package/dist/node_modules/@allyhub/diagnostics/dist/problem.d.ts +43 -0
  28. package/dist/node_modules/@allyhub/diagnostics/dist/problem.js +2 -0
  29. package/dist/node_modules/@allyhub/diagnostics/dist/rules.d.ts +30 -0
  30. package/dist/node_modules/@allyhub/diagnostics/dist/rules.js +2 -0
  31. package/dist/node_modules/@allyhub/diagnostics/package.json +14 -0
  32. package/dist/node_modules/@allyhub/formats/dist/contributed.d.ts +126 -0
  33. package/dist/node_modules/@allyhub/formats/dist/contributed.js +2 -0
  34. package/dist/node_modules/@allyhub/formats/dist/data/faces.d.ts +1 -1
  35. package/dist/node_modules/@allyhub/formats/dist/data/reference.d.ts +7 -12
  36. package/dist/node_modules/@allyhub/formats/dist/data/reference.js +1 -1
  37. package/dist/node_modules/@allyhub/formats/dist/data/script.d.ts +9 -4
  38. package/dist/node_modules/@allyhub/formats/dist/data/script.js +1 -1
  39. package/dist/node_modules/@allyhub/formats/dist/data/sheet.d.ts +107 -83
  40. package/dist/node_modules/@allyhub/formats/dist/data/sheet.js +1 -1
  41. package/dist/node_modules/@allyhub/formats/dist/data/slides.d.ts +185 -8
  42. package/dist/node_modules/@allyhub/formats/dist/data/slides.js +1 -1
  43. package/dist/node_modules/@allyhub/formats/dist/data/website.d.ts +2 -1
  44. package/dist/node_modules/@allyhub/formats/dist/data/website.js +1 -1
  45. package/dist/node_modules/@allyhub/formats/dist/data/work.d.ts +42 -0
  46. package/dist/node_modules/@allyhub/formats/dist/data/work.js +2 -0
  47. package/dist/node_modules/@allyhub/formats/dist/extension.d.ts +91 -0
  48. package/dist/node_modules/@allyhub/formats/dist/extension.js +2 -0
  49. package/dist/node_modules/@allyhub/formats/dist/files.d.ts +51 -0
  50. package/dist/node_modules/@allyhub/formats/dist/files.js +2 -0
  51. package/dist/node_modules/@allyhub/formats/dist/index.d.ts +5 -1
  52. package/dist/node_modules/@allyhub/formats/dist/index.js +1 -1
  53. package/dist/node_modules/@allyhub/formats/dist/items.d.ts +226 -90
  54. package/dist/node_modules/@allyhub/formats/dist/items.js +1 -1
  55. package/dist/node_modules/@allyhub/formats/dist/layout.d.ts +7 -1
  56. package/dist/node_modules/@allyhub/formats/dist/layout.js +1 -1
  57. package/dist/node_modules/@allyhub/formats/dist/schemas.d.ts +96 -42
  58. package/dist/node_modules/@allyhub/formats/dist/schemas.js +1 -1
  59. package/dist/node_modules/@allyhub/formats/package.json +1 -1
  60. package/dist/node_modules/@allyhub/image-draw/LICENSE +241 -0
  61. package/dist/node_modules/@allyhub/image-draw/dist/context.d.ts +5 -0
  62. package/dist/node_modules/@allyhub/image-draw/dist/context.js +2 -0
  63. package/dist/node_modules/@allyhub/image-draw/dist/contrast.d.ts +13 -0
  64. package/dist/node_modules/@allyhub/image-draw/dist/contrast.js +2 -0
  65. package/dist/node_modules/@allyhub/image-draw/dist/env.d.ts +112 -0
  66. package/dist/node_modules/@allyhub/image-draw/dist/env.js +2 -0
  67. package/dist/node_modules/@allyhub/image-draw/dist/errors.d.ts +20 -0
  68. package/dist/node_modules/@allyhub/image-draw/dist/errors.js +2 -0
  69. package/dist/node_modules/@allyhub/image-draw/dist/fonts.d.ts +110 -0
  70. package/dist/node_modules/@allyhub/image-draw/dist/fonts.js +2 -0
  71. package/dist/node_modules/@allyhub/image-draw/dist/guards.d.ts +32 -0
  72. package/dist/node_modules/@allyhub/image-draw/dist/guards.js +2 -0
  73. package/dist/node_modules/@allyhub/image-draw/dist/hash.d.ts +3 -0
  74. package/dist/node_modules/@allyhub/image-draw/dist/hash.js +2 -0
  75. package/dist/node_modules/@allyhub/image-draw/dist/inspect.d.ts +113 -0
  76. package/dist/node_modules/@allyhub/image-draw/dist/inspect.js +3 -0
  77. package/dist/node_modules/@allyhub/image-draw/dist/layer-style.d.ts +151 -0
  78. package/dist/node_modules/@allyhub/image-draw/dist/layer-style.js +2 -0
  79. package/dist/node_modules/@allyhub/image-draw/dist/paint.d.ts +29 -0
  80. package/dist/node_modules/@allyhub/image-draw/dist/paint.js +2 -0
  81. package/dist/node_modules/@allyhub/image-draw/dist/pictures.d.ts +39 -0
  82. package/dist/node_modules/@allyhub/image-draw/dist/pictures.js +2 -0
  83. package/dist/node_modules/@allyhub/image-draw/dist/plan.d.ts +52 -0
  84. package/dist/node_modules/@allyhub/image-draw/dist/plan.js +2 -0
  85. package/dist/node_modules/@allyhub/image-draw/dist/reads.d.ts +145 -0
  86. package/dist/node_modules/@allyhub/image-draw/dist/reads.js +2 -0
  87. package/dist/node_modules/@allyhub/image-draw/dist/shape-path.d.ts +26 -0
  88. package/dist/node_modules/@allyhub/image-draw/dist/shape-path.js +2 -0
  89. package/dist/node_modules/@allyhub/image-draw/dist/stage.d.ts +56 -0
  90. package/dist/node_modules/@allyhub/image-draw/dist/stage.js +2 -0
  91. package/dist/node_modules/@allyhub/image-draw/dist/styles.d.ts +35 -0
  92. package/dist/node_modules/@allyhub/image-draw/dist/styles.js +2 -0
  93. package/dist/node_modules/@allyhub/image-draw/dist/tone.d.ts +53 -0
  94. package/dist/node_modules/@allyhub/image-draw/dist/tone.js +2 -0
  95. package/dist/node_modules/@allyhub/image-draw/package.json +14 -0
  96. package/dist/node_modules/@allyhub/image-measure/LICENSE +241 -0
  97. package/dist/node_modules/@allyhub/image-measure/dist/contrast.d.ts +43 -0
  98. package/dist/node_modules/@allyhub/image-measure/dist/contrast.js +2 -0
  99. package/dist/node_modules/@allyhub/image-measure/dist/layout.d.ts +186 -0
  100. package/dist/node_modules/@allyhub/image-measure/dist/layout.js +5 -0
  101. package/dist/node_modules/@allyhub/image-measure/package.json +14 -0
  102. package/dist/node_modules/@allyhub/image-sdk/LICENSE +241 -0
  103. package/dist/node_modules/@allyhub/image-sdk/dist/adjustment.d.ts +13 -0
  104. package/dist/node_modules/@allyhub/image-sdk/dist/adjustment.js +2 -0
  105. package/dist/{define.d.ts → node_modules/@allyhub/image-sdk/dist/define.d.ts} +21 -4
  106. package/dist/node_modules/@allyhub/image-sdk/dist/define.js +2 -0
  107. package/dist/node_modules/@allyhub/image-sdk/dist/dom.d.ts +210 -0
  108. package/dist/node_modules/@allyhub/image-sdk/dist/dom.js +2 -0
  109. package/dist/node_modules/@allyhub/image-sdk/dist/fill.d.ts +21 -0
  110. package/dist/node_modules/@allyhub/image-sdk/dist/fill.js +2 -0
  111. package/dist/node_modules/@allyhub/image-sdk/dist/group.d.ts +17 -0
  112. package/dist/node_modules/@allyhub/image-sdk/dist/group.js +2 -0
  113. package/dist/node_modules/@allyhub/image-sdk/dist/index.d.ts +166 -0
  114. package/dist/node_modules/@allyhub/image-sdk/dist/index.js +2 -0
  115. package/dist/node_modules/@allyhub/image-sdk/dist/media.d.ts +6 -0
  116. package/dist/node_modules/@allyhub/image-sdk/dist/media.js +2 -0
  117. package/dist/{messages.d.ts → node_modules/@allyhub/image-sdk/dist/messages.d.ts} +1 -1
  118. package/dist/node_modules/@allyhub/image-sdk/dist/picture.d.ts +59 -0
  119. package/dist/node_modules/@allyhub/image-sdk/dist/picture.js +2 -0
  120. package/dist/{props.d.ts → node_modules/@allyhub/image-sdk/dist/props.d.ts} +4 -4
  121. package/dist/node_modules/@allyhub/image-sdk/dist/shape.d.ts +34 -0
  122. package/dist/node_modules/@allyhub/image-sdk/dist/shape.js +2 -0
  123. package/dist/node_modules/@allyhub/image-sdk/dist/stack.d.ts +16 -0
  124. package/dist/node_modules/@allyhub/image-sdk/dist/stack.js +2 -0
  125. package/dist/node_modules/@allyhub/image-sdk/dist/text-layer.d.ts +38 -0
  126. package/dist/node_modules/@allyhub/image-sdk/dist/text-layer.js +2 -0
  127. package/dist/{written.js → node_modules/@allyhub/image-sdk/dist/written.js} +1 -1
  128. package/dist/node_modules/@allyhub/image-sdk/package.json +19 -0
  129. package/dist/node_modules/@allyhub/measure/LICENSE +241 -0
  130. package/dist/node_modules/@allyhub/measure/dist/compare.d.ts +195 -0
  131. package/dist/node_modules/@allyhub/measure/dist/compare.js +2 -0
  132. package/dist/node_modules/@allyhub/measure/dist/grain.d.ts +8 -0
  133. package/dist/node_modules/@allyhub/measure/dist/grain.js +2 -0
  134. package/dist/node_modules/@allyhub/measure/dist/image.d.ts +16 -0
  135. package/dist/node_modules/@allyhub/measure/dist/image.js +2 -0
  136. package/dist/node_modules/@allyhub/measure/dist/index.d.ts +4 -0
  137. package/dist/node_modules/@allyhub/measure/dist/index.js +2 -0
  138. package/dist/node_modules/@allyhub/measure/package.json +13 -0
  139. package/dist/node_modules/@allyhub/ooxml/dist/generated/presets.d.ts +4 -1
  140. package/dist/node_modules/@allyhub/ooxml/dist/generated/presets.js +1 -1
  141. package/dist/node_modules/@allyhub/ooxml/dist/geometry/index.d.ts +15 -1
  142. package/dist/node_modules/@allyhub/ooxml/dist/geometry/index.js +1 -1
  143. package/dist/node_modules/@allyhub/ooxml/package.json +1 -1
  144. package/dist/node_modules/@allyhub/piece/LICENSE +241 -0
  145. package/dist/node_modules/@allyhub/{video-core → piece}/dist/anchors.d.ts +1 -9
  146. package/dist/node_modules/@allyhub/{video-core → piece}/dist/component.js +1 -1
  147. package/dist/node_modules/@allyhub/piece/dist/context.d.ts +39 -0
  148. package/dist/node_modules/@allyhub/piece/dist/context.js +2 -0
  149. package/dist/node_modules/@allyhub/{video-core → piece}/dist/contrast.d.ts +2 -2
  150. package/dist/node_modules/@allyhub/{video-core → piece}/dist/export.d.ts +27 -10
  151. package/dist/node_modules/@allyhub/piece/dist/export.js +2 -0
  152. package/dist/node_modules/@allyhub/{video-core → piece}/dist/formats.d.ts +12 -68
  153. package/dist/node_modules/@allyhub/piece/dist/formats.js +2 -0
  154. package/dist/node_modules/@allyhub/piece/dist/gen.d.ts +104 -0
  155. package/dist/node_modules/@allyhub/piece/dist/index.d.ts +26 -0
  156. package/dist/node_modules/@allyhub/piece/dist/index.js +2 -0
  157. package/dist/node_modules/@allyhub/piece/dist/layer-style.d.ts +1558 -0
  158. package/dist/node_modules/@allyhub/piece/dist/layer-style.js +2 -0
  159. package/dist/node_modules/@allyhub/piece/dist/layer.d.ts +389 -0
  160. package/dist/node_modules/@allyhub/piece/dist/layer.js +2 -0
  161. package/dist/node_modules/@allyhub/piece/dist/layout.d.ts +437 -0
  162. package/dist/node_modules/@allyhub/piece/dist/layout.js +2 -0
  163. package/dist/node_modules/@allyhub/{video-core → piece}/dist/look.d.ts +1 -1
  164. package/dist/node_modules/@allyhub/{video-core → piece}/dist/media.d.ts +39 -9
  165. package/dist/node_modules/@allyhub/{video-core → piece}/dist/media.js +1 -1
  166. package/dist/node_modules/@allyhub/{video-core → piece}/dist/messages.d.ts +6 -0
  167. package/dist/node_modules/@allyhub/piece/dist/names.d.ts +26 -0
  168. package/dist/node_modules/@allyhub/piece/dist/names.js +2 -0
  169. package/dist/node_modules/@allyhub/piece/dist/page/console.d.ts +21 -0
  170. package/dist/node_modules/@allyhub/piece/dist/page/console.js +2 -0
  171. package/dist/node_modules/@allyhub/piece/dist/page/index.d.ts +3 -0
  172. package/dist/node_modules/@allyhub/piece/dist/page/index.js +2 -0
  173. package/dist/node_modules/@allyhub/piece/dist/page/locate.d.ts +4 -0
  174. package/dist/node_modules/@allyhub/piece/dist/page/locate.js +2 -0
  175. package/dist/node_modules/@allyhub/piece/dist/picture.d.ts +62 -0
  176. package/dist/node_modules/@allyhub/piece/dist/picture.js +2 -0
  177. package/dist/node_modules/@allyhub/piece/dist/piece.d.ts +15 -0
  178. package/dist/node_modules/@allyhub/piece/dist/piece.js +2 -0
  179. package/dist/node_modules/@allyhub/{video-core → piece}/dist/script.d.ts +9 -4
  180. package/dist/node_modules/@allyhub/piece/dist/script.js +2 -0
  181. package/dist/node_modules/@allyhub/piece/dist/source.d.ts +131 -0
  182. package/dist/node_modules/@allyhub/piece/dist/stage.d.ts +291 -0
  183. package/dist/node_modules/@allyhub/piece/dist/stage.js +2 -0
  184. package/dist/node_modules/@allyhub/piece/dist/version.d.ts +15 -0
  185. package/dist/node_modules/@allyhub/piece/dist/version.js +2 -0
  186. package/dist/node_modules/@allyhub/{video-core → piece}/dist/voice.d.ts +1 -20
  187. package/dist/node_modules/@allyhub/piece/package.json +18 -0
  188. package/dist/node_modules/@allyhub/protocol/dist/account.d.ts +271 -0
  189. package/dist/node_modules/@allyhub/protocol/dist/account.js +1 -1
  190. package/dist/node_modules/@allyhub/protocol/dist/app.d.ts +3 -10
  191. package/dist/node_modules/@allyhub/protocol/dist/app.js +1 -1
  192. package/dist/node_modules/@allyhub/protocol/dist/auth.d.ts +19 -1
  193. package/dist/node_modules/@allyhub/protocol/dist/auth.js +1 -1
  194. package/dist/node_modules/@allyhub/protocol/dist/browser-bridge.d.ts +337 -0
  195. package/dist/node_modules/@allyhub/protocol/dist/browser-bridge.js +2 -0
  196. package/dist/node_modules/@allyhub/protocol/dist/cli.d.ts +12 -1
  197. package/dist/node_modules/@allyhub/protocol/dist/cli.js +1 -1
  198. package/dist/node_modules/@allyhub/protocol/dist/cloud.d.ts +155 -0
  199. package/dist/node_modules/@allyhub/protocol/dist/cloud.js +1 -1
  200. package/dist/node_modules/@allyhub/protocol/dist/editor.d.ts +235 -133
  201. package/dist/node_modules/@allyhub/protocol/dist/editor.js +1 -1
  202. package/dist/node_modules/@allyhub/protocol/dist/files.d.ts +2 -0
  203. package/dist/node_modules/@allyhub/protocol/dist/files.js +1 -1
  204. package/dist/node_modules/@allyhub/protocol/dist/frame.d.ts +65 -197
  205. package/dist/node_modules/@allyhub/protocol/dist/frame.js +1 -1
  206. package/dist/node_modules/@allyhub/protocol/dist/image.d.ts +8 -0
  207. package/dist/node_modules/@allyhub/protocol/dist/image.js +2 -0
  208. package/dist/node_modules/@allyhub/protocol/dist/index.d.ts +6 -0
  209. package/dist/node_modules/@allyhub/protocol/dist/index.js +1 -1
  210. package/dist/node_modules/@allyhub/protocol/dist/jobs.d.ts +6 -6
  211. package/dist/node_modules/@allyhub/protocol/dist/kinds.d.ts +98 -0
  212. package/dist/node_modules/@allyhub/protocol/dist/kinds.js +2 -0
  213. package/dist/node_modules/@allyhub/protocol/dist/mail.d.ts +274 -0
  214. package/dist/node_modules/@allyhub/protocol/dist/mail.js +2 -0
  215. package/dist/node_modules/@allyhub/protocol/dist/notes.d.ts +77 -91
  216. package/dist/node_modules/@allyhub/protocol/dist/notes.js +1 -1
  217. package/dist/node_modules/@allyhub/protocol/dist/peer.d.ts +59 -0
  218. package/dist/node_modules/@allyhub/protocol/dist/peer.js +2 -0
  219. package/dist/node_modules/@allyhub/protocol/dist/place.d.ts +21 -0
  220. package/dist/node_modules/@allyhub/protocol/dist/place.js +2 -0
  221. package/dist/node_modules/@allyhub/protocol/dist/presence.d.ts +125 -0
  222. package/dist/node_modules/@allyhub/protocol/dist/presence.js +2 -0
  223. package/dist/node_modules/@allyhub/protocol/dist/registry.d.ts +1 -1
  224. package/dist/node_modules/@allyhub/protocol/dist/routes.js +1 -1
  225. package/dist/node_modules/@allyhub/protocol/dist/shape.d.ts +35 -0
  226. package/dist/node_modules/@allyhub/protocol/dist/shape.js +2 -0
  227. package/dist/node_modules/@allyhub/protocol/dist/shares.d.ts +2 -8
  228. package/dist/node_modules/@allyhub/protocol/dist/shares.js +1 -1
  229. package/dist/node_modules/@allyhub/protocol/dist/snapshots.d.ts +70 -40
  230. package/dist/node_modules/@allyhub/protocol/dist/snapshots.js +1 -1
  231. package/dist/node_modules/@allyhub/protocol/dist/tools.d.ts +224 -177
  232. package/dist/node_modules/@allyhub/protocol/dist/tools.js +1 -1
  233. package/dist/node_modules/@allyhub/protocol/package.json +5 -1
  234. package/dist/node_modules/@allyhub/runtimes/dist/bundled.js +1 -1
  235. package/dist/node_modules/@allyhub/runtimes/dist/declared.d.ts +14 -0
  236. package/dist/node_modules/@allyhub/runtimes/dist/declared.js +2 -0
  237. package/dist/node_modules/@allyhub/runtimes/dist/ffmpeg.d.ts +15 -0
  238. package/dist/node_modules/@allyhub/runtimes/dist/ffmpeg.js +2 -0
  239. package/dist/node_modules/@allyhub/runtimes/dist/index.d.ts +2 -0
  240. package/dist/node_modules/@allyhub/runtimes/dist/index.js +1 -1
  241. package/dist/node_modules/@allyhub/runtimes/dist/packages.js +3 -3
  242. package/dist/node_modules/@allyhub/runtimes/dist/runtimes.d.ts +1 -0
  243. package/dist/node_modules/@allyhub/runtimes/dist/runtimes.js +1 -1
  244. package/dist/node_modules/@allyhub/runtimes/manifest.json +0 -82
  245. package/dist/node_modules/@allyhub/runtimes/package.json +1 -1
  246. package/dist/node_modules/@allyhub/scenery/dist/define.d.ts +2 -0
  247. package/dist/node_modules/@allyhub/scenery/dist/define.js +1 -1
  248. package/dist/node_modules/@allyhub/scenery/dist/index.d.ts +2 -2
  249. package/dist/node_modules/@allyhub/scenery/dist/index.js +1 -1
  250. package/dist/node_modules/@allyhub/scenery/dist/moire.d.ts +45 -5
  251. package/dist/node_modules/@allyhub/scenery/dist/moire.js +2 -2
  252. package/dist/node_modules/@allyhub/scenery/dist/phone.d.ts +4 -3
  253. package/dist/node_modules/@allyhub/scenery/dist/phone.js +1 -1
  254. package/dist/node_modules/@allyhub/scenery/package.json +1 -1
  255. package/dist/node_modules/@allyhub/sheet/dist/api/capabilities.js +1 -1
  256. package/dist/node_modules/@allyhub/sheet/dist/api/code.d.ts +4 -4
  257. package/dist/node_modules/@allyhub/sheet/dist/api/code.js +1 -1
  258. package/dist/node_modules/@allyhub/sheet/dist/api/workbook.d.ts +15 -11
  259. package/dist/node_modules/@allyhub/sheet/dist/api/workbook.js +1 -1
  260. package/dist/node_modules/@allyhub/sheet/dist/calc/coerce.js +1 -1
  261. package/dist/node_modules/@allyhub/sheet/dist/calc/engine.d.ts +70 -0
  262. package/dist/node_modules/@allyhub/sheet/dist/calc/engine.js +1 -1
  263. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/criteria.d.ts +6 -0
  264. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/criteria.js +1 -1
  265. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/date.js +1 -1
  266. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/define.d.ts +3 -1
  267. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/define.js +1 -1
  268. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/info.js +1 -1
  269. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/kernels.js +1 -1
  270. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/lookup.js +1 -1
  271. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/maths.js +1 -1
  272. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/text.js +1 -1
  273. package/dist/node_modules/@allyhub/sheet/dist/calc/indexes.d.ts +9 -0
  274. package/dist/node_modules/@allyhub/sheet/dist/calc/indexes.js +1 -1
  275. package/dist/node_modules/@allyhub/sheet/dist/calc/server.d.ts +1 -1
  276. package/dist/node_modules/@allyhub/sheet/dist/calc/types.d.ts +6 -0
  277. package/dist/node_modules/@allyhub/sheet/dist/calc/types.js +1 -1
  278. package/dist/node_modules/@allyhub/sheet/dist/chart.d.ts +9 -0
  279. package/dist/node_modules/@allyhub/sheet/dist/chart.js +1 -1
  280. package/dist/node_modules/@allyhub/sheet/dist/export.js +1 -1
  281. package/dist/node_modules/@allyhub/sheet/dist/file.d.ts +5 -0
  282. package/dist/node_modules/@allyhub/sheet/dist/file.js +1 -1
  283. package/dist/node_modules/@allyhub/sheet/dist/formula/ast.d.ts +12 -1
  284. package/dist/node_modules/@allyhub/sheet/dist/formula/move.d.ts +5 -1
  285. package/dist/node_modules/@allyhub/sheet/dist/formula/move.js +1 -1
  286. package/dist/node_modules/@allyhub/sheet/dist/formula/parse.js +1 -1
  287. package/dist/node_modules/@allyhub/sheet/dist/formula/print.js +1 -1
  288. package/dist/node_modules/@allyhub/sheet/dist/generated.d.ts +5 -19
  289. package/dist/node_modules/@allyhub/sheet/dist/generated.js +1 -1
  290. package/dist/node_modules/@allyhub/sheet/dist/import.d.ts +3 -1
  291. package/dist/node_modules/@allyhub/sheet/dist/import.js +1 -1
  292. package/dist/node_modules/@allyhub/sheet/dist/index.d.ts +5 -5
  293. package/dist/node_modules/@allyhub/sheet/dist/index.js +1 -1
  294. package/dist/node_modules/@allyhub/sheet/dist/inspect.d.ts +88 -3
  295. package/dist/node_modules/@allyhub/sheet/dist/inspect.js +1 -1
  296. package/dist/node_modules/@allyhub/sheet/dist/patch.d.ts +1 -1
  297. package/dist/node_modules/@allyhub/sheet/dist/patch.js +1 -1
  298. package/dist/node_modules/@allyhub/sheet/dist/printed.d.ts +19 -0
  299. package/dist/node_modules/@allyhub/sheet/dist/printed.js +2 -0
  300. package/dist/node_modules/@allyhub/sheet/dist/sdk.d.ts +2 -0
  301. package/dist/node_modules/@allyhub/sheet/dist/sdk.js +2 -0
  302. package/dist/node_modules/@allyhub/sheet/dist/values.d.ts +2 -0
  303. package/dist/node_modules/@allyhub/sheet/dist/values.js +1 -1
  304. package/dist/node_modules/@allyhub/sheet/dist/workbook.d.ts +8 -6
  305. package/dist/node_modules/@allyhub/sheet/dist/workbook.js +1 -1
  306. package/dist/node_modules/@allyhub/sheet/dist/write.js +15 -15
  307. package/dist/node_modules/@allyhub/sheet/dist/xlsx/charts.d.ts +6 -2
  308. package/dist/node_modules/@allyhub/sheet/dist/xlsx/charts.js +1 -1
  309. package/dist/node_modules/@allyhub/sheet/dist/xlsx/formula.js +2 -2
  310. package/dist/node_modules/@allyhub/sheet/dist/xlsx/import.d.ts +2 -1
  311. package/dist/node_modules/@allyhub/sheet/dist/xlsx/import.js +1 -1
  312. package/dist/node_modules/@allyhub/sheet/dist/xlsx/read.d.ts +3 -1
  313. package/dist/node_modules/@allyhub/sheet/dist/xlsx/read.js +2 -2
  314. package/dist/node_modules/@allyhub/sheet/dist/xlsx/sax.d.ts +7 -1
  315. package/dist/node_modules/@allyhub/sheet/dist/xlsx/sax.js +3 -1
  316. package/dist/node_modules/@allyhub/sheet/dist/xlsx/styles.d.ts +6 -0
  317. package/dist/node_modules/@allyhub/sheet/dist/xlsx/styles.js +1 -1
  318. package/dist/node_modules/@allyhub/sheet/dist/xlsx/write.d.ts +1 -1
  319. package/dist/node_modules/@allyhub/sheet/dist/xlsx/write.js +1 -1
  320. package/dist/node_modules/@allyhub/sheet/dist/xlsx/xml.d.ts +12 -1
  321. package/dist/node_modules/@allyhub/sheet/dist/xlsx/xml.js +3 -2
  322. package/dist/node_modules/@allyhub/sheet/package.json +5 -1
  323. package/dist/node_modules/@allyhub/slides-core/dist/animation.d.ts +23 -7
  324. package/dist/node_modules/@allyhub/slides-core/dist/animation.js +1 -1
  325. package/dist/node_modules/@allyhub/slides-core/dist/api.d.ts +101 -11
  326. package/dist/node_modules/@allyhub/slides-core/dist/api.js +2 -2
  327. package/dist/node_modules/@allyhub/slides-core/dist/capabilities.js +1 -1
  328. package/dist/node_modules/@allyhub/slides-core/dist/chart-api.d.ts +18 -1
  329. package/dist/node_modules/@allyhub/slides-core/dist/chart-api.js +1 -1
  330. package/dist/node_modules/@allyhub/slides-core/dist/code.d.ts +1 -1
  331. package/dist/node_modules/@allyhub/slides-core/dist/connect.d.ts +62 -0
  332. package/dist/node_modules/@allyhub/slides-core/dist/connect.js +2 -0
  333. package/dist/node_modules/@allyhub/slides-core/dist/enums.d.ts +24 -0
  334. package/dist/node_modules/@allyhub/slides-core/dist/enums.js +1 -1
  335. package/dist/node_modules/@allyhub/slides-core/dist/fact.d.ts +223 -0
  336. package/dist/node_modules/@allyhub/slides-core/dist/fact.js +2 -0
  337. package/dist/node_modules/@allyhub/slides-core/dist/file.d.ts +4 -4
  338. package/dist/node_modules/@allyhub/slides-core/dist/file.js +2 -2
  339. package/dist/node_modules/@allyhub/slides-core/dist/index.d.ts +2 -0
  340. package/dist/node_modules/@allyhub/slides-core/dist/index.js +1 -1
  341. package/dist/node_modules/@allyhub/slides-core/dist/measure.d.ts +4 -2
  342. package/dist/node_modules/@allyhub/slides-core/dist/measure.js +1 -1
  343. package/dist/node_modules/@allyhub/slides-core/dist/merge.d.ts +5 -5
  344. package/dist/node_modules/@allyhub/slides-core/dist/merge.js +1 -1
  345. package/dist/node_modules/@allyhub/slides-core/dist/model.d.ts +25 -4
  346. package/dist/node_modules/@allyhub/slides-core/dist/office.d.ts +1 -1
  347. package/dist/node_modules/@allyhub/slides-core/dist/path.d.ts +1 -1
  348. package/dist/node_modules/@allyhub/slides-core/dist/resolve.d.ts +20 -11
  349. package/dist/node_modules/@allyhub/slides-core/dist/resolve.js +1 -1
  350. package/dist/node_modules/@allyhub/slides-core/dist/sdk.d.ts +18 -0
  351. package/dist/node_modules/@allyhub/slides-core/dist/sdk.js +2 -0
  352. package/dist/node_modules/@allyhub/slides-core/dist/stage.d.ts +28 -11
  353. package/dist/node_modules/@allyhub/slides-core/dist/units.d.ts +3 -6
  354. package/dist/node_modules/@allyhub/slides-core/dist/units.js +1 -1
  355. package/dist/node_modules/@allyhub/slides-core/package.json +5 -1
  356. package/dist/node_modules/@allyhub/video-core/dist/audio-types.d.ts +1 -2
  357. package/dist/node_modules/@allyhub/video-core/dist/captions.d.ts +1 -10
  358. package/dist/node_modules/@allyhub/video-core/dist/captions.js +1 -1
  359. package/dist/node_modules/@allyhub/video-core/dist/check.d.ts +62 -0
  360. package/dist/node_modules/@allyhub/video-core/dist/check.js +2 -0
  361. package/dist/node_modules/@allyhub/video-core/dist/cut-report.d.ts +2 -2
  362. package/dist/node_modules/@allyhub/video-core/dist/cut-report.js +1 -1
  363. package/dist/node_modules/@allyhub/video-core/dist/edits.d.ts +3 -3
  364. package/dist/node_modules/@allyhub/video-core/dist/edits.js +1 -1
  365. package/dist/node_modules/@allyhub/video-core/dist/fact.d.ts +21 -762
  366. package/dist/node_modules/@allyhub/video-core/dist/fact.js +1 -1
  367. package/dist/node_modules/@allyhub/video-core/dist/footage-motion.d.ts +3 -2
  368. package/dist/node_modules/@allyhub/video-core/dist/footage-motion.js +1 -1
  369. package/dist/node_modules/@allyhub/video-core/dist/index.d.ts +3 -17
  370. package/dist/node_modules/@allyhub/video-core/dist/index.js +1 -1
  371. package/dist/node_modules/@allyhub/video-core/dist/measure.d.ts +72 -423
  372. package/dist/node_modules/@allyhub/video-core/dist/measure.js +1 -4
  373. package/dist/node_modules/@allyhub/video-core/dist/mix-plan.d.ts +44 -0
  374. package/dist/node_modules/@allyhub/video-core/dist/mix-plan.js +2 -0
  375. package/dist/node_modules/@allyhub/video-core/dist/motion.d.ts +1 -1
  376. package/dist/node_modules/@allyhub/video-core/dist/piece.d.ts +24 -432
  377. package/dist/node_modules/@allyhub/video-core/dist/piece.js +1 -1
  378. package/dist/node_modules/@allyhub/video-core/dist/placement.d.ts +1 -1
  379. package/dist/node_modules/@allyhub/video-core/dist/schema.d.ts +8 -14
  380. package/dist/node_modules/@allyhub/video-core/dist/schema.js +1 -1
  381. package/dist/node_modules/@allyhub/video-core/dist/script-edit.d.ts +11 -6
  382. package/dist/node_modules/@allyhub/video-core/dist/script-edit.js +1 -1
  383. package/dist/node_modules/@allyhub/video-core/dist/seams.d.ts +2 -3
  384. package/dist/node_modules/@allyhub/video-core/dist/sound-under.d.ts +2 -2
  385. package/dist/node_modules/@allyhub/video-core/dist/sound-under.js +1 -1
  386. package/dist/node_modules/@allyhub/video-core/dist/speech.d.ts +2 -4
  387. package/dist/node_modules/@allyhub/video-core/dist/speech.js +2 -2
  388. package/dist/node_modules/@allyhub/video-core/dist/stage.d.ts +52 -0
  389. package/dist/node_modules/@allyhub/video-core/dist/stage.js +2 -0
  390. package/dist/node_modules/@allyhub/video-core/dist/timeline.d.ts +18 -136
  391. package/dist/node_modules/@allyhub/video-core/dist/timeline.js +1 -1
  392. package/dist/node_modules/@allyhub/video-core/dist/timing.d.ts +3 -3
  393. package/dist/node_modules/@allyhub/video-core/dist/timing.js +1 -1
  394. package/dist/node_modules/@allyhub/video-core/dist/transcript.d.ts +2 -2
  395. package/dist/node_modules/@allyhub/video-core/dist/transcript.js +1 -1
  396. package/dist/node_modules/@allyhub/video-core/package.json +1 -1
  397. package/dist/node_modules/@allyhub/video-sdk/LICENSE +241 -0
  398. package/dist/node_modules/@allyhub/video-sdk/NOTICE +118 -0
  399. package/dist/{free.d.ts → node_modules/@allyhub/video-sdk/dist/free.d.ts} +14 -10
  400. package/dist/node_modules/@allyhub/video-sdk/dist/free.js +2 -0
  401. package/dist/node_modules/@allyhub/video-sdk/dist/index.d.ts +28 -0
  402. package/dist/node_modules/@allyhub/video-sdk/dist/index.js +2 -0
  403. package/dist/{input.d.ts → node_modules/@allyhub/video-sdk/dist/input.d.ts} +76 -22
  404. package/dist/node_modules/@allyhub/video-sdk/dist/input.js +2 -0
  405. package/dist/{module.d.ts → node_modules/@allyhub/video-sdk/dist/module.d.ts} +6 -4
  406. package/dist/node_modules/@allyhub/video-sdk/dist/module.js +2 -0
  407. package/dist/{parts.d.ts → node_modules/@allyhub/video-sdk/dist/parts.d.ts} +15 -6
  408. package/dist/node_modules/@allyhub/video-sdk/dist/parts.js +2 -0
  409. package/dist/{phone.d.ts → node_modules/@allyhub/video-sdk/dist/phone.d.ts} +12 -5
  410. package/dist/node_modules/@allyhub/video-sdk/dist/phone.js +2 -0
  411. package/dist/{piece.d.ts → node_modules/@allyhub/video-sdk/dist/piece.d.ts} +26 -16
  412. package/dist/node_modules/@allyhub/video-sdk/dist/piece.js +2 -0
  413. package/dist/node_modules/@allyhub/video-sdk/dist/route.d.ts +46 -0
  414. package/dist/node_modules/@allyhub/video-sdk/dist/route.js +2 -0
  415. package/dist/node_modules/@allyhub/video-sdk/dist/scenery.d.ts +2 -0
  416. package/dist/node_modules/@allyhub/video-sdk/dist/scenery.js +2 -0
  417. package/dist/node_modules/@allyhub/video-sdk/package.json +19 -0
  418. package/dist/scenery.d.ts +1 -1
  419. package/dist/scenery.js +1 -1
  420. package/dist/sheets.d.ts +1 -1
  421. package/dist/sheets.js +1 -1
  422. package/dist/slides.d.ts +1 -9
  423. package/dist/slides.js +1 -1
  424. package/docs/README.md +10 -6
  425. package/docs/batches.md +5 -5
  426. package/docs/canvas.md +28 -0
  427. package/docs/contract.md +2 -2
  428. package/docs/defaults.md +298 -22
  429. package/docs/docs.md +80 -66
  430. package/docs/footage.md +7 -7
  431. package/docs/image.md +165 -0
  432. package/docs/layers.md +22 -13
  433. package/docs/modeling.md +4 -4
  434. package/docs/pictures.md +65 -0
  435. package/docs/project.md +51 -31
  436. package/docs/scenery.md +14 -15
  437. package/docs/sheets.md +46 -28
  438. package/docs/slides.md +121 -67
  439. package/docs/sound.md +3 -3
  440. package/docs/speech.md +8 -8
  441. package/docs/video.md +16 -13
  442. package/docs/websites.md +4 -4
  443. package/docs/x.md +73 -0
  444. package/package.json +7 -2
  445. package/dist/define.js +0 -2
  446. package/dist/free.js +0 -2
  447. package/dist/input.js +0 -2
  448. package/dist/module.js +0 -2
  449. package/dist/node_modules/@allyhub/formats/dist/data/comments.d.ts +0 -94
  450. package/dist/node_modules/@allyhub/formats/dist/data/comments.js +0 -2
  451. package/dist/node_modules/@allyhub/runtimes/pins/onnxruntime-node/package-lock.json +0 -227
  452. package/dist/node_modules/@allyhub/runtimes/pins/onnxruntime-node/package.json +0 -8
  453. package/dist/node_modules/@allyhub/runtimes/pins/sherpa-onnx-node/package-lock.json +0 -105
  454. package/dist/node_modules/@allyhub/runtimes/pins/sherpa-onnx-node/package.json +0 -8
  455. package/dist/node_modules/@allyhub/runtimes/pins/tesseract.js/package-lock.json +0 -128
  456. package/dist/node_modules/@allyhub/runtimes/pins/tesseract.js/package.json +0 -9
  457. package/dist/node_modules/@allyhub/video-core/dist/export.js +0 -2
  458. package/dist/node_modules/@allyhub/video-core/dist/formats.js +0 -2
  459. package/dist/node_modules/@allyhub/video-core/dist/gen.d.ts +0 -37
  460. package/dist/node_modules/@allyhub/video-core/dist/problem.d.ts +0 -278
  461. package/dist/node_modules/@allyhub/video-core/dist/problem.js +0 -2
  462. package/dist/node_modules/@allyhub/video-core/dist/script.js +0 -2
  463. package/dist/node_modules/@allyhub/video-core/dist/source.d.ts +0 -7
  464. package/dist/parts.js +0 -2
  465. package/dist/phone.js +0 -2
  466. package/dist/piece.js +0 -2
  467. /package/dist/node_modules/@allyhub/{sheet → formats}/dist/csv.d.ts +0 -0
  468. /package/dist/node_modules/@allyhub/{sheet → formats}/dist/csv.js +0 -0
  469. /package/dist/{fit.d.ts → node_modules/@allyhub/image-sdk/dist/fit.d.ts} +0 -0
  470. /package/dist/{fit.js → node_modules/@allyhub/image-sdk/dist/fit.js} +0 -0
  471. /package/dist/{messages.js → node_modules/@allyhub/image-sdk/dist/messages.js} +0 -0
  472. /package/dist/{props.js → node_modules/@allyhub/image-sdk/dist/props.js} +0 -0
  473. /package/dist/{text.d.ts → node_modules/@allyhub/image-sdk/dist/text.d.ts} +0 -0
  474. /package/dist/{text.js → node_modules/@allyhub/image-sdk/dist/text.js} +0 -0
  475. /package/dist/{written.d.ts → node_modules/@allyhub/image-sdk/dist/written.d.ts} +0 -0
  476. /package/dist/node_modules/@allyhub/{video-core → piece}/dist/anchors.js +0 -0
  477. /package/dist/node_modules/@allyhub/{video-core → piece}/dist/component.d.ts +0 -0
  478. /package/dist/node_modules/@allyhub/{video-core → piece}/dist/console.d.ts +0 -0
  479. /package/dist/node_modules/@allyhub/{video-core → piece}/dist/console.js +0 -0
  480. /package/dist/node_modules/@allyhub/{video-core → piece}/dist/contrast.js +0 -0
  481. /package/dist/node_modules/@allyhub/{video-core → piece}/dist/gen.js +0 -0
  482. /package/dist/node_modules/@allyhub/{video-core → piece}/dist/look.js +0 -0
  483. /package/dist/node_modules/@allyhub/{video-core → piece}/dist/marks.d.ts +0 -0
  484. /package/dist/node_modules/@allyhub/{video-core → piece}/dist/marks.js +0 -0
  485. /package/dist/node_modules/@allyhub/{video-core → piece}/dist/matrix.d.ts +0 -0
  486. /package/dist/node_modules/@allyhub/{video-core → piece}/dist/matrix.js +0 -0
  487. /package/dist/node_modules/@allyhub/{video-core → piece}/dist/messages.js +0 -0
  488. /package/dist/node_modules/@allyhub/{video-core → piece}/dist/source.js +0 -0
  489. /package/dist/node_modules/@allyhub/{video-core → piece}/dist/voice.js +0 -0
  490. /package/dist/node_modules/@allyhub/{video-core → piece}/dist/words.d.ts +0 -0
  491. /package/dist/node_modules/@allyhub/{video-core → piece}/dist/words.js +0 -0
  492. /package/dist/{anim.d.ts → node_modules/@allyhub/video-sdk/dist/anim.d.ts} +0 -0
  493. /package/dist/{anim.js → node_modules/@allyhub/video-sdk/dist/anim.js} +0 -0
  494. /package/dist/{noise.d.ts → node_modules/@allyhub/video-sdk/dist/noise.d.ts} +0 -0
  495. /package/dist/{noise.js → node_modules/@allyhub/video-sdk/dist/noise.js} +0 -0
  496. /package/dist/{paths.d.ts → node_modules/@allyhub/video-sdk/dist/paths.d.ts} +0 -0
  497. /package/dist/{paths.js → node_modules/@allyhub/video-sdk/dist/paths.js} +0 -0
@@ -0,0 +1,16 @@
1
+ import { type GraphicLayer, type StageContext } from "@allyhub/piece";
2
+ /** Mounts a layer in its element with its style; the element its content is in (what it draws at each moment). */
3
+ export declare function mountLayer(el: HTMLElement, layer: GraphicLayer, ctx: StageContext): HTMLElement;
4
+ /** A layer of a stack, mounted: its element, and where its content is. */
5
+ export interface MountedLayer {
6
+ readonly layer: GraphicLayer;
7
+ readonly el: HTMLElement;
8
+ readonly content: HTMLElement;
9
+ }
10
+ /**
11
+ * Mounts layers back to front in a container, each in an element of its
12
+ * own marked with its name, those not visible left out, each clipped layer
13
+ * with its base.
14
+ */
15
+ export declare function mountStack(container: HTMLElement, layers: readonly GraphicLayer[], ctx: StageContext): MountedLayer[];
16
+ //# sourceMappingURL=stack.d.ts.map
@@ -0,0 +1,2 @@
1
+ /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
+ import{LAYER_NAME as m}from"@allyhub/piece";import{baseOf as u,clipStack as c,contentOf as p,styleLayer as a}from"@allyhub/image-draw/layer-style";import{LayerError as f}from"./define.js";export function mountLayer(i,e,n){const o=p(i,e,n.dims);e.mount(o,e.props,n);const r=a(i,{layer:e,ctx:n,frame:n.dims,base:u(e)});if(r!==void 0)throw new f("AK-I007",`${e.component}${e.key===void 0?"":` ${e.key}`}: ${r}.`);return o}export function mountStack(i,e,n){const o=[];for(const s of e){if(s.visible===!1)continue;const t=i.ownerDocument.createElement("div");t.className="ak-layer",t.dataset.component=s.component,s.key!==void 0&&t.setAttribute(m,s.key),Object.assign(t.style,{position:"absolute",inset:"0"}),i.append(t),o.push({layer:s,el:t,content:mountLayer(t,s,n)})}const r=c(o,{frame:n.dims,ctx:n});if(r.length>0)throw new f("AK-I007",`${r.join("; ")}.`);return o}
@@ -0,0 +1,38 @@
1
+ import { type CharacterStyle, type GraphicLayer, type ParagraphStyle } from "@allyhub/piece";
2
+ import { type LayerOptions } from "./define.js";
3
+ import type { Written } from "./written.js";
4
+ /** A type layer's text item: its words and how they are set. */
5
+ export interface TextItem {
6
+ /** Its words: the script's (`ctx.s("key")`); a line break starts a paragraph. */
7
+ contents: string;
8
+ characterStyle?: CharacterStyle;
9
+ paragraphStyle?: ParagraphStyle;
10
+ }
11
+ export interface TextLayerOptions extends LayerOptions {
12
+ textItem: TextItem;
13
+ /** Paragraph text: its box, [x, y, w, h] as shares of the frame; its words wrap in it. */
14
+ box?: readonly [number, number, number, number];
15
+ /** Point text: where it starts, [x, y] as shares of the frame (by its justification: its left, its centre or its right; the top of its first line). Default [0, 0]. */
16
+ position?: readonly [number, number];
17
+ }
18
+ /** A type layer's props. */
19
+ export interface TextLayerProps {
20
+ readonly textItem: TextItem;
21
+ readonly box?: readonly [number, number, number, number];
22
+ readonly position?: readonly [number, number];
23
+ readonly base: string;
24
+ }
25
+ /** The component name of a type layer. */
26
+ export declare const TEXT_LAYER = "textLayer";
27
+ /** What is wrong with a type layer's options, or undefined. */
28
+ export declare function textLayerProblem(o: TextLayerOptions): string | undefined;
29
+ /** The CSS of a text item's justification: text-align and the last line's. */
30
+ export declare function justified(j: ParagraphStyle["justification"]): {
31
+ textAlign: string;
32
+ textAlignLast: string;
33
+ };
34
+ /** A type layer: textLayer({ key, textItem: { contents: ctx.s("title"), characterStyle: { size: 96 } }, box }). */
35
+ export type TextLayerFn = (opts: TextLayerOptions) => GraphicLayer<TextLayerProps>;
36
+ /** textLayer() for the module `at` names: its paths (a mask's, a pattern's) are from its folder. */
37
+ export declare const textLayerFor: (at: Written) => TextLayerFn;
38
+ //# sourceMappingURL=text-layer.d.ts.map
@@ -0,0 +1,2 @@
1
+ /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
+ import{CharacterStyleSchema as m,LAYER_BRAND as A,ParagraphStyleSchema as b,ShareBoxSchema as S,TEXT_DEFAULTS as f,issueOf as L}from"@allyhub/piece";import{z as h}from"zod";import{LayerError as j,splitLayer as w,styleOf as I}from"./define.js";export const TEXT_LAYER="textLayer";const T=h.object({contents:h.string(),characterStyle:m.optional(),paragraphStyle:b.optional()});export function textLayerProblem(t){const n=T.safeParse(t.textItem);if(!n.success)return L(n.error,"textItem");if(t.box!==void 0&&!S.safeParse(t.box).success)return`box ${JSON.stringify(t.box)} is not [x, y, w, h] as shares of the frame, inside it`;if(t.box!==void 0&&t.position!==void 0)return"give a box (paragraph text) or a position (point text), not both";if(t.position!==void 0&&!(Array.isArray(t.position)&&t.position.length===2&&t.position.every(a=>typeof a=="number"&&a>=0&&a<=1)))return`position ${JSON.stringify(t.position)} is not [x, y] as shares of the frame`}const i=t=>`${String(Math.round(t*1e3)/1e3)}px`;export function justified(t){switch(t??f.justification){case"center":return{textAlign:"center",textAlignLast:"auto"};case"right":return{textAlign:"right",textAlignLast:"auto"};case"justifyLeft":return{textAlign:"justify",textAlignLast:"left"};case"justifyCenter":return{textAlign:"justify",textAlignLast:"center"};case"justifyRight":return{textAlign:"justify",textAlignLast:"right"};case"justifyAll":return{textAlign:"justify",textAlignLast:"justify"};default:return{textAlign:"left",textAlignLast:"auto"}}}function k(t,n,a){const g=a.dims.width,u=a.dims.height,e=n.textItem.characterStyle??{},r=n.textItem.paragraphStyle??{},x=e.size??f.size,c=document.createElement("div");c.dataset.akText="";const p=justified(r.justification);if(Object.assign(c.style,{position:"absolute",margin:"0",fontFamily:e.font===void 0?"var(--ak-font-body)":JSON.stringify(e.font),fontWeight:String(e.weight??f.weight),fontStyle:e.italic===!0?"italic":"normal",fontSize:i(x),color:e.color??f.color,letterSpacing:`${String((e.tracking??f.tracking)/1e3)}em`,lineHeight:e.leading===void 0||e.leading==="auto"?String(f.autoLeading):i(e.leading),textTransform:e.capitalization==="allCaps"?"uppercase":"none",fontVariantCaps:e.capitalization==="smallCaps"?"small-caps":"normal",textDecorationLine:[e.underline===!0?"underline":"",e.strikeThrough===!0?"line-through":""].filter(o=>o!=="").join(" ")||"none",textAlign:p.textAlign,textAlignLast:p.textAlignLast,paddingLeft:i(r.leftIndent??0),paddingRight:i(r.rightIndent??0),boxSizing:"border-box"}),n.box){const[o,l,s,y]=n.box;Object.assign(c.style,{left:i(o*g),top:i(l*u),width:i(s*g),height:i(y*u),whiteSpace:"pre-wrap",overflowWrap:"break-word"})}else{const[o,l]=n.position??[0,0],s=p.textAlign==="center"?"-50%":p.textAlign==="right"?"-100%":"0";Object.assign(c.style,{left:i(o*g),top:i(l*u),whiteSpace:"pre",...s==="0"?{}:{transform:`translateX(${s})`}})}const d=n.textItem.contents.split(/\r\n|\r|\n/u);d.forEach((o,l)=>{const s=document.createElement("p");Object.assign(s.style,{margin:"0",textIndent:i(r.firstLineIndent??0),...l>0&&r.spaceBefore?{marginTop:i(r.spaceBefore)}:{},...l<d.length-1&&r.spaceAfter?{marginBottom:i(r.spaceAfter)}:{}}),s.textContent=o===""?"​":o,c.append(s)}),t.append(c)}export const textLayerFor=t=>n=>{const a=textLayerProblem(n);if(a)throw new j("AK-I003",`textLayer()${n.key===void 0?"":` ${n.key}`}: ${a}.`);I(n,"type","textLayer()");const[g,u]=w(n);return{[A]:"graphic",...g,kind:"type",component:TEXT_LAYER,props:{...u,base:t.base},mount:(e,r,x)=>{k(e,r,x)},render:()=>{}}};
@@ -1,2 +1,2 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{dirOf as i,projectPath as e}from"@allyhub/formats";export function writtenIn(r){const t=e(r.file);if(t.startsWith("/")||/^[A-Za-z]:/u.test(t)||t.split("/").includes(".."))throw new Error(`sdkFor: ${JSON.stringify(r.file)} is not a project path: a file's path from the project's root, such as "launch/film/video.ts".`);return{file:t,base:i(t)}}
2
+ import{dirOf as e,projectPath as s}from"@allyhub/formats";export function writtenIn(r){const t=s(r.file);if(t.startsWith("/")||/^[A-Za-z]:/u.test(t)||t.split("/").includes(".."))throw new Error(`sdkFor: ${JSON.stringify(r.file)} is not a project path: a file's path from the project's root, such as "launch/teaser.ts".`);return{file:t,base:e(t)}}
@@ -0,0 +1,19 @@
1
+ {
2
+ "name": "@allyhub/image-sdk",
3
+ "version": "0.10.0",
4
+ "type": "module",
5
+ "exports": {
6
+ ".": {
7
+ "types": "./dist/index.d.ts",
8
+ "default": "./dist/index.js"
9
+ },
10
+ "./*": {
11
+ "types": "./dist/*.d.ts",
12
+ "default": "./dist/*.js"
13
+ },
14
+ "./package.json": "./package.json"
15
+ },
16
+ "sideEffects": false,
17
+ "private": true,
18
+ "license": "SEE LICENSE IN LICENSE.md"
19
+ }
@@ -0,0 +1,241 @@
1
+ AllyHub Software License
2
+
3
+ Copyright (c) 2026 AllyHub, Inc. ("AllyHub"). All rights reserved.
4
+
5
+ This software (the AllyHub command-line tool, its SDK, runtime and the
6
+ packages they depend on) is proprietary. It is not open source.
7
+
8
+ 1. Permitted use. You may install and run the software, unmodified, to make,
9
+ check, preview and render videos and decks, including for commercial
10
+ purposes. What you make with it is yours.
11
+
12
+ 2. Restrictions. Except as this license permits or applicable law requires,
13
+ you may not copy, modify, adapt, translate, sublicense, sell, rent, lease,
14
+ publish or otherwise distribute the software, create derivative works of
15
+ it, or reverse engineer, decompile or disassemble it.
16
+
17
+ 3. Cloud services. AllyHub's cloud tools (sign-in, research, images, voice,
18
+ video) are separate services governed by AllyHub's terms of service.
19
+
20
+ 4. Trademarks. This license grants no right to use the name "AllyHub" or its
21
+ logos.
22
+
23
+ 5. No warranty. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
24
+ KIND, EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY,
25
+ FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
26
+ ALLYHUB BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY ARISING FROM,
27
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR ITS USE.
28
+
29
+ 6. Third-party code. Parts of the software are adapted from HyperFrames,
30
+ licensed under the Apache License, Version 2.0 (see NOTICE). Those parts
31
+ remain under that license, reproduced below, and nothing in this license
32
+ limits your rights under it.
33
+
34
+ 7. Starter components. The starter components in the "components" folder,
35
+ which "allyhub add" copies into your workspace, are licensed under the MIT
36
+ License (see components/LICENSE): once copied, you may change, use and
37
+ share them freely.
38
+
39
+ --------------------------------------------------------------------------------
40
+
41
+ Apache License
42
+ Version 2.0, January 2004
43
+ http://www.apache.org/licenses/
44
+
45
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
46
+
47
+ 1. Definitions.
48
+
49
+ "License" shall mean the terms and conditions for use, reproduction,
50
+ and distribution as defined by Sections 1 through 9 of this document.
51
+
52
+ "Licensor" shall mean the copyright owner or entity authorized by
53
+ the copyright owner that is granting the License.
54
+
55
+ "Legal Entity" shall mean the union of the acting entity and all
56
+ other entities that control, are controlled by, or are under common
57
+ control with that entity. For the purposes of this definition,
58
+ "control" means (i) the power, direct or indirect, to cause the
59
+ direction or management of such entity, whether by contract or
60
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
61
+ outstanding shares, or (iii) beneficial ownership of such entity.
62
+
63
+ "You" (or "Your") shall mean an individual or Legal Entity
64
+ exercising permissions granted by this License.
65
+
66
+ "Source" form shall mean the preferred form for making modifications,
67
+ including but not limited to software source code, documentation
68
+ source, and configuration files.
69
+
70
+ "Object" form shall mean any form resulting from mechanical
71
+ transformation or translation of a Source form, including but
72
+ not limited to compiled object code, generated documentation,
73
+ and conversions to other media types.
74
+
75
+ "Work" shall mean the work of authorship, whether in Source or
76
+ Object form, made available under the License, as indicated by a
77
+ copyright notice that is included in or attached to the work
78
+ (an example is provided in the Appendix below).
79
+
80
+ "Derivative Works" shall mean any work, whether in Source or Object
81
+ form, that is based on (or derived from) the Work and for which the
82
+ editorial revisions, annotations, elaborations, or other modifications
83
+ represent, as a whole, an original work of authorship. For the purposes
84
+ of this License, Derivative Works shall not include works that remain
85
+ separable from, or merely link (or bind by name) to the interfaces of,
86
+ the Work and Derivative Works thereof.
87
+
88
+ "Contribution" shall mean any work of authorship, including
89
+ the original version of the Work and any modifications or additions
90
+ to that Work or Derivative Works thereof, that is intentionally
91
+ submitted to Licensor for inclusion in the Work by the copyright owner
92
+ or by an individual or Legal Entity authorized to submit on behalf of
93
+ the copyright owner. For the purposes of this definition, "submitted"
94
+ means any form of electronic, verbal, or written communication sent
95
+ to the Licensor or its representatives, including but not limited to
96
+ communication on electronic mailing lists, source code control systems,
97
+ and issue tracking systems that are managed by, or on behalf of, the
98
+ Licensor for the purpose of discussing and improving the Work, but
99
+ excluding communication that is conspicuously marked or otherwise
100
+ designated in writing by the copyright owner as "Not a Contribution."
101
+
102
+ "Contributor" shall mean Licensor and any individual or Legal Entity
103
+ on behalf of whom a Contribution has been received by Licensor and
104
+ subsequently incorporated within the Work.
105
+
106
+ 2. Grant of Copyright License. Subject to the terms and conditions of
107
+ this License, each Contributor hereby grants to You a perpetual,
108
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
109
+ copyright license to reproduce, prepare Derivative Works of,
110
+ publicly display, publicly perform, sublicense, and distribute the
111
+ Work and such Derivative Works in Source or Object form.
112
+
113
+ 3. Grant of Patent License. Subject to the terms and conditions of
114
+ this License, each Contributor hereby grants to You a perpetual,
115
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
116
+ (except as stated in this section) patent license to make, have made,
117
+ use, offer to sell, sell, import, and otherwise transfer the Work,
118
+ where such license applies only to those patent claims licensable
119
+ by such Contributor that are necessarily infringed by their
120
+ Contribution(s) alone or by combination of their Contribution(s)
121
+ with the Work to which such Contribution(s) was submitted. If You
122
+ institute patent litigation against any entity (including a
123
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
124
+ or a Contribution incorporated within the Work constitutes direct
125
+ or contributory patent infringement, then any patent licenses
126
+ granted to You under this License for that Work shall terminate
127
+ as of the date such litigation is filed.
128
+
129
+ 4. Redistribution. You may reproduce and distribute copies of the
130
+ Work or Derivative Works thereof in any medium, with or without
131
+ modifications, and in Source or Object form, provided that You
132
+ meet the following conditions:
133
+
134
+ (a) You must give any other recipients of the Work or
135
+ Derivative Works a copy of this License; and
136
+
137
+ (b) You must cause any modified files to carry prominent notices
138
+ stating that You changed the files; and
139
+
140
+ (c) You must retain, in the Source form of any Derivative Works
141
+ that You distribute, all copyright, patent, trademark, and
142
+ attribution notices from the Source form of the Work,
143
+ excluding those notices that do not pertain to any part of
144
+ the Derivative Works; and
145
+
146
+ (d) If the Work includes a "NOTICE" text file as part of its
147
+ distribution, then any Derivative Works that You distribute must
148
+ include a readable copy of the attribution notices contained
149
+ within such NOTICE file, excluding those notices that do not
150
+ pertain to any part of the Derivative Works, in at least one
151
+ of the following places: within a NOTICE text file distributed
152
+ as part of the Derivative Works; within the Source form or
153
+ documentation, if provided along with the Derivative Works; or,
154
+ within a display generated by the Derivative Works, if and
155
+ wherever such third-party notices normally appear. The contents
156
+ of the NOTICE file are for informational purposes only and
157
+ do not modify the License. You may add Your own attribution
158
+ notices within Derivative Works that You distribute, alongside
159
+ or as an addendum to the NOTICE text from the Work, provided
160
+ that such additional attribution notices cannot be construed
161
+ as modifying the License.
162
+
163
+ You may add Your own copyright statement to Your modifications and
164
+ may provide additional or different license terms and conditions
165
+ for use, reproduction, or distribution of Your modifications, or
166
+ for any such Derivative Works as a whole, provided Your use,
167
+ reproduction, and distribution of the Work otherwise complies with
168
+ the conditions stated in this License.
169
+
170
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
171
+ any Contribution intentionally submitted for inclusion in the Work
172
+ by You to the Licensor shall be under the terms and conditions of
173
+ this License, without any additional terms or conditions.
174
+ Notwithstanding the above, nothing herein shall supersede or modify
175
+ the terms of any separate license agreement you may have executed
176
+ with Licensor regarding such Contributions.
177
+
178
+ 6. Trademarks. This License does not grant permission to use the trade
179
+ names, trademarks, service marks, or product names of the Licensor,
180
+ except as required for reasonable and customary use in describing the
181
+ origin of the Work and reproducing the content of the NOTICE file.
182
+
183
+ 7. Disclaimer of Warranty. Unless required by applicable law or
184
+ agreed to in writing, Licensor provides the Work (and each
185
+ Contributor provides its Contributions) on an "AS IS" BASIS,
186
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
187
+ implied, including, without limitation, any warranties or conditions
188
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
189
+ PARTICULAR PURPOSE. You are solely responsible for determining the
190
+ appropriateness of using or redistributing the Work and assume any
191
+ risks associated with Your exercise of permissions under this License.
192
+
193
+ 8. Limitation of Liability. In no event and under no legal theory,
194
+ whether in tort (including negligence), contract, or otherwise,
195
+ unless required by applicable law (such as deliberate and grossly
196
+ negligent acts) or agreed to in writing, shall any Contributor be
197
+ liable to You for damages, including any direct, indirect, special,
198
+ incidental, or consequential damages of any character arising as a
199
+ result of this License or out of the use or inability to use the
200
+ Work (including but not limited to damages for loss of goodwill,
201
+ work stoppage, computer failure or malfunction, or any and all
202
+ other commercial damages or losses), even if such Contributor
203
+ has been advised of the possibility of such damages.
204
+
205
+ 9. Accepting Warranty or Additional Liability. While redistributing
206
+ the Work or Derivative Works thereof, You may choose to offer,
207
+ and charge a fee for, acceptance of support, warranty, indemnity,
208
+ or other liability obligations and/or rights consistent with this
209
+ License. However, in accepting such obligations, You may act only
210
+ on Your own behalf and on Your sole responsibility, not on behalf
211
+ of any other Contributor, and only if You agree to indemnify,
212
+ defend, and hold each Contributor harmless for any liability
213
+ incurred by, or claims asserted against, such Contributor by reason
214
+ of your accepting any such warranty or additional liability.
215
+
216
+ END OF TERMS AND CONDITIONS
217
+
218
+ APPENDIX: How to apply the Apache License to your work.
219
+
220
+ To apply the Apache License to your work, attach the following
221
+ boilerplate notice, with the fields enclosed by brackets "[]"
222
+ replaced with your own identifying information. (Don't include
223
+ the brackets!) The text should be enclosed in the appropriate
224
+ comment syntax for the file format. We also recommend that a
225
+ file or class name and description of purpose be included on the
226
+ same "printed page" as the copyright notice for easier
227
+ identification within third-party archives.
228
+
229
+ Copyright [yyyy] [name of copyright owner]
230
+
231
+ Licensed under the Apache License, Version 2.0 (the "License");
232
+ you may not use this file except in compliance with the License.
233
+ You may obtain a copy of the License at
234
+
235
+ http://www.apache.org/licenses/LICENSE-2.0
236
+
237
+ Unless required by applicable law or agreed to in writing, software
238
+ distributed under the License is distributed on an "AS IS" BASIS,
239
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
240
+ See the License for the specific language governing permissions and
241
+ limitations under the License.
@@ -0,0 +1,195 @@
1
+ import { type Img } from "./image.js";
2
+ /** Every threshold and choice of a comparison; COMPARE_DEFAULTS has their values. */
3
+ export interface CompareOptions {
4
+ /** A pixel differs when its ΔE*ab exceeds this (2.3 is about the smallest difference people see). */
5
+ tolerance: number;
6
+ /** What transparent pixels are seen over, as RGB. */
7
+ background: [number, number, number];
8
+ /** Differing pixels this many pixels apart or closer are one region. */
9
+ gap: number;
10
+ /** Look for the best offset within this many pixels each way (0: none). */
11
+ shift: number;
12
+ /** When the sizes differ: stretch the candidate to the reference's size, scale it to the reference's width, or neither (compare the common area). */
13
+ resize: "stretch" | "width" | "none";
14
+ /** The ΔE*ab at which the heatmap is fully red. */
15
+ heatMax: number;
16
+ /** SSIM's window, in pixels. */
17
+ ssimWindow: number;
18
+ /** An edge is a step of luma by more than this many levels (of 255) within `edgeSpan` pixels along a row or a column. */
19
+ edgeStep: number;
20
+ edgeSpan: number;
21
+ /**
22
+ * Grain is measured in blocks of this many pixels each way, on the
23
+ * share of them whose content is flattest (and not clipped).
24
+ */
25
+ grainBlock: number;
26
+ grainShare: number;
27
+ }
28
+ export declare const COMPARE_DEFAULTS: CompareOptions;
29
+ export interface DiffRegion {
30
+ /** x, y, width, height in the reference's pixels. */
31
+ box: [number, number, number, number];
32
+ /** Differing pixels in it. */
33
+ pixels: number;
34
+ meanDeltaE: number;
35
+ maxDeltaE: number;
36
+ }
37
+ export interface ChannelStats {
38
+ /** Mean absolute difference, 0 to 255. */
39
+ mean: number;
40
+ max: number;
41
+ }
42
+ /** A picture's levels over the area compared, as encoded (0–255), over the background. */
43
+ export interface Levels {
44
+ /** Each channel's mean. */
45
+ rgb: [number, number, number];
46
+ /** Luma's (Rec. 709 weights) mean and its 5th, 50th and 95th percentiles. */
47
+ luma: {
48
+ mean: number;
49
+ p5: number;
50
+ p50: number;
51
+ p95: number;
52
+ };
53
+ /** The mean L* (0–100), a* (green to red) and b* (blue to yellow). */
54
+ lab: [number, number, number];
55
+ }
56
+ export interface CompareResult {
57
+ reference: {
58
+ width: number;
59
+ height: number;
60
+ };
61
+ candidate: {
62
+ width: number;
63
+ height: number;
64
+ };
65
+ /** How the candidate was resized to be compared, when its size differed. */
66
+ resized?: {
67
+ mode: CompareOptions["resize"];
68
+ from: [number, number];
69
+ to: [number, number];
70
+ scale: [number, number];
71
+ };
72
+ /** The area compared, in the reference's pixels. */
73
+ compared: [number, number, number, number];
74
+ /** The candidate was compared moved by x, y pixels (right and down). */
75
+ offset: {
76
+ x: number;
77
+ y: number;
78
+ };
79
+ /** The offset search: the mean ΔE*ab at no offset and at the best one. */
80
+ search?: {
81
+ range: number;
82
+ unshifted: number;
83
+ best: {
84
+ x: number;
85
+ y: number;
86
+ meanDeltaE: number;
87
+ };
88
+ };
89
+ pixels: number;
90
+ tolerance: number;
91
+ /** Pixels whose ΔE*ab is over the tolerance, and their share of `pixels`. */
92
+ differing: number;
93
+ share: number;
94
+ deltaE: {
95
+ mean: number;
96
+ max: number;
97
+ p95: number;
98
+ };
99
+ channels: {
100
+ r: ChannelStats;
101
+ g: ChannelStats;
102
+ b: ChannelStats;
103
+ alpha: ChannelStats;
104
+ };
105
+ /**
106
+ * Each picture's levels, and the candidate's less the reference's:
107
+ * positive where the candidate is brighter, redder (a*), yellower (b*).
108
+ */
109
+ levels: {
110
+ reference: Levels;
111
+ candidate: Levels;
112
+ difference: Levels;
113
+ };
114
+ /**
115
+ * Each picture's grain where it is flat (grainOf; undefined where no
116
+ * block is flat), and the capture.grain.amount whose grain, added to the
117
+ * candidate's, gives the reference's (variances add; 0 when the
118
+ * candidate's is the stronger).
119
+ */
120
+ grain: {
121
+ block: number;
122
+ share: number;
123
+ reference?: Grain;
124
+ candidate?: Grain;
125
+ amount?: number;
126
+ };
127
+ /** Mean SSIM of luma over windows (1: the same structure). */
128
+ ssim: number;
129
+ /** Every region, largest first. */
130
+ regions: DiffRegion[];
131
+ /**
132
+ * How soft each draws a fine edge: the 10–90 % rise of every strong step
133
+ * along the rows and columns compared, px of the reference. A Gaussian's
134
+ * is 2.563 sigmas. `soften` is the blur that widens the candidate's
135
+ * sharper quarter (p25) to the reference's, as capture.soften takes it
136
+ * (a sigma at 1080 lines); 0 when the candidate is the softer.
137
+ */
138
+ edges: {
139
+ step: number;
140
+ span: number;
141
+ reference: EdgeWidths;
142
+ candidate: EdgeWidths;
143
+ soften?: number;
144
+ };
145
+ }
146
+ /** A picture's grain, measured where it is flat. */
147
+ export interface Grain {
148
+ /** The blocks measured: the flattest share of those not clipped (`of`). */
149
+ blocks: number;
150
+ of: number;
151
+ /** Luma's standard deviation in them after each block's slope is taken out, levels of 255, and as a share of full scale (capture.grain.amount's unit). */
152
+ sd: number;
153
+ amount: number;
154
+ /** How alike neighbouring pixels' grain is (0: a pixel each; below 0, as sharpening leaves it), and the capture.grain.size whose grain is that alike (px at 1080 lines). */
155
+ correlation: number;
156
+ size: number;
157
+ }
158
+ /**
159
+ * Grain where a picture is flat: blocks of `block` px each way whose mean
160
+ * is not near black or white, the `share` of them whose content (the
161
+ * means of their sixths, with their slope taken out) varies least, and in
162
+ * those, what is left of each pixel after the block's slope: its standard
163
+ * deviation and how alike neighbours are. Undefined with no such block.
164
+ */
165
+ export declare function grainOf(luma: Float32Array, w: number, h: number, block?: number, share?: number): Grain | undefined;
166
+ /** The 10–90 % rises of a picture's strong steps: how many, the sharper quarter's and the median's. */
167
+ export interface EdgeWidths {
168
+ edges: number;
169
+ p25?: number;
170
+ median?: number;
171
+ }
172
+ export interface CompareImages {
173
+ result: CompareResult;
174
+ /** The reference, faded to grey, with the difference over it in yellow to red and the regions outlined. */
175
+ heatmap: Img;
176
+ /** Reference | candidate (as compared) | heatmap. */
177
+ side: Img;
178
+ /** The candidate as compared: resized, moved, on the reference's canvas. */
179
+ aligned: Img;
180
+ }
181
+ /**
182
+ * Compares a candidate with a reference. The candidate is resized to the
183
+ * reference's size first when they differ (`resize`), then moved by the
184
+ * best offset found within `shift` pixels, if asked.
185
+ */
186
+ /**
187
+ * The 10–90 % rises of a luma picture's steps of more than `step` levels
188
+ * within `span` pixels, along its rows and its columns.
189
+ */
190
+ export declare function edgeWidths(luma: Float32Array, w: number, h: number, o: {
191
+ step: number;
192
+ span: number;
193
+ }): EdgeWidths;
194
+ export declare function compareImages(reference: Img, candidate: Img, options?: Partial<CompareOptions>): CompareImages;
195
+ //# sourceMappingURL=compare.d.ts.map
@@ -0,0 +1,2 @@
1
+ /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
+ import{grainSize as yt}from"./grain.js";import{blankImage as nt,pasteImage as et,resizeImage as ut}from"./image.js";const E=h=>Math.round(h*1e3)/1e3;export const COMPARE_DEFAULTS={tolerance:2.3,background:[255,255,255],gap:4,shift:0,resize:"stretch",heatMax:20,ssimWindow:8,edgeStep:90,edgeSpan:12,grainBlock:48,grainShare:.1};export function grainOf(h,b,k,o=COMPARE_DEFAULTS.grainBlock,r=COMPARE_DEFAULTS.grainShare){const s=Math.max(6,Math.round(o)),e=Math.max(1,Math.floor(s/6)),l=(s-1)/2;let A=0;for(let d=0;d<s;d++)A+=(d-l)**2;A*=s;const t=[];for(let d=0;d+s<=k;d+=s)for(let S=0;S+s<=b;S+=s){let z=0,v=0,B=0;for(let M=0;M<s;M++)for(let y=0;y<s;y++){const U=h[(d+M)*b+S+y]??0;z+=U,v+=(y-l)*U,B+=(M-l)*U}if(z/=s*s,z<12||z>243)continue;const R=v/A,P=B/A,W=new Float32Array(s*s);let J=0;for(let M=0;M<s;M++)for(let y=0;y<s;y++){const U=(h[(d+M)*b+S+y]??0)-z-R*(y-l)-P*(M-l);W[M*s+y]=U,J+=U*U}let N=0;for(let M=0;M+e<=s;M+=e)for(let y=0;y+e<=s;y+=e){let U=0;for(let Q=0;Q<e;Q++)for(let j=0;j<e;j++)U+=W[(M+Q)*s+y+j]??0;N+=(U/(e*e))**2}let D=0;for(let M=0;M<s;M++)for(let y=0;y<s;y++){const U=W[M*s+y]??0;y+1<s&&(D+=U*(W[M*s+y+1]??0)),M+1<s&&(D+=U*(W[(M+1)*s+y]??0))}t.push({content:N,sse:J,across:D})}if(t.length===0)return;t.sort((d,S)=>d.content-S.content);const i=t.slice(0,Math.max(1,Math.round(t.length*Math.min(1,Math.max(0,r))))),f=i.reduce((d,S)=>d+S.sse,0),g=i.reduce((d,S)=>d+S.across,0),I=f/(i.length*(s*s-3)),p=f>0?g/(2*s*(s-1))/(f/(s*s)):0,m=Math.sqrt(I);return{blocks:i.length,of:t.length,sd:E(m),amount:E(m/255),correlation:E(p),size:E(yt(p,Math.min(b,k)))}}function wt(h,b,k){const o=p=>{const m=p/255;return m<=.04045?m/12.92:((m+.055)/1.055)**2.4},r=o(h),s=o(b),e=o(k),l=(.4124564*r+.3575761*s+.1804375*e)/.95047,A=.2126729*r+.7151522*s+.072175*e,t=(.0193339*r+.119192*s+.9503041*e)/1.08883,i=p=>p>216/24389?Math.cbrt(p):(24389/27*p+16)/116,f=i(l),g=i(A),I=i(t);return[116*g-16,500*(f-g),200*(g-I)]}function ft(h,b){const k=h.width*h.height,o=new Float32Array(k*3),r=new Float32Array(k*3),s=new Map;for(let e=0;e<k;e++){const l=(h.data[e*4+3]??0)/255,A=Math.round((h.data[e*4]??0)*l+b[0]*(1-l)),t=Math.round((h.data[e*4+1]??0)*l+b[1]*(1-l)),i=Math.round((h.data[e*4+2]??0)*l+b[2]*(1-l));o[e*3]=A,o[e*3+1]=t,o[e*3+2]=i;const f=A<<16|t<<8|i;let g=s.get(f);g||(g=wt(A,t,i),s.size<1<<20&&s.set(f,g)),r[e*3]=g[0],r[e*3+1]=g[1],r[e*3+2]=g[2]}return{rgb:o,lab:r}}function rt(h,b,k,o,r,s,e){let l=0,A=0;for(let t=Math.max(0,s);t<Math.min(o,o+s);t+=e)for(let i=Math.max(0,r);i<Math.min(k,k+r);i+=e){const f=(t*k+i)*3,g=((t-s)*k+(i-r))*3,I=(h[f]??0)-(b[g]??0),p=(h[f+1]??0)-(b[g+1]??0),m=(h[f+2]??0)-(b[g+2]??0);l+=Math.sqrt(I*I+p*p+m*m),A++}return A?l/A:1/0}function kt(h,b,k,o,r){const s=6.502500000000001,e=(.03*255)**2,l=Math.min(r,k),A=Math.min(r,o),t=Math.max(1,Math.floor(r/2));let i=0,f=0;for(let g=0;g+A<=o;g+=t)for(let I=0;I+l<=k;I+=t){let p=0,m=0;for(let B=g;B<g+A;B++)for(let R=I;R<I+l;R++)p+=h[B*k+R]??0,m+=b[B*k+R]??0;const d=l*A;p/=d,m/=d;let S=0,z=0,v=0;for(let B=g;B<g+A;B++)for(let R=I;R<I+l;R++){const P=(h[B*k+R]??0)-p,W=(b[B*k+R]??0)-m;S+=P*P,z+=W*W,v+=P*W}S/=d-1||1,z/=d-1||1,v/=d-1||1,i+=(2*p*m+s)*(2*v+e)/((p*p+m*m+s)*(S+z+e)),f++}return f?i/f:1}function vt(h,b,k){const o=Math.min(1,Math.max(0,(h-b)/Math.max(1e-6,k-b)));return[255,Math.round(220*(1-o)),0,.55+.45*o]}export function edgeWidths(h,b,k,o){const r=[],s=(t,i)=>{let f=0;for(;f<i-o.span;){if(Math.abs(t(f)-t(f+o.span))<=o.step){f++;continue}let g=f,I=-1;for(let v=f;v<f+o.span;v++){const B=Math.abs(t(v+1)-t(v));B>I&&(I=B,g=v)}const p=t(g+1)>t(g);let m=g;for(;m>0&&g-m<o.span&&(p?t(m-1)<=t(m):t(m-1)>=t(m));)m--;let d=g+1;for(;d<i-1&&d-g-1<o.span&&(p?t(d+1)>=t(d):t(d+1)<=t(d));)d++;const S=t(m),z=t(d);if(Math.abs(z-S)>o.step){const v=[];for(let D=m;D<=d;D++)v.push(p?t(D):-t(D));const B=Math.min(S,z),R=Math.abs(z-S),P=D=>p?B+D*R:-(B+(1-D)*R),W=D=>{for(let M=0;M<v.length-1;M++){const y=v[M]??0,U=v[M+1]??0;if(y<=D&&D<U)return M+(D-y)/(U-y)}},J=W(P(.1)),N=W(P(.9));J!==void 0&&N!==void 0&&N>J&&r.push(N-J)}f=Math.max(f+1,d)}};for(let t=0;t<k;t++)s(i=>h[t*b+i]??0,b);for(let t=0;t<b;t++)s(i=>h[i*b+t]??0,k);r.sort((t,i)=>t-i);const e=t=>r.length===0?void 0:E(r[Math.min(r.length-1,Math.floor(t*r.length))]??0),l=e(.25),A=e(.5);return{edges:r.length,...l===void 0?{}:{p25:l},...A===void 0?{}:{median:A}}}const bt=2.563;export function compareImages(h,b,k={}){const o={...COMPARE_DEFAULTS,...k};let r=b,s;if(r.width!==h.width||r.height!==h.height){if(o.resize==="stretch")r=ut(r,h.width,h.height);else if(o.resize==="width"){const n=Math.max(1,Math.round(r.height*h.width/r.width));r=ut(r,h.width,n)}r!==b&&(s={mode:o.resize,from:[b.width,b.height],to:[r.width,r.height],scale:[E(r.width/b.width),E(r.height/b.height)]})}const e=h.width,l=h.height,A=nt(e,l);et(A,r,0,0);const t=ft(h,o.background);let i=ft(A,o.background),f={x:0,y:0},g;if(o.shift>0){const n=e*l>1e6?2:1,c=rt(t.lab,i.lab,e,l,0,0,1);let a={x:0,y:0,meanDeltaE:rt(t.lab,i.lab,e,l,0,0,n)};for(let x=-o.shift;x<=o.shift;x++)for(let w=-o.shift;w<=o.shift;w++){if(w===0&&x===0)continue;const q=rt(t.lab,i.lab,e,l,w,x,n);q<a.meanDeltaE-1e-9&&(a={x:w,y:x,meanDeltaE:q})}f={x:a.x,y:a.y},g={range:o.shift,unshifted:E(c),best:{...f,meanDeltaE:E(rt(t.lab,i.lab,e,l,a.x,a.y,1))}}}const I=nt(e,l);et(I,r,f.x,f.y),(f.x!==0||f.y!==0)&&(i=ft(I,o.background));const p=Math.max(0,f.x),m=Math.max(0,f.y),d=Math.min(e,r.width+f.x),S=Math.min(l,r.height+f.y),z=Math.max(0,d-p),v=Math.max(0,S-m),B=new Float32Array(e*l),R=(n,c)=>n>=p&&n<d&&c>=m&&c<S;let P=0,W=0,J=0;const N=[0,0,0,0],D=[0,0,0,0],M=new Float32Array(z*v),y=new Float32Array(z*v),U=.05,Q=new Uint32Array(Math.ceil(300/U)+1);for(let n=m;n<S;n++)for(let c=p;c<d;c++){const a=n*e+c,x=(t.lab[a*3]??0)-(i.lab[a*3]??0),w=(t.lab[a*3+1]??0)-(i.lab[a*3+1]??0),q=(t.lab[a*3+2]??0)-(i.lab[a*3+2]??0),u=Math.sqrt(x*x+w*w+q*q);B[a]=u;const O=Math.min(Q.length-1,Math.floor(u/U));Q[O]=(Q[O]??0)+1,P+=u,u>W&&(W=u),u>o.tolerance&&J++;for(let F=0;F<3;F++){const $=Math.abs((t.rgb[a*3+F]??0)-(i.rgb[a*3+F]??0));N[F]=(N[F]??0)+$,$>(D[F]??0)&&(D[F]=$)}const L=Math.abs((h.data[a*4+3]??0)-(I.data[a*4+3]??0));N[3]=(N[3]??0)+L,L>(D[3]??0)&&(D[3]=L);const _=(n-m)*z+(c-p);M[_]=.2126*(t.rgb[a*3]??0)+.7152*(t.rgb[a*3+1]??0)+.0722*(t.rgb[a*3+2]??0),y[_]=.2126*(i.rgb[a*3]??0)+.7152*(i.rgb[a*3+1]??0)+.0722*(i.rgb[a*3+2]??0)}const j=z*v;let dt=0;for(let n=0,c=0;n<Q.length;n++)if(c+=Q[n]??0,c>=j*.95){dt=n*U;break}const X=Math.max(1,Math.round(o.gap)),tt=Math.ceil(e/X),it=Math.ceil(l/X),ot=new Uint8Array(tt*it);for(let n=m;n<S;n++)for(let c=p;c<d;c++)(B[n*e+c]??0)>o.tolerance&&(ot[Math.floor(n/X)*tt+Math.floor(c/X)]=1);const at=new Uint8Array(tt*it),st=[];for(let n=0;n<ot.length;n++){if(!ot[n]||at[n])continue;const c=[n];at[n]=1;let a=1/0,x=1/0,w=-1,q=-1,u=0,O=0,L=0;for(;c.length;){const _=c.pop()??0,F=_%tt,$=Math.floor(_/tt);for(let C=$*X;C<Math.min(l,($+1)*X);C++)for(let G=F*X;G<Math.min(e,(F+1)*X);G++){if(!R(G,C))continue;const V=B[C*e+G]??0;V<=o.tolerance||(u++,O+=V,V>L&&(L=V),G<a&&(a=G),C<x&&(x=C),G>w&&(w=G),C>q&&(q=C))}for(let C=$-1;C<=$+1;C++)for(let G=F-1;G<=F+1;G++){if(G<0||C<0||G>=tt||C>=it)continue;const V=C*tt+G;ot[V]&&!at[V]&&(at[V]=1,c.push(V))}}u>0&&st.push({box:[a,x,w-a+1,q-x+1],pixels:u,meanDeltaE:E(O/u),maxDeltaE:E(L)})}st.sort((n,c)=>c.pixels-n.pixels||n.box[1]-c.box[1]||n.box[0]-c.box[0]);const Y=nt(e,l,[255,255,255,255]);for(let n=0;n<e*l;n++){let a=255-(255-(.2126*(t.rgb[n*3]??0)+.7152*(t.rgb[n*3+1]??0)+.0722*(t.rgb[n*3+2]??0)))*.35,x=a,w=a;const q=B[n]??0;if(q>o.tolerance){const[u,O,L,_]=vt(q,o.tolerance,o.heatMax);a=a*(1-_)+u*_,x=x*(1-_)+O*_,w=w*(1-_)+L*_}Y.data[n*4]=Math.round(a),Y.data[n*4+1]=Math.round(x),Y.data[n*4+2]=Math.round(w)}const mt=n=>{const[c,a,x,w]=n,q=(u,O)=>{if(u<0||O<0||u>=e||O>=l)return;const L=(O*e+u)*4;Y.data[L]=30,Y.data[L+1]=90,Y.data[L+2]=230};for(let u=c-2;u<c+x+2;u++)q(u,a-2),q(u,a+w+1);for(let u=a-2;u<a+w+2;u++)q(c-2,u),q(c+x+1,u)};for(const n of st.slice(0,50))mt(n.box);const Z=Math.max(4,Math.round(Math.min(e,l)/50)),ct=nt(e*3+Z*4,l+Z*2,[128,128,128,255]),ht=n=>{const c=nt(e,l,[...o.background,255]);for(let a=0;a<e*l;a++){const x=(n.data[a*4+3]??0)/255;for(let w=0;w<3;w++)c.data[a*4+w]=Math.round((n.data[a*4+w]??0)*x+(o.background[w]??0)*(1-x))}return c};et(ct,ht(h),Z,Z),et(ct,ht(I),e+Z*2,Z),et(ct,Y,e*2+Z*3,Z);const Mt=()=>{const n={step:o.edgeStep,span:o.edgeSpan},c=edgeWidths(M,z,v,n),a=edgeWidths(y,z,v,n),x=c.p25!==void 0&&a.p25!==void 0?E(Math.sqrt(Math.max(0,(c.p25/bt)**2-(a.p25/bt)**2))*(1080/Math.min(e,l))):void 0;return{...n,reference:c,candidate:a,...x===void 0?{}:{soften:x}}},gt=(n,c)=>{const a=[0,0,0],x=[0,0,0];for(let O=m;O<S;O++)for(let L=p;L<d;L++){const _=O*e+L;for(let F=0;F<3;F++)a[F]=(a[F]??0)+(n.rgb[_*3+F]??0),x[F]=(x[F]??0)+(n.lab[_*3+F]??0)}const w=Float32Array.from(c).sort(),q=O=>w.length?w[Math.min(w.length-1,Math.floor(O*w.length))]??0:0,u=O=>E(j?O/j:0);return{rgb:[u(a[0]??0),u(a[1]??0),u(a[2]??0)],luma:{mean:u(c.reduce((O,L)=>O+L,0)),p5:E(q(.05)),p50:E(q(.5)),p95:E(q(.95))},lab:[u(x[0]??0),u(x[1]??0),u(x[2]??0)]}},T=gt(t,M),H=gt(i,y),K=(n,c)=>E(n-c),xt={reference:T,candidate:H,difference:{rgb:[K(H.rgb[0],T.rgb[0]),K(H.rgb[1],T.rgb[1]),K(H.rgb[2],T.rgb[2])],luma:{mean:K(H.luma.mean,T.luma.mean),p5:K(H.luma.p5,T.luma.p5),p50:K(H.luma.p50,T.luma.p50),p95:K(H.luma.p95,T.luma.p95)},lab:[K(H.lab[0],T.lab[0]),K(H.lab[1],T.lab[1]),K(H.lab[2],T.lab[2])]}},pt=()=>{const n=grainOf(M,z,v,o.grainBlock,o.grainShare),c=grainOf(y,z,v,o.grainBlock,o.grainShare);return{block:o.grainBlock,share:o.grainShare,...n?{reference:n}:{},...c?{candidate:c}:{},...n&&c?{amount:E(Math.sqrt(Math.max(0,n.sd**2-c.sd**2))/255)}:{}}},lt=n=>({mean:E(j?(N[n]??0)/j:0),max:D[n]??0});return{result:{reference:{width:h.width,height:h.height},candidate:{width:b.width,height:b.height},...s?{resized:s}:{},compared:[p,m,z,v],offset:f,...g?{search:g}:{},pixels:j,tolerance:o.tolerance,differing:J,share:j?E(J/j):0,deltaE:{mean:E(j?P/j:0),max:E(W),p95:E(dt)},channels:{r:lt(0),g:lt(1),b:lt(2),alpha:lt(3)},levels:xt,grain:pt(),ssim:E(kt(M,y,z,v,o.ssimWindow)),regions:st,edges:Mt()},heatmap:Y,side:ct,aligned:ht(I)}}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * The capture.grain.size whose grain has neighbouring pixels this
3
+ * correlated, on a picture `lines` px on its shorter side: 0 for grain a
4
+ * pixel each (or neighbours that differ more than chance, as sharpening
5
+ * makes them).
6
+ */
7
+ export declare function grainSize(correlation: number, lines: number): number;
8
+ //# sourceMappingURL=grain.d.ts.map
@@ -0,0 +1,2 @@
1
+ /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
+ const e=[[0,0],[.25,.0563],[.4,.1352],[.5,.197],[.6,.2616],[.75,.3569],[1,.4972],[1.25,.6077],[1.5,.691],[2,.8001],[2.5,.8632],[3,.9018],[4,.9435]];export function grainSize(t,l){const s=e[e.length-1]??[4,.9435];let f=0;if(t>=.999)f=30;else if(t>=s[1])f=s[0]*Math.sqrt(-Math.log(s[1]))/Math.sqrt(-Math.log(t));else if(t>0)for(let g=1;g<e.length;g++){const[M,h]=e[g]??s,[n,i]=e[g-1]??s;if(t<=h){f=n+(M-n)*(t-i)/(h-i);break}}return 2*f*1080/l}
@@ -0,0 +1,16 @@
1
+ /** An image as 8-bit RGBA. */
2
+ export interface Img {
3
+ width: number;
4
+ height: number;
5
+ data: Uint8Array;
6
+ }
7
+ export declare const readPng: (buf: Buffer) => Img;
8
+ export declare const writePng: (img: Img) => Buffer;
9
+ export declare const blankImage: (width: number, height: number, rgba?: readonly [number, number, number, number]) => Img;
10
+ /** A box of an image (x, y, width, height), cut to the image; undefined when nothing of it is inside. */
11
+ export declare function cropImage(img: Img, box: readonly [number, number, number, number]): Img | undefined;
12
+ /** Another image drawn into `dst` at x, y (copied, not blended). */
13
+ export declare function pasteImage(dst: Img, src: Img, x: number, y: number): void;
14
+ /** An image resampled to width × height (premultiplied, so transparent edges keep their colour), or by its nearest pixels. */
15
+ export declare function resizeImage(img: Img, width: number, height: number, filter?: "smooth" | "nearest"): Img;
16
+ //# sourceMappingURL=image.d.ts.map
@@ -0,0 +1,2 @@
1
+ /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
+ import{PNG as I}from"pngjs";export const readPng=t=>{const a=I.sync.read(t);return{width:a.width,height:a.height,data:new Uint8Array(a.data)}},writePng=t=>{const a=new I({width:t.width,height:t.height});return Buffer.from(t.data.buffer,t.data.byteOffset,t.data.byteLength).copy(a.data),I.sync.write(a)},blankImage=(t,a,r=[0,0,0,0])=>{const h=new Uint8Array(t*a*4);for(let c=0;c<h.length;c+=4)h[c]=r[0],h[c+1]=r[1],h[c+2]=r[2],h[c+3]=r[3];return{width:t,height:a,data:h}};export function cropImage(t,a){const r=Math.max(0,Math.round(a[0])),h=Math.max(0,Math.round(a[1])),c=Math.min(t.width,Math.round(a[0]+a[2])),u=Math.min(t.height,Math.round(a[1]+a[3]));if(c<=r||u<=h)return;const e=c-r,d=new Uint8Array(e*(u-h)*4);for(let n=h;n<u;n++)d.set(t.data.subarray((n*t.width+r)*4,(n*t.width+c)*4),(n-h)*e*4);return{width:e,height:u-h,data:d}}export function pasteImage(t,a,r,h){for(let c=0;c<a.height;c++){const u=h+c;if(!(u<0||u>=t.height))for(let e=0;e<a.width;e++){const d=r+e;if(d<0||d>=t.width)continue;const n=(c*a.width+e)*4,s=(u*t.width+d)*4;t.data[s]=a.data[n]??0,t.data[s+1]=a.data[n+1]??0,t.data[s+2]=a.data[n+2]??0,t.data[s+3]=a.data[n+3]??0}}}function k(t,a){const r=a/t;if(r<1)return Array.from({length:a},(c,u)=>{const e=u/r,d=(u+1)/r,n=Math.floor(e),s=Math.min(t,Math.ceil(d)),l=[];for(let o=n;o<s;o++)l.push((Math.min(d,o+1)-Math.max(e,o))/(d-e));return{start:n,weights:l}});const h=1;return Array.from({length:a},(c,u)=>{const e=(u+.5)/r-.5,d=Math.max(0,Math.floor(e-h)),n=Math.min(t-1,Math.ceil(e+h)),s=[];let l=0;for(let o=d;o<=n;o++){const f=Math.max(0,1-Math.abs(o-e)/h);s.push(f),l+=f}return l===0?{start:Math.min(t-1,Math.max(0,Math.round(e))),weights:[1]}:{start:d,weights:s.map(o=>o/l)}})}export function resizeImage(t,a,r,h="smooth"){if(t.width===a&&t.height===r)return t;if(h==="nearest"){const n=new Uint8Array(a*r*4);for(let s=0;s<r;s++){const l=Math.min(t.height-1,Math.floor((s+.5)*t.height/r));for(let o=0;o<a;o++){const f=Math.min(t.width-1,Math.floor((o+.5)*t.width/a));n.set(t.data.subarray((l*t.width+f)*4,(l*t.width+f)*4+4),(s*a+o)*4)}}return{width:a,height:r,data:n}}const c=k(t.width,a),u=k(t.height,r),e=new Float32Array(a*t.height*4);for(let n=0;n<t.height;n++)for(let s=0;s<a;s++){const{start:l,weights:o}=c[s]??{start:0,weights:[]};let f=0,x=0,A=0,M=0;for(let w=0;w<o.length;w++){const y=o[w]??0,p=(n*t.width+l+w)*4,U=(t.data[p+3]??0)/255;f+=y*(t.data[p]??0)*U,x+=y*(t.data[p+1]??0)*U,A+=y*(t.data[p+2]??0)*U,M+=y*U}const i=(n*a+s)*4;e[i]=f,e[i+1]=x,e[i+2]=A,e[i+3]=M}const d=new Uint8Array(a*r*4);for(let n=0;n<r;n++){const{start:s,weights:l}=u[n]??{start:0,weights:[]};for(let o=0;o<a;o++){let f=0,x=0,A=0,M=0;for(let w=0;w<l.length;w++){const y=l[w]??0,p=((s+w)*a+o)*4;f+=y*(e[p]??0),x+=y*(e[p+1]??0),A+=y*(e[p+2]??0),M+=y*(e[p+3]??0)}const i=(n*a+o)*4;d[i]=M>0?Math.round(f/M):0,d[i+1]=M>0?Math.round(x/M):0,d[i+2]=M>0?Math.round(A/M):0,d[i+3]=Math.round(M*255)}}return{width:a,height:r,data:d}}
@@ -0,0 +1,4 @@
1
+ export { blankImage, cropImage, pasteImage, readPng, resizeImage, writePng, type Img, } from "./image.js";
2
+ export { grainSize } from "./grain.js";
3
+ export { COMPARE_DEFAULTS, compareImages, edgeWidths, grainOf, type ChannelStats, type CompareImages, type CompareOptions, type CompareResult, type DiffRegion, type EdgeWidths, type Grain, type Levels, } from "./compare.js";
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,2 @@
1
+ /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
+ export{blankImage,cropImage,pasteImage,readPng,resizeImage,writePng}from"./image.js";export{grainSize}from"./grain.js";export{COMPARE_DEFAULTS,compareImages,edgeWidths,grainOf}from"./compare.js";
@@ -0,0 +1,13 @@
1
+ {
2
+ "name": "@allyhub/measure",
3
+ "version": "0.10.0",
4
+ "type": "module",
5
+ "exports": {
6
+ ".": {
7
+ "types": "./dist/index.d.ts",
8
+ "default": "./dist/index.js"
9
+ }
10
+ },
11
+ "private": true,
12
+ "license": "SEE LICENSE IN LICENSE.md"
13
+ }
@@ -16,11 +16,14 @@ export interface PresetHandle {
16
16
  readonly ang?: HandleRef;
17
17
  readonly pos: readonly [string, string];
18
18
  }
19
- /** A preset geometry: its adjustments and guides (name, formula), its adjust handles, its text rectangle and its paths. */
19
+ /** A connection site: where it sits and the way a line leaves it, 60 000ths of a degree clockwise from the right (guide names or numbers). */
20
+ export type PresetSite = readonly [x: string, y: string, ang: string];
21
+ /** A preset geometry: its adjustments and guides (name, formula), its adjust handles, its connection sites, its text rectangle and its paths. */
20
22
  export interface PresetDef {
21
23
  readonly av?: readonly (readonly [string, string])[];
22
24
  readonly gd?: readonly (readonly [string, string])[];
23
25
  readonly ah?: readonly PresetHandle[];
26
+ readonly cxn?: readonly PresetSite[];
24
27
  readonly text?: readonly [string, string, string, string];
25
28
  readonly paths: readonly PresetPath[];
26
29
  }