@adobe/data 0.9.75 → 0.9.76

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 (317) hide show
  1. package/dist/ecs/database/transactional-store/create-transactional-store.js +7 -1
  2. package/dist/ecs/database/transactional-store/create-transactional-store.js.map +1 -1
  3. package/dist/ecs/database/transactional-store/create-transactional-store.test.js +42 -0
  4. package/dist/ecs/database/transactional-store/create-transactional-store.test.js.map +1 -1
  5. package/dist/functions/serialization/codec.js +4 -0
  6. package/dist/functions/serialization/codec.js.map +1 -1
  7. package/dist/functions/serialization/serialization.test.js +10 -0
  8. package/dist/functions/serialization/serialization.test.js.map +1 -1
  9. package/dist/math/i32/public.d.ts +2 -1
  10. package/dist/math/i32/public.js +2 -1
  11. package/dist/math/i32/public.js.map +1 -1
  12. package/dist/math/i32/shift-right.d.ts +2 -0
  13. package/dist/math/i32/shift-right.js +3 -0
  14. package/dist/math/i32/shift-right.js.map +1 -0
  15. package/dist/math/u32/count-leading-zeros.d.ts +2 -0
  16. package/dist/math/u32/count-leading-zeros.js +3 -0
  17. package/dist/math/u32/count-leading-zeros.js.map +1 -0
  18. package/dist/math/u32/count-one-bits.d.ts +2 -0
  19. package/dist/math/u32/count-one-bits.js +11 -0
  20. package/dist/math/u32/count-one-bits.js.map +1 -0
  21. package/dist/math/u32/count-trailing-zeros.d.ts +2 -0
  22. package/dist/math/u32/count-trailing-zeros.js +14 -0
  23. package/dist/math/u32/count-trailing-zeros.js.map +1 -0
  24. package/dist/math/u32/public.d.ts +6 -1
  25. package/dist/math/u32/public.js +6 -1
  26. package/dist/math/u32/public.js.map +1 -1
  27. package/dist/math/u32/reverse-bits.d.ts +2 -0
  28. package/dist/math/u32/reverse-bits.js +11 -0
  29. package/dist/math/u32/reverse-bits.js.map +1 -0
  30. package/dist/math/u32/shift-right.d.ts +2 -0
  31. package/dist/math/u32/shift-right.js +3 -0
  32. package/dist/math/u32/shift-right.js.map +1 -0
  33. package/dist/math/vec2/f32/f32.d.ts +4 -0
  34. package/dist/math/vec2/f32/f32.js +3 -0
  35. package/dist/math/vec2/f32/f32.js.map +1 -0
  36. package/dist/math/vec2/f32/functions.d.ts +50 -0
  37. package/dist/math/vec2/f32/functions.js +87 -0
  38. package/dist/math/vec2/f32/functions.js.map +1 -0
  39. package/dist/math/vec2/f32/layout.d.ts +1 -0
  40. package/dist/math/vec2/f32/layout.js +5 -0
  41. package/dist/math/vec2/f32/layout.js.map +1 -0
  42. package/dist/math/vec2/f32/public.d.ts +3 -0
  43. package/dist/math/vec2/f32/public.js +5 -0
  44. package/dist/math/vec2/f32/public.js.map +1 -0
  45. package/dist/math/vec2/f32/schema.d.ts +11 -0
  46. package/dist/math/vec2/f32/schema.js +10 -0
  47. package/dist/math/vec2/f32/schema.js.map +1 -0
  48. package/dist/math/vec2/i32/functions.d.ts +21 -0
  49. package/dist/math/vec2/i32/functions.js +39 -0
  50. package/dist/math/vec2/i32/functions.js.map +1 -0
  51. package/dist/math/vec2/i32/i32.d.ts +4 -0
  52. package/dist/math/vec2/i32/i32.js +3 -0
  53. package/dist/math/vec2/i32/i32.js.map +1 -0
  54. package/dist/math/vec2/i32/layout.d.ts +1 -0
  55. package/dist/math/vec2/i32/layout.js +5 -0
  56. package/dist/math/vec2/i32/layout.js.map +1 -0
  57. package/dist/math/vec2/i32/public.d.ts +3 -0
  58. package/dist/math/vec2/i32/public.js +5 -0
  59. package/dist/math/vec2/i32/public.js.map +1 -0
  60. package/dist/math/vec2/i32/schema.d.ts +12 -0
  61. package/dist/math/vec2/i32/schema.js +10 -0
  62. package/dist/math/vec2/i32/schema.js.map +1 -0
  63. package/dist/math/vec2/index.d.ts +61 -4
  64. package/dist/math/vec2/index.js +56 -1
  65. package/dist/math/vec2/index.js.map +1 -1
  66. package/dist/math/vec2/public.d.ts +5 -3
  67. package/dist/math/vec2/public.js +6 -3
  68. package/dist/math/vec2/public.js.map +1 -1
  69. package/dist/math/vec2/u32/functions.d.ts +20 -0
  70. package/dist/math/vec2/u32/functions.js +58 -0
  71. package/dist/math/vec2/u32/functions.js.map +1 -0
  72. package/dist/math/vec2/u32/layout.d.ts +1 -0
  73. package/dist/math/vec2/u32/layout.js +5 -0
  74. package/dist/math/vec2/u32/layout.js.map +1 -0
  75. package/dist/math/vec2/u32/public.d.ts +3 -0
  76. package/dist/math/vec2/u32/public.js +5 -0
  77. package/dist/math/vec2/u32/public.js.map +1 -0
  78. package/dist/math/vec2/u32/schema.d.ts +12 -0
  79. package/dist/math/vec2/u32/schema.js +10 -0
  80. package/dist/math/vec2/u32/schema.js.map +1 -0
  81. package/dist/math/vec2/u32/u32.d.ts +4 -0
  82. package/dist/math/vec2/u32/u32.js +3 -0
  83. package/dist/math/vec2/u32/u32.js.map +1 -0
  84. package/dist/math/vec3/f32/f32.d.ts +4 -0
  85. package/dist/math/vec3/f32/f32.js +3 -0
  86. package/dist/math/vec3/f32/f32.js.map +1 -0
  87. package/dist/math/vec3/f32/functions.d.ts +59 -0
  88. package/dist/math/vec3/f32/functions.js +139 -0
  89. package/dist/math/vec3/f32/functions.js.map +1 -0
  90. package/dist/math/vec3/f32/layout.d.ts +1 -0
  91. package/dist/math/vec3/f32/layout.js +5 -0
  92. package/dist/math/vec3/f32/layout.js.map +1 -0
  93. package/dist/math/vec3/f32/public.d.ts +3 -0
  94. package/dist/math/vec3/f32/public.js +5 -0
  95. package/dist/math/vec3/f32/public.js.map +1 -0
  96. package/dist/math/vec3/f32/schema.d.ts +11 -0
  97. package/dist/math/vec3/f32/schema.js +10 -0
  98. package/dist/math/vec3/f32/schema.js.map +1 -0
  99. package/dist/math/vec3/i32/functions.d.ts +23 -0
  100. package/dist/math/vec3/i32/functions.js +78 -0
  101. package/dist/math/vec3/i32/functions.js.map +1 -0
  102. package/dist/math/vec3/i32/i32.d.ts +4 -0
  103. package/dist/math/vec3/i32/i32.js +3 -0
  104. package/dist/math/vec3/i32/i32.js.map +1 -0
  105. package/dist/math/vec3/i32/layout.d.ts +1 -0
  106. package/dist/math/vec3/i32/layout.js +5 -0
  107. package/dist/math/vec3/i32/layout.js.map +1 -0
  108. package/dist/math/vec3/i32/public.d.ts +3 -0
  109. package/dist/math/vec3/i32/public.js +5 -0
  110. package/dist/math/vec3/i32/public.js.map +1 -0
  111. package/dist/math/vec3/i32/schema.d.ts +12 -0
  112. package/dist/math/vec3/i32/schema.js +10 -0
  113. package/dist/math/vec3/i32/schema.js.map +1 -0
  114. package/dist/math/vec3/index.d.ts +67 -4
  115. package/dist/math/vec3/index.js +62 -1
  116. package/dist/math/vec3/index.js.map +1 -1
  117. package/dist/math/vec3/public.d.ts +5 -3
  118. package/dist/math/vec3/public.js +6 -3
  119. package/dist/math/vec3/public.js.map +1 -1
  120. package/dist/math/vec3/u32/functions.d.ts +23 -0
  121. package/dist/math/vec3/u32/functions.js +85 -0
  122. package/dist/math/vec3/u32/functions.js.map +1 -0
  123. package/dist/math/vec3/u32/layout.d.ts +1 -0
  124. package/dist/math/vec3/u32/layout.js +5 -0
  125. package/dist/math/vec3/u32/layout.js.map +1 -0
  126. package/dist/math/vec3/u32/public.d.ts +3 -0
  127. package/dist/math/vec3/u32/public.js +5 -0
  128. package/dist/math/vec3/u32/public.js.map +1 -0
  129. package/dist/math/vec3/u32/schema.d.ts +12 -0
  130. package/dist/math/vec3/u32/schema.js +10 -0
  131. package/dist/math/vec3/u32/schema.js.map +1 -0
  132. package/dist/math/vec3/u32/u32.d.ts +4 -0
  133. package/dist/math/vec3/u32/u32.js +3 -0
  134. package/dist/math/vec3/u32/u32.js.map +1 -0
  135. package/dist/math/vec4/f32/f32.d.ts +4 -0
  136. package/dist/math/vec4/f32/f32.js +3 -0
  137. package/dist/math/vec4/f32/f32.js.map +1 -0
  138. package/dist/math/vec4/f32/functions.d.ts +49 -0
  139. package/dist/math/vec4/f32/functions.js +130 -0
  140. package/dist/math/vec4/f32/functions.js.map +1 -0
  141. package/dist/math/vec4/f32/layout.d.ts +1 -0
  142. package/dist/math/vec4/f32/layout.js +5 -0
  143. package/dist/math/vec4/f32/layout.js.map +1 -0
  144. package/dist/math/vec4/f32/public.d.ts +3 -0
  145. package/dist/math/vec4/f32/public.js +5 -0
  146. package/dist/math/vec4/f32/public.js.map +1 -0
  147. package/dist/math/vec4/f32/schema.d.ts +11 -0
  148. package/dist/math/vec4/f32/schema.js +10 -0
  149. package/dist/math/vec4/f32/schema.js.map +1 -0
  150. package/dist/math/vec4/i32/functions.d.ts +23 -0
  151. package/dist/math/vec4/i32/functions.js +91 -0
  152. package/dist/math/vec4/i32/functions.js.map +1 -0
  153. package/dist/math/vec4/i32/i32.d.ts +4 -0
  154. package/dist/math/vec4/i32/i32.js +3 -0
  155. package/dist/math/vec4/i32/i32.js.map +1 -0
  156. package/dist/math/vec4/i32/layout.d.ts +1 -0
  157. package/dist/math/vec4/i32/layout.js +5 -0
  158. package/dist/math/vec4/i32/layout.js.map +1 -0
  159. package/dist/math/vec4/i32/public.d.ts +3 -0
  160. package/dist/math/vec4/i32/public.js +5 -0
  161. package/dist/math/vec4/i32/public.js.map +1 -0
  162. package/dist/math/vec4/i32/schema.d.ts +12 -0
  163. package/dist/math/vec4/i32/schema.js +10 -0
  164. package/dist/math/vec4/i32/schema.js.map +1 -0
  165. package/dist/math/vec4/index.d.ts +60 -4
  166. package/dist/math/vec4/index.js +55 -1
  167. package/dist/math/vec4/index.js.map +1 -1
  168. package/dist/math/vec4/public.d.ts +5 -3
  169. package/dist/math/vec4/public.js +6 -3
  170. package/dist/math/vec4/public.js.map +1 -1
  171. package/dist/math/vec4/u32/functions.d.ts +22 -0
  172. package/dist/math/vec4/u32/functions.js +99 -0
  173. package/dist/math/vec4/u32/functions.js.map +1 -0
  174. package/dist/math/vec4/u32/layout.d.ts +1 -0
  175. package/dist/math/vec4/u32/layout.js +5 -0
  176. package/dist/math/vec4/u32/layout.js.map +1 -0
  177. package/dist/math/vec4/u32/public.d.ts +3 -0
  178. package/dist/math/vec4/u32/public.js +5 -0
  179. package/dist/math/vec4/u32/public.js.map +1 -0
  180. package/dist/math/vec4/u32/schema.d.ts +12 -0
  181. package/dist/math/vec4/u32/schema.js +10 -0
  182. package/dist/math/vec4/u32/schema.js.map +1 -0
  183. package/dist/math/vec4/u32/u32.d.ts +4 -0
  184. package/dist/math/vec4/u32/u32.js +3 -0
  185. package/dist/math/vec4/u32/u32.js.map +1 -0
  186. package/dist/schema/boolean/schema.d.ts +1 -0
  187. package/dist/schema/boolean/schema.js +2 -1
  188. package/dist/schema/boolean/schema.js.map +1 -1
  189. package/dist/schema/from-archetype.d.ts +14 -0
  190. package/dist/schema/from-archetype.js +9 -0
  191. package/dist/schema/from-archetype.js.map +1 -0
  192. package/dist/schema/from-components.d.ts +14 -0
  193. package/dist/schema/from-components.js +9 -0
  194. package/dist/schema/from-components.js.map +1 -0
  195. package/dist/schema/from-components.test.d.ts +1 -0
  196. package/dist/schema/from-components.test.js +49 -0
  197. package/dist/schema/from-components.test.js.map +1 -0
  198. package/dist/schema/from-components.type-test.d.ts +1 -0
  199. package/dist/schema/from-components.type-test.js +40 -0
  200. package/dist/schema/from-components.type-test.js.map +1 -0
  201. package/dist/schema/public.d.ts +2 -0
  202. package/dist/schema/public.js +2 -0
  203. package/dist/schema/public.js.map +1 -1
  204. package/dist/schema/to-type.d.ts +2 -0
  205. package/dist/schema/to-type.js.map +1 -1
  206. package/dist/table/copy-column-to-gpu-buffer.js +10 -2
  207. package/dist/table/copy-column-to-gpu-buffer.js.map +1 -1
  208. package/dist/tsconfig.tsbuildinfo +1 -1
  209. package/dist/typed-buffer/create-boolean-buffer.d.ts +6 -0
  210. package/dist/typed-buffer/create-boolean-buffer.js +83 -0
  211. package/dist/typed-buffer/create-boolean-buffer.js.map +1 -0
  212. package/dist/typed-buffer/create-boolean-buffer.test.d.ts +1 -0
  213. package/dist/typed-buffer/create-boolean-buffer.test.js +159 -0
  214. package/dist/typed-buffer/create-boolean-buffer.test.js.map +1 -0
  215. package/dist/typed-buffer/create-typed-buffer.js +4 -0
  216. package/dist/typed-buffer/create-typed-buffer.js.map +1 -1
  217. package/dist/typed-buffer/index.d.ts +1 -0
  218. package/dist/typed-buffer/index.js +1 -0
  219. package/dist/typed-buffer/index.js.map +1 -1
  220. package/dist/typed-buffer/register-typed-buffer-codecs.js +20 -2
  221. package/dist/typed-buffer/register-typed-buffer-codecs.js.map +1 -1
  222. package/dist/typed-buffer/typed-buffer.d.ts +4 -1
  223. package/dist/typed-buffer/typed-buffer.js +1 -0
  224. package/dist/typed-buffer/typed-buffer.js.map +1 -1
  225. package/dist/types/volume/axis-line-callback.d.ts +14 -0
  226. package/dist/types/volume/axis-line-callback.js +3 -0
  227. package/dist/types/volume/axis-line-callback.js.map +1 -0
  228. package/dist/types/volume/block-callback.d.ts +9 -0
  229. package/dist/types/volume/block-callback.js +3 -0
  230. package/dist/types/volume/block-callback.js.map +1 -0
  231. package/dist/types/volume/block-span.d.ts +9 -0
  232. package/dist/types/volume/block-span.js +3 -0
  233. package/dist/types/volume/block-span.js.map +1 -0
  234. package/dist/types/volume/create-dense/create-dense.d.ts +6 -0
  235. package/dist/types/volume/create-dense/create-dense.js +9 -0
  236. package/dist/types/volume/create-dense/create-dense.js.map +1 -0
  237. package/dist/types/volume/create-dense/create-dense.test.d.ts +1 -0
  238. package/dist/types/volume/create-dense/create-dense.test.js +121 -0
  239. package/dist/types/volume/create-dense/create-dense.test.js.map +1 -0
  240. package/dist/types/volume/create-dense/dense-volume.d.ts +17 -0
  241. package/dist/types/volume/create-dense/dense-volume.js +51 -0
  242. package/dist/types/volume/create-dense/dense-volume.js.map +1 -0
  243. package/dist/types/volume/create-dense/is-dense-volume.d.ts +2 -0
  244. package/dist/types/volume/create-dense/is-dense-volume.js +4 -0
  245. package/dist/types/volume/create-dense/is-dense-volume.js.map +1 -0
  246. package/dist/types/volume/create-dense/register-dense-volume-codecs.d.ts +1 -0
  247. package/dist/types/volume/create-dense/register-dense-volume-codecs.js +33 -0
  248. package/dist/types/volume/create-dense/register-dense-volume-codecs.js.map +1 -0
  249. package/dist/types/volume/create-sparse-block/block-dims.d.ts +35 -0
  250. package/dist/types/volume/create-sparse-block/block-dims.js +93 -0
  251. package/dist/types/volume/create-sparse-block/block-dims.js.map +1 -0
  252. package/dist/types/volume/create-sparse-block/block-key.d.ts +9 -0
  253. package/dist/types/volume/create-sparse-block/block-key.js +23 -0
  254. package/dist/types/volume/create-sparse-block/block-key.js.map +1 -0
  255. package/dist/types/volume/create-sparse-block/create-sparse-block.d.ts +6 -0
  256. package/dist/types/volume/create-sparse-block/create-sparse-block.js +9 -0
  257. package/dist/types/volume/create-sparse-block/create-sparse-block.js.map +1 -0
  258. package/dist/types/volume/create-sparse-block/create-sparse-block.test.d.ts +1 -0
  259. package/dist/types/volume/create-sparse-block/create-sparse-block.test.js +287 -0
  260. package/dist/types/volume/create-sparse-block/create-sparse-block.test.js.map +1 -0
  261. package/dist/types/volume/create-sparse-block/is-sparse-block-volume.d.ts +2 -0
  262. package/dist/types/volume/create-sparse-block/is-sparse-block-volume.js +4 -0
  263. package/dist/types/volume/create-sparse-block/is-sparse-block-volume.js.map +1 -0
  264. package/dist/types/volume/create-sparse-block/iterate-sparse-block-axis.d.ts +19 -0
  265. package/dist/types/volume/create-sparse-block/iterate-sparse-block-axis.js +160 -0
  266. package/dist/types/volume/create-sparse-block/iterate-sparse-block-axis.js.map +1 -0
  267. package/dist/types/volume/create-sparse-block/pack-block-key.d.ts +1 -0
  268. package/dist/types/volume/create-sparse-block/pack-block-key.js +3 -0
  269. package/dist/types/volume/create-sparse-block/pack-block-key.js.map +1 -0
  270. package/dist/types/volume/create-sparse-block/register-sparse-block-volume-codecs.d.ts +1 -0
  271. package/dist/types/volume/create-sparse-block/register-sparse-block-volume-codecs.js +37 -0
  272. package/dist/types/volume/create-sparse-block/register-sparse-block-volume-codecs.js.map +1 -0
  273. package/dist/types/volume/create-sparse-block/sparse-block-volume.d.ts +29 -0
  274. package/dist/types/volume/create-sparse-block/sparse-block-volume.js +133 -0
  275. package/dist/types/volume/create-sparse-block/sparse-block-volume.js.map +1 -0
  276. package/dist/types/volume/create-sparse-block/unpack-block-key.d.ts +5 -0
  277. package/dist/types/volume/create-sparse-block/unpack-block-key.js +7 -0
  278. package/dist/types/volume/create-sparse-block/unpack-block-key.js.map +1 -0
  279. package/dist/types/volume/get-dense-index.d.ts +2 -0
  280. package/dist/types/volume/get-dense-index.js +6 -0
  281. package/dist/types/volume/get-dense-index.js.map +1 -0
  282. package/dist/types/volume/get-dense-index.test.d.ts +1 -0
  283. package/dist/types/volume/get-dense-index.test.js +17 -0
  284. package/dist/types/volume/get-dense-index.test.js.map +1 -0
  285. package/dist/types/volume/is-in-bounds.d.ts +2 -0
  286. package/dist/types/volume/is-in-bounds.js +6 -0
  287. package/dist/types/volume/is-in-bounds.js.map +1 -0
  288. package/dist/types/volume/is-in-bounds.test.d.ts +1 -0
  289. package/dist/types/volume/is-in-bounds.test.js +12 -0
  290. package/dist/types/volume/is-in-bounds.test.js.map +1 -0
  291. package/dist/types/volume/iterate-axis.d.ts +7 -0
  292. package/dist/types/volume/iterate-axis.js +58 -0
  293. package/dist/types/volume/iterate-axis.js.map +1 -0
  294. package/dist/types/volume/iterate-sparse-block-axis.test.d.ts +1 -0
  295. package/dist/types/volume/iterate-sparse-block-axis.test.js +11 -0
  296. package/dist/types/volume/iterate-sparse-block-axis.test.js.map +1 -0
  297. package/dist/types/volume/iterate-sparse-block.benchmark.test.d.ts +1 -0
  298. package/dist/types/volume/iterate-sparse-block.benchmark.test.js +80 -0
  299. package/dist/types/volume/iterate-sparse-block.benchmark.test.js.map +1 -0
  300. package/dist/types/volume/iterate-test-helpers.d.ts +14 -0
  301. package/dist/types/volume/iterate-test-helpers.js +41 -0
  302. package/dist/types/volume/iterate-test-helpers.js.map +1 -0
  303. package/dist/types/volume/public.d.ts +7 -0
  304. package/dist/types/volume/public.js +6 -0
  305. package/dist/types/volume/public.js.map +1 -0
  306. package/dist/types/volume/sparse-block-iterate-benchmark.d.ts +49 -0
  307. package/dist/types/volume/sparse-block-iterate-benchmark.js +131 -0
  308. package/dist/types/volume/sparse-block-iterate-benchmark.js.map +1 -0
  309. package/dist/types/volume/volume.d.ts +13 -0
  310. package/dist/types/volume/volume.js +3 -0
  311. package/dist/types/volume/volume.js.map +1 -0
  312. package/package.json +1 -1
  313. package/references/data-lit/package.json +1 -1
  314. package/references/data-lit-tictactoe/package.json +1 -1
  315. package/references/data-react/package.json +1 -1
  316. package/references/data-react-hello/package.json +1 -1
  317. package/references/data-react-pixie/package.json +1 -1
@@ -0,0 +1,87 @@
1
+ // © 2026 Adobe. MIT License. See /LICENSE for details.
2
+ // Constants
3
+ export const zero = [0, 0];
4
+ // Mathematical Operations
5
+ export const abs = ([x, y]) => [Math.abs(x), Math.abs(y)];
6
+ export const ceil = ([x, y]) => [Math.ceil(x), Math.ceil(y)];
7
+ export const floor = ([x, y]) => [Math.floor(x), Math.floor(y)];
8
+ export const round = ([x, y]) => [Math.round(x), Math.round(y)];
9
+ export const trunc = ([x, y]) => [Math.trunc(x), Math.trunc(y)];
10
+ export const min = ([x1, y1], [x2, y2]) => [Math.min(x1, x2), Math.min(y1, y2)];
11
+ export const max = ([x1, y1], [x2, y2]) => [Math.max(x1, x2), Math.max(y1, y2)];
12
+ export const clamp = (v, minVec, maxVec) => min(max(v, minVec), maxVec);
13
+ export const mix = ([x1, y1], [x2, y2], t) => [
14
+ x1 * (1 - t) + x2 * t,
15
+ y1 * (1 - t) + y2 * t
16
+ ];
17
+ export const step = ([edge1, edge2], [x, y]) => [
18
+ x < edge1 ? 0 : 1,
19
+ y < edge2 ? 0 : 1
20
+ ];
21
+ export const smoothstep = ([e0x, e0y], [e1x, e1y], [x, y]) => {
22
+ const tx = Math.max(0, Math.min(1, (x - e0x) / (e1x - e0x)));
23
+ const ty = Math.max(0, Math.min(1, (y - e0y) / (e1y - e0y)));
24
+ return [tx * tx * (3 - 2 * tx), ty * ty * (3 - 2 * ty)];
25
+ };
26
+ export const equals = ([x1, y1], [x2, y2]) => x1 === x2 && y1 === y2;
27
+ // Geometric Functions
28
+ export const length = ([x, y]) => Math.sqrt(x * x + y * y);
29
+ export const distance = (a, b) => length(subtract(b, a));
30
+ export const dot = ([x1, y1], [x2, y2]) => x1 * x2 + y1 * y2;
31
+ export const normalize = (v) => {
32
+ const len = length(v);
33
+ return len === 0 ? [0, 0] : scale(v, 1 / len);
34
+ };
35
+ export const faceforward = (n, i, nref) => dot(nref, i) < 0 ? n : negate(n);
36
+ export const reflect = (i, n) => {
37
+ const dot2 = dot(n, i) * 2;
38
+ return subtract(i, scale(n, dot2));
39
+ };
40
+ export const refract = (i, n, eta) => {
41
+ const dotProduct = dot(n, i);
42
+ const k = 1.0 - eta * eta * (1.0 - dotProduct * dotProduct);
43
+ if (k < 0.0) {
44
+ return [0, 0];
45
+ }
46
+ const scaleFactor = eta * dotProduct + Math.sqrt(k);
47
+ return subtract(scale(i, eta), scale(n, scaleFactor));
48
+ };
49
+ // Trigonometric Functions
50
+ export const sin = ([x, y]) => [Math.sin(x), Math.sin(y)];
51
+ export const cos = ([x, y]) => [Math.cos(x), Math.cos(y)];
52
+ export const tan = ([x, y]) => [Math.tan(x), Math.tan(y)];
53
+ export const asin = ([x, y]) => [Math.asin(x), Math.asin(y)];
54
+ export const acos = ([x, y]) => [Math.acos(x), Math.acos(y)];
55
+ export const atan = ([x, y]) => [Math.atan(x), Math.atan(y)];
56
+ export const sinh = ([x, y]) => [Math.sinh(x), Math.sinh(y)];
57
+ export const cosh = ([x, y]) => [Math.cosh(x), Math.cosh(y)];
58
+ export const tanh = ([x, y]) => [Math.tanh(x), Math.tanh(y)];
59
+ export const asinh = ([x, y]) => [Math.asinh(x), Math.asinh(y)];
60
+ export const acosh = ([x, y]) => [Math.acosh(x), Math.acosh(y)];
61
+ export const atanh = ([x, y]) => [Math.atanh(x), Math.atanh(y)];
62
+ // Common Functions
63
+ export const sign = ([x, y]) => [Math.sign(x), Math.sign(y)];
64
+ export const fract = ([x, y]) => [x - Math.floor(x), y - Math.floor(y)];
65
+ export const mod = ([x, y], m) => [
66
+ ((x % m) + m) % m,
67
+ ((y % m) + m) % m
68
+ ];
69
+ export const modf = ([x, y]) => ({
70
+ whole: [Math.trunc(x), Math.trunc(y)],
71
+ fract: [x - Math.trunc(x), y - Math.trunc(y)]
72
+ });
73
+ export const pow = ([x1, y1], [x2, y2]) => [
74
+ Math.pow(x1, x2),
75
+ Math.pow(y1, y2)
76
+ ];
77
+ export const exp = ([x, y]) => [Math.exp(x), Math.exp(y)];
78
+ export const exp2 = ([x, y]) => [Math.pow(2, x), Math.pow(2, y)];
79
+ export const log = ([x, y]) => [Math.log(x), Math.log(y)];
80
+ export const log2 = ([x, y]) => [Math.log2(x), Math.log2(y)];
81
+ export const sqrt = ([x, y]) => [Math.sqrt(x), Math.sqrt(y)];
82
+ // Helper functions needed by some of the above
83
+ export const add = ([x1, y1], [x2, y2]) => [x1 + x2, y1 + y2];
84
+ export const subtract = ([x1, y1], [x2, y2]) => [x1 - x2, y1 - y2];
85
+ export const scale = ([x, y], s) => [x * s, y * s];
86
+ export const negate = ([x, y]) => [-x, -y];
87
+ //# sourceMappingURL=functions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"functions.js","sourceRoot":"","sources":["../../../../src/math/vec2/f32/functions.ts"],"names":[],"mappings":"AAAA,uDAAuD;AAIvD,YAAY;AACZ,MAAM,CAAC,MAAM,IAAI,GAAQ,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAEhC,0BAA0B;AAC1B,MAAM,CAAC,MAAM,GAAG,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAM,EAAO,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;AACpE,MAAM,CAAC,MAAM,IAAI,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAM,EAAO,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,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026 Adobe. MIT License. See /LICENSE for details.
2
+ import { getStructLayout } from "../../../typed-buffer/index.js";
3
+ import { schema } from "./schema.js";
4
+ export const layout = getStructLayout(schema);
5
+ //# sourceMappingURL=layout.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"layout.js","sourceRoot":"","sources":["../../../../src/math/vec2/f32/layout.ts"],"names":[],"mappings":"AAAA,uDAAuD;AAEvD,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,MAAM,CAAC,MAAM,MAAM,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ export * from "./functions.js";
2
+ export * from "./layout.js";
3
+ export * from "./schema.js";
@@ -0,0 +1,5 @@
1
+ // © 2026 Adobe. MIT License. See /LICENSE for details.
2
+ export * from "./functions.js";
3
+ export * from "./layout.js";
4
+ export * from "./schema.js";
5
+ //# sourceMappingURL=public.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"public.js","sourceRoot":"","sources":["../../../../src/math/vec2/f32/public.ts"],"names":[],"mappings":"AAAA,uDAAuD;AAEvD,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC"}
@@ -0,0 +1,11 @@
1
+ export declare const schema: {
2
+ readonly type: "array";
3
+ readonly items: {
4
+ readonly type: "number";
5
+ readonly precision: 1;
6
+ readonly default: number;
7
+ };
8
+ readonly minItems: 2;
9
+ readonly maxItems: 2;
10
+ readonly default: readonly [0, 0];
11
+ };
@@ -0,0 +1,10 @@
1
+ // © 2026 Adobe. MIT License. See /LICENSE for details.
2
+ import { F32 } from "../../f32/index.js";
3
+ export const schema = {
4
+ type: 'array',
5
+ items: F32.schema,
6
+ minItems: 2,
7
+ maxItems: 2,
8
+ default: [0, 0],
9
+ };
10
+ //# sourceMappingURL=schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../../src/math/vec2/f32/schema.ts"],"names":[],"mappings":"AAAA,uDAAuD;AAEvD,OAAO,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAC;AAGzC,MAAM,CAAC,MAAM,MAAM,GAAG;IAClB,IAAI,EAAE,OAAO;IACb,KAAK,EAAE,GAAG,CAAC,MAAM;IACjB,QAAQ,EAAE,CAAC;IACX,QAAQ,EAAE,CAAC;IACX,OAAO,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;CACQ,CAAC"}
@@ -0,0 +1,21 @@
1
+ import type { I32 as Vec2_I32 } from "./i32.js";
2
+ export declare const zero: Vec2_I32;
3
+ export declare const abs: ([x, y]: Vec2_I32) => Vec2_I32;
4
+ export declare const add: ([x1, y1]: Vec2_I32, [x2, y2]: Vec2_I32) => Vec2_I32;
5
+ export declare const subtract: ([x1, y1]: Vec2_I32, [x2, y2]: Vec2_I32) => Vec2_I32;
6
+ export declare const scale: ([x, y]: Vec2_I32, s: number) => Vec2_I32;
7
+ export declare const negate: ([x, y]: Vec2_I32) => Vec2_I32;
8
+ export declare const min: ([x1, y1]: Vec2_I32, [x2, y2]: Vec2_I32) => Vec2_I32;
9
+ export declare const max: ([x1, y1]: Vec2_I32, [x2, y2]: Vec2_I32) => Vec2_I32;
10
+ export declare const clamp: (v: Vec2_I32, minVec: Vec2_I32, maxVec: Vec2_I32) => Vec2_I32;
11
+ export declare const equals: ([x1, y1]: Vec2_I32, [x2, y2]: Vec2_I32) => boolean;
12
+ export declare const bitwiseAnd: ([x1, y1]: Vec2_I32, [x2, y2]: Vec2_I32) => Vec2_I32;
13
+ export declare const bitwiseOr: ([x1, y1]: Vec2_I32, [x2, y2]: Vec2_I32) => Vec2_I32;
14
+ export declare const bitwiseXor: ([x1, y1]: Vec2_I32, [x2, y2]: Vec2_I32) => Vec2_I32;
15
+ export declare const bitwiseNot: ([x, y]: Vec2_I32) => Vec2_I32;
16
+ export declare const shiftLeft: ([x, y]: Vec2_I32, s: number) => Vec2_I32;
17
+ export declare const shiftRight: ([x, y]: Vec2_I32, s: number) => Vec2_I32;
18
+ export declare const countLeadingZeros: ([x, y]: Vec2_I32) => Vec2_I32;
19
+ export declare const countTrailingZeros: ([x, y]: Vec2_I32) => Vec2_I32;
20
+ export declare const countOneBits: ([x, y]: Vec2_I32) => Vec2_I32;
21
+ export declare const reverseBits: ([x, y]: Vec2_I32) => Vec2_I32;
@@ -0,0 +1,39 @@
1
+ // © 2026 Adobe. MIT License. See /LICENSE for details.
2
+ import { I32 } from "../../i32/index.js";
3
+ import { U32 } from "../../u32/index.js";
4
+ export const zero = [0, 0];
5
+ export const abs = ([x, y]) => [Math.abs(x), Math.abs(y)];
6
+ export const add = ([x1, y1], [x2, y2]) => [x1 + x2, y1 + y2];
7
+ export const subtract = ([x1, y1], [x2, y2]) => [x1 - x2, y1 - y2];
8
+ export const scale = ([x, y], s) => [x * s, y * s];
9
+ export const negate = ([x, y]) => [-x, -y];
10
+ export const min = ([x1, y1], [x2, y2]) => [Math.min(x1, x2), Math.min(y1, y2)];
11
+ export const max = ([x1, y1], [x2, y2]) => [Math.max(x1, x2), Math.max(y1, y2)];
12
+ export const clamp = (v, minVec, maxVec) => min(max(v, minVec), maxVec);
13
+ export const equals = ([x1, y1], [x2, y2]) => x1 === x2 && y1 === y2;
14
+ export const bitwiseAnd = ([x1, y1], [x2, y2]) => [x1 & x2, y1 & y2];
15
+ export const bitwiseOr = ([x1, y1], [x2, y2]) => [x1 | x2, y1 | y2];
16
+ export const bitwiseXor = ([x1, y1], [x2, y2]) => [x1 ^ x2, y1 ^ y2];
17
+ export const bitwiseNot = ([x, y]) => [~x, ~y];
18
+ export const shiftLeft = ([x, y], s) => [x << s, y << s];
19
+ export const shiftRight = ([x, y], s) => [
20
+ I32.shiftRight(x, s),
21
+ I32.shiftRight(y, s),
22
+ ];
23
+ export const countLeadingZeros = ([x, y]) => [
24
+ U32.countLeadingZeros(x),
25
+ U32.countLeadingZeros(y),
26
+ ];
27
+ export const countTrailingZeros = ([x, y]) => [
28
+ U32.countTrailingZeros(x),
29
+ U32.countTrailingZeros(y),
30
+ ];
31
+ export const countOneBits = ([x, y]) => [
32
+ U32.countOneBits(x),
33
+ U32.countOneBits(y),
34
+ ];
35
+ export const reverseBits = ([x, y]) => [
36
+ U32.reverseBits(x),
37
+ U32.reverseBits(y),
38
+ ];
39
+ //# sourceMappingURL=functions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"functions.js","sourceRoot":"","sources":["../../../../src/math/vec2/i32/functions.ts"],"names":[],"mappings":"AAAA,uDAAuD;AAGvD,OAAO,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAC;AACzC,OAAO,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAC;AAEzC,MAAM,CAAC,MAAM,IAAI,GAAa,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAErC,MAAM,CAAC,MAAM,GAAG,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAW,EAAY,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;AAE9E,MAAM,CAAC,MAAM,GAAG,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAW,EAAE,CAAC,EAAE,EAAE,EAAE,CAAW,EAAY,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,CAAC,CAAC;AAC5F,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAW,EAAE,CAAC,EAAE,EAAE,EAAE,CAAW,EAAY,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,CAAC,CAAC;AACjG,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAW,EAAE,CAAS,EAAY,EAAE,CAAC,CAAC,CAAC,GAAG,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AC,CAAC,CAAC;CAC5B,CAAC;AACF,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAW,EAAY,EAAE,CAAC;IACxD,GAAG,CAAC,YAAY,CAAC,CAAC,CAAC;IACnB,GAAG,CAAC,YAAY,CAAC,CAAC,CAAC;CACtB,CAAC;AACF,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAW,EAAY,EAAE,CAAC;IACvD,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC;IAClB,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC;CACrB,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { Schema } from "../../../schema/index.js";
2
+ import { schema } from "./schema.js";
3
+ export type I32 = Schema.ToType<typeof schema>;
4
+ export * as I32 from "./public.js";
@@ -0,0 +1,3 @@
1
+ // © 2026 Adobe. MIT License. See /LICENSE for details.
2
+ export * as I32 from "./public.js";
3
+ //# sourceMappingURL=i32.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"i32.js","sourceRoot":"","sources":["../../../../src/math/vec2/i32/i32.ts"],"names":[],"mappings":"AAAA,uDAAuD;AAOvD,OAAO,KAAK,GAAG,MAAM,aAAa,CAAC"}
@@ -0,0 +1 @@
1
+ export declare const layout: import("../../../typed-buffer/index.js").StructLayout;
@@ -0,0 +1,5 @@
1
+ // © 2026 Adobe. MIT License. See /LICENSE for details.
2
+ import { getStructLayout } from "../../../typed-buffer/index.js";
3
+ import { schema } from "./schema.js";
4
+ export const layout = getStructLayout(schema);
5
+ //# sourceMappingURL=layout.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"layout.js","sourceRoot":"","sources":["../../../../src/math/vec2/i32/layout.ts"],"names":[],"mappings":"AAAA,uDAAuD;AAEvD,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,MAAM,CAAC,MAAM,MAAM,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ export * from "./functions.js";
2
+ export * from "./layout.js";
3
+ export * from "./schema.js";
@@ -0,0 +1,5 @@
1
+ // © 2026 Adobe. MIT License. See /LICENSE for details.
2
+ export * from "./functions.js";
3
+ export * from "./layout.js";
4
+ export * from "./schema.js";
5
+ //# sourceMappingURL=public.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"public.js","sourceRoot":"","sources":["../../../../src/math/vec2/i32/public.ts"],"names":[],"mappings":"AAAA,uDAAuD;AAEvD,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC"}
@@ -0,0 +1,12 @@
1
+ export declare const schema: {
2
+ readonly type: "array";
3
+ readonly items: {
4
+ readonly type: "integer";
5
+ readonly minimum: -2147483648;
6
+ readonly maximum: 2147483647;
7
+ readonly default: number;
8
+ };
9
+ readonly minItems: 2;
10
+ readonly maxItems: 2;
11
+ readonly default: readonly [0, 0];
12
+ };
@@ -0,0 +1,10 @@
1
+ // © 2026 Adobe. MIT License. See /LICENSE for details.
2
+ import { I32 } from "../../i32/index.js";
3
+ export const schema = {
4
+ type: 'array',
5
+ items: I32.schema,
6
+ minItems: 2,
7
+ maxItems: 2,
8
+ default: [0, 0],
9
+ };
10
+ //# sourceMappingURL=schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../../src/math/vec2/i32/schema.ts"],"names":[],"mappings":"AAAA,uDAAuD;AAEvD,OAAO,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAC;AAGzC,MAAM,CAAC,MAAM,MAAM,GAAG;IAClB,IAAI,EAAE,OAAO;IACb,KAAK,EAAE,GAAG,CAAC,MAAM;IACjB,QAAQ,EAAE,CAAC;IACX,QAAQ,EAAE,CAAC;IACX,OAAO,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;CACQ,CAAC"}
@@ -1,4 +1,61 @@
1
- import { Schema } from "../../schema/index.js";
2
- import { schema } from "./schema.js";
3
- export type Vec2 = Schema.ToType<typeof schema>;
4
- export * as Vec2 from "./public.js";
1
+ import type { F32 as Vec2F32 } from "./f32/f32.js";
2
+ import type { I32 as Vec2I32 } from "./i32/i32.js";
3
+ import type { U32 as Vec2U32 } from "./u32/u32.js";
4
+ import * as Public from "./public.js";
5
+ export type Vec2 = Vec2F32;
6
+ export declare namespace Vec2 {
7
+ type F32 = Vec2F32;
8
+ type U32 = Vec2U32;
9
+ type I32 = Vec2I32;
10
+ export import F32 = Public.F32;
11
+ export import U32 = Public.U32;
12
+ export import I32 = Public.I32;
13
+ export import schema = Public.schema;
14
+ export import layout = Public.layout;
15
+ export import abs = Public.abs;
16
+ export import acos = Public.acos;
17
+ export import acosh = Public.acosh;
18
+ export import add = Public.add;
19
+ export import asin = Public.asin;
20
+ export import asinh = Public.asinh;
21
+ export import atan = Public.atan;
22
+ export import atanh = Public.atanh;
23
+ export import ceil = Public.ceil;
24
+ export import clamp = Public.clamp;
25
+ export import cos = Public.cos;
26
+ export import cosh = Public.cosh;
27
+ export import distance = Public.distance;
28
+ export import dot = Public.dot;
29
+ export import equals = Public.equals;
30
+ export import exp = Public.exp;
31
+ export import exp2 = Public.exp2;
32
+ export import faceforward = Public.faceforward;
33
+ export import floor = Public.floor;
34
+ export import fract = Public.fract;
35
+ export import length = Public.length;
36
+ export import log = Public.log;
37
+ export import log2 = Public.log2;
38
+ export import max = Public.max;
39
+ export import min = Public.min;
40
+ export import mix = Public.mix;
41
+ export import mod = Public.mod;
42
+ export import modf = Public.modf;
43
+ export import negate = Public.negate;
44
+ export import normalize = Public.normalize;
45
+ export import pow = Public.pow;
46
+ export import reflect = Public.reflect;
47
+ export import refract = Public.refract;
48
+ export import round = Public.round;
49
+ export import scale = Public.scale;
50
+ export import sign = Public.sign;
51
+ export import sin = Public.sin;
52
+ export import sinh = Public.sinh;
53
+ export import smoothstep = Public.smoothstep;
54
+ export import sqrt = Public.sqrt;
55
+ export import step = Public.step;
56
+ export import subtract = Public.subtract;
57
+ export import tan = Public.tan;
58
+ export import tanh = Public.tanh;
59
+ export import trunc = Public.trunc;
60
+ export import zero = Public.zero;
61
+ }
@@ -1,3 +1,58 @@
1
1
  // © 2026 Adobe. MIT License. See /LICENSE for details.
2
- export * as Vec2 from "./public.js";
2
+ import * as Public from "./public.js";
3
+ export var Vec2;
4
+ (function (Vec2) {
5
+ Vec2.F32 = Public.F32;
6
+ Vec2.U32 = Public.U32;
7
+ Vec2.I32 = Public.I32;
8
+ // Backwards compatibility: Vec2 is synonymous with Vec2.F32
9
+ Vec2.schema = Public.schema;
10
+ Vec2.layout = Public.layout;
11
+ Vec2.abs = Public.abs;
12
+ Vec2.acos = Public.acos;
13
+ Vec2.acosh = Public.acosh;
14
+ Vec2.add = Public.add;
15
+ Vec2.asin = Public.asin;
16
+ Vec2.asinh = Public.asinh;
17
+ Vec2.atan = Public.atan;
18
+ Vec2.atanh = Public.atanh;
19
+ Vec2.ceil = Public.ceil;
20
+ Vec2.clamp = Public.clamp;
21
+ Vec2.cos = Public.cos;
22
+ Vec2.cosh = Public.cosh;
23
+ Vec2.distance = Public.distance;
24
+ Vec2.dot = Public.dot;
25
+ Vec2.equals = Public.equals;
26
+ Vec2.exp = Public.exp;
27
+ Vec2.exp2 = Public.exp2;
28
+ Vec2.faceforward = Public.faceforward;
29
+ Vec2.floor = Public.floor;
30
+ Vec2.fract = Public.fract;
31
+ Vec2.length = Public.length;
32
+ Vec2.log = Public.log;
33
+ Vec2.log2 = Public.log2;
34
+ Vec2.max = Public.max;
35
+ Vec2.min = Public.min;
36
+ Vec2.mix = Public.mix;
37
+ Vec2.mod = Public.mod;
38
+ Vec2.modf = Public.modf;
39
+ Vec2.negate = Public.negate;
40
+ Vec2.normalize = Public.normalize;
41
+ Vec2.pow = Public.pow;
42
+ Vec2.reflect = Public.reflect;
43
+ Vec2.refract = Public.refract;
44
+ Vec2.round = Public.round;
45
+ Vec2.scale = Public.scale;
46
+ Vec2.sign = Public.sign;
47
+ Vec2.sin = Public.sin;
48
+ Vec2.sinh = Public.sinh;
49
+ Vec2.smoothstep = Public.smoothstep;
50
+ Vec2.sqrt = Public.sqrt;
51
+ Vec2.step = Public.step;
52
+ Vec2.subtract = Public.subtract;
53
+ Vec2.tan = Public.tan;
54
+ Vec2.tanh = Public.tanh;
55
+ Vec2.trunc = Public.trunc;
56
+ Vec2.zero = Public.zero;
57
+ })(Vec2 || (Vec2 = {}));
3
58
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/math/vec2/index.ts"],"names":[],"mappings":"AAAA,uDAAuD;AAOvD,OAAO,KAAK,IAAI,MAAM,aAAa,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/math/vec2/index.ts"],"names":[],"mappings":"AAAA,uDAAuD;AAKvD,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AAItC,MAAM,KAAW,IAAI,CA0DpB;AA1DD,WAAiB,IAAI;IAKH,QAAG,GAAG,MAAM,CAAC,GAAG,CAAC;IACjB,QAAG,GAAG,MAAM,CAAC,GAAG,CAAC;IACjB,QAAG,GAAG,MAAM,CAAC,GAAG,CAAC;IAE/B,4DAA4D;IAC9C,WAAM,GAAG,MAAM,CAAC,MAAM,CAAC;IACvB,WAAM,GAAG,MAAM,CAAC,MAAM,CAAC;IACvB,QAAG,GAAG,MAAM,CAAC,GAAG,CAAC;IACjB,SAAI,GAAG,MAAM,CAAC,IAAI,CAAC;IACnB,UAAK,GAAG,MAAM,CAAC,KAAK,CAAC;IACrB,QAAG,GAAG,MAAM,CAAC,GAAG,CAAC;IACjB,SAAI,GAAG,MAAM,CAAC,IAAI,CAAC;IACnB,UAAK,GAAG,MAAM,CAAC,KAAK,CAAC;IACrB,SAAI,GAAG,MAAM,CAAC,IAAI,CAAC;IACnB,UAAK,GAAG,MAAM,CAAC,K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CAAC;IACjB,SAAI,GAAG,MAAM,CAAC,IAAI,CAAC;IACnB,eAAU,GAAG,MAAM,CAAC,UAAU,CAAC;IAC/B,SAAI,GAAG,MAAM,CAAC,IAAI,CAAC;IACnB,SAAI,GAAG,MAAM,CAAC,IAAI,CAAC;IACnB,aAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;IAC3B,QAAG,GAAG,MAAM,CAAC,GAAG,CAAC;IACjB,SAAI,GAAG,MAAM,CAAC,IAAI,CAAC;IACnB,UAAK,GAAG,MAAM,CAAC,KAAK,CAAC;IACrB,SAAI,GAAG,MAAM,CAAC,IAAI,CAAC;AACrC,CAAC,EA1DgB,IAAI,KAAJ,IAAI,QA0DpB"}
@@ -1,3 +1,5 @@
1
- export * from "./functions.js";
2
- export * from "./layout.js";
3
- export * from "./schema.js";
1
+ export * as F32 from "./f32/public.js";
2
+ export * as U32 from "./u32/public.js";
3
+ export * as I32 from "./i32/public.js";
4
+ export { schema, layout } from "./f32/public.js";
5
+ export * from "./f32/functions.js";
@@ -1,5 +1,8 @@
1
1
  // © 2026 Adobe. MIT License. See /LICENSE for details.
2
- export * from "./functions.js";
3
- export * from "./layout.js";
4
- export * from "./schema.js";
2
+ export * as F32 from "./f32/public.js";
3
+ export * as U32 from "./u32/public.js";
4
+ export * as I32 from "./i32/public.js";
5
+ // Backwards compatibility: Vec2 is synonymous with Vec2.F32
6
+ export { schema, layout } from "./f32/public.js";
7
+ export * from "./f32/functions.js";
5
8
  //# sourceMappingURL=public.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"public.js","sourceRoot":"","sources":["../../../src/math/vec2/public.ts"],"names":[],"mappings":"AAAA,uDAAuD;AAEvD,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC"}
1
+ {"version":3,"file":"public.js","sourceRoot":"","sources":["../../../src/math/vec2/public.ts"],"names":[],"mappings":"AAAA,uDAAuD;AAEvD,OAAO,KAAK,GAAG,MAAM,iBAAiB,CAAC;AACvC,OAAO,KAAK,GAAG,MAAM,iBAAiB,CAAC;AACvC,OAAO,KAAK,GAAG,MAAM,iBAAiB,CAAC;AAEvC,4DAA4D;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACjD,cAAc,oBAAoB,CAAC"}
@@ -0,0 +1,20 @@
1
+ import type { U32 as Vec2_U32 } from "./u32.js";
2
+ export declare const zero: Vec2_U32;
3
+ export declare const add: ([x1, y1]: Vec2_U32, [x2, y2]: Vec2_U32) => Vec2_U32;
4
+ export declare const subtract: ([x1, y1]: Vec2_U32, [x2, y2]: Vec2_U32) => Vec2_U32;
5
+ export declare const scale: ([x, y]: Vec2_U32, s: number) => Vec2_U32;
6
+ export declare const negate: ([x, y]: Vec2_U32) => Vec2_U32;
7
+ export declare const min: ([x1, y1]: Vec2_U32, [x2, y2]: Vec2_U32) => Vec2_U32;
8
+ export declare const max: ([x1, y1]: Vec2_U32, [x2, y2]: Vec2_U32) => Vec2_U32;
9
+ export declare const clamp: (v: Vec2_U32, minVec: Vec2_U32, maxVec: Vec2_U32) => Vec2_U32;
10
+ export declare const equals: ([x1, y1]: Vec2_U32, [x2, y2]: Vec2_U32) => boolean;
11
+ export declare const bitwiseAnd: ([x1, y1]: Vec2_U32, [x2, y2]: Vec2_U32) => Vec2_U32;
12
+ export declare const bitwiseOr: ([x1, y1]: Vec2_U32, [x2, y2]: Vec2_U32) => Vec2_U32;
13
+ export declare const bitwiseXor: ([x1, y1]: Vec2_U32, [x2, y2]: Vec2_U32) => Vec2_U32;
14
+ export declare const bitwiseNot: ([x, y]: Vec2_U32) => Vec2_U32;
15
+ export declare const shiftLeft: ([x, y]: Vec2_U32, s: number) => Vec2_U32;
16
+ export declare const shiftRight: ([x, y]: Vec2_U32, s: number) => Vec2_U32;
17
+ export declare const countLeadingZeros: ([x, y]: Vec2_U32) => Vec2_U32;
18
+ export declare const countTrailingZeros: ([x, y]: Vec2_U32) => Vec2_U32;
19
+ export declare const countOneBits: ([x, y]: Vec2_U32) => Vec2_U32;
20
+ export declare const reverseBits: ([x, y]: Vec2_U32) => Vec2_U32;
@@ -0,0 +1,58 @@
1
+ // © 2026 Adobe. MIT License. See /LICENSE for details.
2
+ import { U32 } from "../../u32/index.js";
3
+ export const zero = [0, 0];
4
+ export const add = ([x1, y1], [x2, y2]) => [
5
+ (x1 + x2) >>> 0,
6
+ (y1 + y2) >>> 0,
7
+ ];
8
+ export const subtract = ([x1, y1], [x2, y2]) => [
9
+ (x1 - x2) >>> 0,
10
+ (y1 - y2) >>> 0,
11
+ ];
12
+ export const scale = ([x, y], s) => [(x * s) >>> 0, (y * s) >>> 0];
13
+ export const negate = ([x, y]) => [(-x) >>> 0, (-y) >>> 0];
14
+ export const min = ([x1, y1], [x2, y2]) => [
15
+ Math.min(x1, x2) >>> 0,
16
+ Math.min(y1, y2) >>> 0,
17
+ ];
18
+ export const max = ([x1, y1], [x2, y2]) => [
19
+ Math.max(x1, x2) >>> 0,
20
+ Math.max(y1, y2) >>> 0,
21
+ ];
22
+ export const clamp = (v, minVec, maxVec) => min(max(v, minVec), maxVec);
23
+ export const equals = ([x1, y1], [x2, y2]) => x1 === x2 && y1 === y2;
24
+ export const bitwiseAnd = ([x1, y1], [x2, y2]) => [
25
+ (x1 & x2) >>> 0,
26
+ (y1 & y2) >>> 0,
27
+ ];
28
+ export const bitwiseOr = ([x1, y1], [x2, y2]) => [
29
+ (x1 | x2) >>> 0,
30
+ (y1 | y2) >>> 0,
31
+ ];
32
+ export const bitwiseXor = ([x1, y1], [x2, y2]) => [
33
+ (x1 ^ x2) >>> 0,
34
+ (y1 ^ y2) >>> 0,
35
+ ];
36
+ export const bitwiseNot = ([x, y]) => [(~x) >>> 0, (~y) >>> 0];
37
+ export const shiftLeft = ([x, y], s) => [(x << s) >>> 0, (y << s) >>> 0];
38
+ export const shiftRight = ([x, y], s) => [
39
+ U32.shiftRight(x, s),
40
+ U32.shiftRight(y, s),
41
+ ];
42
+ export const countLeadingZeros = ([x, y]) => [
43
+ U32.countLeadingZeros(x),
44
+ U32.countLeadingZeros(y),
45
+ ];
46
+ export const countTrailingZeros = ([x, y]) => [
47
+ U32.countTrailingZeros(x),
48
+ U32.countTrailingZeros(y),
49
+ ];
50
+ export const countOneBits = ([x, y]) => [
51
+ U32.countOneBits(x),
52
+ U32.countOneBits(y),
53
+ ];
54
+ export const reverseBits = ([x, y]) => [
55
+ U32.reverseBits(x),
56
+ U32.reverseBits(y),
57
+ ];
58
+ //# sourceMappingURL=functions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"functions.js","sourceRoot":"","sources":["../../../../src/math/vec2/u32/functions.ts"],"names":[],"mappings":"AAAA,uDAAuD;AAGvD,OAAO,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAC;AAEzC,MAAM,CAAC,MAAM,IAAI,GAAa,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAErC,MAAM,CAAC,MAAM,GAAG,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAW,EAAE,CAAC,EAAE,EAAE,EAAE,CAAW,EAAY,EAAE,CAAC;IACrE,CAAC,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC;IACf,CAAC,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC;CAClB,CAAC;AACF,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAW,EAAE,CAAC,EAAE,EAAE,EAAE,CAAW,EAAY,EAAE,CAAC;IAC1E,CAAC,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC;IACf,CAAC,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC;CAClB,CAAC;AACF,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAW,EAAE,CAAS,EAAY,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,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AAC,EAAE,CAAC,CAAW,EAAY,EAAE,CAAC;IAC7D,GAAG,CAAC,iBAAiB,CAAC,CAAC,CAAC;IACxB,GAAG,CAAC,iBAAiB,CAAC,CAAC,CAAC;CAC3B,CAAC;AACF,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAW,EAAY,EAAE,CAAC;IAC9D,GAAG,CAAC,kBAAkB,CAAC,CAAC,CAAC;IACzB,GAAG,CAAC,kBAAkB,CAAC,CAAC,CAAC;CAC5B,CAAC;AACF,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAW,EAAY,EAAE,CAAC;IACxD,GAAG,CAAC,YAAY,CAAC,CAAC,CAAC;IACnB,GAAG,CAAC,YAAY,CAAC,CAAC,CAAC;CACtB,CAAC;AACF,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAW,EAAY,EAAE,CAAC;IACvD,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC;IAClB,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC;CACrB,CAAC"}
@@ -0,0 +1 @@
1
+ export declare const layout: import("../../../typed-buffer/index.js").StructLayout;
@@ -0,0 +1,5 @@
1
+ // © 2026 Adobe. MIT License. See /LICENSE for details.
2
+ import { getStructLayout } from "../../../typed-buffer/index.js";
3
+ import { schema } from "./schema.js";
4
+ export const layout = getStructLayout(schema);
5
+ //# sourceMappingURL=layout.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"layout.js","sourceRoot":"","sources":["../../../../src/math/vec2/u32/layout.ts"],"names":[],"mappings":"AAAA,uDAAuD;AAEvD,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,MAAM,CAAC,MAAM,MAAM,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ export * from "./functions.js";
2
+ export * from "./layout.js";
3
+ export * from "./schema.js";
@@ -0,0 +1,5 @@
1
+ // © 2026 Adobe. MIT License. See /LICENSE for details.
2
+ export * from "./functions.js";
3
+ export * from "./layout.js";
4
+ export * from "./schema.js";
5
+ //# sourceMappingURL=public.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"public.js","sourceRoot":"","sources":["../../../../src/math/vec2/u32/public.ts"],"names":[],"mappings":"AAAA,uDAAuD;AAEvD,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC"}
@@ -0,0 +1,12 @@
1
+ export declare const schema: {
2
+ readonly type: "array";
3
+ readonly items: {
4
+ readonly type: "integer";
5
+ readonly minimum: 0;
6
+ readonly maximum: 4294967295;
7
+ readonly default: number;
8
+ };
9
+ readonly minItems: 2;
10
+ readonly maxItems: 2;
11
+ readonly default: readonly [0, 0];
12
+ };
@@ -0,0 +1,10 @@
1
+ // © 2026 Adobe. MIT License. See /LICENSE for details.
2
+ import { U32 } from "../../u32/index.js";
3
+ export const schema = {
4
+ type: 'array',
5
+ items: U32.schema,
6
+ minItems: 2,
7
+ maxItems: 2,
8
+ default: [0, 0],
9
+ };
10
+ //# sourceMappingURL=schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../../src/math/vec2/u32/schema.ts"],"names":[],"mappings":"AAAA,uDAAuD;AAEvD,OAAO,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAC;AAGzC,MAAM,CAAC,MAAM,MAAM,GAAG;IAClB,IAAI,EAAE,OAAO;IACb,KAAK,EAAE,GAAG,CAAC,MAAM;IACjB,QAAQ,EAAE,CAAC;IACX,QAAQ,EAAE,CAAC;IACX,OAAO,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;CACQ,CAAC"}