@vived/core 1.4.2 → 1.4.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 (528) hide show
  1. package/README.md +142 -20
  2. package/dist/cjs/AppObject/AppObject.js +53 -0
  3. package/dist/cjs/AppObject/AppObject.js.map +1 -1
  4. package/dist/cjs/AppObject/AppObjectComponent.js +78 -0
  5. package/dist/cjs/AppObject/AppObjectComponent.js.map +1 -1
  6. package/dist/cjs/AppObject/AppObjectController.js +22 -0
  7. package/dist/cjs/AppObject/AppObjectController.js.map +1 -1
  8. package/dist/cjs/AppObject/AppObjectEntity.js +52 -0
  9. package/dist/cjs/AppObject/AppObjectEntity.js.map +1 -1
  10. package/dist/cjs/AppObject/AppObjectEntityRepo.js +75 -1
  11. package/dist/cjs/AppObject/AppObjectEntityRepo.js.map +1 -1
  12. package/dist/cjs/AppObject/AppObjectPM.js +46 -0
  13. package/dist/cjs/AppObject/AppObjectPM.js.map +1 -1
  14. package/dist/cjs/AppObject/AppObjectRepo.js +20 -0
  15. package/dist/cjs/AppObject/AppObjectRepo.js.map +1 -1
  16. package/dist/cjs/AppObject/AppObjectUC.js +23 -0
  17. package/dist/cjs/AppObject/AppObjectUC.js.map +1 -1
  18. package/dist/cjs/AppObject/AppObjectView.js +22 -0
  19. package/dist/cjs/AppObject/AppObjectView.js.map +1 -1
  20. package/dist/cjs/AppObject/getSingletonComponent.js +19 -0
  21. package/dist/cjs/AppObject/getSingletonComponent.js.map +1 -1
  22. package/dist/cjs/Entities/MemoizedAngle.js +21 -0
  23. package/dist/cjs/Entities/MemoizedAngle.js.map +1 -1
  24. package/dist/cjs/Entities/MemoizedBoolean.js +21 -0
  25. package/dist/cjs/Entities/MemoizedBoolean.js.map +1 -1
  26. package/dist/cjs/Entities/MemoizedColor.js +21 -0
  27. package/dist/cjs/Entities/MemoizedColor.js.map +1 -1
  28. package/dist/cjs/Entities/MemoizedNumber.js +21 -0
  29. package/dist/cjs/Entities/MemoizedNumber.js.map +1 -1
  30. package/dist/cjs/Entities/MemoizedQuaternion.js +21 -0
  31. package/dist/cjs/Entities/MemoizedQuaternion.js.map +1 -1
  32. package/dist/cjs/Entities/MemoizedString.js +21 -0
  33. package/dist/cjs/Entities/MemoizedString.js.map +1 -1
  34. package/dist/cjs/Entities/MemoizedVector2.js +21 -0
  35. package/dist/cjs/Entities/MemoizedVector2.js.map +1 -1
  36. package/dist/cjs/Entities/MemoizedVector3.js +21 -0
  37. package/dist/cjs/Entities/MemoizedVector3.js.map +1 -1
  38. package/dist/cjs/Entities/ObservableEntity.js +17 -0
  39. package/dist/cjs/Entities/ObservableEntity.js.map +1 -1
  40. package/dist/cjs/Entities/ObserverList.js +21 -0
  41. package/dist/cjs/Entities/ObserverList.js.map +1 -1
  42. package/dist/cjs/Entities/RangedNumber.js +29 -0
  43. package/dist/cjs/Entities/RangedNumber.js.map +1 -1
  44. package/dist/cjs/ExampleFeature/Adapters/examplePmAdapter.js +64 -0
  45. package/dist/cjs/ExampleFeature/Adapters/examplePmAdapter.js.map +1 -0
  46. package/dist/cjs/ExampleFeature/Adapters/exampleSingletonPmAdapter.js +60 -0
  47. package/dist/cjs/ExampleFeature/Adapters/exampleSingletonPmAdapter.js.map +1 -0
  48. package/dist/cjs/ExampleFeature/Adapters/index.js +19 -0
  49. package/dist/cjs/ExampleFeature/Adapters/index.js.map +1 -0
  50. package/dist/cjs/ExampleFeature/Controllers/index.js +19 -0
  51. package/dist/cjs/ExampleFeature/Controllers/index.js.map +1 -0
  52. package/dist/cjs/ExampleFeature/Controllers/setExampleText.js +48 -0
  53. package/dist/cjs/ExampleFeature/Controllers/setExampleText.js.map +1 -0
  54. package/dist/cjs/ExampleFeature/Controllers/toggleExampleBoolean.js +47 -0
  55. package/dist/cjs/ExampleFeature/Controllers/toggleExampleBoolean.js.map +1 -0
  56. package/dist/cjs/ExampleFeature/Entities/ExampleEntity.js +90 -0
  57. package/dist/cjs/ExampleFeature/Entities/ExampleEntity.js.map +1 -0
  58. package/dist/cjs/ExampleFeature/Entities/ExampleRepo.js +113 -0
  59. package/dist/cjs/ExampleFeature/Entities/ExampleRepo.js.map +1 -0
  60. package/dist/cjs/ExampleFeature/Entities/ExampleSingletonEntity.js +69 -0
  61. package/dist/cjs/ExampleFeature/Entities/ExampleSingletonEntity.js.map +1 -0
  62. package/dist/cjs/ExampleFeature/Entities/index.js +20 -0
  63. package/dist/cjs/ExampleFeature/Entities/index.js.map +1 -0
  64. package/dist/cjs/ExampleFeature/Factory/index.js +18 -0
  65. package/dist/cjs/ExampleFeature/Factory/index.js.map +1 -0
  66. package/dist/cjs/ExampleFeature/Factory/setupExampleFeature.js +29 -0
  67. package/dist/cjs/ExampleFeature/Factory/setupExampleFeature.js.map +1 -0
  68. package/dist/cjs/ExampleFeature/Mocks/MockEditExampleStringUC.js +47 -0
  69. package/dist/cjs/ExampleFeature/Mocks/MockEditExampleStringUC.js.map +1 -0
  70. package/dist/cjs/ExampleFeature/Mocks/MockExamplePM.js +48 -0
  71. package/dist/cjs/ExampleFeature/Mocks/MockExamplePM.js.map +1 -0
  72. package/dist/cjs/ExampleFeature/Mocks/MockExampleSingletonPM.js +59 -0
  73. package/dist/cjs/ExampleFeature/Mocks/MockExampleSingletonPM.js.map +1 -0
  74. package/dist/cjs/ExampleFeature/Mocks/MockToggleExampleBooleanUC.js +57 -0
  75. package/dist/cjs/ExampleFeature/Mocks/MockToggleExampleBooleanUC.js.map +1 -0
  76. package/dist/cjs/ExampleFeature/Mocks/index.js +21 -0
  77. package/dist/cjs/ExampleFeature/Mocks/index.js.map +1 -0
  78. package/dist/cjs/ExampleFeature/PMs/ExamplePM.js +97 -0
  79. package/dist/cjs/ExampleFeature/PMs/ExamplePM.js.map +1 -0
  80. package/dist/cjs/ExampleFeature/PMs/ExampleSingletonPM.js +102 -0
  81. package/dist/cjs/ExampleFeature/PMs/ExampleSingletonPM.js.map +1 -0
  82. package/dist/cjs/ExampleFeature/PMs/index.js +19 -0
  83. package/dist/cjs/ExampleFeature/PMs/index.js.map +1 -0
  84. package/dist/cjs/ExampleFeature/UCs/EditExampleStringUC.js +87 -0
  85. package/dist/cjs/ExampleFeature/UCs/EditExampleStringUC.js.map +1 -0
  86. package/dist/cjs/ExampleFeature/UCs/ToggleExampleBooleanUC.js +79 -0
  87. package/dist/cjs/ExampleFeature/UCs/ToggleExampleBooleanUC.js.map +1 -0
  88. package/dist/cjs/ExampleFeature/UCs/index.js +19 -0
  89. package/dist/cjs/ExampleFeature/UCs/index.js.map +1 -0
  90. package/dist/cjs/ExampleFeature/index.js +24 -0
  91. package/dist/cjs/ExampleFeature/index.js.map +1 -0
  92. package/dist/cjs/Types/PmAdapter.js.map +1 -1
  93. package/dist/cjs/Types/SingletonPmAdapter.js.map +1 -1
  94. package/dist/cjs/ValueObjects/Angle.js +1 -1
  95. package/dist/cjs/ValueObjects/Angle.js.map +1 -1
  96. package/dist/cjs/ValueObjects/LineSegment2D.js +6 -6
  97. package/dist/cjs/ValueObjects/LineSegment2D.js.map +1 -1
  98. package/dist/cjs/ValueObjects/Matrix.js +6 -6
  99. package/dist/cjs/ValueObjects/Matrix.js.map +1 -1
  100. package/dist/cjs/ValueObjects/Quaternion.js +17 -17
  101. package/dist/cjs/ValueObjects/Quaternion.js.map +1 -1
  102. package/dist/cjs/ValueObjects/Vector2.js +15 -8
  103. package/dist/cjs/ValueObjects/Vector2.js.map +1 -1
  104. package/dist/cjs/index.js +1 -0
  105. package/dist/cjs/index.js.map +1 -1
  106. package/dist/esm/AppObject/AppObject.js +53 -0
  107. package/dist/esm/AppObject/AppObject.js.map +1 -1
  108. package/dist/esm/AppObject/AppObjectComponent.js +78 -0
  109. package/dist/esm/AppObject/AppObjectComponent.js.map +1 -1
  110. package/dist/esm/AppObject/AppObjectController.js +22 -0
  111. package/dist/esm/AppObject/AppObjectController.js.map +1 -1
  112. package/dist/esm/AppObject/AppObjectEntity.js +52 -0
  113. package/dist/esm/AppObject/AppObjectEntity.js.map +1 -1
  114. package/dist/esm/AppObject/AppObjectEntityRepo.js +75 -1
  115. package/dist/esm/AppObject/AppObjectEntityRepo.js.map +1 -1
  116. package/dist/esm/AppObject/AppObjectPM.js +46 -0
  117. package/dist/esm/AppObject/AppObjectPM.js.map +1 -1
  118. package/dist/esm/AppObject/AppObjectRepo.js +20 -0
  119. package/dist/esm/AppObject/AppObjectRepo.js.map +1 -1
  120. package/dist/esm/AppObject/AppObjectUC.js +24 -1
  121. package/dist/esm/AppObject/AppObjectUC.js.map +1 -1
  122. package/dist/esm/AppObject/AppObjectView.js +23 -1
  123. package/dist/esm/AppObject/AppObjectView.js.map +1 -1
  124. package/dist/esm/AppObject/getSingletonComponent.js +19 -0
  125. package/dist/esm/AppObject/getSingletonComponent.js.map +1 -1
  126. package/dist/esm/Entities/MemoizedAngle.js +21 -0
  127. package/dist/esm/Entities/MemoizedAngle.js.map +1 -1
  128. package/dist/esm/Entities/MemoizedBoolean.js +21 -0
  129. package/dist/esm/Entities/MemoizedBoolean.js.map +1 -1
  130. package/dist/esm/Entities/MemoizedColor.js +21 -0
  131. package/dist/esm/Entities/MemoizedColor.js.map +1 -1
  132. package/dist/esm/Entities/MemoizedNumber.js +21 -0
  133. package/dist/esm/Entities/MemoizedNumber.js.map +1 -1
  134. package/dist/esm/Entities/MemoizedQuaternion.js +21 -0
  135. package/dist/esm/Entities/MemoizedQuaternion.js.map +1 -1
  136. package/dist/esm/Entities/MemoizedString.js +21 -0
  137. package/dist/esm/Entities/MemoizedString.js.map +1 -1
  138. package/dist/esm/Entities/MemoizedVector2.js +21 -0
  139. package/dist/esm/Entities/MemoizedVector2.js.map +1 -1
  140. package/dist/esm/Entities/MemoizedVector3.js +21 -0
  141. package/dist/esm/Entities/MemoizedVector3.js.map +1 -1
  142. package/dist/esm/Entities/ObservableEntity.js +17 -0
  143. package/dist/esm/Entities/ObservableEntity.js.map +1 -1
  144. package/dist/esm/Entities/ObserverList.js +21 -0
  145. package/dist/esm/Entities/ObserverList.js.map +1 -1
  146. package/dist/esm/Entities/RangedNumber.js +29 -0
  147. package/dist/esm/Entities/RangedNumber.js.map +1 -1
  148. package/dist/esm/ExampleFeature/Adapters/examplePmAdapter.js +61 -0
  149. package/dist/esm/ExampleFeature/Adapters/examplePmAdapter.js.map +1 -0
  150. package/dist/esm/ExampleFeature/Adapters/exampleSingletonPmAdapter.js +57 -0
  151. package/dist/esm/ExampleFeature/Adapters/exampleSingletonPmAdapter.js.map +1 -0
  152. package/dist/esm/ExampleFeature/Adapters/index.js +3 -0
  153. package/dist/esm/ExampleFeature/Adapters/index.js.map +1 -0
  154. package/dist/esm/ExampleFeature/Controllers/index.js +3 -0
  155. package/dist/esm/ExampleFeature/Controllers/index.js.map +1 -0
  156. package/dist/esm/ExampleFeature/Controllers/setExampleText.js +45 -0
  157. package/dist/esm/ExampleFeature/Controllers/setExampleText.js.map +1 -0
  158. package/dist/esm/ExampleFeature/Controllers/toggleExampleBoolean.js +44 -0
  159. package/dist/esm/ExampleFeature/Controllers/toggleExampleBoolean.js.map +1 -0
  160. package/dist/esm/ExampleFeature/Entities/ExampleEntity.js +85 -0
  161. package/dist/esm/ExampleFeature/Entities/ExampleEntity.js.map +1 -0
  162. package/dist/esm/ExampleFeature/Entities/ExampleRepo.js +108 -0
  163. package/dist/esm/ExampleFeature/Entities/ExampleRepo.js.map +1 -0
  164. package/dist/esm/ExampleFeature/Entities/ExampleSingletonEntity.js +64 -0
  165. package/dist/esm/ExampleFeature/Entities/ExampleSingletonEntity.js.map +1 -0
  166. package/dist/esm/ExampleFeature/Entities/index.js +4 -0
  167. package/dist/esm/ExampleFeature/Entities/index.js.map +1 -0
  168. package/dist/esm/ExampleFeature/Factory/index.js +2 -0
  169. package/dist/esm/ExampleFeature/Factory/index.js.map +1 -0
  170. package/dist/esm/ExampleFeature/Factory/setupExampleFeature.js +26 -0
  171. package/dist/esm/ExampleFeature/Factory/setupExampleFeature.js.map +1 -0
  172. package/dist/esm/ExampleFeature/Mocks/MockEditExampleStringUC.js +43 -0
  173. package/dist/esm/ExampleFeature/Mocks/MockEditExampleStringUC.js.map +1 -0
  174. package/dist/esm/ExampleFeature/Mocks/MockExamplePM.js +44 -0
  175. package/dist/esm/ExampleFeature/Mocks/MockExamplePM.js.map +1 -0
  176. package/dist/esm/ExampleFeature/Mocks/MockExampleSingletonPM.js +54 -0
  177. package/dist/esm/ExampleFeature/Mocks/MockExampleSingletonPM.js.map +1 -0
  178. package/dist/esm/ExampleFeature/Mocks/MockToggleExampleBooleanUC.js +52 -0
  179. package/dist/esm/ExampleFeature/Mocks/MockToggleExampleBooleanUC.js.map +1 -0
  180. package/dist/esm/ExampleFeature/Mocks/index.js +5 -0
  181. package/dist/esm/ExampleFeature/Mocks/index.js.map +1 -0
  182. package/dist/esm/ExampleFeature/PMs/ExamplePM.js +92 -0
  183. package/dist/esm/ExampleFeature/PMs/ExamplePM.js.map +1 -0
  184. package/dist/esm/ExampleFeature/PMs/ExampleSingletonPM.js +97 -0
  185. package/dist/esm/ExampleFeature/PMs/ExampleSingletonPM.js.map +1 -0
  186. package/dist/esm/ExampleFeature/PMs/index.js +3 -0
  187. package/dist/esm/ExampleFeature/PMs/index.js.map +1 -0
  188. package/dist/esm/ExampleFeature/UCs/EditExampleStringUC.js +82 -0
  189. package/dist/esm/ExampleFeature/UCs/EditExampleStringUC.js.map +1 -0
  190. package/dist/esm/ExampleFeature/UCs/ToggleExampleBooleanUC.js +74 -0
  191. package/dist/esm/ExampleFeature/UCs/ToggleExampleBooleanUC.js.map +1 -0
  192. package/dist/esm/ExampleFeature/UCs/index.js +3 -0
  193. package/dist/esm/ExampleFeature/UCs/index.js.map +1 -0
  194. package/dist/esm/ExampleFeature/index.js +8 -0
  195. package/dist/esm/ExampleFeature/index.js.map +1 -0
  196. package/dist/esm/Types/PmAdapter.js.map +1 -1
  197. package/dist/esm/Types/SingletonPmAdapter.js.map +1 -1
  198. package/dist/esm/ValueObjects/Angle.js +1 -1
  199. package/dist/esm/ValueObjects/Angle.js.map +1 -1
  200. package/dist/esm/ValueObjects/LineSegment2D.js +6 -6
  201. package/dist/esm/ValueObjects/LineSegment2D.js.map +1 -1
  202. package/dist/esm/ValueObjects/Matrix.js +6 -6
  203. package/dist/esm/ValueObjects/Matrix.js.map +1 -1
  204. package/dist/esm/ValueObjects/Quaternion.js +17 -17
  205. package/dist/esm/ValueObjects/Quaternion.js.map +1 -1
  206. package/dist/esm/ValueObjects/Vector2.js +15 -8
  207. package/dist/esm/ValueObjects/Vector2.js.map +1 -1
  208. package/dist/esm/index.js +1 -0
  209. package/dist/esm/index.js.map +1 -1
  210. package/dist/types/AppObject/AppObject.d.ts +42 -0
  211. package/dist/types/AppObject/AppObject.d.ts.map +1 -1
  212. package/dist/types/AppObject/AppObjectComponent.d.ts +80 -0
  213. package/dist/types/AppObject/AppObjectComponent.d.ts.map +1 -1
  214. package/dist/types/AppObject/AppObjectController.d.ts +22 -0
  215. package/dist/types/AppObject/AppObjectController.d.ts.map +1 -1
  216. package/dist/types/AppObject/AppObjectEntity.d.ts +55 -0
  217. package/dist/types/AppObject/AppObjectEntity.d.ts.map +1 -1
  218. package/dist/types/AppObject/AppObjectEntityRepo.d.ts +75 -0
  219. package/dist/types/AppObject/AppObjectEntityRepo.d.ts.map +1 -1
  220. package/dist/types/AppObject/AppObjectPM.d.ts +53 -0
  221. package/dist/types/AppObject/AppObjectPM.d.ts.map +1 -1
  222. package/dist/types/AppObject/AppObjectRepo.d.ts +124 -0
  223. package/dist/types/AppObject/AppObjectRepo.d.ts.map +1 -1
  224. package/dist/types/AppObject/AppObjectUC.d.ts +23 -0
  225. package/dist/types/AppObject/AppObjectUC.d.ts.map +1 -1
  226. package/dist/types/AppObject/AppObjectView.d.ts +22 -0
  227. package/dist/types/AppObject/AppObjectView.d.ts.map +1 -1
  228. package/dist/types/AppObject/getSingletonComponent.d.ts +19 -0
  229. package/dist/types/AppObject/getSingletonComponent.d.ts.map +1 -1
  230. package/dist/types/Entities/MemoizedAngle.d.ts +21 -0
  231. package/dist/types/Entities/MemoizedAngle.d.ts.map +1 -1
  232. package/dist/types/Entities/MemoizedBoolean.d.ts +21 -0
  233. package/dist/types/Entities/MemoizedBoolean.d.ts.map +1 -1
  234. package/dist/types/Entities/MemoizedColor.d.ts +21 -0
  235. package/dist/types/Entities/MemoizedColor.d.ts.map +1 -1
  236. package/dist/types/Entities/MemoizedNumber.d.ts +21 -0
  237. package/dist/types/Entities/MemoizedNumber.d.ts.map +1 -1
  238. package/dist/types/Entities/MemoizedQuaternion.d.ts +21 -0
  239. package/dist/types/Entities/MemoizedQuaternion.d.ts.map +1 -1
  240. package/dist/types/Entities/MemoizedString.d.ts +21 -0
  241. package/dist/types/Entities/MemoizedString.d.ts.map +1 -1
  242. package/dist/types/Entities/MemoizedVector2.d.ts +21 -0
  243. package/dist/types/Entities/MemoizedVector2.d.ts.map +1 -1
  244. package/dist/types/Entities/MemoizedVector3.d.ts +21 -0
  245. package/dist/types/Entities/MemoizedVector3.d.ts.map +1 -1
  246. package/dist/types/Entities/ObservableEntity.d.ts +20 -0
  247. package/dist/types/Entities/ObservableEntity.d.ts.map +1 -1
  248. package/dist/types/Entities/ObserverList.d.ts +21 -0
  249. package/dist/types/Entities/ObserverList.d.ts.map +1 -1
  250. package/dist/types/Entities/RangedNumber.d.ts +37 -0
  251. package/dist/types/Entities/RangedNumber.d.ts.map +1 -1
  252. package/dist/types/ExampleFeature/Adapters/examplePmAdapter.d.ts +29 -0
  253. package/dist/types/ExampleFeature/Adapters/examplePmAdapter.d.ts.map +1 -0
  254. package/dist/types/ExampleFeature/Adapters/exampleSingletonPmAdapter.d.ts +31 -0
  255. package/dist/types/ExampleFeature/Adapters/exampleSingletonPmAdapter.d.ts.map +1 -0
  256. package/dist/types/ExampleFeature/Adapters/index.d.ts +3 -0
  257. package/dist/types/ExampleFeature/Adapters/index.d.ts.map +1 -0
  258. package/dist/types/ExampleFeature/Controllers/index.d.ts +3 -0
  259. package/dist/types/ExampleFeature/Controllers/index.d.ts.map +1 -0
  260. package/dist/types/ExampleFeature/Controllers/setExampleText.d.ts +35 -0
  261. package/dist/types/ExampleFeature/Controllers/setExampleText.d.ts.map +1 -0
  262. package/dist/types/ExampleFeature/Controllers/toggleExampleBoolean.d.ts +34 -0
  263. package/dist/types/ExampleFeature/Controllers/toggleExampleBoolean.d.ts.map +1 -0
  264. package/dist/types/ExampleFeature/Entities/ExampleEntity.d.ts +55 -0
  265. package/dist/types/ExampleFeature/Entities/ExampleEntity.d.ts.map +1 -0
  266. package/dist/types/ExampleFeature/Entities/ExampleRepo.d.ts +62 -0
  267. package/dist/types/ExampleFeature/Entities/ExampleRepo.d.ts.map +1 -0
  268. package/dist/types/ExampleFeature/Entities/ExampleSingletonEntity.d.ts +43 -0
  269. package/dist/types/ExampleFeature/Entities/ExampleSingletonEntity.d.ts.map +1 -0
  270. package/dist/types/ExampleFeature/Entities/index.d.ts +4 -0
  271. package/dist/types/ExampleFeature/Entities/index.d.ts.map +1 -0
  272. package/dist/types/ExampleFeature/Factory/index.d.ts +2 -0
  273. package/dist/types/ExampleFeature/Factory/index.d.ts.map +1 -0
  274. package/dist/types/ExampleFeature/Factory/setupExampleFeature.d.ts +17 -0
  275. package/dist/types/ExampleFeature/Factory/setupExampleFeature.d.ts.map +1 -0
  276. package/dist/types/ExampleFeature/Mocks/MockEditExampleStringUC.d.ts +42 -0
  277. package/dist/types/ExampleFeature/Mocks/MockEditExampleStringUC.d.ts.map +1 -0
  278. package/dist/types/ExampleFeature/Mocks/MockExamplePM.d.ts +41 -0
  279. package/dist/types/ExampleFeature/Mocks/MockExamplePM.d.ts.map +1 -0
  280. package/dist/types/ExampleFeature/Mocks/MockExampleSingletonPM.d.ts +49 -0
  281. package/dist/types/ExampleFeature/Mocks/MockExampleSingletonPM.d.ts.map +1 -0
  282. package/dist/types/ExampleFeature/Mocks/MockToggleExampleBooleanUC.d.ts +47 -0
  283. package/dist/types/ExampleFeature/Mocks/MockToggleExampleBooleanUC.d.ts.map +1 -0
  284. package/dist/types/ExampleFeature/Mocks/index.d.ts +5 -0
  285. package/dist/types/ExampleFeature/Mocks/index.d.ts.map +1 -0
  286. package/dist/types/ExampleFeature/PMs/ExamplePM.d.ts +42 -0
  287. package/dist/types/ExampleFeature/PMs/ExamplePM.d.ts.map +1 -0
  288. package/dist/types/ExampleFeature/PMs/ExampleSingletonPM.d.ts +52 -0
  289. package/dist/types/ExampleFeature/PMs/ExampleSingletonPM.d.ts.map +1 -0
  290. package/dist/types/ExampleFeature/PMs/index.d.ts +3 -0
  291. package/dist/types/ExampleFeature/PMs/index.d.ts.map +1 -0
  292. package/dist/types/ExampleFeature/UCs/EditExampleStringUC.d.ts +52 -0
  293. package/dist/types/ExampleFeature/UCs/EditExampleStringUC.d.ts.map +1 -0
  294. package/dist/types/ExampleFeature/UCs/ToggleExampleBooleanUC.d.ts +44 -0
  295. package/dist/types/ExampleFeature/UCs/ToggleExampleBooleanUC.d.ts.map +1 -0
  296. package/dist/types/ExampleFeature/UCs/index.d.ts +3 -0
  297. package/dist/types/ExampleFeature/UCs/index.d.ts.map +1 -0
  298. package/dist/types/ExampleFeature/index.d.ts +8 -0
  299. package/dist/types/ExampleFeature/index.d.ts.map +1 -0
  300. package/dist/types/Types/PmAdapter.d.ts +60 -0
  301. package/dist/types/Types/PmAdapter.d.ts.map +1 -1
  302. package/dist/types/Types/SingletonPmAdapter.d.ts +55 -0
  303. package/dist/types/Types/SingletonPmAdapter.d.ts.map +1 -1
  304. package/dist/types/ValueObjects/Angle.d.ts +1 -1
  305. package/dist/types/ValueObjects/Matrix.d.ts +5 -5
  306. package/dist/types/ValueObjects/Matrix.d.ts.map +1 -1
  307. package/dist/types/ValueObjects/Quaternion.d.ts +17 -17
  308. package/dist/types/ValueObjects/Vector2.d.ts +8 -3
  309. package/dist/types/ValueObjects/Vector2.d.ts.map +1 -1
  310. package/dist/types/index.d.ts +1 -0
  311. package/dist/types/index.d.ts.map +1 -1
  312. package/package.json +6 -4
  313. package/dist/cjs/AppObject/AppObject.test.js +0 -113
  314. package/dist/cjs/AppObject/AppObject.test.js.map +0 -1
  315. package/dist/cjs/AppObject/AppObjectComponent.test.js +0 -132
  316. package/dist/cjs/AppObject/AppObjectComponent.test.js.map +0 -1
  317. package/dist/cjs/AppObject/AppObjectEntity.test.js +0 -108
  318. package/dist/cjs/AppObject/AppObjectEntity.test.js.map +0 -1
  319. package/dist/cjs/AppObject/AppObjectEntityRepo.test.js +0 -149
  320. package/dist/cjs/AppObject/AppObjectEntityRepo.test.js.map +0 -1
  321. package/dist/cjs/AppObject/AppObjectPM.test.js +0 -103
  322. package/dist/cjs/AppObject/AppObjectPM.test.js.map +0 -1
  323. package/dist/cjs/AppObject/AppObjectRepo.test.js +0 -213
  324. package/dist/cjs/AppObject/AppObjectRepo.test.js.map +0 -1
  325. package/dist/cjs/AppObject/getSingletonComponent.test.js +0 -13
  326. package/dist/cjs/AppObject/getSingletonComponent.test.js.map +0 -1
  327. package/dist/cjs/Entities/MemoizedAngle.test.js +0 -30
  328. package/dist/cjs/Entities/MemoizedAngle.test.js.map +0 -1
  329. package/dist/cjs/Entities/MemoizedBoolean.test.js +0 -34
  330. package/dist/cjs/Entities/MemoizedBoolean.test.js.map +0 -1
  331. package/dist/cjs/Entities/MemoizedColor.test.js +0 -32
  332. package/dist/cjs/Entities/MemoizedColor.test.js.map +0 -1
  333. package/dist/cjs/Entities/MemoizedNumber.test.js +0 -29
  334. package/dist/cjs/Entities/MemoizedNumber.test.js.map +0 -1
  335. package/dist/cjs/Entities/MemoizedQuaternion.test.js +0 -32
  336. package/dist/cjs/Entities/MemoizedQuaternion.test.js.map +0 -1
  337. package/dist/cjs/Entities/MemoizedString.test.js +0 -29
  338. package/dist/cjs/Entities/MemoizedString.test.js.map +0 -1
  339. package/dist/cjs/Entities/MemoizedVector2.test.js +0 -32
  340. package/dist/cjs/Entities/MemoizedVector2.test.js.map +0 -1
  341. package/dist/cjs/Entities/MemoizedVector3.test.js +0 -32
  342. package/dist/cjs/Entities/MemoizedVector3.test.js.map +0 -1
  343. package/dist/cjs/Entities/ObservableEntity.test.js +0 -25
  344. package/dist/cjs/Entities/ObservableEntity.test.js.map +0 -1
  345. package/dist/cjs/Entities/ObserverList.test.js +0 -44
  346. package/dist/cjs/Entities/ObserverList.test.js.map +0 -1
  347. package/dist/cjs/Entities/RangedNumber.test.js +0 -96
  348. package/dist/cjs/Entities/RangedNumber.test.js.map +0 -1
  349. package/dist/cjs/Utilities/LengthConverters.test.js +0 -24
  350. package/dist/cjs/Utilities/LengthConverters.test.js.map +0 -1
  351. package/dist/cjs/Utilities/LerpNumber.test.js +0 -90
  352. package/dist/cjs/Utilities/LerpNumber.test.js.map +0 -1
  353. package/dist/cjs/Utilities/addAlphaToHex.test.js +0 -34
  354. package/dist/cjs/Utilities/addAlphaToHex.test.js.map +0 -1
  355. package/dist/cjs/Utilities/alphaToHex.test.js +0 -75
  356. package/dist/cjs/Utilities/alphaToHex.test.js.map +0 -1
  357. package/dist/cjs/Utilities/degreesToRadians.test.js +0 -9
  358. package/dist/cjs/Utilities/degreesToRadians.test.js.map +0 -1
  359. package/dist/cjs/Utilities/easeFunctions.test.js +0 -209
  360. package/dist/cjs/Utilities/easeFunctions.test.js.map +0 -1
  361. package/dist/cjs/Utilities/interpolateNumber.test.js +0 -26
  362. package/dist/cjs/Utilities/interpolateNumber.test.js.map +0 -1
  363. package/dist/cjs/ValueObjects/Angle.test.js +0 -28
  364. package/dist/cjs/ValueObjects/Angle.test.js.map +0 -1
  365. package/dist/cjs/ValueObjects/Color.test.js +0 -147
  366. package/dist/cjs/ValueObjects/Color.test.js.map +0 -1
  367. package/dist/cjs/ValueObjects/LineSegment2D.test.js +0 -102
  368. package/dist/cjs/ValueObjects/LineSegment2D.test.js.map +0 -1
  369. package/dist/cjs/ValueObjects/Matrix.test.js +0 -385
  370. package/dist/cjs/ValueObjects/Matrix.test.js.map +0 -1
  371. package/dist/cjs/ValueObjects/ParametricLine.test.js +0 -126
  372. package/dist/cjs/ValueObjects/ParametricLine.test.js.map +0 -1
  373. package/dist/cjs/ValueObjects/ParametricPlane.test.js +0 -101
  374. package/dist/cjs/ValueObjects/ParametricPlane.test.js.map +0 -1
  375. package/dist/cjs/ValueObjects/Quaternion.test.js +0 -240
  376. package/dist/cjs/ValueObjects/Quaternion.test.js.map +0 -1
  377. package/dist/cjs/ValueObjects/Rectangle.test.js +0 -32
  378. package/dist/cjs/ValueObjects/Rectangle.test.js.map +0 -1
  379. package/dist/cjs/ValueObjects/Vector2.test.js +0 -136
  380. package/dist/cjs/ValueObjects/Vector2.test.js.map +0 -1
  381. package/dist/cjs/ValueObjects/Vector3.test.js +0 -188
  382. package/dist/cjs/ValueObjects/Vector3.test.js.map +0 -1
  383. package/dist/cjs/ValueObjects/Version.test.js +0 -310
  384. package/dist/cjs/ValueObjects/Version.test.js.map +0 -1
  385. package/dist/esm/AppObject/AppObject.test.js +0 -110
  386. package/dist/esm/AppObject/AppObject.test.js.map +0 -1
  387. package/dist/esm/AppObject/AppObjectComponent.test.js +0 -130
  388. package/dist/esm/AppObject/AppObjectComponent.test.js.map +0 -1
  389. package/dist/esm/AppObject/AppObjectEntity.test.js +0 -106
  390. package/dist/esm/AppObject/AppObjectEntity.test.js.map +0 -1
  391. package/dist/esm/AppObject/AppObjectEntityRepo.test.js +0 -147
  392. package/dist/esm/AppObject/AppObjectEntityRepo.test.js.map +0 -1
  393. package/dist/esm/AppObject/AppObjectPM.test.js +0 -101
  394. package/dist/esm/AppObject/AppObjectPM.test.js.map +0 -1
  395. package/dist/esm/AppObject/AppObjectRepo.test.js +0 -211
  396. package/dist/esm/AppObject/AppObjectRepo.test.js.map +0 -1
  397. package/dist/esm/AppObject/getSingletonComponent.test.js +0 -11
  398. package/dist/esm/AppObject/getSingletonComponent.test.js.map +0 -1
  399. package/dist/esm/Entities/MemoizedAngle.test.js +0 -28
  400. package/dist/esm/Entities/MemoizedAngle.test.js.map +0 -1
  401. package/dist/esm/Entities/MemoizedBoolean.test.js +0 -32
  402. package/dist/esm/Entities/MemoizedBoolean.test.js.map +0 -1
  403. package/dist/esm/Entities/MemoizedColor.test.js +0 -30
  404. package/dist/esm/Entities/MemoizedColor.test.js.map +0 -1
  405. package/dist/esm/Entities/MemoizedNumber.test.js +0 -27
  406. package/dist/esm/Entities/MemoizedNumber.test.js.map +0 -1
  407. package/dist/esm/Entities/MemoizedQuaternion.test.js +0 -30
  408. package/dist/esm/Entities/MemoizedQuaternion.test.js.map +0 -1
  409. package/dist/esm/Entities/MemoizedString.test.js +0 -27
  410. package/dist/esm/Entities/MemoizedString.test.js.map +0 -1
  411. package/dist/esm/Entities/MemoizedVector2.test.js +0 -30
  412. package/dist/esm/Entities/MemoizedVector2.test.js.map +0 -1
  413. package/dist/esm/Entities/MemoizedVector3.test.js +0 -30
  414. package/dist/esm/Entities/MemoizedVector3.test.js.map +0 -1
  415. package/dist/esm/Entities/ObservableEntity.test.js +0 -23
  416. package/dist/esm/Entities/ObservableEntity.test.js.map +0 -1
  417. package/dist/esm/Entities/ObserverList.test.js +0 -42
  418. package/dist/esm/Entities/ObserverList.test.js.map +0 -1
  419. package/dist/esm/Entities/RangedNumber.test.js +0 -94
  420. package/dist/esm/Entities/RangedNumber.test.js.map +0 -1
  421. package/dist/esm/Utilities/LengthConverters.test.js +0 -22
  422. package/dist/esm/Utilities/LengthConverters.test.js.map +0 -1
  423. package/dist/esm/Utilities/LerpNumber.test.js +0 -88
  424. package/dist/esm/Utilities/LerpNumber.test.js.map +0 -1
  425. package/dist/esm/Utilities/addAlphaToHex.test.js +0 -32
  426. package/dist/esm/Utilities/addAlphaToHex.test.js.map +0 -1
  427. package/dist/esm/Utilities/alphaToHex.test.js +0 -73
  428. package/dist/esm/Utilities/alphaToHex.test.js.map +0 -1
  429. package/dist/esm/Utilities/degreesToRadians.test.js +0 -7
  430. package/dist/esm/Utilities/degreesToRadians.test.js.map +0 -1
  431. package/dist/esm/Utilities/easeFunctions.test.js +0 -207
  432. package/dist/esm/Utilities/easeFunctions.test.js.map +0 -1
  433. package/dist/esm/Utilities/interpolateNumber.test.js +0 -24
  434. package/dist/esm/Utilities/interpolateNumber.test.js.map +0 -1
  435. package/dist/esm/ValueObjects/Angle.test.js +0 -26
  436. package/dist/esm/ValueObjects/Angle.test.js.map +0 -1
  437. package/dist/esm/ValueObjects/Color.test.js +0 -145
  438. package/dist/esm/ValueObjects/Color.test.js.map +0 -1
  439. package/dist/esm/ValueObjects/LineSegment2D.test.js +0 -100
  440. package/dist/esm/ValueObjects/LineSegment2D.test.js.map +0 -1
  441. package/dist/esm/ValueObjects/Matrix.test.js +0 -383
  442. package/dist/esm/ValueObjects/Matrix.test.js.map +0 -1
  443. package/dist/esm/ValueObjects/ParametricLine.test.js +0 -124
  444. package/dist/esm/ValueObjects/ParametricLine.test.js.map +0 -1
  445. package/dist/esm/ValueObjects/ParametricPlane.test.js +0 -99
  446. package/dist/esm/ValueObjects/ParametricPlane.test.js.map +0 -1
  447. package/dist/esm/ValueObjects/Quaternion.test.js +0 -238
  448. package/dist/esm/ValueObjects/Quaternion.test.js.map +0 -1
  449. package/dist/esm/ValueObjects/Rectangle.test.js +0 -30
  450. package/dist/esm/ValueObjects/Rectangle.test.js.map +0 -1
  451. package/dist/esm/ValueObjects/Vector2.test.js +0 -134
  452. package/dist/esm/ValueObjects/Vector2.test.js.map +0 -1
  453. package/dist/esm/ValueObjects/Vector3.test.js +0 -186
  454. package/dist/esm/ValueObjects/Vector3.test.js.map +0 -1
  455. package/dist/esm/ValueObjects/Version.test.js +0 -308
  456. package/dist/esm/ValueObjects/Version.test.js.map +0 -1
  457. package/dist/types/AppObject/AppObject.test.d.ts +0 -7
  458. package/dist/types/AppObject/AppObject.test.d.ts.map +0 -1
  459. package/dist/types/AppObject/AppObjectComponent.test.d.ts +0 -2
  460. package/dist/types/AppObject/AppObjectComponent.test.d.ts.map +0 -1
  461. package/dist/types/AppObject/AppObjectEntity.test.d.ts +0 -2
  462. package/dist/types/AppObject/AppObjectEntity.test.d.ts.map +0 -1
  463. package/dist/types/AppObject/AppObjectEntityRepo.test.d.ts +0 -2
  464. package/dist/types/AppObject/AppObjectEntityRepo.test.d.ts.map +0 -1
  465. package/dist/types/AppObject/AppObjectPM.test.d.ts +0 -2
  466. package/dist/types/AppObject/AppObjectPM.test.d.ts.map +0 -1
  467. package/dist/types/AppObject/AppObjectRepo.test.d.ts +0 -2
  468. package/dist/types/AppObject/AppObjectRepo.test.d.ts.map +0 -1
  469. package/dist/types/AppObject/getSingletonComponent.test.d.ts +0 -2
  470. package/dist/types/AppObject/getSingletonComponent.test.d.ts.map +0 -1
  471. package/dist/types/Entities/MemoizedAngle.test.d.ts +0 -2
  472. package/dist/types/Entities/MemoizedAngle.test.d.ts.map +0 -1
  473. package/dist/types/Entities/MemoizedBoolean.test.d.ts +0 -2
  474. package/dist/types/Entities/MemoizedBoolean.test.d.ts.map +0 -1
  475. package/dist/types/Entities/MemoizedColor.test.d.ts +0 -2
  476. package/dist/types/Entities/MemoizedColor.test.d.ts.map +0 -1
  477. package/dist/types/Entities/MemoizedNumber.test.d.ts +0 -2
  478. package/dist/types/Entities/MemoizedNumber.test.d.ts.map +0 -1
  479. package/dist/types/Entities/MemoizedQuaternion.test.d.ts +0 -2
  480. package/dist/types/Entities/MemoizedQuaternion.test.d.ts.map +0 -1
  481. package/dist/types/Entities/MemoizedString.test.d.ts +0 -2
  482. package/dist/types/Entities/MemoizedString.test.d.ts.map +0 -1
  483. package/dist/types/Entities/MemoizedVector2.test.d.ts +0 -2
  484. package/dist/types/Entities/MemoizedVector2.test.d.ts.map +0 -1
  485. package/dist/types/Entities/MemoizedVector3.test.d.ts +0 -2
  486. package/dist/types/Entities/MemoizedVector3.test.d.ts.map +0 -1
  487. package/dist/types/Entities/ObservableEntity.test.d.ts +0 -2
  488. package/dist/types/Entities/ObservableEntity.test.d.ts.map +0 -1
  489. package/dist/types/Entities/ObserverList.test.d.ts +0 -2
  490. package/dist/types/Entities/ObserverList.test.d.ts.map +0 -1
  491. package/dist/types/Entities/RangedNumber.test.d.ts +0 -2
  492. package/dist/types/Entities/RangedNumber.test.d.ts.map +0 -1
  493. package/dist/types/Utilities/LengthConverters.test.d.ts +0 -2
  494. package/dist/types/Utilities/LengthConverters.test.d.ts.map +0 -1
  495. package/dist/types/Utilities/LerpNumber.test.d.ts +0 -2
  496. package/dist/types/Utilities/LerpNumber.test.d.ts.map +0 -1
  497. package/dist/types/Utilities/addAlphaToHex.test.d.ts +0 -2
  498. package/dist/types/Utilities/addAlphaToHex.test.d.ts.map +0 -1
  499. package/dist/types/Utilities/alphaToHex.test.d.ts +0 -2
  500. package/dist/types/Utilities/alphaToHex.test.d.ts.map +0 -1
  501. package/dist/types/Utilities/degreesToRadians.test.d.ts +0 -2
  502. package/dist/types/Utilities/degreesToRadians.test.d.ts.map +0 -1
  503. package/dist/types/Utilities/easeFunctions.test.d.ts +0 -2
  504. package/dist/types/Utilities/easeFunctions.test.d.ts.map +0 -1
  505. package/dist/types/Utilities/interpolateNumber.test.d.ts +0 -2
  506. package/dist/types/Utilities/interpolateNumber.test.d.ts.map +0 -1
  507. package/dist/types/ValueObjects/Angle.test.d.ts +0 -2
  508. package/dist/types/ValueObjects/Angle.test.d.ts.map +0 -1
  509. package/dist/types/ValueObjects/Color.test.d.ts +0 -2
  510. package/dist/types/ValueObjects/Color.test.d.ts.map +0 -1
  511. package/dist/types/ValueObjects/LineSegment2D.test.d.ts +0 -2
  512. package/dist/types/ValueObjects/LineSegment2D.test.d.ts.map +0 -1
  513. package/dist/types/ValueObjects/Matrix.test.d.ts +0 -2
  514. package/dist/types/ValueObjects/Matrix.test.d.ts.map +0 -1
  515. package/dist/types/ValueObjects/ParametricLine.test.d.ts +0 -2
  516. package/dist/types/ValueObjects/ParametricLine.test.d.ts.map +0 -1
  517. package/dist/types/ValueObjects/ParametricPlane.test.d.ts +0 -2
  518. package/dist/types/ValueObjects/ParametricPlane.test.d.ts.map +0 -1
  519. package/dist/types/ValueObjects/Quaternion.test.d.ts +0 -2
  520. package/dist/types/ValueObjects/Quaternion.test.d.ts.map +0 -1
  521. package/dist/types/ValueObjects/Rectangle.test.d.ts +0 -2
  522. package/dist/types/ValueObjects/Rectangle.test.d.ts.map +0 -1
  523. package/dist/types/ValueObjects/Vector2.test.d.ts +0 -2
  524. package/dist/types/ValueObjects/Vector2.test.d.ts.map +0 -1
  525. package/dist/types/ValueObjects/Vector3.test.d.ts +0 -2
  526. package/dist/types/ValueObjects/Vector3.test.d.ts.map +0 -1
  527. package/dist/types/ValueObjects/Version.test.d.ts +0 -2
  528. package/dist/types/ValueObjects/Version.test.d.ts.map +0 -1
@@ -0,0 +1,44 @@
1
+ /**
2
+ * toggleExampleBoolean.ts
3
+ *
4
+ * This file demonstrates how to implement a Controller function for a singleton UC.
5
+ * This controller provides a simplified API for UI components to interact with
6
+ * the ToggleExampleBooleanUC singleton, handling the details of finding the UC
7
+ * and calling its method.
8
+ *
9
+ * Key concepts:
10
+ * - Controllers for singleton UCs don't need an ID parameter
11
+ * - They access the singleton UC using its static get() method
12
+ * - They handle error cases and provide appropriate feedback
13
+ * - They simplify the API for UI components
14
+ *
15
+ * Usage pattern (React example):
16
+ * ```typescript
17
+ * // In a React component
18
+ * function ToggleButton({ appObjects }) {
19
+ * return (
20
+ * <button onClick={() => toggleExampleBoolean(appObjects)}>
21
+ * Toggle
22
+ * </button>
23
+ * );
24
+ * }
25
+ * ```
26
+ */
27
+ import { ToggleExampleBooleanUC } from "../UCs/ToggleExampleBooleanUC";
28
+ /**
29
+ * Controller function to toggle the boolean property of the SingletonEntityExample
30
+ *
31
+ * @param appObjects The application's AppObjectRepo
32
+ */
33
+ export function toggleExampleBoolean(appObjects) {
34
+ // Access the singleton UC using its static get method
35
+ const uc = ToggleExampleBooleanUC.get(appObjects);
36
+ // Handle the case where the UC doesn't exist yet
37
+ if (!uc) {
38
+ appObjects.submitWarning("toggleExampleBoolean", "Unable to find ToggleExampleBooleanUC");
39
+ return;
40
+ }
41
+ // Call the UC method to perform the operation
42
+ uc.toggleExampleBoolean();
43
+ }
44
+ //# sourceMappingURL=toggleExampleBoolean.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toggleExampleBoolean.js","sourceRoot":"","sources":["../../../../src/ExampleFeature/Controllers/toggleExampleBoolean.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAGH,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AAEvE;;;;GAIG;AACH,MAAM,UAAU,oBAAoB,CAAC,UAAyB;IAC5D,sDAAsD;IACtD,MAAM,EAAE,GAAG,sBAAsB,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;IAElD,iDAAiD;IACjD,IAAI,CAAC,EAAE,EAAE,CAAC;QACR,UAAU,CAAC,aAAa,CACtB,sBAAsB,EACtB,uCAAuC,CACxC,CAAC;QACF,OAAO;IACT,CAAC;IAED,8CAA8C;IAC9C,EAAE,CAAC,oBAAoB,EAAE,CAAC;AAC5B,CAAC","sourcesContent":["/**\r\n * toggleExampleBoolean.ts\r\n * \r\n * This file demonstrates how to implement a Controller function for a singleton UC.\r\n * This controller provides a simplified API for UI components to interact with \r\n * the ToggleExampleBooleanUC singleton, handling the details of finding the UC\r\n * and calling its method.\r\n * \r\n * Key concepts:\r\n * - Controllers for singleton UCs don't need an ID parameter\r\n * - They access the singleton UC using its static get() method\r\n * - They handle error cases and provide appropriate feedback\r\n * - They simplify the API for UI components\r\n * \r\n * Usage pattern (React example):\r\n * ```typescript\r\n * // In a React component\r\n * function ToggleButton({ appObjects }) {\r\n * return (\r\n * <button onClick={() => toggleExampleBoolean(appObjects)}>\r\n * Toggle\r\n * </button>\r\n * );\r\n * }\r\n * ```\r\n */\r\n\r\nimport { AppObjectRepo } from \"../../AppObject\";\r\nimport { ToggleExampleBooleanUC } from \"../UCs/ToggleExampleBooleanUC\";\r\n\r\n/**\r\n * Controller function to toggle the boolean property of the SingletonEntityExample\r\n * \r\n * @param appObjects The application's AppObjectRepo\r\n */\r\nexport function toggleExampleBoolean(appObjects: AppObjectRepo) {\r\n // Access the singleton UC using its static get method\r\n const uc = ToggleExampleBooleanUC.get(appObjects);\r\n \r\n // Handle the case where the UC doesn't exist yet\r\n if (!uc) {\r\n appObjects.submitWarning(\r\n \"toggleExampleBoolean\",\r\n \"Unable to find ToggleExampleBooleanUC\"\r\n );\r\n return;\r\n }\r\n\r\n // Call the UC method to perform the operation\r\n uc.toggleExampleBoolean();\r\n}\r\n"]}
@@ -0,0 +1,85 @@
1
+ /**
2
+ * ExampleEntity.ts
3
+ *
4
+ * This file demonstrates how to implement a standard (non-singleton) entity in the application.
5
+ * Entities store and manage data, track state changes, and notify observers when changes occur.
6
+ *
7
+ * Key concepts:
8
+ * - Entity classes extend AppObjectEntity
9
+ * - They provide access to data properties
10
+ * - They use Memoized types (MemoizedString, MemoizedBoolean, etc.) to track changes
11
+ * - They notify observers when properties change
12
+ *
13
+ * Usage pattern:
14
+ * 1. Get or create an entity instance using getById, get, or addIfMissing
15
+ * 2. Access or modify properties via getters/setters
16
+ * 3. Register change observers to react to property updates
17
+ */
18
+ import { AppObjectEntity } from "../../AppObject";
19
+ import { MemoizedString } from "../../Entities/MemoizedString";
20
+ /**
21
+ * ExampleEntity represents a basic entity with a string property.
22
+ * Abstract class provides the interface and static helper methods.
23
+ */
24
+ export class ExampleEntity extends AppObjectEntity {
25
+ /**
26
+ * Retrieves an ExampleEntity component from an AppObject
27
+ * @param appObj The AppObject to get the component from
28
+ * @returns The ExampleEntity component or undefined if not found
29
+ */
30
+ static get(appObj) {
31
+ return appObj.getComponent(this.type);
32
+ }
33
+ /**
34
+ * Retrieves an ExampleEntity by its parent AppObject's ID
35
+ * @param id The ID of the parent AppObject
36
+ * @param appObjects The AppObjectRepo to search in
37
+ * @returns The ExampleEntity component or undefined if not found
38
+ */
39
+ static getById(id, appObjects) {
40
+ return appObjects.get(id)?.getComponent(this.type);
41
+ }
42
+ /**
43
+ * Ensures an ExampleEntity exists on the AppObject, creating one if needed
44
+ * @param appObj The AppObject to check/add the component to
45
+ * @returns The existing or newly created ExampleEntity
46
+ */
47
+ static addIfMissing(appObj) {
48
+ const existing = appObj.getComponent(this.type);
49
+ if (existing) {
50
+ return existing;
51
+ }
52
+ else {
53
+ return makeExampleEntity(appObj);
54
+ }
55
+ }
56
+ }
57
+ /** Unique type identifier for this component */
58
+ ExampleEntity.type = "ExampleEntityType";
59
+ /**
60
+ * Factory function to create a new ExampleEntity
61
+ * @param appObject The AppObject to attach the entity to
62
+ * @returns A new ExampleEntity instance
63
+ */
64
+ export function makeExampleEntity(appObject) {
65
+ return new ExampleEntityImp(appObject);
66
+ }
67
+ /**
68
+ * Concrete implementation of ExampleEntity
69
+ * This private class handles the actual implementation details
70
+ */
71
+ class ExampleEntityImp extends ExampleEntity {
72
+ // Property accessors that use the memoized value
73
+ get aStringProperty() {
74
+ return this.memoizedIsAuthoring.val;
75
+ }
76
+ set aStringProperty(val) {
77
+ this.memoizedIsAuthoring.val = val;
78
+ }
79
+ constructor(appObject) {
80
+ super(appObject, ExampleEntity.type);
81
+ // MemoizedString tracks changes to the string value and calls notifyOnChange when updated
82
+ this.memoizedIsAuthoring = new MemoizedString("", this.notifyOnChange);
83
+ }
84
+ }
85
+ //# sourceMappingURL=ExampleEntity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExampleEntity.js","sourceRoot":"","sources":["../../../../src/ExampleFeature/Entities/ExampleEntity.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAEL,eAAe,EAEhB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAE/D;;;GAGG;AACH,MAAM,OAAgB,aAAc,SAAQ,eAAe;IAQzD;;;;OAIG;IACH,MAAM,CAAC,GAAG,CAAC,MAAiB;QAC1B,OAAO,MAAM,CAAC,YAAY,CAAgB,IAAI,CAAC,IAAI,CAAC,CAAC;IACvD,CAAC;IAED;;;;;OAKG;IACH,MAAM,CAAC,OAAO,CACZ,EAAU,EACV,UAAyB;QAEzB,OAAO,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,YAAY,CAAgB,IAAI,CAAC,IAAI,CAAC,CAAC;IACpE,CAAC;IAED;;;;OAIG;IACH,MAAM,CAAC,YAAY,CAAC,MAAiB;QACnC,MAAM,QAAQ,GAAG,MAAM,CAAC,YAAY,CAAgB,IAAI,CAAC,IAAI,CAAC,CAAC;QAC/D,IAAI,QAAQ,EAAE,CAAC;YACb,OAAO,QAAQ,CAAC;QAClB,CAAC;aAAM,CAAC;YACN,OAAO,iBAAiB,CAAC,MAAM,CAAC,CAAC;QACnC,CAAC;IACH,CAAC;;AAzCD,gDAAgD;AAChC,kBAAI,GAAG,mBAAmB,CAAC;AA2C7C;;;;GAIG;AACH,MAAM,UAAU,iBAAiB,CAC/B,SAAoB;IAEpB,OAAO,IAAI,gBAAgB,CAAC,SAAS,CAAC,CAAC;AACzC,CAAC;AAED;;;GAGG;AACH,MAAM,gBAAiB,SAAQ,aAAa;IAI1C,iDAAiD;IACjD,IAAI,eAAe;QACjB,OAAO,IAAI,CAAC,mBAAmB,CAAC,GAAG,CAAC;IACtC,CAAC;IAED,IAAI,eAAe,CAAC,GAAW;QAC7B,IAAI,CAAC,mBAAmB,CAAC,GAAG,GAAG,GAAG,CAAC;IACrC,CAAC;IAED,YAAY,SAAoB;QAC9B,KAAK,CAAC,SAAS,EAAE,aAAa,CAAC,IAAI,CAAC,CAAC;QAbvC,0FAA0F;QAClF,wBAAmB,GAAG,IAAI,cAAc,CAAC,EAAE,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;IAa1E,CAAC;CACF","sourcesContent":["/**\r\n * ExampleEntity.ts\r\n * \r\n * This file demonstrates how to implement a standard (non-singleton) entity in the application.\r\n * Entities store and manage data, track state changes, and notify observers when changes occur.\r\n * \r\n * Key concepts:\r\n * - Entity classes extend AppObjectEntity\r\n * - They provide access to data properties\r\n * - They use Memoized types (MemoizedString, MemoizedBoolean, etc.) to track changes\r\n * - They notify observers when properties change\r\n * \r\n * Usage pattern:\r\n * 1. Get or create an entity instance using getById, get, or addIfMissing\r\n * 2. Access or modify properties via getters/setters\r\n * 3. Register change observers to react to property updates\r\n */\r\n\r\nimport {\r\n AppObject,\r\n AppObjectEntity,\r\n AppObjectRepo\r\n} from \"../../AppObject\";\r\nimport { MemoizedString } from \"../../Entities/MemoizedString\";\r\n\r\n/**\r\n * ExampleEntity represents a basic entity with a string property.\r\n * Abstract class provides the interface and static helper methods.\r\n */\r\nexport abstract class ExampleEntity extends AppObjectEntity {\r\n /** Unique type identifier for this component */\r\n static readonly type = \"ExampleEntityType\";\r\n\r\n /** String property accessor methods that must be implemented */\r\n abstract get aStringProperty(): string;\r\n abstract set aStringProperty(val: string);\r\n\r\n /**\r\n * Retrieves an ExampleEntity component from an AppObject\r\n * @param appObj The AppObject to get the component from\r\n * @returns The ExampleEntity component or undefined if not found\r\n */\r\n static get(appObj: AppObject): ExampleEntity | undefined {\r\n return appObj.getComponent<ExampleEntity>(this.type);\r\n }\r\n\r\n /**\r\n * Retrieves an ExampleEntity by its parent AppObject's ID\r\n * @param id The ID of the parent AppObject\r\n * @param appObjects The AppObjectRepo to search in\r\n * @returns The ExampleEntity component or undefined if not found\r\n */\r\n static getById(\r\n id: string,\r\n appObjects: AppObjectRepo\r\n ): ExampleEntity | undefined {\r\n return appObjects.get(id)?.getComponent<ExampleEntity>(this.type);\r\n }\r\n\r\n /**\r\n * Ensures an ExampleEntity exists on the AppObject, creating one if needed\r\n * @param appObj The AppObject to check/add the component to\r\n * @returns The existing or newly created ExampleEntity\r\n */\r\n static addIfMissing(appObj: AppObject): ExampleEntity {\r\n const existing = appObj.getComponent<ExampleEntity>(this.type);\r\n if (existing) {\r\n return existing;\r\n } else {\r\n return makeExampleEntity(appObj);\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * Factory function to create a new ExampleEntity\r\n * @param appObject The AppObject to attach the entity to\r\n * @returns A new ExampleEntity instance\r\n */\r\nexport function makeExampleEntity(\r\n appObject: AppObject\r\n): ExampleEntity {\r\n return new ExampleEntityImp(appObject);\r\n}\r\n\r\n/**\r\n * Concrete implementation of ExampleEntity\r\n * This private class handles the actual implementation details\r\n */\r\nclass ExampleEntityImp extends ExampleEntity {\r\n // MemoizedString tracks changes to the string value and calls notifyOnChange when updated\r\n private memoizedIsAuthoring = new MemoizedString(\"\", this.notifyOnChange);\r\n \r\n // Property accessors that use the memoized value\r\n get aStringProperty() {\r\n return this.memoizedIsAuthoring.val;\r\n }\r\n \r\n set aStringProperty(val: string) {\r\n this.memoizedIsAuthoring.val = val;\r\n }\r\n\r\n constructor(appObject: AppObject) {\r\n super(appObject, ExampleEntity.type);\r\n }\r\n}\r\n"]}
@@ -0,0 +1,108 @@
1
+ /**
2
+ * ExampleRepo.ts
3
+ *
4
+ * This file demonstrates how to implement a repository to manage collections of entities.
5
+ * Repositories are responsible for creating, retrieving, and deleting entities.
6
+ *
7
+ * Key concepts:
8
+ * - Repositories extend AppObjectEntityRepo<T> where T is the entity type
9
+ * - They provide methods to create and delete entities
10
+ * - They manage collections of entities and provide access to them
11
+ * - They can use custom entity factories to create specialized entities
12
+ *
13
+ * Usage pattern:
14
+ * 1. Get or create a repository using getById, get, or addIfMissing
15
+ * 2. Use the repository to create new entities
16
+ * 3. Access entities through the repository's getters
17
+ * 4. Delete entities through the repository when they're no longer needed
18
+ */
19
+ import { AppObjectEntityRepo } from "../../AppObject";
20
+ import { generateUniqueID } from "../../Utilities/generateUniqueID";
21
+ import { makeExampleEntity } from "./ExampleEntity";
22
+ /**
23
+ * ExampleRepo manages a collection of ExampleEntity instances.
24
+ * Abstract class provides the interface and static helper methods.
25
+ */
26
+ export class ExampleRepo extends AppObjectEntityRepo {
27
+ /**
28
+ * Retrieves an ExampleRepo component from an AppObject
29
+ * @param appObj The AppObject to get the component from
30
+ * @returns The ExampleRepo component or undefined if not found
31
+ */
32
+ static get(appObj) {
33
+ return appObj.getComponent(this.type);
34
+ }
35
+ /**
36
+ * Retrieves an ExampleRepo by its parent AppObject's ID
37
+ * @param id The ID of the parent AppObject
38
+ * @param appObjects The AppObjectRepo to search in
39
+ * @returns The ExampleRepo component or undefined if not found
40
+ */
41
+ static getById(id, appObjects) {
42
+ return appObjects.get(id)?.getComponent(this.type);
43
+ }
44
+ /**
45
+ * Ensures an ExampleRepo exists on the AppObject, creating one if needed
46
+ * @param appObject The AppObject to check/add the component to
47
+ * @returns The existing or newly created ExampleRepo
48
+ */
49
+ static addIfMissing(appObject) {
50
+ const existing = appObject.getComponent(ExampleRepo.type);
51
+ if (existing) {
52
+ return existing;
53
+ }
54
+ else {
55
+ return makeExampleRepo(appObject);
56
+ }
57
+ }
58
+ }
59
+ /** Unique type identifier for this component */
60
+ ExampleRepo.type = "ExampleRepoType";
61
+ /**
62
+ * Factory function to create a new ExampleRepo
63
+ * @param appObject The AppObject to attach the repo to
64
+ * @returns A new ExampleRepo instance
65
+ */
66
+ export function makeExampleRepo(appObject) {
67
+ return new ExampleRepoImp(appObject);
68
+ }
69
+ /**
70
+ * Concrete implementation of ExampleRepo
71
+ * This private class handles the actual implementation details
72
+ */
73
+ class ExampleRepoImp extends ExampleRepo {
74
+ /**
75
+ * Deletes an ExampleEntity from the repository by its AppObject ID
76
+ * @param id The ID of the entity's AppObject
77
+ */
78
+ deleteExampleEntity(id) {
79
+ const entity = this.getForAppObject(id);
80
+ if (!entity)
81
+ return;
82
+ entity.appObject.dispose();
83
+ this.removeForAppObject(id);
84
+ }
85
+ constructor(appObject) {
86
+ super(appObject, ExampleRepo.type);
87
+ /**
88
+ * Creates a new ExampleEntity and adds it to the repository
89
+ * @param id Optional ID for the entity's AppObject (generates one if not provided)
90
+ * @returns The newly created ExampleEntity
91
+ */
92
+ this.createExampleEntity = (id) => {
93
+ const idToUse = id ?? generateUniqueID();
94
+ const entity = this.exampleEntityFactory(idToUse);
95
+ this.add(entity);
96
+ return entity;
97
+ };
98
+ /**
99
+ * Default factory implementation for creating ExampleEntity instances
100
+ * Can be overridden to create specialized entities
101
+ */
102
+ this.exampleEntityFactory = (id) => {
103
+ const ao = this.appObjects.getOrCreate(id);
104
+ return makeExampleEntity(ao);
105
+ };
106
+ }
107
+ }
108
+ //# sourceMappingURL=ExampleRepo.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExampleRepo.js","sourceRoot":"","sources":["../../../../src/ExampleFeature/Entities/ExampleRepo.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAEL,mBAAmB,EAEpB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AACpE,OAAO,EAAiB,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAKnE;;;GAGG;AACH,MAAM,OAAgB,WAAY,SAAQ,mBAAkC;IAa1E;;;;OAIG;IACH,MAAM,CAAC,GAAG,CAAC,MAAiB;QAC1B,OAAO,MAAM,CAAC,YAAY,CAAc,IAAI,CAAC,IAAI,CAAC,CAAC;IACrD,CAAC;IAED;;;;;OAKG;IACH,MAAM,CAAC,OAAO,CACZ,EAAU,EACV,UAAyB;QAEzB,OAAO,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,YAAY,CAAc,IAAI,CAAC,IAAI,CAAC,CAAC;IAClE,CAAC;IAED;;;;OAIG;IACH,MAAM,CAAC,YAAY,CAAC,SAAoB;QACtC,MAAM,QAAQ,GAAG,SAAS,CAAC,YAAY,CAAc,WAAW,CAAC,IAAI,CAAC,CAAC;QACvE,IAAI,QAAQ,EAAE,CAAC;YACb,OAAO,QAAQ,CAAC;QAClB,CAAC;aAAM,CAAC;YACN,OAAO,eAAe,CAAC,SAAS,CAAC,CAAC;QACpC,CAAC;IACH,CAAC;;AA9CD,gDAAgD;AAChC,gBAAI,GAAG,iBAAiB,CAAC;AAgD3C;;;;GAIG;AACH,MAAM,UAAU,eAAe,CAAC,SAAoB;IAClD,OAAO,IAAI,cAAc,CAAC,SAAS,CAAC,CAAC;AACvC,CAAC;AAED;;;GAGG;AACH,MAAM,cAAe,SAAQ,WAAW;IAatC;;;OAGG;IACH,mBAAmB,CAAC,EAAU;QAC5B,MAAM,MAAM,GAAG,IAAI,CAAC,eAAe,CAAC,EAAE,CAAC,CAAC;QACxC,IAAI,CAAC,MAAM;YAAE,OAAO;QAEpB,MAAM,CAAC,SAAS,CAAC,OAAO,EAAE,CAAC;QAC3B,IAAI,CAAC,kBAAkB,CAAC,EAAE,CAAC,CAAC;IAC9B,CAAC;IAWD,YAAY,SAAoB;QAC9B,KAAK,CAAC,SAAS,EAAE,WAAW,CAAC,IAAI,CAAC,CAAC;QAlCrC;;;;WAIG;QACH,wBAAmB,GAAG,CAAC,EAAsB,EAAiB,EAAE;YAC9D,MAAM,OAAO,GAAG,EAAE,IAAI,gBAAgB,EAAE,CAAC;YACzC,MAAM,MAAM,GAAG,IAAI,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAC;YAClD,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;YACjB,OAAO,MAAM,CAAC;QAChB,CAAC,CAAC;QAcF;;;WAGG;QACH,yBAAoB,GAAG,CAAC,EAAU,EAAiB,EAAE;YACnD,MAAM,EAAE,GAAG,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC;YAC3C,OAAO,iBAAiB,CAAC,EAAE,CAAC,CAAC;QAC/B,CAAC,CAAC;IAIF,CAAC;CACF","sourcesContent":["/**\r\n * ExampleRepo.ts\r\n * \r\n * This file demonstrates how to implement a repository to manage collections of entities.\r\n * Repositories are responsible for creating, retrieving, and deleting entities.\r\n * \r\n * Key concepts:\r\n * - Repositories extend AppObjectEntityRepo<T> where T is the entity type\r\n * - They provide methods to create and delete entities\r\n * - They manage collections of entities and provide access to them\r\n * - They can use custom entity factories to create specialized entities\r\n * \r\n * Usage pattern:\r\n * 1. Get or create a repository using getById, get, or addIfMissing\r\n * 2. Use the repository to create new entities\r\n * 3. Access entities through the repository's getters\r\n * 4. Delete entities through the repository when they're no longer needed\r\n */\r\n\r\nimport {\r\n AppObject,\r\n AppObjectEntityRepo,\r\n AppObjectRepo\r\n} from \"../../AppObject\";\r\nimport { generateUniqueID } from \"../../Utilities/generateUniqueID\";\r\nimport { ExampleEntity, makeExampleEntity } from \"./ExampleEntity\";\r\n\r\n/** Type definition for a factory function that creates ExampleEntity instances */\r\nexport type ExampleEntityFactory = (id: string) => ExampleEntity;\r\n\r\n/**\r\n * ExampleRepo manages a collection of ExampleEntity instances.\r\n * Abstract class provides the interface and static helper methods.\r\n */\r\nexport abstract class ExampleRepo extends AppObjectEntityRepo<ExampleEntity> {\r\n /** Unique type identifier for this component */\r\n static readonly type = \"ExampleRepoType\";\r\n\r\n /** Factory function used to create new entities */\r\n abstract exampleEntityFactory: ExampleEntityFactory;\r\n\r\n /** Creates a new entity with an optional ID */\r\n abstract createExampleEntity(id?: string): ExampleEntity;\r\n \r\n /** Deletes an entity by its AppObject ID */\r\n abstract deleteExampleEntity(id: string): void;\r\n\r\n /**\r\n * Retrieves an ExampleRepo component from an AppObject\r\n * @param appObj The AppObject to get the component from\r\n * @returns The ExampleRepo component or undefined if not found\r\n */\r\n static get(appObj: AppObject): ExampleRepo | undefined {\r\n return appObj.getComponent<ExampleRepo>(this.type);\r\n }\r\n\r\n /**\r\n * Retrieves an ExampleRepo by its parent AppObject's ID\r\n * @param id The ID of the parent AppObject\r\n * @param appObjects The AppObjectRepo to search in\r\n * @returns The ExampleRepo component or undefined if not found\r\n */\r\n static getById(\r\n id: string,\r\n appObjects: AppObjectRepo\r\n ): ExampleRepo | undefined {\r\n return appObjects.get(id)?.getComponent<ExampleRepo>(this.type);\r\n }\r\n\r\n /**\r\n * Ensures an ExampleRepo exists on the AppObject, creating one if needed\r\n * @param appObject The AppObject to check/add the component to\r\n * @returns The existing or newly created ExampleRepo\r\n */\r\n static addIfMissing(appObject: AppObject): ExampleRepo {\r\n const existing = appObject.getComponent<ExampleRepo>(ExampleRepo.type);\r\n if (existing) {\r\n return existing;\r\n } else {\r\n return makeExampleRepo(appObject);\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * Factory function to create a new ExampleRepo\r\n * @param appObject The AppObject to attach the repo to\r\n * @returns A new ExampleRepo instance\r\n */\r\nexport function makeExampleRepo(appObject: AppObject): ExampleRepo {\r\n return new ExampleRepoImp(appObject);\r\n}\r\n\r\n/**\r\n * Concrete implementation of ExampleRepo\r\n * This private class handles the actual implementation details\r\n */\r\nclass ExampleRepoImp extends ExampleRepo {\r\n /**\r\n * Creates a new ExampleEntity and adds it to the repository\r\n * @param id Optional ID for the entity's AppObject (generates one if not provided)\r\n * @returns The newly created ExampleEntity\r\n */\r\n createExampleEntity = (id: string | undefined): ExampleEntity => {\r\n const idToUse = id ?? generateUniqueID();\r\n const entity = this.exampleEntityFactory(idToUse);\r\n this.add(entity);\r\n return entity;\r\n };\r\n\r\n /**\r\n * Deletes an ExampleEntity from the repository by its AppObject ID\r\n * @param id The ID of the entity's AppObject\r\n */\r\n deleteExampleEntity(id: string): void {\r\n const entity = this.getForAppObject(id);\r\n if (!entity) return;\r\n\r\n entity.appObject.dispose();\r\n this.removeForAppObject(id);\r\n }\r\n\r\n /**\r\n * Default factory implementation for creating ExampleEntity instances\r\n * Can be overridden to create specialized entities\r\n */\r\n exampleEntityFactory = (id: string): ExampleEntity => {\r\n const ao = this.appObjects.getOrCreate(id);\r\n return makeExampleEntity(ao);\r\n };\r\n\r\n constructor(appObject: AppObject) {\r\n super(appObject, ExampleRepo.type);\r\n }\r\n}\r\n"]}
@@ -0,0 +1,64 @@
1
+ /**
2
+ * ExampleSingletonEntity.ts
3
+ *
4
+ * This file demonstrates how to implement a singleton entity in the application.
5
+ * Singleton entities are special entities that exist only once in the application
6
+ * and can be accessed globally from anywhere.
7
+ *
8
+ * Key concepts:
9
+ * - Singleton entities extend AppObjectEntity like regular entities
10
+ * - They register themselves as singletons with appObjects.registerSingleton()
11
+ * - They're accessed through a static get() method using getSingletonComponent()
12
+ * - There's only one instance of a singleton entity in the entire application
13
+ *
14
+ * Usage pattern:
15
+ * 1. Access the singleton entity using the static get() method
16
+ * 2. Access or modify properties via getters/setters
17
+ * 3. Register change observers to react to property updates
18
+ */
19
+ import { AppObjectEntity } from "../../AppObject";
20
+ import { getSingletonComponent } from "../../AppObject/getSingletonComponent";
21
+ import { MemoizedBoolean } from "../../Entities/MemoizedBoolean";
22
+ /**
23
+ * SingletonEntityExample represents a global entity with a boolean property.
24
+ * As a singleton, only one instance exists in the application.
25
+ */
26
+ export class SingletonEntityExample extends AppObjectEntity {
27
+ }
28
+ /** Unique type identifier for this component */
29
+ SingletonEntityExample.type = "SingletonEntityExampleType";
30
+ /**
31
+ * Global accessor for the singleton entity
32
+ * @param appObjects The AppObjectRepo to search in
33
+ * @returns The singleton entity or undefined if not created yet
34
+ */
35
+ SingletonEntityExample.get = (appObjects) => getSingletonComponent(SingletonEntityExample.type, appObjects);
36
+ /**
37
+ * Factory function to create a new SingletonEntityExample
38
+ * @param appObject The AppObject to attach the entity to
39
+ * @returns A new SingletonEntityExample instance
40
+ */
41
+ export function makeSingletonEntityExample(appObject) {
42
+ return new SingletonEntityExampleImp(appObject);
43
+ }
44
+ /**
45
+ * Concrete implementation of SingletonEntityExample
46
+ * This private class handles the actual implementation details
47
+ */
48
+ class SingletonEntityExampleImp extends SingletonEntityExample {
49
+ // Property accessors that use the memoized value
50
+ get aBoolProperty() {
51
+ return this.memoizedIsAuthoring.val;
52
+ }
53
+ set aBoolProperty(val) {
54
+ this.memoizedIsAuthoring.val = val;
55
+ }
56
+ constructor(appObject) {
57
+ super(appObject, SingletonEntityExample.type);
58
+ // MemoizedBoolean tracks changes to the boolean value and calls notifyOnChange when updated
59
+ this.memoizedIsAuthoring = new MemoizedBoolean(false, this.notifyOnChange);
60
+ // Register this entity as a singleton so it can be accessed globally
61
+ this.appObjects.registerSingleton(this);
62
+ }
63
+ }
64
+ //# sourceMappingURL=ExampleSingletonEntity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExampleSingletonEntity.js","sourceRoot":"","sources":["../../../../src/ExampleFeature/Entities/ExampleSingletonEntity.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAEL,eAAe,EAEhB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,qBAAqB,EAAE,MAAM,uCAAuC,CAAC;AAC9E,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAEjE;;;GAGG;AACH,MAAM,OAAgB,sBAAuB,SAAQ,eAAe;;AAClE,gDAAgD;AAChC,2BAAI,GAAG,4BAA4B,CAAC;AAMpD;;;;GAIG;AACI,0BAAG,GAAG,CACX,UAAyB,EACW,EAAE,CACtC,qBAAqB,CAAC,sBAAsB,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;AAGnE;;;;GAIG;AACH,MAAM,UAAU,0BAA0B,CACxC,SAAoB;IAEpB,OAAO,IAAI,yBAAyB,CAAC,SAAS,CAAC,CAAC;AAClD,CAAC;AAED;;;GAGG;AACH,MAAM,yBAA0B,SAAQ,sBAAsB;IAI5D,iDAAiD;IACjD,IAAI,aAAa;QACf,OAAO,IAAI,CAAC,mBAAmB,CAAC,GAAG,CAAC;IACtC,CAAC;IAED,IAAI,aAAa,CAAC,GAAY;QAC5B,IAAI,CAAC,mBAAmB,CAAC,GAAG,GAAG,GAAG,CAAC;IACrC,CAAC;IAED,YAAY,SAAoB;QAC9B,KAAK,CAAC,SAAS,EAAE,sBAAsB,CAAC,IAAI,CAAC,CAAC;QAbhD,4FAA4F;QACpF,wBAAmB,GAAG,IAAI,eAAe,CAAC,KAAK,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;QAa5E,qEAAqE;QACrE,IAAI,CAAC,UAAU,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC;IAC1C,CAAC;CACF","sourcesContent":["/**\r\n * ExampleSingletonEntity.ts\r\n * \r\n * This file demonstrates how to implement a singleton entity in the application.\r\n * Singleton entities are special entities that exist only once in the application\r\n * and can be accessed globally from anywhere.\r\n * \r\n * Key concepts:\r\n * - Singleton entities extend AppObjectEntity like regular entities\r\n * - They register themselves as singletons with appObjects.registerSingleton()\r\n * - They're accessed through a static get() method using getSingletonComponent()\r\n * - There's only one instance of a singleton entity in the entire application\r\n * \r\n * Usage pattern:\r\n * 1. Access the singleton entity using the static get() method\r\n * 2. Access or modify properties via getters/setters\r\n * 3. Register change observers to react to property updates\r\n */\r\n\r\nimport {\r\n AppObject,\r\n AppObjectEntity,\r\n AppObjectRepo\r\n} from \"../../AppObject\";\r\nimport { getSingletonComponent } from \"../../AppObject/getSingletonComponent\";\r\nimport { MemoizedBoolean } from \"../../Entities/MemoizedBoolean\";\r\n\r\n/**\r\n * SingletonEntityExample represents a global entity with a boolean property.\r\n * As a singleton, only one instance exists in the application.\r\n */\r\nexport abstract class SingletonEntityExample extends AppObjectEntity {\r\n /** Unique type identifier for this component */\r\n static readonly type = \"SingletonEntityExampleType\";\r\n\r\n /** Boolean property accessor methods that must be implemented */\r\n abstract get aBoolProperty(): boolean;\r\n abstract set aBoolProperty(val: boolean);\r\n\r\n /**\r\n * Global accessor for the singleton entity\r\n * @param appObjects The AppObjectRepo to search in\r\n * @returns The singleton entity or undefined if not created yet\r\n */\r\n static get = (\r\n appObjects: AppObjectRepo\r\n ): SingletonEntityExample | undefined =>\r\n getSingletonComponent(SingletonEntityExample.type, appObjects);\r\n}\r\n\r\n/**\r\n * Factory function to create a new SingletonEntityExample\r\n * @param appObject The AppObject to attach the entity to\r\n * @returns A new SingletonEntityExample instance\r\n */\r\nexport function makeSingletonEntityExample(\r\n appObject: AppObject\r\n): SingletonEntityExample {\r\n return new SingletonEntityExampleImp(appObject);\r\n}\r\n\r\n/**\r\n * Concrete implementation of SingletonEntityExample\r\n * This private class handles the actual implementation details\r\n */\r\nclass SingletonEntityExampleImp extends SingletonEntityExample {\r\n // MemoizedBoolean tracks changes to the boolean value and calls notifyOnChange when updated\r\n private memoizedIsAuthoring = new MemoizedBoolean(false, this.notifyOnChange);\r\n \r\n // Property accessors that use the memoized value\r\n get aBoolProperty() {\r\n return this.memoizedIsAuthoring.val;\r\n }\r\n \r\n set aBoolProperty(val: boolean) {\r\n this.memoizedIsAuthoring.val = val;\r\n }\r\n\r\n constructor(appObject: AppObject) {\r\n super(appObject, SingletonEntityExample.type);\r\n // Register this entity as a singleton so it can be accessed globally\r\n this.appObjects.registerSingleton(this);\r\n }\r\n}\r\n"]}
@@ -0,0 +1,4 @@
1
+ export * from "./ExampleEntity";
2
+ export * from "./ExampleRepo";
3
+ export * from "./ExampleSingletonEntity";
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/ExampleFeature/Entities/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,0BAA0B,CAAC","sourcesContent":["export * from \"./ExampleEntity\";\r\nexport * from \"./ExampleRepo\";\r\nexport * from \"./ExampleSingletonEntity\";\r\n"]}
@@ -0,0 +1,2 @@
1
+ export * from "./setupExampleFeature";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/ExampleFeature/Factory/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC","sourcesContent":["export * from \"./setupExampleFeature\";"]}
@@ -0,0 +1,26 @@
1
+ /**
2
+ * setupExampleFeature.ts
3
+ *
4
+ * This file provides a setup function to initialize the ExampleFeature components.
5
+ * It creates a dedicated AppObject for ExampleFeature and adds all required
6
+ * singleton components to it.
7
+ */
8
+ import { makeSingletonEntityExample } from "../Entities/ExampleSingletonEntity";
9
+ import { makeExampleSingletonPM } from "../PMs/ExampleSingletonPM";
10
+ import { makeToggleExampleBooleanUC } from "../UCs/ToggleExampleBooleanUC";
11
+ /**
12
+ * Sets up the ExampleFeature by creating an AppObject and attaching required components.
13
+ *
14
+ * @param appObjects - Repository of AppObjects to use for creating the feature
15
+ * @returns The singleton entity instance
16
+ */
17
+ export function setupExampleFeature(appObjects) {
18
+ // Create a dedicated AppObject for ExampleFeature
19
+ const appObject = appObjects.getOrCreate("ExampleFeature");
20
+ // Add singleton components to the AppObject
21
+ const entity = makeSingletonEntityExample(appObject);
22
+ makeExampleSingletonPM(appObject);
23
+ makeToggleExampleBooleanUC(appObject);
24
+ return entity;
25
+ }
26
+ //# sourceMappingURL=setupExampleFeature.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"setupExampleFeature.js","sourceRoot":"","sources":["../../../../src/ExampleFeature/Factory/setupExampleFeature.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAAE,0BAA0B,EAA0B,MAAM,oCAAoC,CAAC;AACxG,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AACnE,OAAO,EAAE,0BAA0B,EAAE,MAAM,+BAA+B,CAAC;AAE3E;;;;;GAKG;AACH,MAAM,UAAU,mBAAmB,CAAC,UAAyB;IAC3D,kDAAkD;IAClD,MAAM,SAAS,GAAG,UAAU,CAAC,WAAW,CAAC,gBAAgB,CAAC,CAAC;IAE3D,4CAA4C;IAC5C,MAAM,MAAM,GAAG,0BAA0B,CAAC,SAAS,CAAC,CAAC;IACrD,sBAAsB,CAAC,SAAS,CAAC,CAAC;IAClC,0BAA0B,CAAC,SAAS,CAAC,CAAC;IAEtC,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["/**\r\n * setupExampleFeature.ts\r\n * \r\n * This file provides a setup function to initialize the ExampleFeature components.\r\n * It creates a dedicated AppObject for ExampleFeature and adds all required\r\n * singleton components to it.\r\n */\r\n\r\nimport { AppObjectRepo } from \"../../AppObject\";\r\nimport { makeSingletonEntityExample, SingletonEntityExample } from \"../Entities/ExampleSingletonEntity\";\r\nimport { makeExampleSingletonPM } from \"../PMs/ExampleSingletonPM\";\r\nimport { makeToggleExampleBooleanUC } from \"../UCs/ToggleExampleBooleanUC\";\r\n\r\n/**\r\n * Sets up the ExampleFeature by creating an AppObject and attaching required components.\r\n * \r\n * @param appObjects - Repository of AppObjects to use for creating the feature\r\n * @returns The singleton entity instance\r\n */\r\nexport function setupExampleFeature(appObjects: AppObjectRepo): SingletonEntityExample {\r\n // Create a dedicated AppObject for ExampleFeature\r\n const appObject = appObjects.getOrCreate(\"ExampleFeature\");\r\n \r\n // Add singleton components to the AppObject\r\n const entity = makeSingletonEntityExample(appObject);\r\n makeExampleSingletonPM(appObject);\r\n makeToggleExampleBooleanUC(appObject);\r\n \r\n return entity;\r\n}"]}
@@ -0,0 +1,43 @@
1
+ /**
2
+ * MockEditExampleStringUC.ts
3
+ *
4
+ * This file demonstrates how to implement a mock UC for testing.
5
+ * Mock UCs extend the real UC classes but override their methods with test implementations.
6
+ * This allows tests to verify that the UC methods are called correctly without
7
+ * actually modifying entities or performing real operations.
8
+ *
9
+ * Key concepts:
10
+ * - Mock UCs extend the real UC classes
11
+ * - They override methods with test implementations (often empty or spy functions)
12
+ * - They're used in unit tests to isolate components from their dependencies
13
+ * - They help verify that methods are called with the correct parameters
14
+ *
15
+ * Usage pattern (in tests):
16
+ * ```typescript
17
+ * // In a test file
18
+ * const mockUC = new MockEditExampleStringUC(appObject);
19
+ * const spy = jest.spyOn(mockUC, 'editExampleString');
20
+ *
21
+ * // Call the function that should use the UC
22
+ * someFunction(appObject);
23
+ *
24
+ * // Verify the UC method was called correctly
25
+ * expect(spy).toHaveBeenCalledWith('expected value');
26
+ * ```
27
+ */
28
+ import { EditExampleStringUC } from "../UCs/EditExampleStringUC";
29
+ /**
30
+ * Mock implementation of EditExampleStringUC for testing
31
+ * Provides a no-op implementation of editExampleString that can be spied on in tests
32
+ */
33
+ export class MockEditExampleStringUC extends EditExampleStringUC {
34
+ constructor(appObject) {
35
+ super(appObject, EditExampleStringUC.type);
36
+ /**
37
+ * Mock implementation that does nothing
38
+ * In tests, this can be replaced with a Jest spy to track calls
39
+ */
40
+ this.editExampleString = (text) => { };
41
+ }
42
+ }
43
+ //# sourceMappingURL=MockEditExampleStringUC.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MockEditExampleStringUC.js","sourceRoot":"","sources":["../../../../src/ExampleFeature/Mocks/MockEditExampleStringUC.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAGH,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAEjE;;;GAGG;AACH,MAAM,OAAO,uBAAwB,SAAQ,mBAAmB;IAO9D,YAAY,SAAoB;QAC9B,KAAK,CAAC,SAAS,EAAE,mBAAmB,CAAC,IAAI,CAAC,CAAC;QAP7C;;;WAGG;QACH,sBAAiB,GAAG,CAAC,IAAY,EAAQ,EAAE,GAAE,CAAC,CAAC;IAI/C,CAAC;CACF","sourcesContent":["/**\r\n * MockEditExampleStringUC.ts\r\n * \r\n * This file demonstrates how to implement a mock UC for testing.\r\n * Mock UCs extend the real UC classes but override their methods with test implementations.\r\n * This allows tests to verify that the UC methods are called correctly without\r\n * actually modifying entities or performing real operations.\r\n * \r\n * Key concepts:\r\n * - Mock UCs extend the real UC classes\r\n * - They override methods with test implementations (often empty or spy functions)\r\n * - They're used in unit tests to isolate components from their dependencies\r\n * - They help verify that methods are called with the correct parameters\r\n * \r\n * Usage pattern (in tests):\r\n * ```typescript\r\n * // In a test file\r\n * const mockUC = new MockEditExampleStringUC(appObject);\r\n * const spy = jest.spyOn(mockUC, 'editExampleString');\r\n * \r\n * // Call the function that should use the UC\r\n * someFunction(appObject);\r\n * \r\n * // Verify the UC method was called correctly\r\n * expect(spy).toHaveBeenCalledWith('expected value');\r\n * ```\r\n */\r\n\r\nimport { AppObject } from \"../../AppObject\";\r\nimport { EditExampleStringUC } from \"../UCs/EditExampleStringUC\";\r\n\r\n/**\r\n * Mock implementation of EditExampleStringUC for testing\r\n * Provides a no-op implementation of editExampleString that can be spied on in tests\r\n */\r\nexport class MockEditExampleStringUC extends EditExampleStringUC {\r\n /**\r\n * Mock implementation that does nothing\r\n * In tests, this can be replaced with a Jest spy to track calls\r\n */\r\n editExampleString = (text: string): void => {};\r\n\r\n constructor(appObject: AppObject) {\r\n super(appObject, EditExampleStringUC.type);\r\n }\r\n}\r\n"]}
@@ -0,0 +1,44 @@
1
+ /**
2
+ * MockExamplePM.ts
3
+ *
4
+ * This file demonstrates how to implement a mock PM for testing.
5
+ * Mock PMs extend the real PM classes but override their methods with test implementations.
6
+ * This allows tests to verify PM behavior without depending on real entities.
7
+ *
8
+ * Key concepts:
9
+ * - Mock PMs extend the real PM classes
10
+ * - They override methods with test implementations
11
+ * - They're used in unit tests to isolate components from their dependencies
12
+ * - They help test adapters and other components that use PMs
13
+ *
14
+ * Usage pattern (in tests):
15
+ * ```typescript
16
+ * // In a test file
17
+ * const mockPM = new MockExamplePM(appObject);
18
+ * const addViewSpy = jest.spyOn(mockPM, 'addView');
19
+ *
20
+ * // Test the component that uses the PM
21
+ * adapter.subscribe(id, appObjects, setVM);
22
+ *
23
+ * // Verify the PM method was called correctly
24
+ * expect(addViewSpy).toHaveBeenCalledWith(setVM);
25
+ * ```
26
+ */
27
+ import { ExamplePM } from "../PMs/ExamplePM";
28
+ /**
29
+ * Mock implementation of ExamplePM for testing
30
+ * Provides simplified implementations of required methods
31
+ */
32
+ export class MockExamplePM extends ExamplePM {
33
+ constructor(appObject) {
34
+ super(appObject, ExamplePM.type);
35
+ /**
36
+ * Simplified implementation that always returns true
37
+ * This avoids the need to implement real comparison logic in tests
38
+ */
39
+ this.vmsAreEqual = () => {
40
+ return true;
41
+ };
42
+ }
43
+ }
44
+ //# sourceMappingURL=MockExamplePM.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MockExamplePM.js","sourceRoot":"","sources":["../../../../src/ExampleFeature/Mocks/MockExamplePM.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAGH,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE7C;;;GAGG;AACH,MAAM,OAAO,aAAc,SAAQ,SAAS;IAS1C,YAAY,SAAoB;QAC9B,KAAK,CAAC,SAAS,EAAE,SAAS,CAAC,IAAI,CAAC,CAAC;QATnC;;;WAGG;QACH,gBAAW,GAAG,GAAG,EAAE;YACjB,OAAO,IAAI,CAAC;QACd,CAAC,CAAC;IAIF,CAAC;CACF","sourcesContent":["/**\r\n * MockExamplePM.ts\r\n * \r\n * This file demonstrates how to implement a mock PM for testing.\r\n * Mock PMs extend the real PM classes but override their methods with test implementations.\r\n * This allows tests to verify PM behavior without depending on real entities.\r\n * \r\n * Key concepts:\r\n * - Mock PMs extend the real PM classes\r\n * - They override methods with test implementations\r\n * - They're used in unit tests to isolate components from their dependencies\r\n * - They help test adapters and other components that use PMs\r\n * \r\n * Usage pattern (in tests):\r\n * ```typescript\r\n * // In a test file\r\n * const mockPM = new MockExamplePM(appObject);\r\n * const addViewSpy = jest.spyOn(mockPM, 'addView');\r\n * \r\n * // Test the component that uses the PM\r\n * adapter.subscribe(id, appObjects, setVM);\r\n * \r\n * // Verify the PM method was called correctly\r\n * expect(addViewSpy).toHaveBeenCalledWith(setVM);\r\n * ```\r\n */\r\n\r\nimport { AppObject } from \"../../AppObject\";\r\nimport { ExamplePM } from \"../PMs/ExamplePM\";\r\n\r\n/**\r\n * Mock implementation of ExamplePM for testing\r\n * Provides simplified implementations of required methods\r\n */\r\nexport class MockExamplePM extends ExamplePM {\r\n /**\r\n * Simplified implementation that always returns true\r\n * This avoids the need to implement real comparison logic in tests\r\n */\r\n vmsAreEqual = () => {\r\n return true;\r\n };\r\n\r\n constructor(appObject: AppObject) {\r\n super(appObject, ExamplePM.type);\r\n }\r\n}\r\n"]}
@@ -0,0 +1,54 @@
1
+ /**
2
+ * MockExampleSingletonPM.ts
3
+ *
4
+ * This file demonstrates how to implement a mock singleton PM for testing.
5
+ * Mock singleton PMs extend the real singleton PM classes and provide helper
6
+ * functions to create and access them in tests.
7
+ *
8
+ * Key concepts:
9
+ * - Mock singleton PMs extend the real singleton PM classes
10
+ * - They override methods with test implementations
11
+ * - They include helper functions to create and access them in tests
12
+ * - They're used to test adapters and controllers that depend on singleton PMs
13
+ *
14
+ * Usage pattern (in tests):
15
+ * ```typescript
16
+ * // In a test file
17
+ * const mockPM = makeMockExampleSingletonPM(appObjects);
18
+ * const addViewSpy = jest.spyOn(mockPM, 'addView');
19
+ *
20
+ * // Test the component that uses the singleton PM
21
+ * adapter.subscribe(appObjects, setVM);
22
+ *
23
+ * // Verify the PM method was called correctly
24
+ * expect(addViewSpy).toHaveBeenCalledWith(setVM);
25
+ * ```
26
+ */
27
+ import { ExampleSingletonPM } from "../PMs/ExampleSingletonPM";
28
+ /**
29
+ * Mock implementation of ExampleSingletonPM for testing
30
+ * Provides simplified implementations of required methods
31
+ */
32
+ export class MockExampleSingletonPM extends ExampleSingletonPM {
33
+ constructor(appObject) {
34
+ super(appObject, ExampleSingletonPM.type);
35
+ /**
36
+ * Simplified implementation that always returns true
37
+ * This avoids the need to implement real comparison logic in tests
38
+ */
39
+ this.vmsAreEqual = () => {
40
+ return true;
41
+ };
42
+ }
43
+ }
44
+ /**
45
+ * Helper function to create and register a MockExampleSingletonPM
46
+ * Returns the created mock for use in tests
47
+ *
48
+ * @param appObjects The AppObjectRepo to register the mock with
49
+ * @returns A new MockExampleSingletonPM instance
50
+ */
51
+ export function makeMockExampleSingletonPM(appObjects) {
52
+ return new MockExampleSingletonPM(appObjects.getOrCreate("MockExampleSingletonPM"));
53
+ }
54
+ //# sourceMappingURL=MockExampleSingletonPM.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MockExampleSingletonPM.js","sourceRoot":"","sources":["../../../../src/ExampleFeature/Mocks/MockExampleSingletonPM.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAGH,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAE/D;;;GAGG;AACH,MAAM,OAAO,sBAAuB,SAAQ,kBAAkB;IAS5D,YAAY,SAAoB;QAC9B,KAAK,CAAC,SAAS,EAAE,kBAAkB,CAAC,IAAI,CAAC,CAAC;QAT5C;;;WAGG;QACH,gBAAW,GAAG,GAAG,EAAE;YACjB,OAAO,IAAI,CAAC;QACd,CAAC,CAAC;IAIF,CAAC;CACF;AAED;;;;;;GAMG;AACH,MAAM,UAAU,0BAA0B,CAAC,UAAyB;IAClE,OAAO,IAAI,sBAAsB,CAC/B,UAAU,CAAC,WAAW,CAAC,wBAAwB,CAAC,CACjD,CAAC;AACJ,CAAC","sourcesContent":["/**\r\n * MockExampleSingletonPM.ts\r\n * \r\n * This file demonstrates how to implement a mock singleton PM for testing.\r\n * Mock singleton PMs extend the real singleton PM classes and provide helper\r\n * functions to create and access them in tests.\r\n * \r\n * Key concepts:\r\n * - Mock singleton PMs extend the real singleton PM classes\r\n * - They override methods with test implementations\r\n * - They include helper functions to create and access them in tests\r\n * - They're used to test adapters and controllers that depend on singleton PMs\r\n * \r\n * Usage pattern (in tests):\r\n * ```typescript\r\n * // In a test file\r\n * const mockPM = makeMockExampleSingletonPM(appObjects);\r\n * const addViewSpy = jest.spyOn(mockPM, 'addView');\r\n * \r\n * // Test the component that uses the singleton PM\r\n * adapter.subscribe(appObjects, setVM);\r\n * \r\n * // Verify the PM method was called correctly\r\n * expect(addViewSpy).toHaveBeenCalledWith(setVM);\r\n * ```\r\n */\r\n\r\nimport { AppObject, AppObjectRepo } from \"../../AppObject\";\r\nimport { ExampleSingletonPM } from \"../PMs/ExampleSingletonPM\";\r\n\r\n/**\r\n * Mock implementation of ExampleSingletonPM for testing\r\n * Provides simplified implementations of required methods\r\n */\r\nexport class MockExampleSingletonPM extends ExampleSingletonPM {\r\n /**\r\n * Simplified implementation that always returns true\r\n * This avoids the need to implement real comparison logic in tests\r\n */\r\n vmsAreEqual = () => {\r\n return true;\r\n };\r\n\r\n constructor(appObject: AppObject) {\r\n super(appObject, ExampleSingletonPM.type);\r\n }\r\n}\r\n\r\n/**\r\n * Helper function to create and register a MockExampleSingletonPM\r\n * Returns the created mock for use in tests\r\n * \r\n * @param appObjects The AppObjectRepo to register the mock with\r\n * @returns A new MockExampleSingletonPM instance\r\n */\r\nexport function makeMockExampleSingletonPM(appObjects: AppObjectRepo) {\r\n return new MockExampleSingletonPM(\r\n appObjects.getOrCreate(\"MockExampleSingletonPM\")\r\n );\r\n}\r\n"]}
@@ -0,0 +1,52 @@
1
+ /**
2
+ * MockToggleExampleBooleanUC.ts
3
+ *
4
+ * This file demonstrates how to implement a mock singleton UC for testing.
5
+ * Mock singleton UCs extend the real UC classes and provide helper functions
6
+ * to create and register them as singletons for tests.
7
+ *
8
+ * Key concepts:
9
+ * - Mock singleton UCs extend the real UC classes
10
+ * - They override methods with test implementations
11
+ * - They register themselves as singletons just like the real UCs
12
+ * - They include helper functions to create them in tests
13
+ *
14
+ * Usage pattern (in tests):
15
+ * ```typescript
16
+ * // In a test file
17
+ * const mockUC = makeMockToggleExampleBooleanUC(appObject);
18
+ * const spy = jest.spyOn(mockUC, 'toggleExampleBoolean');
19
+ *
20
+ * // Call the function that should use the UC
21
+ * toggleExampleBoolean(appObjects);
22
+ *
23
+ * // Verify the UC method was called correctly
24
+ * expect(spy).toHaveBeenCalled();
25
+ * ```
26
+ */
27
+ import { ToggleExampleBooleanUC } from "../UCs/ToggleExampleBooleanUC";
28
+ /**
29
+ * Mock implementation of ToggleExampleBooleanUC for testing
30
+ * Provides a no-op implementation of toggleExampleBoolean that can be spied on in tests
31
+ */
32
+ export class MockToggleExampleBooleanUC extends ToggleExampleBooleanUC {
33
+ constructor(appObject) {
34
+ super(appObject, ToggleExampleBooleanUC.type);
35
+ /**
36
+ * Mock implementation that does nothing
37
+ * In tests, this can be replaced with a Jest spy to track calls
38
+ */
39
+ this.toggleExampleBoolean = () => { };
40
+ // Register as a singleton just like the real UC
41
+ this.appObjects.registerSingleton(this);
42
+ }
43
+ }
44
+ /**
45
+ * Helper factory function to create a mock ToggleExampleBooleanUC
46
+ * @param appObject The AppObject to attach the UC to
47
+ * @returns A new MockToggleExampleBooleanUC instance
48
+ */
49
+ export function makeMockToggleExampleBooleanUC(appObject) {
50
+ return new MockToggleExampleBooleanUC(appObject);
51
+ }
52
+ //# sourceMappingURL=MockToggleExampleBooleanUC.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MockToggleExampleBooleanUC.js","sourceRoot":"","sources":["../../../../src/ExampleFeature/Mocks/MockToggleExampleBooleanUC.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAGH,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AAEvE;;;GAGG;AACH,MAAM,OAAO,0BAA2B,SAAQ,sBAAsB;IAOpE,YAAY,SAAoB;QAC9B,KAAK,CAAC,SAAS,EAAE,sBAAsB,CAAC,IAAI,CAAC,CAAC;QAPhD;;;WAGG;QACH,yBAAoB,GAAG,GAAS,EAAE,GAAE,CAAC,CAAC;QAIpC,gDAAgD;QAChD,IAAI,CAAC,UAAU,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC;IAC1C,CAAC;CACF;AAED;;;;GAIG;AACH,MAAM,UAAU,8BAA8B,CAC5C,SAAoB;IAEpB,OAAO,IAAI,0BAA0B,CAAC,SAAS,CAAC,CAAC;AACnD,CAAC","sourcesContent":["/**\r\n * MockToggleExampleBooleanUC.ts\r\n * \r\n * This file demonstrates how to implement a mock singleton UC for testing.\r\n * Mock singleton UCs extend the real UC classes and provide helper functions\r\n * to create and register them as singletons for tests.\r\n * \r\n * Key concepts:\r\n * - Mock singleton UCs extend the real UC classes\r\n * - They override methods with test implementations\r\n * - They register themselves as singletons just like the real UCs\r\n * - They include helper functions to create them in tests\r\n * \r\n * Usage pattern (in tests):\r\n * ```typescript\r\n * // In a test file\r\n * const mockUC = makeMockToggleExampleBooleanUC(appObject);\r\n * const spy = jest.spyOn(mockUC, 'toggleExampleBoolean');\r\n * \r\n * // Call the function that should use the UC\r\n * toggleExampleBoolean(appObjects);\r\n * \r\n * // Verify the UC method was called correctly\r\n * expect(spy).toHaveBeenCalled();\r\n * ```\r\n */\r\n\r\nimport { AppObject } from \"../../AppObject\";\r\nimport { ToggleExampleBooleanUC } from \"../UCs/ToggleExampleBooleanUC\";\r\n\r\n/**\r\n * Mock implementation of ToggleExampleBooleanUC for testing\r\n * Provides a no-op implementation of toggleExampleBoolean that can be spied on in tests\r\n */\r\nexport class MockToggleExampleBooleanUC extends ToggleExampleBooleanUC {\r\n /**\r\n * Mock implementation that does nothing\r\n * In tests, this can be replaced with a Jest spy to track calls\r\n */\r\n toggleExampleBoolean = (): void => {};\r\n\r\n constructor(appObject: AppObject) {\r\n super(appObject, ToggleExampleBooleanUC.type);\r\n // Register as a singleton just like the real UC\r\n this.appObjects.registerSingleton(this);\r\n }\r\n}\r\n\r\n/**\r\n * Helper factory function to create a mock ToggleExampleBooleanUC\r\n * @param appObject The AppObject to attach the UC to\r\n * @returns A new MockToggleExampleBooleanUC instance\r\n */\r\nexport function makeMockToggleExampleBooleanUC(\r\n appObject: AppObject\r\n): MockToggleExampleBooleanUC {\r\n return new MockToggleExampleBooleanUC(appObject);\r\n}\r\n"]}
@@ -0,0 +1,5 @@
1
+ export * from "./MockEditExampleStringUC";
2
+ export * from "./MockExamplePM";
3
+ export * from "./MockExampleSingletonPM";
4
+ export * from "./MockToggleExampleBooleanUC";
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/ExampleFeature/Mocks/index.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAC;AAC1C,cAAc,iBAAiB,CAAC;AAChC,cAAc,0BAA0B,CAAC;AACzC,cAAc,8BAA8B,CAAC","sourcesContent":["export * from \"./MockEditExampleStringUC\";\r\nexport * from \"./MockExamplePM\";\r\nexport * from \"./MockExampleSingletonPM\";\r\nexport * from \"./MockToggleExampleBooleanUC\";\r\n"]}