@adobe/data 0.2.3 → 0.2.4

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 (526) hide show
  1. package/dist/_/data.d.ts +11 -0
  2. package/dist/{schemas/index.js → _/data.js} +2 -2
  3. package/dist/_/data.js.map +1 -0
  4. package/dist/_/equals.d.ts +11 -0
  5. package/dist/_/equals.js +73 -0
  6. package/dist/_/equals.js.map +1 -0
  7. package/dist/_/equals.test.js +150 -0
  8. package/dist/_/equals.test.js.map +1 -0
  9. package/dist/_/index.d.ts +4 -0
  10. package/dist/{core/schema → _}/index.js +2 -4
  11. package/dist/_/index.js.map +1 -0
  12. package/dist/_/is-data.d.ts +11 -0
  13. package/dist/_/is-data.js +2 -0
  14. package/dist/_/is-data.js.map +1 -0
  15. package/dist/_/normalize.d.ts +1 -0
  16. package/dist/_/normalize.js +34 -0
  17. package/dist/_/normalize.js.map +1 -0
  18. package/dist/_/normalize.test.js +48 -0
  19. package/dist/_/normalize.test.js.map +1 -0
  20. package/dist/_/schema.test.js +16 -0
  21. package/dist/_/schema.test.js.map +1 -0
  22. package/dist/blob-store/blob-store.d.ts +94 -0
  23. package/dist/blob-store/blob-store.js +194 -0
  24. package/dist/blob-store/blob-store.js.map +1 -0
  25. package/dist/blob-store/blob-store.test.js +142 -0
  26. package/dist/blob-store/blob-store.test.js.map +1 -0
  27. package/dist/core/IsData.d.ts +6 -0
  28. package/dist/core/IsData.js +2 -0
  29. package/dist/core/IsData.js.map +1 -0
  30. package/dist/core/data.d.ts +1 -12
  31. package/dist/core/data.js +1 -30
  32. package/dist/core/data.js.map +1 -1
  33. package/dist/core/data.test.js +1 -1
  34. package/dist/core/data.test.js.map +1 -1
  35. package/dist/core/equals.d.ts +11 -0
  36. package/dist/core/equals.js +73 -0
  37. package/dist/core/equals.js.map +1 -0
  38. package/dist/core/equals.test.js +150 -0
  39. package/dist/core/equals.test.js.map +1 -0
  40. package/dist/core/functions/array-equals-shallow.d.ts +1 -0
  41. package/dist/core/functions/{array-equals.js → array-equals-shallow.js} +2 -2
  42. package/dist/core/functions/array-equals-shallow.js.map +1 -0
  43. package/dist/core/functions/deep-assign.d.ts +11 -0
  44. package/dist/core/functions/deep-assign.js +61 -0
  45. package/dist/core/functions/deep-assign.js.map +1 -0
  46. package/dist/core/functions/deep-assign.test.d.ts +1 -0
  47. package/dist/core/functions/deep-assign.test.js +180 -0
  48. package/dist/core/functions/deep-assign.test.js.map +1 -0
  49. package/dist/core/functions/index.d.ts +1 -3
  50. package/dist/core/functions/index.js +1 -3
  51. package/dist/core/functions/index.js.map +1 -1
  52. package/dist/core/functions/memoize-factory.d.ts +1 -0
  53. package/dist/core/functions/memoize-factory.js +12 -0
  54. package/dist/core/functions/memoize-factory.js.map +1 -0
  55. package/dist/core/index.d.ts +4 -3
  56. package/dist/core/index.js +2 -3
  57. package/dist/core/index.js.map +1 -1
  58. package/dist/core/is-data.d.ts +11 -0
  59. package/dist/core/is-data.js +2 -0
  60. package/dist/core/is-data.js.map +1 -0
  61. package/dist/core/normalize.d.ts +1 -0
  62. package/dist/core/normalize.js +34 -0
  63. package/dist/core/normalize.js.map +1 -0
  64. package/dist/core/normalize.test.d.ts +1 -0
  65. package/dist/core/normalize.test.js +48 -0
  66. package/dist/core/normalize.test.js.map +1 -0
  67. package/dist/ecs/action-ecs/action-ecs.js +1 -1
  68. package/dist/ecs/action-ecs/action-ecs.js.map +1 -1
  69. package/dist/ecs/action-ecs/action-ecs.test.js +4 -3
  70. package/dist/ecs/action-ecs/action-ecs.test.js.map +1 -1
  71. package/dist/ecs/action-ecs/action-types.d.ts +3 -3
  72. package/dist/ecs/action-ecs/index.d.ts +1 -0
  73. package/dist/ecs/action-ecs/index.js +1 -0
  74. package/dist/ecs/action-ecs/index.js.map +1 -1
  75. package/dist/ecs/action-ecs/sequential-action.d.ts +18 -0
  76. package/dist/{core/schema/validation/validate.js → ecs/action-ecs/sequential-action.js} +21 -14
  77. package/dist/ecs/action-ecs/sequential-action.js.map +1 -0
  78. package/dist/ecs/core-components.js +0 -21
  79. package/dist/ecs/core-components.js.map +1 -1
  80. package/dist/ecs/core-ecs/core-ecs-serialization.test.js +3 -2
  81. package/dist/ecs/core-ecs/core-ecs-serialization.test.js.map +1 -1
  82. package/dist/ecs/core-ecs/core-ecs-types.d.ts +2 -1
  83. package/dist/ecs/core-ecs/core-ecs.js +2 -2
  84. package/dist/ecs/core-ecs/core-ecs.js.map +1 -1
  85. package/dist/ecs/core-ecs/core-ecs.test.js +3 -2
  86. package/dist/ecs/core-ecs/core-ecs.test.js.map +1 -1
  87. package/dist/ecs/database/create-database.d.ts +3 -3
  88. package/dist/ecs/database/create-database.js +12 -11
  89. package/dist/ecs/database/create-database.js.map +1 -1
  90. package/dist/ecs/database/create-database.test.js +17 -13
  91. package/dist/ecs/database/create-database.test.js.map +1 -1
  92. package/dist/ecs/database/database-schema/create-database-from-schemas.d.ts +15 -0
  93. package/dist/ecs/database/database-schema/create-database-from-schemas.js +33 -0
  94. package/dist/ecs/database/database-schema/create-database-from-schemas.js.map +1 -0
  95. package/dist/ecs/database/database-schema/create-database-schema.d.ts +7 -0
  96. package/dist/ecs/database/database-schema/create-database-schema.js +5 -0
  97. package/dist/ecs/database/database-schema/create-database-schema.js.map +1 -0
  98. package/dist/ecs/database/database-schema/database-schema.d.ts +12 -0
  99. package/dist/ecs/database/database-schema/database-schema.js +2 -0
  100. package/dist/ecs/database/database-schema/database-schema.js.map +1 -0
  101. package/dist/ecs/database/database-schema/index.d.ts +3 -0
  102. package/dist/ecs/database/database-schema/index.js +3 -0
  103. package/dist/ecs/database/database-schema/index.js.map +1 -0
  104. package/dist/ecs/database/database.d.ts +7 -9
  105. package/dist/ecs/database/index.d.ts +1 -0
  106. package/dist/ecs/database/index.js +1 -0
  107. package/dist/ecs/database/index.js.map +1 -1
  108. package/dist/ecs/database/observe-dependent-value.js.map +1 -1
  109. package/dist/ecs/database/observe-dependent-value.test.js +21 -21
  110. package/dist/ecs/database/observe-dependent-value.test.js.map +1 -1
  111. package/dist/ecs/database/transactional-store/create-transactional-store.d.ts +2 -2
  112. package/dist/ecs/database/transactional-store/create-transactional-store.js +1 -0
  113. package/dist/ecs/database/transactional-store/create-transactional-store.js.map +1 -1
  114. package/dist/ecs/database/transactional-store/create-transactional-store.test.js +11 -9
  115. package/dist/ecs/database/transactional-store/create-transactional-store.test.js.map +1 -1
  116. package/dist/ecs/database/transactional-store/transactional-store.d.ts +3 -2
  117. package/dist/ecs/ecs/ecs-types.d.ts +14 -13
  118. package/dist/ecs/ecs/ecs.js.map +1 -1
  119. package/dist/ecs/ecs/ecs.test.js +1 -1
  120. package/dist/ecs/ecs/ecs.test.js.map +1 -1
  121. package/dist/ecs/ecs/index.d.ts +0 -1
  122. package/dist/ecs/ecs/index.js +21 -0
  123. package/dist/ecs/ecs/index.js.map +1 -1
  124. package/dist/ecs/index.d.ts +4 -0
  125. package/dist/ecs/index.js +4 -0
  126. package/dist/ecs/index.js.map +1 -1
  127. package/dist/ecs/resource-schemas.d.ts +6 -0
  128. package/dist/ecs/resource-schemas.js +2 -0
  129. package/dist/ecs/resource-schemas.js.map +1 -0
  130. package/dist/ecs/store/components.d.ts +1 -0
  131. package/dist/{core/schema.js → ecs/store/components.js} +1 -11
  132. package/dist/ecs/store/components.js.map +1 -0
  133. package/dist/ecs/store/core/core.d.ts +9 -8
  134. package/dist/ecs/store/core/core.js +21 -0
  135. package/dist/ecs/store/core/core.js.map +1 -1
  136. package/dist/ecs/store/create-store.d.ts +4 -6
  137. package/dist/ecs/store/create-store.js +5 -6
  138. package/dist/ecs/store/create-store.js.map +1 -1
  139. package/dist/ecs/store/create-store.test.js +21 -21
  140. package/dist/ecs/store/create-store.test.js.map +1 -1
  141. package/dist/ecs/store/resource-components copy.d.ts +1 -0
  142. package/dist/{core/schema/schema.js → ecs/store/resource-components copy.js } +1 -12
  143. package/dist/ecs/store/resource-components copy.js.map +1 -0
  144. package/dist/ecs/store/store.d.ts +5 -4
  145. package/dist/ecs/systems/index.d.ts +2 -0
  146. package/dist/ecs/systems/index.js +2 -0
  147. package/dist/ecs/systems/index.js.map +1 -0
  148. package/dist/ecs/systems/system-phase.d.ts +5 -0
  149. package/dist/ecs/systems/system-phase.js +16 -0
  150. package/dist/ecs/systems/system-phase.js.map +1 -0
  151. package/dist/ecs/systems/system.d.ts +7 -0
  152. package/dist/ecs/systems/system.js +2 -0
  153. package/dist/ecs/systems/system.js.map +1 -0
  154. package/dist/ecs/transaction-ecs/transaction-ecs.js +2 -2
  155. package/dist/ecs/transaction-ecs/transaction-ecs.js.map +1 -1
  156. package/dist/ecs/transaction-ecs/transaction-types.d.ts +7 -6
  157. package/dist/ecs/transaction-ecs/transactions.js.map +1 -1
  158. package/dist/equalsShallow.d.ts +1 -0
  159. package/dist/equalsShallow.js +37 -0
  160. package/dist/equalsShallow.js.map +1 -0
  161. package/dist/equalsShallow.test.d.ts +1 -0
  162. package/dist/equalsShallow.test.js +113 -0
  163. package/dist/equalsShallow.test.js.map +1 -0
  164. package/dist/functions/apply-args.d.ts +7 -0
  165. package/dist/functions/apply-args.js +19 -0
  166. package/dist/functions/apply-args.js.map +1 -0
  167. package/dist/functions/index.d.ts +1 -0
  168. package/dist/functions/index.js +2 -0
  169. package/dist/functions/index.js.map +1 -0
  170. package/dist/internal/object/mutable-clone.d.ts +5 -0
  171. package/dist/internal/object/mutable-clone.js +4 -0
  172. package/dist/internal/object/mutable-clone.js.map +1 -0
  173. package/dist/internal/typed-array/get-byte-size.d.ts +1 -1
  174. package/dist/lit/decorators/apply-service-decorators.js +1 -1
  175. package/dist/lit/decorators/apply-service-decorators.js.map +1 -1
  176. package/dist/lit/elements/service-application.d.ts +3 -2
  177. package/dist/lit/elements/service-application.js +10 -6
  178. package/dist/lit/elements/service-application.js.map +1 -1
  179. package/dist/lit/elements/service-element.d.ts +1 -1
  180. package/dist/lit/elements/service-element.js +2 -2
  181. package/dist/lit/elements/service-element.js.map +1 -1
  182. package/dist/old-ecs/ecs/ecs-where-cache.test.d.ts +1 -0
  183. package/dist/old-ecs/ecs/ecs-where-cache.test.js +164 -0
  184. package/dist/old-ecs/ecs/ecs-where-cache.test.js.map +1 -0
  185. package/dist/package.json +24 -24
  186. package/dist/schema/FromSchema.d.ts +25 -0
  187. package/dist/schema/FromSchema.js +2 -0
  188. package/dist/schema/FromSchema.js.map +1 -0
  189. package/dist/schema/index.d.ts +1 -1
  190. package/dist/schema/schema.d.ts +6 -0
  191. package/dist/schema/schema.js.map +1 -1
  192. package/dist/service/isService.d.ts +2 -0
  193. package/dist/service/isService.js +5 -0
  194. package/dist/service/isService.js.map +1 -0
  195. package/dist/table/copy-column-to-gpu-buffer.d.ts +5 -0
  196. package/dist/table/copy-column-to-gpu-buffer.js +26 -0
  197. package/dist/table/copy-column-to-gpu-buffer.js.map +1 -0
  198. package/dist/table/copy-to-gpu-buffer.d.ts +2 -0
  199. package/dist/table/copy-to-gpu-buffer.js +16 -0
  200. package/dist/table/copy-to-gpu-buffer.js.map +1 -0
  201. package/dist/table/create-composite-table.d.ts +5 -0
  202. package/dist/table/create-composite-table.js +20 -0
  203. package/dist/table/create-composite-table.js.map +1 -0
  204. package/dist/table/create-table.test.d.ts +1 -0
  205. package/dist/{core/schema/validation/is-valid.test.js → table/create-table.test.js} +17 -16
  206. package/dist/table/create-table.test.js.map +1 -0
  207. package/dist/table/index.d.ts +1 -0
  208. package/dist/table/index.js +1 -0
  209. package/dist/table/index.js.map +1 -1
  210. package/dist/tsconfig.tsbuildinfo +1 -1
  211. package/dist/typed-buffer/copy-to-gpu-buffer.js +1 -1
  212. package/dist/typed-buffer/copy-to-gpu-buffer.js.map +1 -1
  213. package/dist/typed-buffer/create-array-buffer.js +7 -2
  214. package/dist/typed-buffer/create-array-buffer.js.map +1 -1
  215. package/dist/typed-buffer/create-composite-buffer.d.ts +2 -0
  216. package/dist/typed-buffer/create-composite-buffer.js +85 -0
  217. package/dist/typed-buffer/create-composite-buffer.js.map +1 -0
  218. package/dist/typed-buffer/create-composite-buffer.test.d.ts +1 -0
  219. package/dist/typed-buffer/create-composite-buffer.test.js +291 -0
  220. package/dist/typed-buffer/create-composite-buffer.test.js.map +1 -0
  221. package/dist/typed-buffer/create-const-buffer.d.ts +2 -0
  222. package/dist/typed-buffer/create-const-buffer.js +30 -0
  223. package/dist/typed-buffer/create-const-buffer.js.map +1 -0
  224. package/dist/typed-buffer/create-const-buffer.test.d.ts +1 -0
  225. package/dist/typed-buffer/create-const-buffer.test.js +128 -0
  226. package/dist/typed-buffer/create-const-buffer.test.js.map +1 -0
  227. package/dist/typed-buffer/create-mapped-buffer.d.ts +6 -0
  228. package/dist/typed-buffer/create-mapped-buffer.js +32 -0
  229. package/dist/typed-buffer/create-mapped-buffer.js.map +1 -0
  230. package/dist/typed-buffer/create-mapped-buffer.test.d.ts +1 -0
  231. package/dist/typed-buffer/create-mapped-buffer.test.js +202 -0
  232. package/dist/typed-buffer/create-mapped-buffer.test.js.map +1 -0
  233. package/dist/typed-buffer/create-number-buffer.js +4 -2
  234. package/dist/typed-buffer/create-number-buffer.js.map +1 -1
  235. package/dist/typed-buffer/create-struct-buffer.js +8 -16
  236. package/dist/typed-buffer/create-struct-buffer.js.map +1 -1
  237. package/dist/typed-buffer/create-typed-buffer.js +4 -0
  238. package/dist/typed-buffer/create-typed-buffer.js.map +1 -1
  239. package/dist/typed-buffer/index.js.map +1 -1
  240. package/dist/typed-buffer/typed-buffer.d.ts +3 -1
  241. package/dist/typed-buffer/typed-buffer.test.js +103 -0
  242. package/dist/typed-buffer/typed-buffer.test.js.map +1 -1
  243. package/dist/types/array/equalsShallow.d.ts +1 -0
  244. package/dist/types/array/equalsShallow.js +37 -0
  245. package/dist/types/array/equalsShallow.js.map +1 -0
  246. package/dist/types/array/equalsShallow.test.d.ts +1 -0
  247. package/dist/types/array/equalsShallow.test.js +113 -0
  248. package/dist/types/array/equalsShallow.test.js.map +1 -0
  249. package/dist/types/array/index.d.ts +1 -0
  250. package/dist/types/array/index.js +2 -0
  251. package/dist/types/array/index.js.map +1 -0
  252. package/dist/types/array-buffer-like/copy.d.ts +1 -0
  253. package/dist/types/array-buffer-like/copy.js +469 -0
  254. package/dist/types/array-buffer-like/copy.js.map +1 -0
  255. package/dist/types/array-buffer-like/grow.d.ts +1 -0
  256. package/dist/types/array-buffer-like/grow.js +53 -0
  257. package/dist/types/array-buffer-like/grow.js.map +1 -0
  258. package/dist/types/array-buffer-like/index.d.ts +4 -0
  259. package/dist/types/array-buffer-like/index.js +26 -0
  260. package/dist/types/array-buffer-like/index.js.map +1 -0
  261. package/dist/types/array-buffer-like/is-array-buffer.d.ts +1 -0
  262. package/dist/types/array-buffer-like/is-array-buffer.js +445 -0
  263. package/dist/types/array-buffer-like/is-array-buffer.js.map +1 -0
  264. package/dist/types/array-buffer-like/is-shared-array-buffer.d.ts +1 -0
  265. package/dist/types/array-buffer-like/is-shared-array-buffer.js +445 -0
  266. package/dist/types/array-buffer-like/is-shared-array-buffer.js.map +1 -0
  267. package/dist/types/data-view-32/create-data-view-32.d.ts +2 -0
  268. package/dist/types/data-view-32/create-data-view-32.js +8 -0
  269. package/dist/types/data-view-32/create-data-view-32.js.map +1 -0
  270. package/dist/types/data-view-32/data-view-32.d.ts +5 -0
  271. package/dist/types/data-view-32/data-view-32.js +23 -0
  272. package/dist/types/data-view-32/data-view-32.js.map +1 -0
  273. package/dist/types/data-view-32/index.d.ts +2 -0
  274. package/dist/types/data-view-32/index.js +24 -0
  275. package/dist/types/data-view-32/index.js.map +1 -0
  276. package/dist/types/object/index.d.ts +2 -0
  277. package/dist/types/object/index.js +24 -0
  278. package/dist/types/object/index.js.map +1 -0
  279. package/dist/types/object/map-entries.d.ts +5 -0
  280. package/dist/types/object/map-entries.js +29 -0
  281. package/dist/types/object/map-entries.js.map +1 -0
  282. package/dist/types/object/mutable-clone.d.ts +5 -0
  283. package/dist/types/object/mutable-clone.js +4 -0
  284. package/dist/types/object/mutable-clone.js.map +1 -0
  285. package/dist/types/remove-readonly.d.ts +3 -0
  286. package/dist/types/remove-readonly.js +2 -0
  287. package/dist/types/remove-readonly.js.map +1 -0
  288. package/dist/types/table/add-row.d.ts +8 -0
  289. package/dist/types/table/add-row.js +40 -0
  290. package/dist/types/table/add-row.js.map +1 -0
  291. package/dist/types/table/create-table.d.ts +3 -0
  292. package/dist/types/table/create-table.js +33 -0
  293. package/dist/types/table/create-table.js.map +1 -0
  294. package/dist/types/table/delete-row.d.ts +9 -0
  295. package/dist/types/table/delete-row.js +18 -0
  296. package/dist/types/table/delete-row.js.map +1 -0
  297. package/dist/types/table/ensure-capacity.d.ts +2 -0
  298. package/dist/types/table/ensure-capacity.js +15 -0
  299. package/dist/types/table/ensure-capacity.js.map +1 -0
  300. package/dist/types/table/get-row-data.d.ts +3 -0
  301. package/dist/types/table/get-row-data.js +8 -0
  302. package/dist/types/table/get-row-data.js.map +1 -0
  303. package/dist/types/table/index.d.ts +8 -0
  304. package/dist/types/table/index.js +30 -0
  305. package/dist/types/table/index.js.map +1 -0
  306. package/dist/types/table/row-index.d.ts +8 -0
  307. package/dist/types/table/row-index.js +3 -0
  308. package/dist/types/table/row-index.js.map +1 -0
  309. package/dist/types/table/table.d.ts +13 -0
  310. package/dist/types/table/table.js +2 -0
  311. package/dist/types/table/table.js.map +1 -0
  312. package/dist/types/table/update-row.d.ts +8 -0
  313. package/dist/types/table/update-row.js +12 -0
  314. package/dist/types/table/update-row.js.map +1 -0
  315. package/dist/types/typed-array/copy-to-gpu-buffer.d.ts +2 -0
  316. package/dist/types/typed-array/copy-to-gpu-buffer.js +16 -0
  317. package/dist/types/typed-array/copy-to-gpu-buffer.js.map +1 -0
  318. package/dist/types/typed-array/get-byte-size.d.ts +2 -0
  319. package/dist/types/typed-array/get-byte-size.js +28 -0
  320. package/dist/types/typed-array/get-byte-size.js.map +1 -0
  321. package/dist/types/typed-array/index.d.ts +4 -0
  322. package/dist/types/typed-array/index.js +26 -0
  323. package/dist/types/typed-array/index.js.map +1 -0
  324. package/dist/types/typed-array/typed-array-constructer.d.ts +7 -0
  325. package/dist/types/typed-array/typed-array-constructer.js +2 -0
  326. package/dist/types/typed-array/typed-array-constructer.js.map +1 -0
  327. package/dist/types/typed-array/typed-array.d.ts +1 -0
  328. package/dist/types/typed-array/typed-array.js +23 -0
  329. package/dist/types/typed-array/typed-array.js.map +1 -0
  330. package/dist/types/typed-buffer/copy-to-gpu-buffer.d.ts +2 -0
  331. package/dist/types/typed-buffer/copy-to-gpu-buffer.js +16 -0
  332. package/dist/types/typed-buffer/copy-to-gpu-buffer.js.map +1 -0
  333. package/dist/types/typed-buffer/create-array-buffer.d.ts +4 -0
  334. package/dist/types/typed-buffer/create-array-buffer.js +29 -0
  335. package/dist/types/typed-buffer/create-array-buffer.js.map +1 -0
  336. package/dist/types/typed-buffer/create-number-buffer.d.ts +8 -0
  337. package/dist/types/typed-buffer/create-number-buffer.js +75 -0
  338. package/dist/types/typed-buffer/create-number-buffer.js.map +1 -0
  339. package/dist/types/typed-buffer/create-struct-buffer.d.ts +10 -0
  340. package/dist/types/typed-buffer/create-struct-buffer.js +78 -0
  341. package/dist/types/typed-buffer/create-struct-buffer.js.map +1 -0
  342. package/dist/types/typed-buffer/create-typed-buffer.d.ts +7 -0
  343. package/dist/types/typed-buffer/create-typed-buffer.js +17 -0
  344. package/dist/types/typed-buffer/create-typed-buffer.js.map +1 -0
  345. package/dist/types/typed-buffer/index.d.ts +6 -0
  346. package/dist/types/typed-buffer/index.js +28 -0
  347. package/dist/types/typed-buffer/index.js.map +1 -0
  348. package/dist/types/typed-buffer/structs/assert-struct.d.ts +8 -0
  349. package/dist/types/typed-buffer/structs/assert-struct.js +15 -0
  350. package/dist/types/typed-buffer/structs/assert-struct.js.map +1 -0
  351. package/dist/types/typed-buffer/structs/create-read-struct.d.ts +3 -0
  352. package/dist/types/typed-buffer/structs/create-read-struct.js +62 -0
  353. package/dist/types/typed-buffer/structs/create-read-struct.js.map +1 -0
  354. package/dist/types/typed-buffer/structs/create-read-struct.test.d.ts +1 -0
  355. package/dist/types/typed-buffer/structs/create-read-struct.test.js +189 -0
  356. package/dist/types/typed-buffer/structs/create-read-struct.test.js.map +1 -0
  357. package/dist/types/typed-buffer/structs/create-write-struct.d.ts +3 -0
  358. package/dist/types/typed-buffer/structs/create-write-struct.js +58 -0
  359. package/dist/types/typed-buffer/structs/create-write-struct.js.map +1 -0
  360. package/dist/types/typed-buffer/structs/get-field-offset.d.ts +2 -0
  361. package/dist/types/typed-buffer/structs/get-field-offset.js +14 -0
  362. package/dist/types/typed-buffer/structs/get-field-offset.js.map +1 -0
  363. package/dist/types/typed-buffer/structs/get-struct-layout.d.ts +5 -0
  364. package/dist/types/typed-buffer/structs/get-struct-layout.js +198 -0
  365. package/dist/types/typed-buffer/structs/get-struct-layout.js.map +1 -0
  366. package/dist/types/typed-buffer/structs/get-struct-layout.test.d.ts +1 -0
  367. package/dist/types/typed-buffer/structs/get-struct-layout.test.js +133 -0
  368. package/dist/types/typed-buffer/structs/get-struct-layout.test.js.map +1 -0
  369. package/dist/types/typed-buffer/structs/index.d.ts +1 -0
  370. package/dist/types/typed-buffer/structs/index.js +23 -0
  371. package/dist/types/typed-buffer/structs/index.js.map +1 -0
  372. package/dist/types/typed-buffer/structs/read-struct.d.ts +2 -0
  373. package/dist/types/typed-buffer/structs/read-struct.js +2 -0
  374. package/dist/types/typed-buffer/structs/read-struct.js.map +1 -0
  375. package/dist/types/typed-buffer/structs/struct-layout.d.ts +21 -0
  376. package/dist/types/typed-buffer/structs/struct-layout.js +23 -0
  377. package/dist/types/typed-buffer/structs/struct-layout.js.map +1 -0
  378. package/dist/types/typed-buffer/structs/write-struct.d.ts +2 -0
  379. package/dist/types/typed-buffer/structs/write-struct.js +2 -0
  380. package/dist/types/typed-buffer/structs/write-struct.js.map +1 -0
  381. package/dist/types/typed-buffer/structs/write-struct.test.d.ts +1 -0
  382. package/dist/types/typed-buffer/structs/write-struct.test.js +181 -0
  383. package/dist/types/typed-buffer/structs/write-struct.test.js.map +1 -0
  384. package/dist/types/typed-buffer/typed-buffer.d.ts +16 -0
  385. package/dist/types/typed-buffer/typed-buffer.js +2 -0
  386. package/dist/types/typed-buffer/typed-buffer.js.map +1 -0
  387. package/dist/types/typed-buffer/typed-buffer.test.d.ts +1 -0
  388. package/dist/types/typed-buffer/typed-buffer.test.js +223 -0
  389. package/dist/types/typed-buffer/typed-buffer.test.js.map +1 -0
  390. package/dist/types/types.d.ts +5 -2
  391. package/dist/types/types.js.map +1 -1
  392. package/dist/ui/decorators/apply-decorator.d.ts +1 -0
  393. package/dist/ui/decorators/apply-decorator.js +18 -0
  394. package/dist/ui/decorators/apply-decorator.js.map +1 -0
  395. package/dist/ui/decorators/apply-service-decorators.d.ts +1 -0
  396. package/dist/ui/decorators/apply-service-decorators.js +12 -0
  397. package/dist/ui/decorators/apply-service-decorators.js.map +1 -0
  398. package/dist/ui/decorators/require-service.d.ts +1 -0
  399. package/dist/ui/decorators/require-service.js +13 -0
  400. package/dist/ui/decorators/require-service.js.map +1 -0
  401. package/dist/ui/elements/index.d.ts +3 -0
  402. package/dist/ui/elements/index.js +4 -0
  403. package/dist/ui/elements/index.js.map +1 -0
  404. package/dist/ui/elements/service-application.d.ts +8 -0
  405. package/dist/ui/elements/service-application.js +27 -0
  406. package/dist/ui/elements/service-application.js.map +1 -0
  407. package/dist/ui/elements/service-context.d.ts +1 -0
  408. package/dist/ui/elements/service-context.js +3 -0
  409. package/dist/ui/elements/service-context.js.map +1 -0
  410. package/dist/ui/elements/service-element.d.ts +6 -0
  411. package/dist/ui/elements/service-element.js +22 -0
  412. package/dist/ui/elements/service-element.js.map +1 -0
  413. package/dist/ui/hooks/component/component.d.ts +9 -0
  414. package/dist/ui/hooks/component/component.js +2 -0
  415. package/dist/ui/hooks/component/component.js.map +1 -0
  416. package/dist/ui/hooks/component/stack.d.ts +6 -0
  417. package/dist/ui/hooks/component/stack.js +15 -0
  418. package/dist/ui/hooks/component/stack.js.map +1 -0
  419. package/dist/ui/hooks/index.d.ts +7 -0
  420. package/dist/ui/hooks/index.js +9 -0
  421. package/dist/ui/hooks/index.js.map +1 -0
  422. package/dist/ui/hooks/use-connected.d.ts +2 -0
  423. package/dist/ui/hooks/use-connected.js +31 -0
  424. package/dist/ui/hooks/use-connected.js.map +1 -0
  425. package/dist/ui/hooks/use-effect.d.ts +3 -0
  426. package/dist/ui/hooks/use-effect.js +13 -0
  427. package/dist/ui/hooks/use-effect.js.map +1 -0
  428. package/dist/ui/hooks/use-element.d.ts +4 -0
  429. package/dist/ui/hooks/use-element.js +8 -0
  430. package/dist/ui/hooks/use-element.js.map +1 -0
  431. package/dist/ui/hooks/use-memo.d.ts +1 -0
  432. package/dist/ui/hooks/use-memo.js +12 -0
  433. package/dist/ui/hooks/use-memo.js.map +1 -0
  434. package/dist/ui/hooks/use-observable-values.d.ts +5 -0
  435. package/dist/ui/hooks/use-observable-values.js +8 -0
  436. package/dist/ui/hooks/use-observable-values.js.map +1 -0
  437. package/dist/ui/hooks/use-observable.d.ts +2 -0
  438. package/dist/ui/hooks/use-observable.js +12 -0
  439. package/dist/ui/hooks/use-observable.js.map +1 -0
  440. package/dist/ui/hooks/use-ref.d.ts +3 -0
  441. package/dist/ui/hooks/use-ref.js +6 -0
  442. package/dist/ui/hooks/use-ref.js.map +1 -0
  443. package/dist/ui/hooks/use-resize-observer.d.ts +10 -0
  444. package/dist/ui/hooks/use-resize-observer.js +20 -0
  445. package/dist/ui/hooks/use-resize-observer.js.map +1 -0
  446. package/dist/ui/hooks/use-state.d.ts +2 -0
  447. package/dist/ui/hooks/use-state.js +14 -0
  448. package/dist/ui/hooks/use-state.js.map +1 -0
  449. package/dist/ui/hooks/use-window-event.d.ts +1 -0
  450. package/dist/ui/hooks/use-window-event.js +10 -0
  451. package/dist/ui/hooks/use-window-event.js.map +1 -0
  452. package/dist/ui/hooks/with-hooks.d.ts +2 -0
  453. package/dist/ui/hooks/with-hooks.js +15 -0
  454. package/dist/ui/hooks/with-hooks.js.map +1 -0
  455. package/dist/ui/index.d.ts +1 -0
  456. package/dist/ui/index.js +2 -0
  457. package/dist/ui/index.js.map +1 -0
  458. package/package.json +8 -1
  459. package/dist/core/functions/array-equals.d.ts +0 -1
  460. package/dist/core/functions/array-equals.js.map +0 -1
  461. package/dist/core/functions/with-validation.d.ts +0 -5
  462. package/dist/core/functions/with-validation.js +0 -38
  463. package/dist/core/functions/with-validation.js.map +0 -1
  464. package/dist/core/functions/with-validation.test.js +0 -96
  465. package/dist/core/functions/with-validation.test.js.map +0 -1
  466. package/dist/core/schema/dynamic/dynamic-schema.d.ts +0 -27
  467. package/dist/core/schema/dynamic/dynamic-schema.js +0 -2
  468. package/dist/core/schema/dynamic/dynamic-schema.js.map +0 -1
  469. package/dist/core/schema/dynamic/enumerate-patches.d.ts +0 -9
  470. package/dist/core/schema/dynamic/enumerate-patches.js +0 -50
  471. package/dist/core/schema/dynamic/enumerate-patches.js.map +0 -1
  472. package/dist/core/schema/dynamic/enumerate-patches.test.d.ts +0 -134
  473. package/dist/core/schema/dynamic/enumerate-patches.test.js +0 -209
  474. package/dist/core/schema/dynamic/enumerate-patches.test.js.map +0 -1
  475. package/dist/core/schema/dynamic/get-dynamic-schema.d.ts +0 -5
  476. package/dist/core/schema/dynamic/get-dynamic-schema.js +0 -26
  477. package/dist/core/schema/dynamic/get-dynamic-schema.js.map +0 -1
  478. package/dist/core/schema/dynamic/get-dynamic-schema.test.js +0 -94
  479. package/dist/core/schema/dynamic/get-dynamic-schema.test.js.map +0 -1
  480. package/dist/core/schema/dynamic/index.d.ts +0 -1
  481. package/dist/core/schema/dynamic/index.js +0 -2
  482. package/dist/core/schema/dynamic/index.js.map +0 -1
  483. package/dist/core/schema/dynamic/schema-path-value-path.d.ts +0 -5
  484. package/dist/core/schema/dynamic/schema-path-value-path.js +0 -12
  485. package/dist/core/schema/dynamic/schema-path-value-path.js.map +0 -1
  486. package/dist/core/schema/dynamic-schema.d.ts +0 -27
  487. package/dist/core/schema/dynamic-schema.js +0 -2
  488. package/dist/core/schema/dynamic-schema.js.map +0 -1
  489. package/dist/core/schema/index.d.ts +0 -4
  490. package/dist/core/schema/index.js.map +0 -1
  491. package/dist/core/schema/schema.d.ts +0 -122
  492. package/dist/core/schema/schema.js.map +0 -1
  493. package/dist/core/schema/schemas.d.ts +0 -45
  494. package/dist/core/schema/schemas.js +0 -39
  495. package/dist/core/schema/schemas.js.map +0 -1
  496. package/dist/core/schema/ui-schema.d.ts +0 -25
  497. package/dist/core/schema/ui-schema.js +0 -2
  498. package/dist/core/schema/ui-schema.js.map +0 -1
  499. package/dist/core/schema/validation/is-valid.d.ts +0 -2
  500. package/dist/core/schema/validation/is-valid.js +0 -14
  501. package/dist/core/schema/validation/is-valid.js.map +0 -1
  502. package/dist/core/schema/validation/is-valid.test.js.map +0 -1
  503. package/dist/core/schema/validation/validate.d.ts +0 -2
  504. package/dist/core/schema/validation/validate.js.map +0 -1
  505. package/dist/core/schema/validation/validate.test.js +0 -106
  506. package/dist/core/schema/validation/validate.test.js.map +0 -1
  507. package/dist/core/schema/validation/with-validation.d.ts +0 -5
  508. package/dist/core/schema/validation/with-validation.js +0 -16
  509. package/dist/core/schema/validation/with-validation.js.map +0 -1
  510. package/dist/core/schema/validation/with-validation.test.js +0 -96
  511. package/dist/core/schema/validation/with-validation.test.js.map +0 -1
  512. package/dist/core/schema.d.ts +0 -86
  513. package/dist/core/schema.js.map +0 -1
  514. package/dist/core/schemas.d.ts +0 -45
  515. package/dist/core/schemas.js +0 -39
  516. package/dist/core/schemas.js.map +0 -1
  517. package/dist/schemas/index.d.ts +0 -1
  518. package/dist/schemas/index.js.map +0 -1
  519. package/dist/schemas/schemas.d.ts +0 -45
  520. package/dist/schemas/schemas.js +0 -39
  521. package/dist/schemas/schemas.js.map +0 -1
  522. /package/dist/{core/functions/with-validation.test.d.ts → _/equals.test.d.ts} +0 -0
  523. /package/dist/{core/schema/dynamic/get-dynamic-schema.test.d.ts → _/normalize.test.d.ts} +0 -0
  524. /package/dist/{core/schema/validation/is-valid.test.d.ts → _/schema.test.d.ts} +0 -0
  525. /package/dist/{core/schema/validation/validate.test.d.ts → blob-store/blob-store.test.d.ts} +0 -0
  526. /package/dist/core/{schema/validation/with-validation.test.d.ts → equals.test.d.ts} +0 -0
@@ -0,0 +1,198 @@
1
+ /*MIT License
2
+
3
+ © Copyright 2025 Adobe. All rights reserved.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.*/
22
+ import { memoizeFactory } from "../../../internal/function/memoize-factory.js";
23
+ import { I32Schema } from "../../../schema/i32.js";
24
+ import { U32Schema } from "../../../schema/u32.js";
25
+ // Constants for std140 layout
26
+ const VEC4_SIZE = 16; // size in bytes
27
+ /**
28
+ * Gets alignment in bytes for a field within a struct
29
+ * Adheres to WebGPU std140 layout rules
30
+ */
31
+ const getStructFieldAlignment = (type) => {
32
+ // Primitive types are 4-byte aligned
33
+ if (typeof type === "string") {
34
+ return 4;
35
+ }
36
+ // Arrays are aligned to vec4 (16 bytes)
37
+ if (type.type === "array") {
38
+ return VEC4_SIZE;
39
+ }
40
+ // Structs are aligned to 4 bytes within other structs
41
+ return 4;
42
+ };
43
+ /**
44
+ * Gets size in bytes for a field type
45
+ */
46
+ const getFieldSize = (type) => {
47
+ if (typeof type === "string") {
48
+ return 4; // All primitives are 4 bytes
49
+ }
50
+ return type.size;
51
+ };
52
+ /**
53
+ * Gets stride in bytes for an array element type
54
+ * In std140, array elements are aligned to vec4 if they are arrays/structs
55
+ * but primitives just use their natural alignment
56
+ */
57
+ const getArrayElementStride = (type) => {
58
+ // For primitives in arrays, use 4 bytes
59
+ if (typeof type === "string") {
60
+ return 4;
61
+ }
62
+ // For structs and arrays, round up to vec4
63
+ return roundUpToAlignment(type.size, VEC4_SIZE);
64
+ };
65
+ /**
66
+ * Gets alignment for array elements
67
+ * In std140, array elements are aligned to vec4 if they are arrays/structs
68
+ * but primitives just use their natural alignment
69
+ */
70
+ const getArrayElementAlignment = (type) => {
71
+ if (typeof type === "string") {
72
+ return 4; // Primitives use natural alignment
73
+ }
74
+ return VEC4_SIZE; // Arrays and structs align to vec4
75
+ };
76
+ /**
77
+ * Rounds up to the next multiple of alignment
78
+ */
79
+ const roundUpToAlignment = (offset, alignment) => {
80
+ return Math.ceil(offset / alignment) * alignment;
81
+ };
82
+ /**
83
+ * Converts a primitive schema type to a StructFieldPrimitiveType or returns null if not a valid primitive type
84
+ */
85
+ const getPrimitiveType = (schema) => {
86
+ if (schema.type === "number" || schema.type === "integer") {
87
+ if (schema.type === "integer") {
88
+ if (schema.minimum !== undefined && schema.minimum >= 0 && schema.maximum && schema.maximum <= U32Schema.maximum) {
89
+ return "u32";
90
+ }
91
+ if (schema.minimum !== undefined && schema.minimum < 0 && schema.maximum && schema.maximum <= I32Schema.maximum) {
92
+ return "i32";
93
+ }
94
+ }
95
+ else if (schema.precision === 1 || schema.precision === 2) {
96
+ return "f32";
97
+ }
98
+ }
99
+ return null;
100
+ };
101
+ /**
102
+ * Analyzes a Schema and returns a StructLayout.
103
+ * Returns null if schema is not a valid struct schema.
104
+ */
105
+ const getStructLayoutInternal = memoizeFactory((schema) => {
106
+ // Handle root array/tuple case
107
+ if (schema.type === "array") {
108
+ if (!schema.items || Array.isArray(schema.items)) {
109
+ throw new Error("Array schema must have single item type");
110
+ }
111
+ if (schema.minItems !== schema.maxItems || !schema.minItems) {
112
+ throw new Error("Array must have fixed length");
113
+ }
114
+ if (schema.minItems < 2) {
115
+ throw new Error("Array length must be at least 2");
116
+ }
117
+ // Special case for vec3
118
+ const primitiveType = getPrimitiveType(schema.items);
119
+ if (primitiveType && schema.minItems === 3) {
120
+ const fields = {};
121
+ for (let i = 0; i < 3; i++) {
122
+ fields[i.toString()] = {
123
+ offset: i * 4,
124
+ type: primitiveType
125
+ };
126
+ }
127
+ return {
128
+ type: "array",
129
+ size: VEC4_SIZE, // vec3 is padded to vec4
130
+ fields
131
+ };
132
+ }
133
+ // Regular array case
134
+ const fields = {};
135
+ const elementType = primitiveType ?? getStructLayoutInternal(schema.items);
136
+ if (!elementType) {
137
+ return null;
138
+ }
139
+ let currentOffset = 0;
140
+ // Arrays are aligned to vec4 boundary
141
+ currentOffset = roundUpToAlignment(currentOffset, VEC4_SIZE);
142
+ const elementAlignment = getArrayElementAlignment(elementType);
143
+ const stride = getArrayElementStride(elementType);
144
+ for (let i = 0; i < schema.minItems; i++) {
145
+ // Align each element according to its type
146
+ currentOffset = roundUpToAlignment(currentOffset, elementAlignment);
147
+ fields[i.toString()] = {
148
+ offset: currentOffset,
149
+ type: elementType
150
+ };
151
+ currentOffset += stride;
152
+ }
153
+ // Total size must be rounded up to vec4
154
+ const size = roundUpToAlignment(currentOffset, VEC4_SIZE);
155
+ return {
156
+ type: "array",
157
+ size,
158
+ fields
159
+ };
160
+ }
161
+ // Handle object case
162
+ if (schema.type !== "object" || !schema.properties) {
163
+ return null;
164
+ }
165
+ const fields = {};
166
+ let currentOffset = 0;
167
+ // First pass: create all fields and calculate alignments
168
+ for (const [name, fieldSchema] of Object.entries(schema.properties)) {
169
+ const primitiveType = getPrimitiveType(fieldSchema);
170
+ const fieldType = primitiveType ?? getStructLayoutInternal(fieldSchema);
171
+ if (!fieldType) {
172
+ return null;
173
+ }
174
+ const alignment = getStructFieldAlignment(fieldType);
175
+ // Align field to its required alignment
176
+ currentOffset = roundUpToAlignment(currentOffset, alignment);
177
+ fields[name] = {
178
+ offset: currentOffset,
179
+ type: fieldType
180
+ };
181
+ currentOffset += getFieldSize(fieldType);
182
+ }
183
+ // Round up total size to vec4
184
+ const size = roundUpToAlignment(currentOffset, VEC4_SIZE);
185
+ return {
186
+ type: "object",
187
+ size,
188
+ fields
189
+ };
190
+ });
191
+ export function getStructLayout(schema, throwError = true) {
192
+ const layout = getStructLayoutInternal(schema);
193
+ if (layout === null && throwError) {
194
+ throw new Error("Invalid structure schema");
195
+ }
196
+ return layout;
197
+ }
198
+ //# sourceMappingURL=get-struct-layout.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-struct-layout.js","sourceRoot":"","sources":["../../../../src/types/typed-buffer/structs/get-struct-layout.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;WAoBW;AACX,OAAO,EAAE,cAAc,EAAE,MAAM,+CAA+C,CAAC;AAC/E,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAEnD,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAGnD,8BAA8B;AAC9B,MAAM,SAAS,GAAG,EAAE,CAAC,CAAE,gBAAgB;AAEvC;;;GAGG;AACH,MAAM,uBAAuB,GAAG,CAAC,IAA6C,EAAU,EAAE;IACtF,qCAAqC;IACrC,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;QAC3B,OAAO,CAAC,CAAC;IACb,CAAC;IACD,wCAAwC;IACxC,IAAI,IAAI,CAAC,IAAI,KAAK,OAAO,EAAE,CAAC;QACxB,OAAO,SAAS,CAAC;IACrB,CAAC;IACD,sDAA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AAK,IAAI,IAAI,UAAU,EAAE,CAAC;QAChC,MAAM,IAAI,KAAK,CAAC,0BAA0B,CAAC,CAAC;IAChD,CAAC;IACD,OAAO,MAAM,CAAC;AAClB,CAAC"}
@@ -0,0 +1,133 @@
1
+ /*MIT License
2
+
3
+ © Copyright 2025 Adobe. All rights reserved.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.*/
22
+ import { describe, it, expect } from "vitest";
23
+ import { getStructLayout } from "./get-struct-layout.js";
24
+ import { F32Schema } from "../../../schema/f32.js";
25
+ import { U32Schema } from "../../../schema/u32.js";
26
+ import { I32Schema } from "../../../schema/i32.js";
27
+ describe("getStructLayout", () => {
28
+ it("should handle primitive types", () => {
29
+ const schema = {
30
+ type: "object",
31
+ properties: {
32
+ a: F32Schema,
33
+ b: U32Schema,
34
+ c: I32Schema,
35
+ }
36
+ };
37
+ const layout = getStructLayout(schema);
38
+ expect(layout.type).toBe("object");
39
+ expect(layout.size).toBe(16); // rounded to vec4
40
+ expect(layout.fields.a.offset).toBe(0);
41
+ expect(layout.fields.b.offset).toBe(4);
42
+ expect(layout.fields.c.offset).toBe(8);
43
+ });
44
+ it("should handle vec3 with proper padding", () => {
45
+ const schema = {
46
+ type: "array",
47
+ items: { type: "number", precision: 1 },
48
+ minItems: 3,
49
+ maxItems: 3
50
+ };
51
+ const layout = getStructLayout(schema);
52
+ expect(layout.type).toBe("array");
53
+ expect(layout.size).toBe(16); // padded to vec4
54
+ expect(layout.fields["0"].offset).toBe(0);
55
+ expect(layout.fields["1"].offset).toBe(4);
56
+ expect(layout.fields["2"].offset).toBe(8);
57
+ });
58
+ it("should handle nested structs", () => {
59
+ const schema = {
60
+ type: "object",
61
+ properties: {
62
+ transform: {
63
+ type: "object",
64
+ properties: {
65
+ position: {
66
+ type: "array",
67
+ items: F32Schema,
68
+ minItems: 3,
69
+ maxItems: 3
70
+ },
71
+ scale: F32Schema
72
+ }
73
+ },
74
+ active: U32Schema
75
+ }
76
+ };
77
+ const layout = getStructLayout(schema);
78
+ expect(layout.type).toBe("object");
79
+ // transform (32 bytes) + active (4 bytes) = 36 bytes
80
+ // rounded up to largest member alignment (16 bytes) = 48 bytes
81
+ expect(layout.size).toBe(48);
82
+ const transform = layout.fields.transform.type;
83
+ expect(typeof transform).not.toBe("string");
84
+ if (typeof transform !== "string") {
85
+ // position (vec3 = 16 bytes) + scale (4 bytes) = 20 bytes
86
+ // rounded up to largest member alignment (16 bytes) = 32 bytes
87
+ expect(transform.size).toBe(32);
88
+ const position = transform.fields.position.type;
89
+ expect(typeof position !== "string" && position.size).toBe(16);
90
+ }
91
+ });
92
+ it("should handle array of structs", () => {
93
+ const schema = {
94
+ type: "array",
95
+ items: {
96
+ type: "object",
97
+ properties: {
98
+ x: { type: "number", precision: 1 },
99
+ y: { type: "number", precision: 1 }
100
+ }
101
+ },
102
+ minItems: 2,
103
+ maxItems: 2
104
+ };
105
+ const layout = getStructLayout(schema);
106
+ expect(layout.type).toBe("array");
107
+ expect(layout.size).toBe(32); // 2 structs aligned to vec4
108
+ expect(layout.fields["0"].offset).toBe(0);
109
+ expect(layout.fields["1"].offset).toBe(16); // aligned to vec4
110
+ });
111
+ it("should reject invalid schemas", () => {
112
+ // Non-fixed length array
113
+ expect(() => getStructLayout({
114
+ type: "array",
115
+ items: { type: "number", precision: 1 }
116
+ })).toThrow();
117
+ // Invalid primitive type
118
+ expect(() => getStructLayout({
119
+ type: "object",
120
+ properties: {
121
+ a: { type: "string" }
122
+ }
123
+ })).toThrow();
124
+ // Array length < 2
125
+ expect(() => getStructLayout({
126
+ type: "array",
127
+ items: { type: "number", precision: 1 },
128
+ minItems: 1,
129
+ maxItems: 1
130
+ })).toThrow();
131
+ });
132
+ });
133
+ //# sourceMappingURL=get-struct-layout.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-struct-layout.test.js","sourceRoot":"","sources":["../../../../src/types/typed-buffer/structs/get-struct-layout.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;WAoBW;AACX,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAEzD,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAEnD,QAAQ,CAAC,iBAAiB,EAAE,GAAG,EAAE;IAC7B,EAAE,CAAC,+BAA+B,EAAE,GAAG,EAAE;QACrC,MAAM,MAAM,GAAW;YACnB,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACR,CAAC,EAAE,SAAS;gBACZ,CAAC,EAAE,SAAS;gBACZ,CAAC,EAAE,SAAS;aACf;SACJ,CAAC;QAEF,MAAM,MAAM,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC;QACv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IAAI,EAAE,QAAQ,EAAE;aACxB;SACJ,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;QAEd,mBAAmB;QACnB,MAAM,CAAC,GAAG,EAAE,CAAC,eAAe,CAAC;YACzB,IAAI,EAAE,OAAO;YACb,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC,EAAE;YACvC,QAAQ,EAAE,CAAC;YACX,QAAQ,EAAE,CAAC;SACd,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;IAClB,CAAC,CAAC,CAAC;AAEP,CAAC,CAAC,CAAC"}
@@ -0,0 +1 @@
1
+ export { getStructLayout } from "./get-struct-layout.js";
@@ -0,0 +1,23 @@
1
+ /*MIT License
2
+
3
+ © Copyright 2025 Adobe. All rights reserved.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.*/
22
+ export { getStructLayout } from "./get-struct-layout.js";
23
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/types/typed-buffer/structs/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;WAoBW;AACX,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC"}
@@ -0,0 +1,2 @@
1
+ import type { DataView32 } from "../../../internal/data-view-32/data-view-32.js";
2
+ export type ReadStruct<T> = (data: DataView32, index: number) => T;
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=read-struct.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"read-struct.js","sourceRoot":"","sources":["../../../../src/types/typed-buffer/structs/read-struct.ts"],"names":[],"mappings":""}
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Primitive types for struct fields
3
+ */
4
+ export type StructFieldPrimitiveType = "i32" | "u32" | "f32";
5
+ /**
6
+ * Layout for struct fields
7
+ */
8
+ export interface StructLayoutField {
9
+ offset: number;
10
+ type: StructFieldPrimitiveType | StructLayout;
11
+ }
12
+ /**
13
+ * Layout for struct types
14
+ */
15
+ export interface StructLayout {
16
+ type: "object" | "array";
17
+ /** Total size including padding in bytes */
18
+ size: number;
19
+ /** Fields for struct types */
20
+ fields: Record<string, StructLayoutField>;
21
+ }
@@ -0,0 +1,23 @@
1
+ /*MIT License
2
+
3
+ © Copyright 2025 Adobe. All rights reserved.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.*/
22
+ export {};
23
+ //# sourceMappingURL=struct-layout.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"struct-layout.js","sourceRoot":"","sources":["../../../../src/types/typed-buffer/structs/struct-layout.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;WAoBW"}
@@ -0,0 +1,2 @@
1
+ import type { DataView32 } from "../../../internal/data-view-32/data-view-32.js";
2
+ export type WriteStruct<T> = (data: DataView32, index: number, value: T) => void;
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=write-struct.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"write-struct.js","sourceRoot":"","sources":["../../../../src/types/typed-buffer/structs/write-struct.ts"],"names":[],"mappings":""}
@@ -0,0 +1,181 @@
1
+ /*MIT License
2
+
3
+ © Copyright 2025 Adobe. All rights reserved.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.*/
22
+ import { describe, it, expect } from "vitest";
23
+ import { createWriteStruct } from "./create-write-struct.js";
24
+ import { createDataView32 } from "../../../internal/data-view-32/create-data-view-32.js";
25
+ describe("WriteStruct", () => {
26
+ it("Vec2 array root", () => {
27
+ const layout = {
28
+ "type": "array",
29
+ "size": 8,
30
+ "fields": {
31
+ "0": {
32
+ "offset": 0,
33
+ "type": "f32"
34
+ },
35
+ "1": {
36
+ "offset": 4,
37
+ "type": "f32"
38
+ }
39
+ }
40
+ };
41
+ const write = createWriteStruct(layout);
42
+ const data = createDataView32(new ArrayBuffer(16));
43
+ write(data, 0, [1.5, 2.5]);
44
+ expect(data.f32[0]).toBe(1.5);
45
+ expect(data.f32[1]).toBe(2.5);
46
+ // Test with offset
47
+ write(data, 1, [3.5, 4.5]);
48
+ expect(data.f32[2]).toBe(3.5);
49
+ expect(data.f32[3]).toBe(4.5);
50
+ });
51
+ it("Vec2 object root", () => {
52
+ const layout = {
53
+ "type": "object",
54
+ "size": 8,
55
+ "fields": {
56
+ "x": {
57
+ "offset": 0,
58
+ "type": "f32"
59
+ },
60
+ "y": {
61
+ "offset": 4,
62
+ "type": "f32"
63
+ }
64
+ }
65
+ };
66
+ const write = createWriteStruct(layout);
67
+ const data = createDataView32(new ArrayBuffer(16));
68
+ write(data, 0, { x: 1.5, y: 2.5 });
69
+ expect(data.f32[0]).toBe(1.5);
70
+ expect(data.f32[1]).toBe(2.5);
71
+ // Test with offset
72
+ write(data, 1, { x: 3.5, y: 4.5 });
73
+ expect(data.f32[2]).toBe(3.5);
74
+ expect(data.f32[3]).toBe(4.5);
75
+ });
76
+ it("Complex struct with nested arrays and primitives", () => {
77
+ const layout = {
78
+ type: "object",
79
+ size: 48, // Total size rounded to vec4 (16 bytes)
80
+ fields: {
81
+ position: {
82
+ offset: 0,
83
+ type: {
84
+ type: "array",
85
+ size: 16, // vec3 padded to vec4
86
+ fields: {
87
+ "0": { offset: 0, type: "f32" },
88
+ "1": { offset: 4, type: "f32" },
89
+ "2": { offset: 8, type: "f32" }
90
+ }
91
+ }
92
+ },
93
+ color: {
94
+ offset: 16, // Aligned to vec4
95
+ type: {
96
+ type: "array",
97
+ size: 16,
98
+ fields: {
99
+ "0": { offset: 0, type: "f32" },
100
+ "1": { offset: 4, type: "f32" },
101
+ "2": { offset: 8, type: "f32" },
102
+ "3": { offset: 12, type: "f32" }
103
+ }
104
+ }
105
+ },
106
+ age: {
107
+ offset: 32, // Aligned to vec4
108
+ type: "u32"
109
+ },
110
+ charge: {
111
+ offset: 36,
112
+ type: "i32"
113
+ }
114
+ }
115
+ };
116
+ const write = createWriteStruct(layout);
117
+ const data = createDataView32(new ArrayBuffer(96)); // Space for 2 structs
118
+ // Write first struct
119
+ write(data, 0, {
120
+ position: [1, 2, 3],
121
+ color: [1, 0, 0, 1],
122
+ age: 42,
123
+ charge: -5
124
+ });
125
+ // Verify first struct
126
+ expect(data.f32[0]).toBe(1);
127
+ expect(data.f32[1]).toBe(2);
128
+ expect(data.f32[2]).toBe(3);
129
+ expect(data.f32[4]).toBe(1);
130
+ expect(data.f32[5]).toBe(0);
131
+ expect(data.f32[6]).toBe(0);
132
+ expect(data.f32[7]).toBe(1);
133
+ expect(data.u32[8]).toBe(42);
134
+ expect(data.i32[9]).toBe(-5);
135
+ // Write second struct at offset
136
+ write(data, 1, {
137
+ position: [4, 5, 6],
138
+ color: [0, 1, 0, 1],
139
+ age: 24,
140
+ charge: 3
141
+ });
142
+ // Verify second struct
143
+ expect(data.f32[12]).toBe(4);
144
+ expect(data.f32[13]).toBe(5);
145
+ expect(data.f32[14]).toBe(6);
146
+ expect(data.f32[16]).toBe(0);
147
+ expect(data.f32[17]).toBe(1);
148
+ expect(data.f32[18]).toBe(0);
149
+ expect(data.f32[19]).toBe(1);
150
+ expect(data.u32[20]).toBe(24);
151
+ expect(data.i32[21]).toBe(3);
152
+ });
153
+ it("should only destructure used view types", () => {
154
+ // f32 only
155
+ const vec2Layout = {
156
+ type: "array",
157
+ size: 8,
158
+ fields: {
159
+ "0": { offset: 0, type: "f32" },
160
+ "1": { offset: 4, type: "f32" }
161
+ }
162
+ };
163
+ const writeVec2 = createWriteStruct(vec2Layout);
164
+ expect(writeVec2.toString()).toMatch(/const { f32: __f32 } = data/);
165
+ expect(writeVec2.toString()).not.toMatch(/i32: __i32/);
166
+ expect(writeVec2.toString()).not.toMatch(/u32: __u32/);
167
+ // i32 and u32 only
168
+ const mixedLayout = {
169
+ type: "object",
170
+ size: 8,
171
+ fields: {
172
+ a: { offset: 0, type: "i32" },
173
+ b: { offset: 4, type: "u32" }
174
+ }
175
+ };
176
+ const writeMixed = createWriteStruct(mixedLayout);
177
+ expect(writeMixed.toString()).not.toMatch(/f32: __f32/);
178
+ expect(writeMixed.toString()).toMatch(/const { (?=.*i32: __i32)(?=.*u32: __u32).*? } = data/);
179
+ });
180
+ });
181
+ //# sourceMappingURL=write-struct.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"write-struct.test.js","sourceRoot":"","sources":["../../../../src/types/typed-buffer/structs/write-struct.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;WAoBW;AACX,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,uDAAuD,CAAC;AAGzF,QAAQ,CAAC,aAAa,EAAE,GAAG,EAAE;IACzB,EAAE,CAAC,iBAAiB,EAAE,GAAG,EAAE;QACvB,MAAM,M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