@adobe/data 0.1.2 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (541) hide show
  1. package/.cursorrules +28 -0
  2. package/.eslintrc.cjs +48 -0
  3. package/.github/CONTRIBUTING.md +47 -0
  4. package/CODE_OF_CONDUCT.md +79 -0
  5. package/LICENSE +21 -0
  6. package/README.md +2 -2
  7. package/asconfig.json +22 -0
  8. package/assembly/index.ts +85 -0
  9. package/assembly/tsconfig.json +17 -0
  10. package/c/build_run.sh +2 -0
  11. package/c/vector_addition +0 -0
  12. package/c/vector_addition.c +125 -0
  13. package/{cache/functions/types.js → config/license.js} +0 -2
  14. package/docs/perftest.html +28 -0
  15. package/index.html +10 -0
  16. package/package.json +50 -27
  17. package/scripts/deploy-docs.sh +41 -0
  18. package/{assembly-test/assembly.test.js → src/assembly-test/assembly.test.ts} +4 -4
  19. package/src/cache/async-cache.ts +38 -0
  20. package/{cache/blob-store.test.js → src/cache/blob-store.test.ts} +41 -7
  21. package/src/cache/blob-store.ts +278 -0
  22. package/src/cache/data-cache.test.ts +61 -0
  23. package/src/cache/data-cache.ts +183 -0
  24. package/src/cache/expiring-data-cache.test.ts +81 -0
  25. package/src/cache/expiring-data-cache.ts +61 -0
  26. package/src/cache/fallback-async-cache.ts +49 -0
  27. package/src/cache/functions/async-data-function.ts +25 -0
  28. package/src/cache/functions/functions.test.ts +84 -0
  29. package/{cache/functions/get-cached.test.js → src/cache/functions/get-cached.test.ts} +24 -7
  30. package/{cache/functions/get-cached.js → src/cache/functions/get-cached.ts} +12 -6
  31. package/{cache/functions/hashing/blob-to-hash.js → src/cache/functions/hashing/blob-to-hash.ts} +20 -18
  32. package/{cache/functions/hashing/buffer-to-hash.js → src/cache/functions/hashing/buffer-to-hash.ts} +7 -7
  33. package/src/cache/functions/hashing/hashing.test.ts +95 -0
  34. package/{cache/functions/hashing/index.js → src/cache/functions/hashing/index.ts} +1 -1
  35. package/{cache/functions/hashing/json-to-hash.js → src/cache/functions/hashing/json-to-hash.ts} +3 -3
  36. package/{cache/functions/hashing/string-to-hash.js → src/cache/functions/hashing/string-to-hash.ts} +11 -10
  37. package/{cache/functions/index.js → src/cache/functions/index.ts} +2 -4
  38. package/{cache/functions/memoize.js → src/cache/functions/memoize.ts} +22 -15
  39. package/src/cache/functions/prevent-parallel-execution.ts +50 -0
  40. package/src/cache/get-persistent-cache.ts +62 -0
  41. package/{cache/index.js → src/cache/index.ts} +9 -3
  42. package/src/cache/managed-array.ts +243 -0
  43. package/{cache/managed-async-cache.browser.test.js → src/cache/managed-async-cache.browser.test.ts} +27 -24
  44. package/src/cache/managed-async-cache.ts +78 -0
  45. package/src/cache/memory-allocator.ts +176 -0
  46. package/src/cache/memory-async-cache.ts +51 -0
  47. package/src/data.ts +38 -0
  48. package/src/ecs/README.md +21 -0
  49. package/src/ecs/archetype/archetype.ts +39 -0
  50. package/src/ecs/archetype/create-archetype.test.ts +115 -0
  51. package/src/ecs/archetype/create-archetype.ts +52 -0
  52. package/src/ecs/archetype/delete-row.test.ts +110 -0
  53. package/src/ecs/archetype/delete-row.ts +37 -0
  54. package/src/ecs/archetype/index.ts +24 -0
  55. package/src/ecs/component-schemas.ts +24 -0
  56. package/src/ecs/core-components.ts +443 -0
  57. package/src/ecs/database/create-database.test.ts +745 -0
  58. package/src/ecs/database/create-database.ts +205 -0
  59. package/src/ecs/database/database.ts +81 -0
  60. package/src/ecs/database/index.ts +24 -0
  61. package/src/ecs/database/observe-dependent-value.test.ts +198 -0
  62. package/src/ecs/database/observe-dependent-value.ts +78 -0
  63. package/src/ecs/database/transactional-store/create-transactional-store.test.ts +250 -0
  64. package/src/ecs/database/transactional-store/create-transactional-store.ts +281 -0
  65. package/{ecs/ecs/ecs-types.js → src/ecs/database/transactional-store/index.ts} +1 -2
  66. package/src/ecs/database/transactional-store/transactional-store.ts +80 -0
  67. package/src/ecs/entity-location-table/create-entity-location-table.test.ts +170 -0
  68. package/src/ecs/entity-location-table/create-entity-location-table.ts +96 -0
  69. package/src/ecs/entity-location-table/entity-location-table.ts +30 -0
  70. package/src/ecs/entity-location-table/entity-location.ts +34 -0
  71. package/src/ecs/entity-location-table/index.ts +23 -0
  72. package/src/ecs/entity.ts +26 -0
  73. package/src/ecs/index.ts +26 -0
  74. package/src/ecs/store/core/core.ts +71 -0
  75. package/src/ecs/store/core/create-core.test.ts +440 -0
  76. package/src/ecs/store/core/create-core.ts +168 -0
  77. package/{cache/async-cache.js → src/ecs/store/core/index.ts} +1 -2
  78. package/src/ecs/store/create-store.test.ts +562 -0
  79. package/src/ecs/store/create-store.ts +97 -0
  80. package/src/ecs/store/index.ts +23 -0
  81. package/{types/types.js → src/ecs/store/resource-components.ts} +2 -6
  82. package/src/ecs/store/store.ts +55 -0
  83. package/src/equals-shallow.test.ts +133 -0
  84. package/src/equals-shallow.ts +37 -0
  85. package/src/equals.test.ts +175 -0
  86. package/src/equals.ts +70 -0
  87. package/src/index.ts +27 -0
  88. package/src/internal/array-buffer-like/copy.ts +469 -0
  89. package/src/internal/array-buffer-like/grow.ts +53 -0
  90. package/{core/index.js → src/internal/array-buffer-like/index.ts} +4 -4
  91. package/src/internal/array-buffer-like/is-array-buffer.ts +445 -0
  92. package/src/internal/array-buffer-like/is-shared-array-buffer.ts +445 -0
  93. package/{core/functions/is-async-generator.js → src/internal/async-generator/is-async-generator.ts} +2 -2
  94. package/{core/schema.js → src/internal/data-view-32/create-data-view-32.ts} +8 -11
  95. package/src/internal/data-view-32/data-view-32.ts +447 -0
  96. package/{ecs/action-ecs/index.js → src/internal/data-view-32/index.ts} +2 -2
  97. package/src/internal/function/memoize-factory.ts +12 -0
  98. package/src/internal/object/index.ts +23 -0
  99. package/{cache/functions/bind-functions.js → src/internal/object/map-entries.ts} +6 -11
  100. package/src/internal/promise/is-promise.ts +28 -0
  101. package/src/internal/typed-array/get-byte-size.ts +50 -0
  102. package/src/internal/typed-array/index.ts +24 -0
  103. package/src/internal/typed-array/typed-array-constructer.ts +32 -0
  104. package/src/internal/typed-array/typed-array.ts +25 -0
  105. package/src/is-data.ts +47 -0
  106. package/src/lit/decorators/apply-decorator.ts +24 -0
  107. package/src/lit/decorators/apply-service-decorators.ts +13 -0
  108. package/src/lit/decorators/index.ts +24 -0
  109. package/src/lit/decorators/require-service.ts +19 -0
  110. package/src/lit/elements/index.ts +3 -0
  111. package/src/lit/elements/service-application.ts +26 -0
  112. package/src/lit/elements/service-context.ts +3 -0
  113. package/src/lit/elements/service-element.ts +18 -0
  114. package/src/lit/hooks/component/component.ts +10 -0
  115. package/src/lit/hooks/component/stack.ts +17 -0
  116. package/src/lit/hooks/index.ts +13 -0
  117. package/src/lit/hooks/use-connected.ts +39 -0
  118. package/src/lit/hooks/use-effect.ts +17 -0
  119. package/src/lit/hooks/use-element.ts +8 -0
  120. package/src/lit/hooks/use-memo.ts +14 -0
  121. package/src/lit/hooks/use-observable-values.ts +9 -0
  122. package/src/lit/hooks/use-observable.ts +13 -0
  123. package/src/lit/hooks/use-ref.ts +6 -0
  124. package/src/lit/hooks/use-resize-observer.ts +27 -0
  125. package/src/lit/hooks/use-state.ts +17 -0
  126. package/src/lit/hooks/use-window-event.ts +14 -0
  127. package/src/lit/hooks/with-hooks.ts +20 -0
  128. package/src/lit/index.ts +3 -0
  129. package/src/mutable-clone.ts +29 -0
  130. package/{core/data.test.js → src/normalize.test.ts} +22 -22
  131. package/src/normalize.ts +37 -0
  132. package/src/observe/create-observable-event.ts +47 -0
  133. package/src/observe/create-observable-state.ts +51 -0
  134. package/src/observe/create-persisted-state.test.ts +143 -0
  135. package/src/observe/create-persisted-state.ts +60 -0
  136. package/src/observe/create-query-state.ts +70 -0
  137. package/{observe/from-array.js → src/observe/from-array.ts} +14 -3
  138. package/{service/service.js → src/observe/from-constant.ts} +13 -4
  139. package/{observe/from-element-id.js → src/observe/from-element-id.ts} +44 -39
  140. package/src/observe/from-element-properties-and-events.ts +47 -0
  141. package/{observe/from-element-property.js → src/observe/from-element-property.ts} +33 -25
  142. package/src/observe/from-promise-with-error.ts +51 -0
  143. package/src/observe/from-promise.ts +49 -0
  144. package/src/observe/from-properties.ts +67 -0
  145. package/{observe/index.js → src/observe/index.ts} +4 -1
  146. package/src/observe/observe.test.ts +467 -0
  147. package/src/observe/to-promise.ts +40 -0
  148. package/src/observe/to-properties.ts +41 -0
  149. package/src/observe/types.ts +40 -0
  150. package/src/observe/with-async-map.ts +37 -0
  151. package/src/observe/with-batch.test.ts +141 -0
  152. package/src/observe/with-batch.ts +67 -0
  153. package/{core/data.js → src/observe/with-cache.ts} +32 -26
  154. package/src/observe/with-copy.ts +32 -0
  155. package/src/observe/with-deduplicate-data.ts +43 -0
  156. package/src/observe/with-deduplicate.ts +41 -0
  157. package/src/observe/with-default.ts +48 -0
  158. package/src/observe/with-lazy.test.ts +68 -0
  159. package/{core/functions/is-promise.js → src/observe/with-lazy.ts} +17 -5
  160. package/{observe/with-map-data.js → src/observe/with-map-data.ts} +9 -3
  161. package/src/observe/with-map.ts +36 -0
  162. package/src/observe/with-optional.ts +47 -0
  163. package/src/observe/with-unwrap.ts +54 -0
  164. package/src/old-ecs/action-ecs/action-ecs.test.ts +420 -0
  165. package/src/old-ecs/action-ecs/action-ecs.ts +274 -0
  166. package/src/old-ecs/action-ecs/action-types.ts +178 -0
  167. package/{core/functions/index.js → src/old-ecs/action-ecs/index.ts} +8 -5
  168. package/{service/sequential-action.js → src/old-ecs/action-ecs/sequential-action.ts} +19 -4
  169. package/src/old-ecs/core-ecs/core-ecs-serialization.test.ts +244 -0
  170. package/src/old-ecs/core-ecs/core-ecs-types.ts +183 -0
  171. package/src/old-ecs/core-ecs/core-ecs.test.ts +474 -0
  172. package/src/old-ecs/core-ecs/core-ecs.ts +640 -0
  173. package/src/old-ecs/core-ecs/index.ts +30 -0
  174. package/src/old-ecs/ecs/ecs-types.ts +189 -0
  175. package/src/old-ecs/ecs/ecs-where-functions.ts +95 -0
  176. package/src/old-ecs/ecs/ecs.test.ts +461 -0
  177. package/src/old-ecs/ecs/ecs.ts +279 -0
  178. package/{ecs/core-ecs/core-ecs-types.js → src/old-ecs/ecs/index.ts} +2 -2
  179. package/src/old-ecs/entity.ts +26 -0
  180. package/{ecs/index.js → src/old-ecs/index.ts} +1 -1
  181. package/{ecs/transaction-ecs/index.js → src/old-ecs/transaction-ecs/index.ts} +0 -1
  182. package/src/old-ecs/transaction-ecs/transaction-ecs.test.ts +725 -0
  183. package/src/old-ecs/transaction-ecs/transaction-ecs.ts +283 -0
  184. package/src/old-ecs/transaction-ecs/transaction-types.ts +248 -0
  185. package/src/old-ecs/transaction-ecs/transactions.ts +243 -0
  186. package/src/perftest/ecs-perf.ts +255 -0
  187. package/src/perftest/helper-functions.ts +31 -0
  188. package/src/perftest/horizon-perf.ts +132 -0
  189. package/{perftest/index.js → src/perftest/index.ts} +9 -7
  190. package/src/perftest/perf-test.ts +193 -0
  191. package/src/perftest/perf.md +90 -0
  192. package/src/perftest/vanilla-perf.ts +136 -0
  193. package/src/schema/boolean.ts +5 -0
  194. package/src/schema/dynamic/deep-merge.test.ts +100 -0
  195. package/src/schema/dynamic/deep-merge.ts +67 -0
  196. package/src/schema/dynamic/enumerate-patches.test.ts +235 -0
  197. package/src/schema/dynamic/enumerate-patches.ts +90 -0
  198. package/src/schema/dynamic/get-dynamic-schema.test.ts +129 -0
  199. package/src/schema/dynamic/get-dynamic-schema.ts +48 -0
  200. package/src/schema/dynamic/index.ts +22 -0
  201. package/src/schema/f32.ts +30 -0
  202. package/src/schema/i32.ts +31 -0
  203. package/src/schema/index.ts +32 -0
  204. package/{cache/functions/omit.js → src/schema/nullable.ts} +10 -7
  205. package/src/schema/schema.ts +229 -0
  206. package/src/schema/time.ts +5 -0
  207. package/src/schema/true.ts +26 -0
  208. package/src/schema/tuple.ts +5 -0
  209. package/src/schema/u32.ts +31 -0
  210. package/src/schema/validation/is-valid.test.ts +43 -0
  211. package/{core/functions/array-equals.js → src/schema/validation/is-valid.ts} +8 -10
  212. package/src/schema/validation/validate.test.ts +120 -0
  213. package/src/schema/validation/validate.ts +41 -0
  214. package/{core/functions/with-validation.test.js → src/schema/validation/with-validation.test.ts} +28 -12
  215. package/{core/functions/with-validation.js → src/schema/validation/with-validation.ts} +14 -10
  216. package/src/schema.test.ts +55 -0
  217. package/src/service/add-observable-actions.ts +207 -0
  218. package/{service/index.js → src/service/index.ts} +4 -4
  219. package/src/service/is-service.ts +7 -0
  220. package/src/service/progressive-result.ts +141 -0
  221. package/src/service/service.ts +27 -0
  222. package/src/table/add-row.ts +42 -0
  223. package/src/table/create-table.ts +36 -0
  224. package/src/table/delete-row.ts +42 -0
  225. package/src/table/ensure-capacity.ts +37 -0
  226. package/src/table/get-row-data.ts +31 -0
  227. package/src/table/index.ts +29 -0
  228. package/src/table/row-index.ts +26 -0
  229. package/src/table/table.ts +32 -0
  230. package/src/table/update-row.ts +35 -0
  231. package/src/tsconfig.json +6 -0
  232. package/src/typed-buffer/copy-to-gpu-buffer.ts +23 -0
  233. package/{cache/expiring-data-cache.js → src/typed-buffer/create-array-buffer.ts} +31 -25
  234. package/src/typed-buffer/create-number-buffer.ts +90 -0
  235. package/src/typed-buffer/create-struct-buffer.ts +93 -0
  236. package/src/typed-buffer/create-typed-buffer.ts +49 -0
  237. package/src/typed-buffer/index.ts +26 -0
  238. package/src/typed-buffer/structs/assert-struct.ts +37 -0
  239. package/src/typed-buffer/structs/create-read-struct.test.ts +202 -0
  240. package/src/typed-buffer/structs/create-read-struct.ts +77 -0
  241. package/src/typed-buffer/structs/create-write-struct.ts +73 -0
  242. package/src/typed-buffer/structs/get-field-offset.ts +36 -0
  243. package/src/typed-buffer/structs/get-struct-layout.test.ts +146 -0
  244. package/src/typed-buffer/structs/get-struct-layout.ts +222 -0
  245. package/src/typed-buffer/structs/index.ts +22 -0
  246. package/src/typed-buffer/structs/read-struct.ts +25 -0
  247. package/src/typed-buffer/structs/struct-layout.ts +465 -0
  248. package/src/typed-buffer/structs/write-struct.test.ts +195 -0
  249. package/src/typed-buffer/structs/write-struct.ts +25 -0
  250. package/src/typed-buffer/typed-buffer.test.ts +253 -0
  251. package/src/typed-buffer/typed-buffer.ts +41 -0
  252. package/src/types/assert.ts +22 -0
  253. package/src/types/equal.ts +24 -0
  254. package/{types/index.js → src/types/index.ts} +3 -1
  255. package/src/types/types.ts +166 -0
  256. package/tsconfig-base.json +25 -0
  257. package/tsconfig.json +8 -0
  258. package/typedoc.json +22 -0
  259. package/vite.config.js +16 -0
  260. package/assembly/index.d.ts +0 -30
  261. package/assembly/index.js +0 -18
  262. package/assembly/index.wasm +0 -0
  263. package/assembly/index.wasm.map +0 -1
  264. package/assembly-test/assembly.test.d.ts +0 -1
  265. package/assembly-test/assembly.test.js.map +0 -1
  266. package/cache/async-cache.d.ts +0 -15
  267. package/cache/async-cache.js.map +0 -1
  268. package/cache/blob-store.d.ts +0 -94
  269. package/cache/blob-store.js +0 -191
  270. package/cache/blob-store.js.map +0 -1
  271. package/cache/blob-store.test.d.ts +0 -1
  272. package/cache/blob-store.test.js.map +0 -1
  273. package/cache/data-cache.d.ts +0 -38
  274. package/cache/data-cache.js +0 -96
  275. package/cache/data-cache.js.map +0 -1
  276. package/cache/data-cache.test.d.ts +0 -1
  277. package/cache/data-cache.test.js +0 -50
  278. package/cache/data-cache.test.js.map +0 -1
  279. package/cache/expiring-data-cache.d.ts +0 -6
  280. package/cache/expiring-data-cache.js.map +0 -1
  281. package/cache/expiring-data-cache.test.d.ts +0 -1
  282. package/cache/expiring-data-cache.test.js +0 -62
  283. package/cache/expiring-data-cache.test.js.map +0 -1
  284. package/cache/fallback-async-cache.d.ts +0 -7
  285. package/cache/fallback-async-cache.js +0 -22
  286. package/cache/fallback-async-cache.js.map +0 -1
  287. package/cache/functions/bind-functions.d.ts +0 -6
  288. package/cache/functions/bind-functions.js.map +0 -1
  289. package/cache/functions/functions.test.d.ts +0 -1
  290. package/cache/functions/functions.test.js +0 -79
  291. package/cache/functions/functions.test.js.map +0 -1
  292. package/cache/functions/get-cached.d.ts +0 -11
  293. package/cache/functions/get-cached.js.map +0 -1
  294. package/cache/functions/get-cached.test.d.ts +0 -1
  295. package/cache/functions/get-cached.test.js.map +0 -1
  296. package/cache/functions/hashing/blob-to-hash.d.ts +0 -4
  297. package/cache/functions/hashing/blob-to-hash.js.map +0 -1
  298. package/cache/functions/hashing/buffer-to-hash.d.ts +0 -4
  299. package/cache/functions/hashing/buffer-to-hash.js.map +0 -1
  300. package/cache/functions/hashing/hashing.test.d.ts +0 -1
  301. package/cache/functions/hashing/hashing.test.js +0 -95
  302. package/cache/functions/hashing/hashing.test.js.map +0 -1
  303. package/cache/functions/hashing/index.d.ts +0 -4
  304. package/cache/functions/hashing/index.js.map +0 -1
  305. package/cache/functions/hashing/json-to-hash.d.ts +0 -4
  306. package/cache/functions/hashing/json-to-hash.js.map +0 -1
  307. package/cache/functions/hashing/string-to-hash.d.ts +0 -4
  308. package/cache/functions/hashing/string-to-hash.js.map +0 -1
  309. package/cache/functions/index.d.ts +0 -5
  310. package/cache/functions/index.js.map +0 -1
  311. package/cache/functions/memoize.d.ts +0 -12
  312. package/cache/functions/memoize.js.map +0 -1
  313. package/cache/functions/omit.d.ts +0 -1
  314. package/cache/functions/omit.js.map +0 -1
  315. package/cache/functions/prevent-parallel-execution.d.ts +0 -7
  316. package/cache/functions/prevent-parallel-execution.js +0 -25
  317. package/cache/functions/prevent-parallel-execution.js.map +0 -1
  318. package/cache/functions/types.d.ts +0 -1
  319. package/cache/functions/types.js.map +0 -1
  320. package/cache/get-persistent-cache.d.ts +0 -12
  321. package/cache/get-persistent-cache.js +0 -23
  322. package/cache/get-persistent-cache.js.map +0 -1
  323. package/cache/index.d.ts +0 -3
  324. package/cache/index.js.map +0 -1
  325. package/cache/managed-array.d.ts +0 -23
  326. package/cache/managed-array.js +0 -160
  327. package/cache/managed-array.js.map +0 -1
  328. package/cache/managed-async-cache.browser.test.d.ts +0 -1
  329. package/cache/managed-async-cache.browser.test.js.map +0 -1
  330. package/cache/managed-async-cache.d.ts +0 -4
  331. package/cache/managed-async-cache.js +0 -45
  332. package/cache/managed-async-cache.js.map +0 -1
  333. package/cache/memory-allocator.d.ts +0 -23
  334. package/cache/memory-allocator.js +0 -94
  335. package/cache/memory-allocator.js.map +0 -1
  336. package/cache/memory-async-cache.d.ts +0 -6
  337. package/cache/memory-async-cache.js +0 -23
  338. package/cache/memory-async-cache.js.map +0 -1
  339. package/core/data.d.ts +0 -22
  340. package/core/data.js.map +0 -1
  341. package/core/data.test.d.ts +0 -1
  342. package/core/data.test.js.map +0 -1
  343. package/core/functions/array-equals.d.ts +0 -1
  344. package/core/functions/array-equals.js.map +0 -1
  345. package/core/functions/deep-merge.d.ts +0 -31
  346. package/core/functions/deep-merge.js +0 -51
  347. package/core/functions/deep-merge.js.map +0 -1
  348. package/core/functions/deep-merge.test.d.ts +0 -1
  349. package/core/functions/deep-merge.test.js +0 -94
  350. package/core/functions/deep-merge.test.js.map +0 -1
  351. package/core/functions/index.d.ts +0 -4
  352. package/core/functions/index.js.map +0 -1
  353. package/core/functions/is-async-generator.d.ts +0 -1
  354. package/core/functions/is-async-generator.js.map +0 -1
  355. package/core/functions/is-promise.d.ts +0 -1
  356. package/core/functions/is-promise.js.map +0 -1
  357. package/core/functions/with-validation.d.ts +0 -5
  358. package/core/functions/with-validation.js.map +0 -1
  359. package/core/functions/with-validation.test.d.ts +0 -1
  360. package/core/functions/with-validation.test.js.map +0 -1
  361. package/core/index.d.ts +0 -3
  362. package/core/index.js.map +0 -1
  363. package/core/schema.d.ts +0 -86
  364. package/core/schema.js.map +0 -1
  365. package/core/schema.test.d.ts +0 -1
  366. package/core/schema.test.js +0 -16
  367. package/core/schema.test.js.map +0 -1
  368. package/ecs/action-ecs/action-ecs.d.ts +0 -19
  369. package/ecs/action-ecs/action-ecs.js +0 -203
  370. package/ecs/action-ecs/action-ecs.js.map +0 -1
  371. package/ecs/action-ecs/action-ecs.test.d.ts +0 -1
  372. package/ecs/action-ecs/action-ecs.test.js +0 -362
  373. package/ecs/action-ecs/action-ecs.test.js.map +0 -1
  374. package/ecs/action-ecs/action-types.d.ts +0 -106
  375. package/ecs/action-ecs/action-types.js +0 -19
  376. package/ecs/action-ecs/action-types.js.map +0 -1
  377. package/ecs/action-ecs/index.d.ts +0 -2
  378. package/ecs/action-ecs/index.js.map +0 -1
  379. package/ecs/core-ecs/core-ecs-serialization.test.d.ts +0 -1
  380. package/ecs/core-ecs/core-ecs-serialization.test.js +0 -230
  381. package/ecs/core-ecs/core-ecs-serialization.test.js.map +0 -1
  382. package/ecs/core-ecs/core-ecs-types.d.ts +0 -141
  383. package/ecs/core-ecs/core-ecs-types.js.map +0 -1
  384. package/ecs/core-ecs/core-ecs.d.ts +0 -7
  385. package/ecs/core-ecs/core-ecs.js +0 -492
  386. package/ecs/core-ecs/core-ecs.js.map +0 -1
  387. package/ecs/core-ecs/core-ecs.test.d.ts +0 -1
  388. package/ecs/core-ecs/core-ecs.test.js +0 -404
  389. package/ecs/core-ecs/core-ecs.test.js.map +0 -1
  390. package/ecs/core-ecs/index.d.ts +0 -1
  391. package/ecs/core-ecs/index.js +0 -2
  392. package/ecs/core-ecs/index.js.map +0 -1
  393. package/ecs/ecs/ecs-types.d.ts +0 -132
  394. package/ecs/ecs/ecs-types.js.map +0 -1
  395. package/ecs/ecs/ecs-where-functions.d.ts +0 -6
  396. package/ecs/ecs/ecs-where-functions.js +0 -91
  397. package/ecs/ecs/ecs-where-functions.js.map +0 -1
  398. package/ecs/ecs/ecs.d.ts +0 -13
  399. package/ecs/ecs/ecs.js +0 -177
  400. package/ecs/ecs/ecs.js.map +0 -1
  401. package/ecs/ecs/ecs.test.d.ts +0 -1
  402. package/ecs/ecs/ecs.test.js +0 -399
  403. package/ecs/ecs/ecs.test.js.map +0 -1
  404. package/ecs/ecs/index.d.ts +0 -3
  405. package/ecs/ecs/index.js +0 -3
  406. package/ecs/ecs/index.js.map +0 -1
  407. package/ecs/index.d.ts +0 -4
  408. package/ecs/index.js.map +0 -1
  409. package/ecs/transaction-ecs/index.d.ts +0 -2
  410. package/ecs/transaction-ecs/index.js.map +0 -1
  411. package/ecs/transaction-ecs/transaction-ecs.d.ts +0 -11
  412. package/ecs/transaction-ecs/transaction-ecs.js +0 -184
  413. package/ecs/transaction-ecs/transaction-ecs.js.map +0 -1
  414. package/ecs/transaction-ecs/transaction-ecs.test.d.ts +0 -1
  415. package/ecs/transaction-ecs/transaction-ecs.test.js +0 -599
  416. package/ecs/transaction-ecs/transaction-ecs.test.js.map +0 -1
  417. package/ecs/transaction-ecs/transaction-types.d.ts +0 -135
  418. package/ecs/transaction-ecs/transaction-types.js +0 -2
  419. package/ecs/transaction-ecs/transaction-types.js.map +0 -1
  420. package/ecs/transaction-ecs/transactions.d.ts +0 -5
  421. package/ecs/transaction-ecs/transactions.js +0 -158
  422. package/ecs/transaction-ecs/transactions.js.map +0 -1
  423. package/index.d.ts +0 -1
  424. package/index.js +0 -23
  425. package/index.js.map +0 -1
  426. package/observe/create-observable-event.d.ts +0 -10
  427. package/observe/create-observable-event.js +0 -22
  428. package/observe/create-observable-event.js.map +0 -1
  429. package/observe/create-observable-state.d.ts +0 -7
  430. package/observe/create-observable-state.js +0 -27
  431. package/observe/create-observable-state.js.map +0 -1
  432. package/observe/create-persisted-state.d.ts +0 -11
  433. package/observe/create-persisted-state.js +0 -31
  434. package/observe/create-persisted-state.js.map +0 -1
  435. package/observe/create-persisted-state.test.d.ts +0 -1
  436. package/observe/create-persisted-state.test.js +0 -124
  437. package/observe/create-persisted-state.test.js.map +0 -1
  438. package/observe/from-array.d.ts +0 -5
  439. package/observe/from-array.js.map +0 -1
  440. package/observe/from-constant.d.ts +0 -5
  441. package/observe/from-constant.js +0 -12
  442. package/observe/from-constant.js.map +0 -1
  443. package/observe/from-element-id.d.ts +0 -7
  444. package/observe/from-element-id.js.map +0 -1
  445. package/observe/from-element-properties-and-events.d.ts +0 -2
  446. package/observe/from-element-properties-and-events.js +0 -18
  447. package/observe/from-element-properties-and-events.js.map +0 -1
  448. package/observe/from-element-property.d.ts +0 -11
  449. package/observe/from-element-property.js.map +0 -1
  450. package/observe/from-promise-with-error.d.ts +0 -7
  451. package/observe/from-promise-with-error.js +0 -27
  452. package/observe/from-promise-with-error.js.map +0 -1
  453. package/observe/from-promise.d.ts +0 -6
  454. package/observe/from-promise.js +0 -22
  455. package/observe/from-promise.js.map +0 -1
  456. package/observe/from-properties.d.ts +0 -10
  457. package/observe/from-properties.js +0 -33
  458. package/observe/from-properties.js.map +0 -1
  459. package/observe/index.d.ts +0 -27
  460. package/observe/index.js.map +0 -1
  461. package/observe/observe.test.d.ts +0 -7
  462. package/observe/observe.test.js +0 -417
  463. package/observe/observe.test.js.map +0 -1
  464. package/observe/to-promise.d.ts +0 -8
  465. package/observe/to-promise.js +0 -18
  466. package/observe/to-promise.js.map +0 -1
  467. package/observe/to-properties.d.ts +0 -11
  468. package/observe/to-properties.js +0 -9
  469. package/observe/to-properties.js.map +0 -1
  470. package/observe/types.d.ts +0 -17
  471. package/observe/types.js +0 -2
  472. package/observe/types.js.map +0 -1
  473. package/observe/with-async-map.d.ts +0 -6
  474. package/observe/with-async-map.js +0 -12
  475. package/observe/with-async-map.js.map +0 -1
  476. package/observe/with-cache.d.ts +0 -6
  477. package/observe/with-cache.js +0 -33
  478. package/observe/with-cache.js.map +0 -1
  479. package/observe/with-copy.d.ts +0 -5
  480. package/observe/with-copy.js +0 -10
  481. package/observe/with-copy.js.map +0 -1
  482. package/observe/with-deduplicate-data.d.ts +0 -7
  483. package/observe/with-deduplicate-data.js +0 -18
  484. package/observe/with-deduplicate-data.js.map +0 -1
  485. package/observe/with-deduplicate.d.ts +0 -6
  486. package/observe/with-deduplicate.js +0 -19
  487. package/observe/with-deduplicate.js.map +0 -1
  488. package/observe/with-default.d.ts +0 -6
  489. package/observe/with-default.js +0 -21
  490. package/observe/with-default.js.map +0 -1
  491. package/observe/with-map-data.d.ts +0 -7
  492. package/observe/with-map-data.js.map +0 -1
  493. package/observe/with-map.d.ts +0 -5
  494. package/observe/with-map.js +0 -11
  495. package/observe/with-map.js.map +0 -1
  496. package/observe/with-optional.d.ts +0 -5
  497. package/observe/with-optional.js +0 -20
  498. package/observe/with-optional.js.map +0 -1
  499. package/observe/with-unwrap.d.ts +0 -5
  500. package/observe/with-unwrap.js +0 -26
  501. package/observe/with-unwrap.js.map +0 -1
  502. package/perftest/ecs-perf.d.ts +0 -49
  503. package/perftest/ecs-perf.js +0 -230
  504. package/perftest/ecs-perf.js.map +0 -1
  505. package/perftest/helper-functions.d.ts +0 -1
  506. package/perftest/helper-functions.js +0 -31
  507. package/perftest/helper-functions.js.map +0 -1
  508. package/perftest/horizon-perf.d.ts +0 -22
  509. package/perftest/horizon-perf.js +0 -126
  510. package/perftest/horizon-perf.js.map +0 -1
  511. package/perftest/index.d.ts +0 -1
  512. package/perftest/index.js.map +0 -1
  513. package/perftest/perf-test.d.ts +0 -18
  514. package/perftest/perf-test.js +0 -124
  515. package/perftest/perf-test.js.map +0 -1
  516. package/perftest/vanilla-perf.d.ts +0 -38
  517. package/perftest/vanilla-perf.js +0 -128
  518. package/perftest/vanilla-perf.js.map +0 -1
  519. package/schemas/index.d.ts +0 -1
  520. package/schemas/index.js +0 -23
  521. package/schemas/index.js.map +0 -1
  522. package/schemas/schemas.d.ts +0 -45
  523. package/schemas/schemas.js +0 -39
  524. package/schemas/schemas.js.map +0 -1
  525. package/service/add-observable-actions.d.ts +0 -29
  526. package/service/add-observable-actions.js +0 -108
  527. package/service/add-observable-actions.js.map +0 -1
  528. package/service/index.d.ts +0 -4
  529. package/service/index.js.map +0 -1
  530. package/service/progressive-result.d.ts +0 -96
  531. package/service/progressive-result.js +0 -99
  532. package/service/progressive-result.js.map +0 -1
  533. package/service/sequential-action.d.ts +0 -18
  534. package/service/sequential-action.js.map +0 -1
  535. package/service/service.d.ts +0 -4
  536. package/service/service.js.map +0 -1
  537. package/tsconfig.tsbuildinfo +0 -1
  538. package/types/index.d.ts +0 -1
  539. package/types/index.js.map +0 -1
  540. package/types/types.d.ts +0 -61
  541. package/types/types.js.map +0 -1
@@ -1,128 +0,0 @@
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 { shuffleArray } from "./helper-functions.js";
23
- function createParticlesJS(n) {
24
- const particles = [];
25
- for (let i = 0; i < n; i++) {
26
- const particle = {
27
- color: 0xff00ff,
28
- mass: 10,
29
- positionX: i + 1,
30
- positionY: i + 1,
31
- positionZ: i + 1,
32
- velocityX: -i,
33
- velocityY: -i,
34
- velocityZ: -i,
35
- };
36
- if ((i >> 0) % 2 === 0) {
37
- particle.visible = true;
38
- }
39
- if ((i >> 1) % 2 === 0) {
40
- particle.enabled = true;
41
- }
42
- particles.push(particle);
43
- }
44
- return particles;
45
- }
46
- const create = (() => {
47
- let count = 0;
48
- const setup = async (n) => {
49
- count = n;
50
- };
51
- const run = () => {
52
- createParticlesJS(count);
53
- };
54
- const cleanup = async () => { };
55
- return { setup, run: run, cleanup, type: "create" };
56
- })();
57
- function createMoveParticlesPerformanceTest(options) {
58
- let particles = [];
59
- const setup = async (n) => {
60
- particles = createParticlesJS(n);
61
- if (options.shuffle) {
62
- shuffleArray(particles);
63
- }
64
- };
65
- const run = () => {
66
- if (options.immutable) {
67
- for (let i = 0; i < particles.length; i++) {
68
- const p = particles[i];
69
- if (p.visible && p.enabled) {
70
- particles[i] = {
71
- ...p,
72
- positionX: p.positionX + p.velocityX,
73
- positionY: p.positionY + p.velocityY,
74
- positionZ: p.positionZ + p.velocityZ,
75
- };
76
- }
77
- }
78
- }
79
- else {
80
- for (let i = 0; i < particles.length; i++) {
81
- const p = particles[i];
82
- if (p.visible && p.enabled) {
83
- p.positionX += p.velocityX;
84
- p.positionY += p.velocityY;
85
- p.positionZ += p.velocityZ;
86
- }
87
- }
88
- }
89
- };
90
- const getVisibleEnabledPositions = () => {
91
- const values = [];
92
- for (let i = 0; i < particles.length; i++) {
93
- const p = particles[i];
94
- if (p.visible && p.enabled) {
95
- values.push(p.positionX, p.positionY, p.positionZ);
96
- }
97
- }
98
- return values;
99
- };
100
- const cleanup = async () => { };
101
- return { setup, run: run, cleanup, getVisibleEnabledPositions: options.shuffle ? undefined : getVisibleEnabledPositions, type: "move" };
102
- }
103
- const move_best = createMoveParticlesPerformanceTest({
104
- shuffle: false,
105
- immutable: false,
106
- });
107
- const move_worst = createMoveParticlesPerformanceTest({
108
- shuffle: true,
109
- immutable: false,
110
- });
111
- const move_best_immutable = createMoveParticlesPerformanceTest({
112
- shuffle: false,
113
- immutable: true,
114
- });
115
- const move_worst_immutable = createMoveParticlesPerformanceTest({
116
- shuffle: true,
117
- immutable: true,
118
- });
119
- export const vanilla_js = {
120
- create,
121
- move_best,
122
- move_worst,
123
- };
124
- export const immutable_js = {
125
- move_best: move_best_immutable,
126
- move_worst: move_worst_immutable,
127
- };
128
- //# sourceMappingURL=vanilla-perf.js.map
@@ -1 +0,0 @@
1
- {"version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,MAAM,mBAAmB,GAAG,kCAAkC,CAAC;IAC7D,OAAO,EAAE,KAAK;IACd,SAAS,EAAE,IAAI;CAChB,CAAC,CAAC;AACH,MAAM,oBAAoB,GAAG,kCAAkC,CAAC;IAC9D,OAAO,EAAE,IAAI;IACb,SAAS,EAAE,IAAI;CAChB,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,MAAM;IACN,SAAS;IACT,UAAU;CACX,CAAC;AAEF,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,SAAS,EAAE,mBAAmB;IAC9B,UAAU,EAAE,oBAAoB;CACjC,CAAC"}
@@ -1 +0,0 @@
1
- export * from "./schemas.js";
package/schemas/index.js DELETED
@@ -1,23 +0,0 @@
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 * from "./schemas.js";
23
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/schemas/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;WAoBW;AACX,cAAc,cAAc,CAAC"}
@@ -1,45 +0,0 @@
1
- import { Schema } from "../core/index.js";
2
- export declare function Nullable<T extends Schema>(schema: T): {
3
- oneOf: [T, {
4
- type: "null";
5
- }];
6
- };
7
- export declare function Tuple<T extends Schema, N extends number>(items: T, length: N): {
8
- readonly type: "array";
9
- readonly items: T;
10
- readonly minItems: N;
11
- readonly maxItems: N;
12
- };
13
- export declare const TrueSchema: {
14
- readonly const: true;
15
- };
16
- export declare const BooleanSchema: {
17
- readonly type: "boolean";
18
- };
19
- export declare const Float32Schema: {
20
- readonly type: "number";
21
- readonly precision: 1;
22
- };
23
- export declare const Float64Schema: {
24
- readonly type: "number";
25
- readonly precision: 2;
26
- };
27
- export declare const TimeSchema: {
28
- readonly type: "number";
29
- readonly precision: 2;
30
- };
31
- export declare const Uint8Schema: {
32
- readonly type: "integer";
33
- readonly minimum: 0;
34
- readonly maximum: 255;
35
- };
36
- export declare const Uint16Schema: {
37
- readonly type: "integer";
38
- readonly minimum: 0;
39
- readonly maximum: 65535;
40
- };
41
- export declare const Uint32Schema: {
42
- readonly type: "integer";
43
- readonly minimum: 0;
44
- readonly maximum: 4294967295;
45
- };
@@ -1,39 +0,0 @@
1
- export function Nullable(schema) {
2
- return {
3
- oneOf: [schema, { type: "null" }],
4
- };
5
- }
6
- export function Tuple(items, length) {
7
- return { type: "array", items, minItems: length, maxItems: length };
8
- }
9
- export const TrueSchema = {
10
- const: true,
11
- };
12
- export const BooleanSchema = {
13
- type: "boolean",
14
- };
15
- export const Float32Schema = {
16
- type: "number",
17
- precision: 1,
18
- };
19
- export const Float64Schema = {
20
- type: "number",
21
- precision: 2,
22
- };
23
- export const TimeSchema = Float64Schema;
24
- export const Uint8Schema = {
25
- type: "integer",
26
- minimum: 0,
27
- maximum: 0xff,
28
- };
29
- export const Uint16Schema = {
30
- type: "integer",
31
- minimum: 0,
32
- maximum: 0xffff,
33
- };
34
- export const Uint32Schema = {
35
- type: "integer",
36
- minimum: 0,
37
- maximum: 0xffffffff,
38
- };
39
- //# sourceMappingURL=schemas.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"schemas.js","sourceRoot":"","sources":["../../src/schemas/schemas.ts"],"names":[],"mappings":"AAuBA,MAAM,UAAU,QAAQ,CACtB,MAAS;IAET,OAAO;QACL,KAAK,EAAE,CAAC,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;KAClC,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,KAAK,CAAqC,KAAQ,EAAE,MAAS;IAC3E,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAA4B,CAAC;AAChG,CAAC;AAED,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,KAAK,EAAE,IAAI;CACc,CAAC;AAE5B,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,IAAI,EAAE,SAAS;CACU,CAAC;AAE5B,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,IAAI,EAAE,QAAQ;IACd,SAAS,EAAE,CAAC;CACa,CAAC;AAE5B,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,IAAI,EAAE,QAAQ;IACd,SAAS,EAAE,CAAC;CACa,CAAC;AAE5B,MAAM,CAAC,MAAM,UAAU,GAAG,aAAa,CAAC;AAExC,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,IAAI,EAAE,SAAS;IACf,OAAO,EAAE,CAAC;IACV,OAAO,EAAE,IAAI;CACY,CAAC;AAE5B,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,IAAI,EAAE,SAAS;IACf,OAAO,EAAE,CAAC;IACV,OAAO,EAAE,MAAM;CACU,CAAC;AAE5B,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,IAAI,EAAE,SAAS;IACf,OAAO,EAAE,CAAC;IACV,OAAO,EAAE,UAAU;CACM,CAAC"}
@@ -1,29 +0,0 @@
1
- import { Service } from './service.js';
2
- import { Observe } from '../observe/index.js';
3
- import { Expand, IsVoid, NoNever } from '../types/index.js';
4
- declare const NESTED_SERVICE_SEPARATOR = "_";
5
- export type WithObservableActions<T extends Service> = T & {
6
- actions: Observe<ServiceActionMessages<T>>;
7
- };
8
- export declare function addObservableActions<T extends Service>(service: T): WithObservableActions<T>;
9
- type FunctionsToMessages<T, Prefix extends string = ''> = {
10
- [K in keyof T]: K extends string ? T[K] extends (...args: any[]) => unknown ? {
11
- action: `${Prefix}${K}`;
12
- args: Parameters<T[K]>;
13
- } : never : never;
14
- };
15
- type SubServices<T> = NoNever<{
16
- [K in keyof T]: T[K] extends Service ? T[K] : never;
17
- }>;
18
- type SubServiceActionMessages<T, ParentPrefix extends string = ''> = {
19
- [K in keyof T]: K extends string ? ServiceActionMessagesWithPrefix<T[K], `${ParentPrefix}${K}${typeof NESTED_SERVICE_SEPARATOR}`> : never;
20
- };
21
- export type IsPromiseOrVoid<T> = T extends Promise<unknown> ? true : IsVoid<T>;
22
- export type PromiseOrVoidFunctions<T> = NoNever<{
23
- [K in keyof T]: T[K] extends (...args: any[]) => infer R ? (IsPromiseOrVoid<R> extends true ? T[K] : never) : never;
24
- }>;
25
- type ServiceActionMessagesWithPrefix<T, Prefix extends string = ''> = FunctionsToMessages<PromiseOrVoidFunctions<T>, Prefix>[keyof FunctionsToMessages<PromiseOrVoidFunctions<T>, Prefix>] | (T extends Service ? Expand<SubServiceActionMessages<SubServices<T>, Prefix>[keyof SubServiceActionMessages<SubServices<T>, Prefix>]> : never);
26
- export type ServiceActionMessages<T> = Extract<ServiceActionMessagesWithPrefix<T>, {
27
- action: string;
28
- }>;
29
- export {};
@@ -1,108 +0,0 @@
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 { isService } from './service.js';
23
- import { createObservableEvent } from '../observe/index.js';
24
- import { isPromise } from '../core/functions/is-promise.js';
25
- const NESTED_SERVICE_SEPARATOR = '_';
26
- /**
27
- * Returns true if this function return value is from an action function.
28
- * Action functions are only allowed to return void, BUT some action function implementations
29
- * may be async and return a Promise<void>. This is convenient for authoring and since
30
- * no other service functions are allowed to return Promises then we will assume this is an action.
31
- */
32
- function isActionReturnValue(result) {
33
- return result === undefined || isPromise(result);
34
- }
35
- /**
36
- * Intercepts actions on a service and notifies via a callback.
37
- *
38
- * This function creates a proxy around the given service object. It intercepts
39
- * action calls and sends back action messages after each call.
40
- * It also wraps any child services within their own namespaced interceptActions Proxy.
41
- *
42
- * @template T - The type of the service object.
43
- * @param {T} service - The service object to be proxied.
44
- * @param {string} prefix - A prefix to be added to action names for nested services.
45
- * @param {(...args: unknown[]) => void} callback - A callback function to be called after an action is executed.
46
- * @returns {T} - The proxied service object.
47
- */
48
- function interceptActions(service, prefix, callback) {
49
- const propertyCache = new Map();
50
- const serviceCache = new Map();
51
- return new Proxy(service, {
52
- get(target, prop, receiver) {
53
- const value = Reflect.get(target, prop, receiver);
54
- const cached = propertyCache.get(prop);
55
- if (cached) {
56
- return cached;
57
- }
58
- let returnValue = value;
59
- if (typeof prop === 'string') {
60
- if (typeof value === 'function') {
61
- returnValue = (...args) => {
62
- // Call the original function with the same arguments
63
- // the binding to the target as `this` shouldn't be necessary but
64
- // we'll add it out of an abundance of caution.
65
- // eslint-disable-next-line @typescript-eslint/no-explicit-any -- calling with same args.
66
- const result = value.call(target, ...args);
67
- const executeCallback = () => {
68
- // this is an action, as actions always return void.
69
- callback({ action: prefix + prop, args });
70
- };
71
- // Notify via callback if the function returns void
72
- if (isActionReturnValue(result)) {
73
- if (isPromise(result)) {
74
- result.finally(executeCallback);
75
- }
76
- else {
77
- executeCallback();
78
- }
79
- }
80
- return result;
81
- };
82
- }
83
- else if (isService(value)) {
84
- // Wrap nested services in the same way
85
- const cachedService = serviceCache.get(prop);
86
- if (cachedService) {
87
- return cachedService;
88
- }
89
- const wrappedService = interceptActions(value, prefix + prop + NESTED_SERVICE_SEPARATOR, callback);
90
- serviceCache.set(prop, wrappedService);
91
- return wrappedService;
92
- }
93
- }
94
- propertyCache.set(prop, returnValue);
95
- return returnValue;
96
- },
97
- });
98
- }
99
- // Function to add observable actions to a service
100
- export function addObservableActions(service) {
101
- const [actions, notifyActions] = createObservableEvent();
102
- // eslint-disable-next-line @typescript-eslint/no-explicit-any -- the compiler is complaining about type recursion for no discernable reason.
103
- return interceptActions({ ...service, actions }, '', notifyActions);
104
- }
105
- // Compile-time type unit tests
106
- {
107
- }
108
- //# sourceMappingURL=add-observable-actions.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"add-observable-actions.js","sourceRoot":"","sources":["../../src/service/add-observable-actions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;WAoBW;AAEX,OAAO,EAAW,SAAS,EAAE,MAAM,cAAc,CAAC;AAClD,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from './sequential-action.js';
4
- export * from './progressive-result.js';
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/service/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;WAoBW;AAEX,cAAc,cAAc,CAAC;AAC7B,cAAc,6BAA6B,CAAC;AAC5C,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC"}
@@ -1,96 +0,0 @@
1
- import { Schema } from "../core/schema.js";
2
- export type ErrorResult<Result, Error> = Partial<Result> & {
3
- readonly error: Error;
4
- readonly progress?: number;
5
- };
6
- export type IntermediateResult<Result> = Partial<Result> & {
7
- readonly error?: never;
8
- readonly progress: number;
9
- };
10
- export type SuccessResult<Result> = Result & {
11
- readonly error?: never;
12
- readonly progress: 1.0;
13
- };
14
- export type ProgressiveResult<Result, Error> = IntermediateResult<Result> | SuccessResult<Result> | ErrorResult<Result, Error>;
15
- /**
16
- * Results must be objects as we are going to add error and progress properties to them.
17
- */
18
- type ResultSchema = Schema & {
19
- properties: {};
20
- required: string[];
21
- };
22
- /**
23
- * Returns a json schema for an final result with the specified value schema.
24
- */
25
- export declare function SuccessResultSchema<T extends ResultSchema>(valueSchema: T): Omit<T, "properties" | "required"> & {
26
- readonly type: "object";
27
- readonly properties: {
28
- readonly progress: {
29
- readonly const: 1;
30
- };
31
- };
32
- readonly required: readonly [...string[], "progress"];
33
- };
34
- /**
35
- * Returns a json schema for an intermediate result with the specified result schema.
36
- */
37
- export declare function IntermediateResultSchema<T extends ResultSchema>(valueSchema: T): Omit<T, "properties" | "required"> & {
38
- readonly type: "object";
39
- readonly properties: {
40
- readonly error: T;
41
- };
42
- readonly required: readonly ["progress"];
43
- };
44
- /**
45
- * Returns a json schema for an error result with the specified result schema.
46
- */
47
- export declare function ErrorResultSchema<T extends ResultSchema, E extends ResultSchema>(valueSchema: T, errorSchema: E): Omit<T, "properties" | "required"> & {
48
- readonly type: "object";
49
- readonly properties: {
50
- readonly error: E;
51
- };
52
- readonly required: readonly ["error"];
53
- };
54
- /**
55
- * Returns a json schema for a progressive result with the specified result schemas.
56
- */
57
- export declare function ProgressiveResultSchema<T extends ResultSchema, E extends ResultSchema>(successSchema: T, errorSchema: E): {
58
- readonly oneOf: readonly [Omit<T, "properties" | "required"> & {
59
- readonly type: "object";
60
- readonly properties: {
61
- readonly error: T;
62
- };
63
- readonly required: readonly ["progress"];
64
- }, Omit<T, "properties" | "required"> & {
65
- readonly type: "object";
66
- readonly properties: {
67
- readonly progress: {
68
- readonly const: 1;
69
- };
70
- };
71
- readonly required: readonly [...string[], "progress"];
72
- }, Omit<T, "properties" | "required"> & {
73
- readonly type: "object";
74
- readonly properties: {
75
- readonly error: E;
76
- };
77
- readonly required: readonly ["error"];
78
- }];
79
- };
80
- /**
81
- * Checks if the result is an error result.
82
- */
83
- export declare function isErrorResult<FinalValue extends ResultSchema, ErrorValue>(result: ProgressiveResult<FinalValue, ErrorValue>): result is ErrorResult<FinalValue, ErrorValue>;
84
- /**
85
- * Checks if the result is not started. We check progress < 0.0 to mean not started.
86
- */
87
- export declare function isNotStarted<FinalValue extends ResultSchema, ErrorValue>(result: ProgressiveResult<FinalValue, ErrorValue>): result is IntermediateResult<FinalValue>;
88
- /**
89
- * Checks if the result is an intermediate result.
90
- */
91
- export declare function isIntermediateResult<FinalValue extends ResultSchema, ErrorValue>(result: ProgressiveResult<FinalValue, ErrorValue>): result is IntermediateResult<FinalValue>;
92
- /**
93
- * Checks if the result is a final result.
94
- */
95
- export declare function isSuccessResult<FinalValue extends ResultSchema, ErrorValue>(result: ProgressiveResult<FinalValue, ErrorValue>): result is SuccessResult<FinalValue>;
96
- export {};
@@ -1,99 +0,0 @@
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
- /**
23
- * Returns a json schema for an final result with the specified value schema.
24
- */
25
- export function SuccessResultSchema(valueSchema) {
26
- const { properties, required, ...rest } = valueSchema;
27
- return {
28
- ...rest,
29
- type: 'object',
30
- properties: {
31
- ...properties,
32
- progress: { const: 1.0 },
33
- },
34
- required: [...required, 'progress'],
35
- };
36
- }
37
- /**
38
- * Returns a json schema for an intermediate result with the specified result schema.
39
- */
40
- export function IntermediateResultSchema(valueSchema) {
41
- const { properties, required, ...rest } = valueSchema;
42
- return {
43
- ...rest,
44
- type: 'object',
45
- properties: {
46
- ...properties,
47
- error: valueSchema,
48
- },
49
- required: ['progress'],
50
- };
51
- }
52
- /**
53
- * Returns a json schema for an error result with the specified result schema.
54
- */
55
- export function ErrorResultSchema(valueSchema, errorSchema) {
56
- const { properties, required, ...rest } = valueSchema;
57
- return {
58
- ...rest,
59
- type: 'object',
60
- properties: {
61
- ...properties,
62
- error: errorSchema,
63
- },
64
- required: ['error'],
65
- };
66
- }
67
- /**
68
- * Returns a json schema for a progressive result with the specified result schemas.
69
- */
70
- export function ProgressiveResultSchema(successSchema, errorSchema) {
71
- return {
72
- oneOf: [IntermediateResultSchema(successSchema), SuccessResultSchema(successSchema), ErrorResultSchema(successSchema, errorSchema)],
73
- };
74
- }
75
- /**
76
- * Checks if the result is an error result.
77
- */
78
- export function isErrorResult(result) {
79
- return result.error !== null && result.error !== undefined;
80
- }
81
- /**
82
- * Checks if the result is not started. We check progress < 0.0 to mean not started.
83
- */
84
- export function isNotStarted(result) {
85
- return !isErrorResult(result) && result.progress < 0.0;
86
- }
87
- /**
88
- * Checks if the result is an intermediate result.
89
- */
90
- export function isIntermediateResult(result) {
91
- return !isErrorResult(result) && result.progress !== 1.0;
92
- }
93
- /**
94
- * Checks if the result is a final result.
95
- */
96
- export function isSuccessResult(result) {
97
- return !isErrorResult(result) && result.progress === 1.0;
98
- }
99
- //# sourceMappingURL=progressive-result.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"progressive-result.js","sourceRoot":"","sources":["../../src/service/progressive-result.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;WAoBW;AA2BX;;GAEG;AACH,MAAM,UAAU,mBAAmB,CAAyB,WAAc;IACxE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAE,GAAG,WAAW,CAAC;IACtD,OAAO;QACL,GAAG,IAAI;QACP,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,GAAG,UAAU;YACb,QAAQ,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE;SACzB;QACD,QAAQ,EAAE,CAAC,GAAG,QAAQ,EAAE,UAAU,CAAC;KAC3B,CAAC;AACb,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,wBAAwB,CAAyB,WAAc;IAC7E,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAE,GAAG,WAAW,CAAC;IACtD,OAAO;QACL,GAAG,IAAI;QACP,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,GAAG,UAAU;YACb,KAAK,EAAE,WAAW;SACnB;QACD,QAAQ,EAAE,CAAC,UAAU,C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extends Data[]> = {
3
- update: (...args: Args) => SequentialActionResult<Args>;
4
- cancel: () => void;
5
- commit: () => void;
6
- };
7
- /**
8
- * A function that represents a transient, sequential series of actions that must end with a commit or cancel.
9
- * This is the only service action which can return a value other than void.
10
- * It is intended to be used for multiframe transactions.
11
- */
12
- export type SequentialAction<Args extends Data[]> = (...args: Args) => SequentialActionResult<Args>;
13
- /**
14
- * Executes a sequential action using an async iterable iterator that provides the arguments.
15
- * @param action - The action to execute.
16
- * @param argProvider - An async iterable iterator of arguments to pass to the action.
17
- */
18
- export declare function executeSequentialAction<Arg extends Data>(action: SequentialAction<[Arg]>, argProvider: AsyncIterableIterator<Arg>): Promise<void>;
@@ -1 +0,0 @@
1
- {"version":3,"file":"sequential-action.js","sourceRoot":"","sources":["../../src/service/sequential-action.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;WAoBW;AAiBX;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,uBAAuB,CAAmB,MAA+B,EAAE,WAAuC;IACpI,IAAI,QAAmD,CAAC;IACxD,IAAI,CAAC;QACD,gDAAgD;QAChD,IAAI,KAAK,EAAE,MAAM,GAAG,IAAI,WAAW,EAAE,CAAC;YAClC,kGAAkG;YAClG,QAAQ,GAAG,CAAC,QAAQ,EAAE,MAAM,IAAI,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC;QACjD,CAAC;QACD,oDAAoD;QACpD,QAAQ,EAAE,MAAM,EAAE,CAAC;IACvB,CAAC;IACD,OAAO,CAAC,EAAE,CAAC;QACP,uBAAuB;QACvB,QAAQ,EAAE,MAAM,EAAE,CAAC;QACnB,8EAA8E;QAC9E,WAAW,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC;IAC3B,CAAC;AACL,CAAC"}
@@ -1,4 +0,0 @@
1
- export interface Service {
2
- readonly serviceName: string;
3
- }
4
- export declare function isService(value: unknown): value is Service;
@@ -1 +0,0 @@
1
- {"version":3,"file":"service.js","sourceRoot":"","sources":["../../src/service/service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;WAoBW;AAMX,MAAM,UAAU,SAAS,CAAC,KAAc;IACtC,MAAM,YAAY,GAAG,KAA4C,CAAC;IAClE,OAAO,OAAO,YAAY,EAAE,WAAW,KAAK,QAAQ,CAAC;AACvD,CAAC"}