@tstdl/base 0.93.181 → 0.93.183

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 (353) hide show
  1. package/api/server/api-request-token.provider.js +1 -1
  2. package/api/server/gateway.js +8 -3
  3. package/authentication/authentication.api.d.ts +13 -40
  4. package/authentication/authentication.api.js +5 -14
  5. package/authentication/client/authentication.service.d.ts +6 -14
  6. package/authentication/client/authentication.service.js +22 -4
  7. package/authentication/client/module.d.ts +1 -1
  8. package/authentication/client/module.js +4 -4
  9. package/authentication/models/index.d.ts +1 -0
  10. package/authentication/models/index.js +1 -0
  11. package/authentication/models/totp-results.model.d.ts +11 -0
  12. package/authentication/models/totp-results.model.js +37 -0
  13. package/authentication/server/authentication.api-controller.d.ts +3 -3
  14. package/authentication/server/authentication.api-controller.js +31 -4
  15. package/authentication/server/authentication.service.d.ts +5 -14
  16. package/authentication/server/authentication.service.js +6 -4
  17. package/core.d.ts +0 -5
  18. package/core.js +0 -8
  19. package/document-management/api/document-management.api.d.ts +2 -2
  20. package/document-management/service-models/document.service-model.d.ts +1 -1
  21. package/examples/config.d.ts +25 -0
  22. package/examples/config.js +26 -0
  23. package/notification/server/module.d.ts +1 -1
  24. package/notification/server/module.js +1 -1
  25. package/package.json +5 -5
  26. package/signals/api.d.ts +5 -1
  27. package/signals/api.js +3 -1
  28. package/signals/implementation/api.d.ts +13 -5
  29. package/signals/implementation/api.js +7 -1
  30. package/signals/implementation/asserts.d.ts +2 -2
  31. package/signals/implementation/asserts.js +3 -3
  32. package/signals/implementation/computed.d.ts +7 -34
  33. package/signals/implementation/computed.js +14 -83
  34. package/signals/implementation/configure.js +6 -2
  35. package/signals/implementation/effect.d.ts +65 -46
  36. package/signals/implementation/effect.js +97 -62
  37. package/signals/implementation/index.d.ts +2 -4
  38. package/signals/implementation/index.js +2 -4
  39. package/signals/implementation/linked_signal.d.ts +36 -0
  40. package/signals/implementation/linked_signal.js +34 -0
  41. package/signals/implementation/primitive/computed.d.ts +55 -0
  42. package/signals/implementation/primitive/computed.js +107 -0
  43. package/signals/implementation/primitive/effect.d.ts +26 -0
  44. package/signals/implementation/primitive/effect.js +31 -0
  45. package/signals/implementation/{equality.d.ts → primitive/equality.d.ts} +1 -1
  46. package/signals/implementation/{equality.js → primitive/equality.js} +1 -1
  47. package/signals/implementation/primitive/errors.d.ts +10 -0
  48. package/signals/implementation/{errors.js → primitive/errors.js} +3 -4
  49. package/signals/implementation/primitive/formatter.d.ts +19 -0
  50. package/signals/implementation/primitive/formatter.js +136 -0
  51. package/signals/implementation/{graph.d.ts → primitive/graph.d.ts} +68 -36
  52. package/signals/implementation/primitive/graph.js +386 -0
  53. package/signals/implementation/primitive/linked_signal.d.ts +46 -0
  54. package/signals/implementation/primitive/linked_signal.js +110 -0
  55. package/signals/implementation/primitive/signal.d.ts +31 -0
  56. package/signals/implementation/primitive/signal.js +80 -0
  57. package/signals/implementation/primitive/untracked.d.ts +12 -0
  58. package/signals/implementation/primitive/untracked.js +23 -0
  59. package/signals/implementation/{watch.d.ts → primitive/watch.d.ts} +1 -2
  60. package/signals/implementation/{watch.js → primitive/watch.js} +22 -16
  61. package/signals/implementation/resource/api.d.ts +275 -0
  62. package/signals/implementation/resource/api.js +26 -0
  63. package/signals/implementation/resource/debounce.d.ts +13 -0
  64. package/signals/implementation/resource/debounce.js +113 -0
  65. package/signals/implementation/resource/from_snapshots.d.ts +16 -0
  66. package/signals/implementation/resource/from_snapshots.js +44 -0
  67. package/signals/implementation/resource/index.d.ts +11 -0
  68. package/signals/implementation/resource/index.js +11 -0
  69. package/signals/implementation/resource/resource.d.ts +110 -0
  70. package/signals/implementation/resource/resource.js +402 -0
  71. package/signals/implementation/root_effect_scheduler.d.ts +50 -0
  72. package/signals/implementation/root_effect_scheduler.js +66 -0
  73. package/signals/implementation/signal.d.ts +42 -18
  74. package/signals/implementation/signal.js +29 -49
  75. package/signals/implementation/to-observable.d.ts +12 -5
  76. package/signals/implementation/to-observable.js +12 -2
  77. package/signals/implementation/to-signal.d.ts +9 -18
  78. package/signals/implementation/to-signal.js +46 -13
  79. package/signals/implementation/untracked.d.ts +1 -1
  80. package/signals/implementation/untracked.js +3 -11
  81. package/signals/operators/debounce.d.ts +8 -0
  82. package/signals/operators/debounce.js +19 -0
  83. package/signals/operators/derive-async.js +43 -15
  84. package/signals/operators/index.d.ts +2 -0
  85. package/signals/operators/index.js +2 -0
  86. package/signals/operators/throttle.d.ts +8 -0
  87. package/signals/operators/throttle.js +31 -0
  88. package/ai/genkit/tests/multi-region.test.d.ts +0 -2
  89. package/ai/genkit/tests/multi-region.test.js +0 -179
  90. package/ai/genkit/tests/token-limit-fallback.test.d.ts +0 -2
  91. package/ai/genkit/tests/token-limit-fallback.test.js +0 -209
  92. package/ai/prompts/tests/prompt-builder.test.d.ts +0 -1
  93. package/ai/prompts/tests/prompt-builder.test.js +0 -22
  94. package/ai/tests/instructions-formatter.test.d.ts +0 -1
  95. package/ai/tests/instructions-formatter.test.js +0 -116
  96. package/ai/tests/steering.test.d.ts +0 -1
  97. package/ai/tests/steering.test.js +0 -37
  98. package/api/client/tests/api-client.test.d.ts +0 -1
  99. package/api/client/tests/api-client.test.js +0 -194
  100. package/api/server/tests/csrf.middleware.test.d.ts +0 -1
  101. package/api/server/tests/csrf.middleware.test.js +0 -91
  102. package/authentication/tests/authentication-password-requirements.validator.test.d.ts +0 -1
  103. package/authentication/tests/authentication-password-requirements.validator.test.js +0 -29
  104. package/authentication/tests/authentication.api-controller.test.d.ts +0 -1
  105. package/authentication/tests/authentication.api-controller.test.js +0 -156
  106. package/authentication/tests/authentication.api-request-token.provider.test.d.ts +0 -1
  107. package/authentication/tests/authentication.api-request-token.provider.test.js +0 -48
  108. package/authentication/tests/authentication.client-error-handling.test.d.ts +0 -1
  109. package/authentication/tests/authentication.client-error-handling.test.js +0 -123
  110. package/authentication/tests/authentication.client-middleware.test.d.ts +0 -1
  111. package/authentication/tests/authentication.client-middleware.test.js +0 -118
  112. package/authentication/tests/authentication.client-service-methods.test.d.ts +0 -1
  113. package/authentication/tests/authentication.client-service-methods.test.js +0 -177
  114. package/authentication/tests/authentication.client-service-refresh.test.d.ts +0 -1
  115. package/authentication/tests/authentication.client-service-refresh.test.js +0 -153
  116. package/authentication/tests/authentication.client-service.test.d.ts +0 -1
  117. package/authentication/tests/authentication.client-service.test.js +0 -76
  118. package/authentication/tests/authentication.refresh-busy-loop.test.d.ts +0 -1
  119. package/authentication/tests/authentication.refresh-busy-loop.test.js +0 -84
  120. package/authentication/tests/authentication.service.test.d.ts +0 -1
  121. package/authentication/tests/authentication.service.test.js +0 -167
  122. package/authentication/tests/authentication.test-ancillary-service.d.ts +0 -9
  123. package/authentication/tests/authentication.test-ancillary-service.js +0 -27
  124. package/authentication/tests/brute-force-protection.test.d.ts +0 -1
  125. package/authentication/tests/brute-force-protection.test.js +0 -211
  126. package/authentication/tests/helper.test.d.ts +0 -1
  127. package/authentication/tests/helper.test.js +0 -122
  128. package/authentication/tests/password-requirements.error.test.d.ts +0 -1
  129. package/authentication/tests/password-requirements.error.test.js +0 -14
  130. package/authentication/tests/remember.api.test.d.ts +0 -1
  131. package/authentication/tests/remember.api.test.js +0 -117
  132. package/authentication/tests/remember.service.test.d.ts +0 -1
  133. package/authentication/tests/remember.service.test.js +0 -83
  134. package/authentication/tests/subject.service.test.d.ts +0 -1
  135. package/authentication/tests/subject.service.test.js +0 -140
  136. package/authentication/tests/suspended-subject.test.d.ts +0 -1
  137. package/authentication/tests/suspended-subject.test.js +0 -120
  138. package/authentication/tests/totp.enrollment.test.d.ts +0 -1
  139. package/authentication/tests/totp.enrollment.test.js +0 -123
  140. package/authentication/tests/totp.login.test.d.ts +0 -1
  141. package/authentication/tests/totp.login.test.js +0 -213
  142. package/authentication/tests/totp.recovery-codes.test.d.ts +0 -1
  143. package/authentication/tests/totp.recovery-codes.test.js +0 -97
  144. package/authentication/tests/totp.status.test.d.ts +0 -1
  145. package/authentication/tests/totp.status.test.js +0 -72
  146. package/cancellation/tests/coverage.test.d.ts +0 -1
  147. package/cancellation/tests/coverage.test.js +0 -49
  148. package/cancellation/tests/leak.test.d.ts +0 -1
  149. package/cancellation/tests/leak.test.js +0 -35
  150. package/cancellation/tests/token.test.d.ts +0 -1
  151. package/cancellation/tests/token.test.js +0 -136
  152. package/circuit-breaker/tests/circuit-breaker.test.d.ts +0 -1
  153. package/circuit-breaker/tests/circuit-breaker.test.js +0 -116
  154. package/cryptography/tests/cryptography.test.d.ts +0 -1
  155. package/cryptography/tests/cryptography.test.js +0 -175
  156. package/cryptography/tests/jwt.test.d.ts +0 -1
  157. package/cryptography/tests/jwt.test.js +0 -54
  158. package/cryptography/tests/modern.test.d.ts +0 -1
  159. package/cryptography/tests/modern.test.js +0 -105
  160. package/cryptography/tests/module.test.d.ts +0 -1
  161. package/cryptography/tests/module.test.js +0 -100
  162. package/cryptography/tests/totp.test.d.ts +0 -1
  163. package/cryptography/tests/totp.test.js +0 -108
  164. package/document-management/tests/ai-config-hierarchy.test.d.ts +0 -1
  165. package/document-management/tests/ai-config-hierarchy.test.js +0 -59
  166. package/document-management/tests/ai-config-integration.test.d.ts +0 -1
  167. package/document-management/tests/ai-config-integration.test.js +0 -125
  168. package/document-management/tests/ai-config-merge.test.d.ts +0 -1
  169. package/document-management/tests/ai-config-merge.test.js +0 -46
  170. package/document-management/tests/document-management-ai-overrides.test.d.ts +0 -1
  171. package/document-management/tests/document-management-ai-overrides.test.js +0 -63
  172. package/document-management/tests/document-management-core.test.d.ts +0 -1
  173. package/document-management/tests/document-management-core.test.js +0 -157
  174. package/document-management/tests/document-management.api.test.d.ts +0 -1
  175. package/document-management/tests/document-management.api.test.js +0 -101
  176. package/document-management/tests/document-statistics.service.test.d.ts +0 -1
  177. package/document-management/tests/document-statistics.service.test.js +0 -498
  178. package/document-management/tests/document-validation-ai-overrides.test.d.ts +0 -1
  179. package/document-management/tests/document-validation-ai-overrides.test.js +0 -87
  180. package/document-management/tests/document.service.test.d.ts +0 -1
  181. package/document-management/tests/document.service.test.js +0 -143
  182. package/document-management/tests/enum-helpers.test.d.ts +0 -1
  183. package/document-management/tests/enum-helpers.test.js +0 -452
  184. package/document-management/tests/helper.d.ts +0 -24
  185. package/document-management/tests/helper.js +0 -39
  186. package/errors/tests/format.test.d.ts +0 -1
  187. package/errors/tests/format.test.js +0 -84
  188. package/http/tests/server-timing.test.d.ts +0 -1
  189. package/http/tests/server-timing.test.js +0 -42
  190. package/injector/tests/advanced.test.d.ts +0 -1
  191. package/injector/tests/advanced.test.js +0 -116
  192. package/injector/tests/async-init.test.d.ts +0 -1
  193. package/injector/tests/async-init.test.js +0 -77
  194. package/injector/tests/basic.test.d.ts +0 -1
  195. package/injector/tests/basic.test.js +0 -114
  196. package/injector/tests/hierarchical.test.d.ts +0 -1
  197. package/injector/tests/hierarchical.test.js +0 -59
  198. package/injector/tests/leak.test.d.ts +0 -1
  199. package/injector/tests/leak.test.js +0 -45
  200. package/injector/tests/lifecycles.test.d.ts +0 -1
  201. package/injector/tests/lifecycles.test.js +0 -109
  202. package/logger/tests/pretty-print.test.d.ts +0 -1
  203. package/logger/tests/pretty-print.test.js +0 -60
  204. package/notification/tests/notification-api.test.d.ts +0 -1
  205. package/notification/tests/notification-api.test.js +0 -124
  206. package/notification/tests/notification-client.test.d.ts +0 -1
  207. package/notification/tests/notification-client.test.js +0 -101
  208. package/notification/tests/notification-flow.test.d.ts +0 -1
  209. package/notification/tests/notification-flow.test.js +0 -296
  210. package/notification/tests/notification-sse.service.test.d.ts +0 -1
  211. package/notification/tests/notification-sse.service.test.js +0 -43
  212. package/notification/tests/notification-type.service.test.d.ts +0 -1
  213. package/notification/tests/notification-type.service.test.js +0 -41
  214. package/object-storage/s3/tests/s3.object-storage.integration.test.d.ts +0 -1
  215. package/object-storage/s3/tests/s3.object-storage.integration.test.js +0 -303
  216. package/orm/tests/build-jsonb.test.d.ts +0 -1
  217. package/orm/tests/build-jsonb.test.js +0 -39
  218. package/orm/tests/data-types.test.d.ts +0 -1
  219. package/orm/tests/data-types.test.js +0 -39
  220. package/orm/tests/database-extension.test.d.ts +0 -1
  221. package/orm/tests/database-extension.test.js +0 -63
  222. package/orm/tests/database-migration.test.d.ts +0 -1
  223. package/orm/tests/database-migration.test.js +0 -83
  224. package/orm/tests/decorators.test.d.ts +0 -1
  225. package/orm/tests/decorators.test.js +0 -77
  226. package/orm/tests/encryption.test.d.ts +0 -1
  227. package/orm/tests/encryption.test.js +0 -31
  228. package/orm/tests/query-complex.test.d.ts +0 -1
  229. package/orm/tests/query-complex.test.js +0 -172
  230. package/orm/tests/query-converter-complex.test.d.ts +0 -1
  231. package/orm/tests/query-converter-complex.test.js +0 -131
  232. package/orm/tests/query-converter.test.d.ts +0 -1
  233. package/orm/tests/query-converter.test.js +0 -123
  234. package/orm/tests/repository-advanced.test.d.ts +0 -1
  235. package/orm/tests/repository-advanced.test.js +0 -189
  236. package/orm/tests/repository-attributes.test.d.ts +0 -1
  237. package/orm/tests/repository-attributes.test.js +0 -83
  238. package/orm/tests/repository-compound-primary-key.test.d.ts +0 -2
  239. package/orm/tests/repository-compound-primary-key.test.js +0 -226
  240. package/orm/tests/repository-comprehensive.test.d.ts +0 -1
  241. package/orm/tests/repository-comprehensive.test.js +0 -162
  242. package/orm/tests/repository-coverage.test.d.ts +0 -2
  243. package/orm/tests/repository-coverage.test.js +0 -242
  244. package/orm/tests/repository-cti-complex.test.d.ts +0 -1
  245. package/orm/tests/repository-cti-complex.test.js +0 -151
  246. package/orm/tests/repository-cti-embedded.test.d.ts +0 -1
  247. package/orm/tests/repository-cti-embedded.test.js +0 -178
  248. package/orm/tests/repository-cti-extensive.test.d.ts +0 -2
  249. package/orm/tests/repository-cti-extensive.test.js +0 -279
  250. package/orm/tests/repository-cti-mapping.test.d.ts +0 -2
  251. package/orm/tests/repository-cti-mapping.test.js +0 -108
  252. package/orm/tests/repository-cti-search.test.d.ts +0 -1
  253. package/orm/tests/repository-cti-search.test.js +0 -141
  254. package/orm/tests/repository-cti-soft-delete.test.d.ts +0 -2
  255. package/orm/tests/repository-cti-soft-delete.test.js +0 -103
  256. package/orm/tests/repository-cti-transactions.test.d.ts +0 -1
  257. package/orm/tests/repository-cti-transactions.test.js +0 -112
  258. package/orm/tests/repository-cti-upsert-many.test.d.ts +0 -2
  259. package/orm/tests/repository-cti-upsert-many.test.js +0 -115
  260. package/orm/tests/repository-cti.test.d.ts +0 -2
  261. package/orm/tests/repository-cti.test.js +0 -390
  262. package/orm/tests/repository-edge-cases.test.d.ts +0 -1
  263. package/orm/tests/repository-edge-cases.test.js +0 -178
  264. package/orm/tests/repository-expiration.test.d.ts +0 -2
  265. package/orm/tests/repository-expiration.test.js +0 -140
  266. package/orm/tests/repository-extra-coverage.test.d.ts +0 -2
  267. package/orm/tests/repository-extra-coverage.test.js +0 -402
  268. package/orm/tests/repository-mapping.test.d.ts +0 -2
  269. package/orm/tests/repository-mapping.test.js +0 -65
  270. package/orm/tests/repository-regression.test.d.ts +0 -1
  271. package/orm/tests/repository-regression.test.js +0 -288
  272. package/orm/tests/repository-search-coverage.test.d.ts +0 -1
  273. package/orm/tests/repository-search-coverage.test.js +0 -107
  274. package/orm/tests/repository-search.test.d.ts +0 -1
  275. package/orm/tests/repository-search.test.js +0 -105
  276. package/orm/tests/repository-soft-delete.test.d.ts +0 -1
  277. package/orm/tests/repository-soft-delete.test.js +0 -118
  278. package/orm/tests/repository-transactions-nested.test.d.ts +0 -1
  279. package/orm/tests/repository-transactions-nested.test.js +0 -178
  280. package/orm/tests/repository-types.test.d.ts +0 -1
  281. package/orm/tests/repository-types.test.js +0 -184
  282. package/orm/tests/repository-undelete.test.d.ts +0 -2
  283. package/orm/tests/repository-undelete.test.js +0 -201
  284. package/orm/tests/schema-converter.test.d.ts +0 -1
  285. package/orm/tests/schema-converter.test.js +0 -82
  286. package/orm/tests/schema-generation.test.d.ts +0 -2
  287. package/orm/tests/schema-generation.test.js +0 -174
  288. package/orm/tests/sql-helpers.test.d.ts +0 -1
  289. package/orm/tests/sql-helpers.test.js +0 -67
  290. package/orm/tests/transaction-safety.test.d.ts +0 -1
  291. package/orm/tests/transaction-safety.test.js +0 -81
  292. package/orm/tests/transactional.test.d.ts +0 -1
  293. package/orm/tests/transactional.test.js +0 -215
  294. package/orm/tests/utils.test.d.ts +0 -1
  295. package/orm/tests/utils.test.js +0 -70
  296. package/pdf/tests/utils.test.d.ts +0 -1
  297. package/pdf/tests/utils.test.js +0 -187
  298. package/process/tests/spawn.test.d.ts +0 -1
  299. package/process/tests/spawn.test.js +0 -182
  300. package/rate-limit/tests/postgres-rate-limiter.test.d.ts +0 -1
  301. package/rate-limit/tests/postgres-rate-limiter.test.js +0 -84
  302. package/renderer/tests/renderer.test.d.ts +0 -1
  303. package/renderer/tests/renderer.test.js +0 -88
  304. package/rpc/tests/rpc.integration.test.d.ts +0 -1
  305. package/rpc/tests/rpc.integration.test.js +0 -615
  306. package/signals/implementation/errors.d.ts +0 -2
  307. package/signals/implementation/graph.js +0 -312
  308. package/signals/implementation/writable-signal.d.ts +0 -48
  309. package/signals/implementation/writable-signal.js +0 -32
  310. package/task-queue/tests/coverage-branch.test.d.ts +0 -1
  311. package/task-queue/tests/coverage-branch.test.js +0 -395
  312. package/task-queue/tests/coverage-enhancement.test.d.ts +0 -1
  313. package/task-queue/tests/coverage-enhancement.test.js +0 -150
  314. package/task-queue/tests/dag.test.d.ts +0 -1
  315. package/task-queue/tests/dag.test.js +0 -188
  316. package/task-queue/tests/dependencies.test.d.ts +0 -1
  317. package/task-queue/tests/dependencies.test.js +0 -296
  318. package/task-queue/tests/enqueue-batch.test.d.ts +0 -1
  319. package/task-queue/tests/enqueue-batch.test.js +0 -125
  320. package/task-queue/tests/enqueue-item.test.d.ts +0 -1
  321. package/task-queue/tests/enqueue-item.test.js +0 -12
  322. package/task-queue/tests/fan-out-spawning.test.d.ts +0 -1
  323. package/task-queue/tests/fan-out-spawning.test.js +0 -94
  324. package/task-queue/tests/idempotent-replacement.test.d.ts +0 -1
  325. package/task-queue/tests/idempotent-replacement.test.js +0 -114
  326. package/task-queue/tests/missing-idempotent-tasks.test.d.ts +0 -1
  327. package/task-queue/tests/missing-idempotent-tasks.test.js +0 -39
  328. package/task-queue/tests/optimization-edge-cases.test.d.ts +0 -1
  329. package/task-queue/tests/optimization-edge-cases.test.js +0 -124
  330. package/task-queue/tests/queue-generic.test.d.ts +0 -1
  331. package/task-queue/tests/queue-generic.test.js +0 -8
  332. package/task-queue/tests/queue.test.d.ts +0 -1
  333. package/task-queue/tests/queue.test.js +0 -756
  334. package/task-queue/tests/shutdown.test.d.ts +0 -1
  335. package/task-queue/tests/shutdown.test.js +0 -41
  336. package/task-queue/tests/task-context.test.d.ts +0 -1
  337. package/task-queue/tests/task-context.test.js +0 -7
  338. package/task-queue/tests/task-union.test.d.ts +0 -1
  339. package/task-queue/tests/task-union.test.js +0 -18
  340. package/task-queue/tests/transactions.test.d.ts +0 -1
  341. package/task-queue/tests/transactions.test.js +0 -47
  342. package/task-queue/tests/typing.test.d.ts +0 -1
  343. package/task-queue/tests/typing.test.js +0 -9
  344. package/task-queue/tests/worker.test.d.ts +0 -1
  345. package/task-queue/tests/worker.test.js +0 -258
  346. package/task-queue/tests/zombie-parent.test.d.ts +0 -1
  347. package/task-queue/tests/zombie-parent.test.js +0 -45
  348. package/task-queue/tests/zombie-recovery.test.d.ts +0 -1
  349. package/task-queue/tests/zombie-recovery.test.js +0 -51
  350. package/utils/tests/backoff.test.d.ts +0 -1
  351. package/utils/tests/backoff.test.js +0 -41
  352. package/utils/tests/retry-with-backoff.test.d.ts +0 -1
  353. package/utils/tests/retry-with-backoff.test.js +0 -49
@@ -362,8 +362,8 @@ export declare const documentManagementApiDefinition: {
362
362
  resource: string;
363
363
  method: "POST";
364
364
  parameters: import("../../schema/index.js").ObjectSchema<{
365
- id: string;
366
365
  state: "error" | "pending" | "running" | "completed" | "review" | "failed";
366
+ id: string;
367
367
  }>;
368
368
  result: import("../../schema/index.js").LiteralSchema<"ok">;
369
369
  credentials: true;
@@ -772,8 +772,8 @@ declare const _DocumentManagementApi: import("../../api/client/index.js").ApiCli
772
772
  resource: string;
773
773
  method: "POST";
774
774
  parameters: import("../../schema/index.js").ObjectSchema<{
775
- id: string;
776
775
  state: "error" | "pending" | "running" | "completed" | "review" | "failed";
776
+ id: string;
777
777
  }>;
778
778
  result: import("../../schema/index.js").LiteralSchema<"ok">;
779
779
  credentials: true;
@@ -235,8 +235,8 @@ export declare const addOrArchiveDocumentToOrFromCollectionParametersSchema: imp
235
235
  }> | undefined;
236
236
  }>;
237
237
  export declare const proceedDocumentWorkflowParametersSchema: import("../../schema/index.js").ObjectSchema<{
238
- id: string;
239
238
  state: "error" | "pending" | "running" | "completed" | "review" | "failed";
239
+ id: string;
240
240
  }>;
241
241
  export type MetadataParameter = SchemaOutput<typeof metadataParameterObjectSchema>;
242
242
  export type LoadDataParameters = SchemaOutput<typeof getDataParametersSchema>;
@@ -0,0 +1,25 @@
1
+ export declare const examplesConfig: {
2
+ database: {
3
+ host: string;
4
+ port: number;
5
+ user: string;
6
+ pass: string;
7
+ database: string;
8
+ schema: string;
9
+ };
10
+ ai: {
11
+ apiKey: string | undefined;
12
+ keyFile: string | undefined;
13
+ vertex: {
14
+ project: string;
15
+ location: string;
16
+ };
17
+ };
18
+ s3: {
19
+ endpoint: string;
20
+ accessKey: string;
21
+ secretKey: string;
22
+ bucket: string | undefined;
23
+ bucketPerModule: boolean;
24
+ };
25
+ };
@@ -0,0 +1,26 @@
1
+ import { boolean, positiveInteger, string } from '../utils/config-parser.js';
2
+ export const examplesConfig = {
3
+ database: {
4
+ host: string('DATABASE_HOST', '127.0.0.1'),
5
+ port: positiveInteger('DATABASE_PORT', 15433),
6
+ user: string('DATABASE_USER', 'tstdl'),
7
+ pass: string('DATABASE_PASS', 'wf7rq6glrk5jykne'),
8
+ database: string('DATABASE_NAME', 'tstdl'),
9
+ schema: string('DATABASE_SCHEMA', 'tstdl'),
10
+ },
11
+ ai: {
12
+ apiKey: string('AI_API_KEY', undefined),
13
+ keyFile: string('AI_API_KEY_FILE', undefined),
14
+ vertex: {
15
+ project: string('AI_VERTEX_PROJECT', 'tstdl-dev'),
16
+ location: string('AI_VERTEX_LOCATION', 'tstdl-dev'),
17
+ },
18
+ },
19
+ s3: {
20
+ endpoint: string('S3_ENDPOINT', 'http://localhost:19552'),
21
+ accessKey: string('S3_ACCESS_KEY', 'tstdl-dev'),
22
+ secretKey: string('S3_SECRET_KEY', 'tstdl-dev'),
23
+ bucket: string('S3_BUCKET', undefined),
24
+ bucketPerModule: boolean('S3_BUCKET_PER_MODULE', true),
25
+ },
26
+ };
@@ -13,7 +13,7 @@ export declare class NotificationConfiguration {
13
13
  autoArchiveAfter?: number;
14
14
  autoMigrate?: boolean;
15
15
  }
16
- export declare function configureNotification({ injector, ...config }: NotificationConfiguration & {
16
+ export declare function configureNotification({ injector, ...config }?: NotificationConfiguration & {
17
17
  injector?: Injector;
18
18
  }): void;
19
19
  /**
@@ -13,7 +13,7 @@ export class NotificationConfiguration {
13
13
  autoArchiveAfter;
14
14
  autoMigrate;
15
15
  }
16
- export function configureNotification({ injector, ...config }) {
16
+ export function configureNotification({ injector, ...config } = {}) {
17
17
  const targetInjector = injector ?? Injector;
18
18
  targetInjector.register(NotificationConfiguration, { useValue: { autoArchiveAfter: 30 * 24 * 60 * 60 * 1000, ...config } });
19
19
  if (isDefined(config.ancillaryService)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tstdl/base",
3
- "version": "0.93.181",
3
+ "version": "0.93.183",
4
4
  "author": "Patrick Hein",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -20,7 +20,7 @@
20
20
  "test:coverage": "f() { vitest run --coverage --coverage.include=\"source/$1/**/*.ts\" source/$1; }; f",
21
21
  "tsc:watch": "tsc --watch",
22
22
  "tsc-alias:watch": "tsc-alias --watch",
23
- "cleanup:dist": "rm -vrf dist/tools/",
23
+ "cleanup:dist": "rm -vrf dist/tools/ && find dist -type d -name \"tests\" -exec rm -rf {} +",
24
24
  "copy:readmes": "cp README.md dist/ && cd source && find . -name \"README.md\" -exec cp --parents {} ../dist/ \\;",
25
25
  "generate:migration": "./scripts/manage-orm.sh generate && npm run copy:orm",
26
26
  "generate:readmes": "deno run --allow-run=code2prompt --allow-read --allow-write=source --allow-net=generativelanguage.googleapis.com --allow-env=GEMINI_API_KEY generate-readmes.ts",
@@ -153,8 +153,8 @@
153
153
  "type-fest": "^5.5"
154
154
  },
155
155
  "peerDependencies": {
156
- "@aws-sdk/client-s3": "^3.1020",
157
- "@aws-sdk/s3-request-presigner": "^3.1020",
156
+ "@aws-sdk/client-s3": "^3.1021",
157
+ "@aws-sdk/s3-request-presigner": "^3.1021",
158
158
  "@genkit-ai/google-genai": "^1.31",
159
159
  "@google-cloud/storage": "^7.19",
160
160
  "@toon-format/toon": "^2.1.0",
@@ -170,7 +170,7 @@
170
170
  "mjml": "^4.18",
171
171
  "nodemailer": "^8.0",
172
172
  "pg": "^8.20",
173
- "playwright": "^1.58",
173
+ "playwright": "^1.59",
174
174
  "preact": "^10.29",
175
175
  "preact-render-to-string": "^6.6",
176
176
  "sharp": "^0.34",
package/signals/api.d.ts CHANGED
@@ -1,12 +1,14 @@
1
1
  import type { Tagged } from 'type-fest';
2
2
  import type * as Types from './implementation/index.js';
3
- export type { CreateComputedOptions, CreateEffectOptions, CreateSignalOptions, EffectCleanupRegisterFn, EffectRef, Signal, ToObservableOptions, ToSignalOptions, WritableSignal } from './implementation/index.js';
3
+ export type { CreateComputedOptions, CreateEffectOptions, CreateSignalOptions, EffectCleanupRegisterFn, EffectRef, Signal, ToObservableOptions, ToSignalOptions, ValueEqualityFn, WritableSignal } from './implementation/index.js';
4
4
  export type SignalsInjector = Tagged<symbol, 'injector'>;
5
5
  export type SignalsConfiguration<TInjector = SignalsInjector> = {
6
6
  signal: typeof Types.signal;
7
7
  computed: typeof Types.computed;
8
8
  effect: typeof Types.effect;
9
+ linkedSignal: typeof Types.linkedSignal;
9
10
  untracked: typeof Types.untracked;
11
+ resource: typeof Types.resource;
10
12
  isSignal: typeof Types.isSignal;
11
13
  toSignal: typeof Types.toSignal;
12
14
  toObservable: typeof Types.toObservable;
@@ -17,6 +19,8 @@ export type SignalsConfiguration<TInjector = SignalsInjector> = {
17
19
  export declare let signal: typeof Types.signal;
18
20
  export declare let computed: typeof Types.computed;
19
21
  export declare let effect: typeof Types.effect;
22
+ export declare let linkedSignal: typeof Types.linkedSignal;
23
+ export declare let resource: typeof Types.resource;
20
24
  export declare let untracked: typeof Types.untracked;
21
25
  export declare let isSignal: typeof Types.isSignal;
22
26
  export declare let toSignal: typeof Types.toSignal;
package/signals/api.js CHANGED
@@ -2,6 +2,8 @@
2
2
  export let signal = throwSignalsNotConfigured;
3
3
  export let computed = throwSignalsNotConfigured;
4
4
  export let effect = throwSignalsNotConfigured;
5
+ export let linkedSignal = throwSignalsNotConfigured;
6
+ export let resource = throwSignalsNotConfigured;
5
7
  export let untracked = throwSignalsNotConfigured;
6
8
  export let isSignal = throwSignalsNotConfigured;
7
9
  export let toSignal = throwSignalsNotConfigured;
@@ -11,7 +13,7 @@ export let getCurrentSignalsInjector = throwSignalsNotConfigured;
11
13
  export let runInSignalsInjectionContext = throwSignalsNotConfigured;
12
14
  /* eslint-enable import/no-mutable-exports */
13
15
  export function configureSignals(configuration) {
14
- ({ signal, computed, effect, untracked, isSignal, toSignal, toObservable, isInSignalsInjectionContext, runInSignalsInjectionContext, getCurrentSignalsInjector } = configuration);
16
+ ({ signal, computed, effect, linkedSignal, resource, untracked, isSignal, toSignal, toObservable, isInSignalsInjectionContext, runInSignalsInjectionContext, getCurrentSignalsInjector } = configuration);
15
17
  }
16
18
  function throwSignalsNotConfigured() {
17
19
  throw new Error('Signals are not configured. Use configureDefaultSignalsImplementation() for default implementation or configureSignals() for custom implementation.');
@@ -3,9 +3,10 @@
3
3
  * Copyright Google LLC All Rights Reserved.
4
4
  *
5
5
  * Use of this source code is governed by an MIT-style license that can be
6
- * found in the LICENSE file at https://angular.io/license
6
+ * found in the LICENSE file at https://angular.dev/license
7
7
  */
8
8
  import { SIGNAL } from '../symbol.js';
9
+ import type { WritableSignal } from './signal.js';
9
10
  /**
10
11
  * A reactive value which notifies consumers of any changes.
11
12
  *
@@ -14,11 +15,18 @@ import { SIGNAL } from '../symbol.js';
14
15
  *
15
16
  * Ordinary values can be turned into `Signal`s with the `signal` function.
16
17
  */
17
- export interface Signal<T> {
18
- (): T;
19
- [SIGNAL]?: unknown;
20
- }
18
+ export type Signal<T> = (() => T) & {
19
+ [SIGNAL]: unknown;
20
+ };
21
21
  /**
22
22
  * Checks if the given `value` is a reactive `Signal`.
23
23
  */
24
24
  export declare function isSignal(value: unknown): value is Signal<unknown>;
25
+ /**
26
+ * A comparison function which can determine if two values are equal.
27
+ */
28
+ export type ValueEqualityFn<T> = (a: T, b: T) => boolean;
29
+ /**
30
+ * Checks if the given `value` is a writeable signal.
31
+ */
32
+ export declare function isWritableSignal(value: unknown): value is WritableSignal<unknown>;
@@ -3,7 +3,7 @@
3
3
  * Copyright Google LLC All Rights Reserved.
4
4
  *
5
5
  * Use of this source code is governed by an MIT-style license that can be
6
- * found in the LICENSE file at https://angular.io/license
6
+ * found in the LICENSE file at https://angular.dev/license
7
7
  */
8
8
  import { SIGNAL } from '../symbol.js';
9
9
  /**
@@ -12,3 +12,9 @@ import { SIGNAL } from '../symbol.js';
12
12
  export function isSignal(value) {
13
13
  return typeof value === 'function' && value[SIGNAL] !== undefined;
14
14
  }
15
+ /**
16
+ * Checks if the given `value` is a writeable signal.
17
+ */
18
+ export function isWritableSignal(value) {
19
+ return isSignal(value) && typeof value.set === 'function';
20
+ }
@@ -3,11 +3,11 @@
3
3
  * Copyright Google LLC All Rights Reserved.
4
4
  *
5
5
  * Use of this source code is governed by an MIT-style license that can be
6
- * found in the LICENSE file at https://angular.io/license
6
+ * found in the LICENSE file at https://angular.dev/license
7
7
  */
8
8
  /**
9
9
  * Asserts that the current stack frame is not within a reactive context. Useful
10
- * to disallow certain code from running inside a reactive context (see {@link toSignal}).
10
+ * to disallow certain code from running inside a reactive context (see {@link toSignal})
11
11
  *
12
12
  * @param debugFn a reference to the function making the assertion (used for the error message).
13
13
  */
@@ -3,12 +3,12 @@
3
3
  * Copyright Google LLC All Rights Reserved.
4
4
  *
5
5
  * Use of this source code is governed by an MIT-style license that can be
6
- * found in the LICENSE file at https://angular.io/license
6
+ * found in the LICENSE file at https://angular.dev/license
7
7
  */
8
- import { getActiveConsumer } from './graph.js';
8
+ import { getActiveConsumer } from './primitive/graph.js';
9
9
  /**
10
10
  * Asserts that the current stack frame is not within a reactive context. Useful
11
- * to disallow certain code from running inside a reactive context (see {@link toSignal}).
11
+ * to disallow certain code from running inside a reactive context (see {@link toSignal})
12
12
  *
13
13
  * @param debugFn a reference to the function making the assertion (used for the error message).
14
14
  */
@@ -3,41 +3,9 @@
3
3
  * Copyright Google LLC All Rights Reserved.
4
4
  *
5
5
  * Use of this source code is governed by an MIT-style license that can be
6
- * found in the LICENSE file at https://angular.io/license
6
+ * found in the LICENSE file at https://angular.dev/license
7
7
  */
8
- import type { Signal } from './api.js';
9
- import type { ValueEqualityFn } from './equality.js';
10
- import type { ReactiveNode } from './graph.js';
11
- import { SIGNAL } from './graph.js';
12
- /**
13
- * A computation, which derives a value from a declarative reactive expression.
14
- *
15
- * `Computed`s are both producers and consumers of reactivity.
16
- */
17
- export interface ComputedNode<T> extends ReactiveNode {
18
- /**
19
- * Current value of the computation, or one of the sentinel values above (`UNSET`, `COMPUTING`,
20
- * `ERROR`).
21
- */
22
- value: T;
23
- /**
24
- * If `value` is `ERRORED`, the error caught from the last computation attempt which will
25
- * be re-thrown.
26
- */
27
- error: unknown;
28
- /**
29
- * The computation function which will produce a new value.
30
- */
31
- computation: () => T;
32
- equal: ValueEqualityFn<T>;
33
- }
34
- export type ComputedGetter<T> = (() => T) & {
35
- [SIGNAL]: ComputedNode<T>;
36
- };
37
- /**
38
- * Create a computed signal which derives a reactive value from an expression.
39
- */
40
- export declare function createComputed<T>(computation: () => T): ComputedGetter<T>;
8
+ import type { Signal, ValueEqualityFn } from './api.js';
41
9
  /**
42
10
  * Options passed to the `computed` creation function.
43
11
  */
@@ -46,8 +14,13 @@ export interface CreateComputedOptions<T> {
46
14
  * A comparison function which defines equality for computed values.
47
15
  */
48
16
  equal?: ValueEqualityFn<T>;
17
+ /**
18
+ * A debug name for the computed signal. Used in Angular DevTools to identify the signal.
19
+ */
20
+ debugName?: string;
49
21
  }
50
22
  /**
51
23
  * Create a computed `Signal` which derives a reactive value from an expression.
24
+ * @see [Computed signals](guide/signals#computed-signals)
52
25
  */
53
26
  export declare function computed<T>(computation: () => T, options?: CreateComputedOptions<T>): Signal<T>;
@@ -1,92 +1,23 @@
1
- /* eslint-disable */
2
- import { defaultEquals } from './equality.js';
3
- import { consumerAfterComputation, consumerBeforeComputation, producerAccessed, producerUpdateValueVersion, REACTIVE_NODE, SIGNAL } from './graph.js';
4
1
  /**
5
- * Create a computed signal which derives a reactive value from an expression.
2
+ * @license
3
+ * Copyright Google LLC All Rights Reserved.
4
+ *
5
+ * Use of this source code is governed by an MIT-style license that can be
6
+ * found in the LICENSE file at https://angular.dev/license
6
7
  */
7
- export function createComputed(computation) {
8
- const node = Object.create(COMPUTED_NODE);
9
- node.computation = computation;
10
- const computed = () => {
11
- // Check if the value needs updating before returning it.
12
- producerUpdateValueVersion(node);
13
- // Record that someone looked at this signal.
14
- producerAccessed(node);
15
- if (node.value === ERRORED) {
16
- throw node.error;
17
- }
18
- return node.value;
19
- };
20
- computed[SIGNAL] = node;
21
- return computed;
22
- }
23
- /**
24
- * A dedicated symbol used before a computed value has been calculated for the first time.
25
- * Explicitly typed as `any` so we can use it as signal's value.
26
- */
27
- const UNSET = /* @__PURE__ */ Symbol('UNSET');
28
- /**
29
- * A dedicated symbol used in place of a computed signal value to indicate that a given computation
30
- * is in progress. Used to detect cycles in computation chains.
31
- * Explicitly typed as `any` so we can use it as signal's value.
32
- */
33
- const COMPUTING = /* @__PURE__ */ Symbol('COMPUTING');
34
- /**
35
- * A dedicated symbol used in place of a computed signal value to indicate that a given computation
36
- * failed. The thrown error is cached until the computation gets dirty again.
37
- * Explicitly typed as `any` so we can use it as signal's value.
38
- */
39
- const ERRORED = /* @__PURE__ */ Symbol('ERRORED');
40
- const COMPUTED_NODE = {
41
- ...REACTIVE_NODE,
42
- value: UNSET,
43
- dirty: true,
44
- error: null,
45
- equal: defaultEquals,
46
- producerMustRecompute(node) {
47
- // Force a recomputation if there's no current value, or if the current value is in the
48
- // process of being calculated (which should throw an error).
49
- return node.value === UNSET || node.value === COMPUTING;
50
- },
51
- producerRecomputeValue(node) {
52
- if (node.value === COMPUTING) {
53
- // Our computation somehow led to a cyclic read of itself.
54
- throw new Error('Detected cycle in computations.');
55
- }
56
- const oldValue = node.value;
57
- node.value = COMPUTING;
58
- const prevConsumer = consumerBeforeComputation(node);
59
- let newValue;
60
- try {
61
- newValue = node.computation();
62
- }
63
- catch (err) {
64
- newValue = ERRORED;
65
- node.error = err;
66
- }
67
- finally {
68
- consumerAfterComputation(node, prevConsumer);
69
- }
70
- if (oldValue !== UNSET &&
71
- oldValue !== ERRORED &&
72
- newValue !== ERRORED &&
73
- node.equal(oldValue, newValue)) {
74
- // No change to `valueVersion` - old and new values are
75
- // semantically equivalent.
76
- node.value = oldValue;
77
- return;
78
- }
79
- node.value = newValue;
80
- node.version++;
81
- },
82
- };
8
+ import { isDevMode } from '../../core.js';
9
+ import { SIGNAL } from '../symbol.js';
10
+ import { createComputed } from './primitive/computed.js';
83
11
  /**
84
12
  * Create a computed `Signal` which derives a reactive value from an expression.
13
+ * @see [Computed signals](guide/signals#computed-signals)
85
14
  */
86
15
  export function computed(computation, options) {
87
- const getter = createComputed(computation);
88
- if (options?.equal) {
89
- getter[SIGNAL].equal = options.equal;
16
+ const getter = createComputed(computation, options?.equal);
17
+ if (isDevMode()) {
18
+ const debugName = options?.debugName;
19
+ getter[SIGNAL].debugName = debugName;
20
+ getter.toString = () => `[Computed${debugName ? ' (' + debugName + ')' : ''}: ${getter()}]`;
90
21
  }
91
22
  return getter;
92
23
  }
@@ -2,10 +2,12 @@ import { configureSignals } from '../api.js';
2
2
  import { isSignal } from './api.js';
3
3
  import { computed } from './computed.js';
4
4
  import { effect } from './effect.js';
5
+ import { linkedSignal } from './linked_signal.js';
6
+ import { resource } from './resource/resource.js';
7
+ import { signal } from './signal.js';
5
8
  import { toObservable } from './to-observable.js';
6
9
  import { toSignal } from './to-signal.js';
7
10
  import { untracked } from './untracked.js';
8
- import { signal } from './writable-signal.js';
9
11
  /**
10
12
  * registers default signals implementation in container
11
13
  */
@@ -15,11 +17,13 @@ export function configureDefaultSignalsImplementation() {
15
17
  computed,
16
18
  effect,
17
19
  untracked,
20
+ linkedSignal,
21
+ resource,
18
22
  isSignal,
19
23
  toSignal,
20
24
  toObservable,
21
25
  isInSignalsInjectionContext: () => true,
22
26
  getCurrentSignalsInjector: () => null,
23
- runInSignalsInjectionContext: (_, fn) => fn()
27
+ runInSignalsInjectionContext: (_, fn) => fn(),
24
28
  });
25
29
  }
@@ -1,45 +1,8 @@
1
- /**
2
- * @license
3
- * Copyright Google LLC All Rights Reserved.
4
- *
5
- * Use of this source code is governed by an MIT-style license that can be
6
- * found in the LICENSE file at https://angular.io/license
7
- */
1
+ /** biome-ignore-all lint: <explanation> */
8
2
  import type { SignalsInjector } from '../api.js';
9
- /**
10
- * An effect can, optionally, register a cleanup function. If registered, the cleanup is executed
11
- * before the next effect run. The cleanup function makes it possible to "cancel" any work that the
12
- * previous effect run might have started.
13
- */
14
- export type EffectCleanupFn = () => void;
15
- /**
16
- * A callback passed to the effect function that makes it possible to register cleanup logic.
17
- */
18
- export type EffectCleanupRegisterFn = (cleanupFn: EffectCleanupFn) => void;
19
- export interface SchedulableEffect {
20
- run(): void;
21
- }
22
- /**
23
- * A scheduler which manages the execution of effects.
24
- */
25
- export declare abstract class EffectScheduler {
26
- /**
27
- * Schedule the given effect to be executed at a later time.
28
- *
29
- * It is an error to attempt to execute any effects synchronously during a scheduling operation.
30
- */
31
- abstract scheduleEffect(e: SchedulableEffect): void;
32
- /**
33
- * Run any scheduled effects.
34
- */
35
- abstract flush(): void;
36
- }
37
- export declare class TstdlEffectScheduler implements EffectScheduler {
38
- private readonly queue;
39
- private hasPendingFlush;
40
- scheduleEffect(effect: SchedulableEffect): void;
41
- flush(): void;
42
- }
3
+ import { SIGNAL } from '../symbol.js';
4
+ import { type BaseEffectNode } from './primitive/effect.js';
5
+ import { type EffectScheduler, type SchedulableEffect } from './root_effect_scheduler.js';
43
6
  /**
44
7
  * A global reactive effect, which can be manually destroyed.
45
8
  */
@@ -49,8 +12,15 @@ export interface EffectRef {
49
12
  */
50
13
  destroy(): void;
51
14
  }
15
+ export declare class EffectRefImpl implements EffectRef {
16
+ [SIGNAL]: EffectNode;
17
+ constructor(node: EffectNode);
18
+ destroy(): void;
19
+ }
52
20
  /**
53
21
  * Options passed to the `effect` function.
22
+ *
23
+ * @publicApi 20.0
54
24
  */
55
25
  export interface CreateEffectOptions {
56
26
  /**
@@ -65,17 +35,66 @@ export interface CreateEffectOptions {
65
35
  *
66
36
  * If this is `false` (the default) the effect will automatically register itself to be cleaned up
67
37
  * with the current `DestroyRef`.
38
+ *
39
+ * If this is `true` and you want to use the effect outside an injection context, you still
40
+ * need to provide an `Injector` to the effect.
68
41
  */
69
42
  manualCleanup?: boolean;
70
43
  /**
71
- * Whether the `effect` should allow writing to signals.
72
- *
73
- * Using effects to synchronize data by writing to signals can lead to confusing and potentially
74
- * incorrect behavior, and should be enabled only when necessary.
44
+ * @deprecated no longer required, signal writes are allowed by default.
75
45
  */
76
46
  allowSignalWrites?: boolean;
47
+ /**
48
+ * A debug name for the effect. Used in Angular DevTools to identify the effect.
49
+ */
50
+ debugName?: string;
77
51
  }
78
52
  /**
79
- * Create a global `Effect` for the given reactive function.
53
+ * An effect can, optionally, register a cleanup function. If registered, the cleanup is executed
54
+ * before the next effect run. The cleanup function makes it possible to "cancel" any work that the
55
+ * previous effect run might have started.
56
+ *
57
+ * @see [Effect cleanup functions](guide/signals#effect-cleanup-functions)
58
+ *
59
+ * @publicApi 20.0
60
+ */
61
+ export type EffectCleanupFn = () => void;
62
+ /**
63
+ * A callback passed to the effect function that makes it possible to register cleanup logic.
64
+ *
65
+ * @see [Effect cleanup functions](guide/signals#effect-cleanup-functions)
66
+ *
67
+ * @publicApi 20.0
68
+ */
69
+ export type EffectCleanupRegisterFn = (cleanupFn: EffectCleanupFn) => void;
70
+ /**
71
+ * Registers an "effect" that will be scheduled & executed whenever the signals that it reads
72
+ * changes.
73
+ *
74
+ * Angular has two different kinds of effect: component effects and root effects. Component effects
75
+ * are created when `effect()` is called from a component, directive, or within a service of a
76
+ * component/directive. Root effects are created when `effect()` is called from outside the
77
+ * component tree, such as in a root service.
78
+ *
79
+ * The two effect types differ in their timing. Component effects run as a component lifecycle
80
+ * event during Angular's synchronization (change detection) process, and can safely read input
81
+ * signals or create/destroy views that depend on component state. Root effects run as microtasks
82
+ * and have no connection to the component tree or change detection.
83
+ *
84
+ * `effect()` must be run in injection context, unless the `injector` option is manually specified.
85
+ *
86
+ * @see [Effects](guide/signals#effects)
87
+ *
88
+ * @publicApi 20.0
80
89
  */
81
90
  export declare function effect(effectFn: (onCleanup: EffectCleanupRegisterFn) => void, options?: CreateEffectOptions): EffectRef;
91
+ export interface EffectNode extends BaseEffectNode, SchedulableEffect {
92
+ cleanupFns: EffectCleanupFn[] | undefined;
93
+ onDestroyFns: (() => void)[] | null;
94
+ }
95
+ export interface RootEffectNode extends EffectNode {
96
+ scheduler: EffectScheduler;
97
+ }
98
+ export declare const EFFECT_NODE: Omit<EffectNode, 'fn' | 'destroy' | 'injector' | 'notifier'>;
99
+ export declare const ROOT_EFFECT_NODE: Omit<RootEffectNode, 'fn' | 'scheduler' | 'notifier' | 'injector'>;
100
+ export declare function createRootEffect(fn: (onCleanup: EffectCleanupRegisterFn) => void, scheduler: EffectScheduler): RootEffectNode;