@typed/fx 1.32.0 → 2.0.0-beta.1

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 (881) hide show
  1. package/README.md +367 -2
  2. package/dist/Fx/Fx.d.ts +96 -0
  3. package/dist/Fx/Fx.d.ts.map +1 -0
  4. package/dist/Fx/Fx.js +35 -0
  5. package/dist/Fx/TypeId.d.ts +20 -0
  6. package/dist/Fx/TypeId.d.ts.map +1 -0
  7. package/dist/Fx/TypeId.js +15 -0
  8. package/dist/Fx/combinators/additive.d.ts +94 -0
  9. package/dist/Fx/combinators/additive.d.ts.map +1 -0
  10. package/dist/Fx/combinators/additive.js +92 -0
  11. package/dist/Fx/combinators/catch.d.ts +114 -0
  12. package/dist/Fx/combinators/catch.d.ts.map +1 -0
  13. package/dist/Fx/combinators/catch.js +123 -0
  14. package/dist/Fx/combinators/causes.d.ts +12 -0
  15. package/dist/Fx/combinators/causes.d.ts.map +1 -0
  16. package/dist/Fx/combinators/causes.js +16 -0
  17. package/dist/Fx/combinators/changesWithEffect.d.ts +20 -0
  18. package/dist/Fx/combinators/changesWithEffect.d.ts.map +1 -0
  19. package/dist/Fx/combinators/changesWithEffect.js +28 -0
  20. package/dist/Fx/combinators/compact.d.ts +12 -0
  21. package/dist/Fx/combinators/compact.d.ts.map +1 -0
  22. package/dist/Fx/combinators/compact.js +11 -0
  23. package/dist/Fx/combinators/continueWith.d.ts +51 -0
  24. package/dist/Fx/combinators/continueWith.d.ts.map +1 -0
  25. package/dist/Fx/combinators/continueWith.js +41 -0
  26. package/dist/Fx/combinators/dropUntil.d.ts +29 -0
  27. package/dist/Fx/combinators/dropUntil.d.ts.map +1 -0
  28. package/dist/Fx/combinators/dropUntil.js +23 -0
  29. package/dist/Fx/combinators/ensuring.d.ts +16 -0
  30. package/dist/Fx/combinators/ensuring.d.ts.map +1 -0
  31. package/dist/Fx/combinators/ensuring.js +13 -0
  32. package/dist/Fx/combinators/exhaustLatestMap.d.ts +15 -0
  33. package/dist/Fx/combinators/exhaustLatestMap.d.ts.map +1 -0
  34. package/dist/Fx/combinators/exhaustLatestMap.js +48 -0
  35. package/dist/Fx/combinators/exhaustLatestMapEffect.d.ts +13 -0
  36. package/dist/Fx/combinators/exhaustLatestMapEffect.d.ts.map +1 -0
  37. package/dist/Fx/combinators/exhaustLatestMapEffect.js +14 -0
  38. package/dist/Fx/combinators/exhaustMap.d.ts +11 -0
  39. package/dist/Fx/combinators/exhaustMap.d.ts.map +1 -0
  40. package/dist/Fx/combinators/exhaustMap.js +19 -0
  41. package/dist/Fx/combinators/exhaustMapEffect.d.ts +11 -0
  42. package/dist/Fx/combinators/exhaustMapEffect.d.ts.map +1 -0
  43. package/dist/Fx/combinators/exhaustMapEffect.js +12 -0
  44. package/dist/Fx/combinators/exit.d.ts +12 -0
  45. package/dist/Fx/combinators/exit.d.ts.map +1 -0
  46. package/dist/Fx/combinators/exit.js +11 -0
  47. package/dist/Fx/combinators/filter.d.ts +14 -0
  48. package/dist/Fx/combinators/filter.d.ts.map +1 -0
  49. package/dist/Fx/combinators/filter.js +12 -0
  50. package/dist/Fx/combinators/filterEffect.d.ts +15 -0
  51. package/dist/Fx/combinators/filterEffect.d.ts.map +1 -0
  52. package/dist/Fx/combinators/filterEffect.js +12 -0
  53. package/dist/Fx/combinators/filterMap.d.ts +15 -0
  54. package/dist/Fx/combinators/filterMap.d.ts.map +1 -0
  55. package/dist/Fx/combinators/filterMap.js +12 -0
  56. package/dist/Fx/combinators/filterMapEffect.d.ts +16 -0
  57. package/dist/Fx/combinators/filterMapEffect.d.ts.map +1 -0
  58. package/dist/Fx/combinators/filterMapEffect.js +12 -0
  59. package/dist/Fx/combinators/filterMapLoop.d.ts +17 -0
  60. package/dist/Fx/combinators/filterMapLoop.d.ts.map +1 -0
  61. package/dist/Fx/combinators/filterMapLoop.js +14 -0
  62. package/dist/Fx/combinators/filterMapLoopCause.d.ts +18 -0
  63. package/dist/Fx/combinators/filterMapLoopCause.d.ts.map +1 -0
  64. package/dist/Fx/combinators/filterMapLoopCause.js +14 -0
  65. package/dist/Fx/combinators/filterMapLoopCauseEffect.d.ts +18 -0
  66. package/dist/Fx/combinators/filterMapLoopCauseEffect.d.ts.map +1 -0
  67. package/dist/Fx/combinators/filterMapLoopCauseEffect.js +13 -0
  68. package/dist/Fx/combinators/filterMapLoopEffect.d.ts +17 -0
  69. package/dist/Fx/combinators/filterMapLoopEffect.d.ts.map +1 -0
  70. package/dist/Fx/combinators/filterMapLoopEffect.js +13 -0
  71. package/dist/Fx/combinators/flatMap.d.ts +23 -0
  72. package/dist/Fx/combinators/flatMap.d.ts.map +1 -0
  73. package/dist/Fx/combinators/flatMap.js +21 -0
  74. package/dist/Fx/combinators/flatMapConcurrently.d.ts +12 -0
  75. package/dist/Fx/combinators/flatMapConcurrently.d.ts.map +1 -0
  76. package/dist/Fx/combinators/flatMapConcurrently.js +23 -0
  77. package/dist/Fx/combinators/flatMapConcurrentlyEffect.d.ts +12 -0
  78. package/dist/Fx/combinators/flatMapConcurrentlyEffect.d.ts.map +1 -0
  79. package/dist/Fx/combinators/flatMapConcurrentlyEffect.js +13 -0
  80. package/dist/Fx/combinators/flatMapEffect.d.ts +24 -0
  81. package/dist/Fx/combinators/flatMapEffect.d.ts.map +1 -0
  82. package/dist/Fx/combinators/flatMapEffect.js +14 -0
  83. package/dist/Fx/combinators/flip.d.ts +11 -0
  84. package/dist/Fx/combinators/flip.d.ts.map +1 -0
  85. package/dist/Fx/combinators/flip.js +11 -0
  86. package/dist/Fx/combinators/gen.d.ts +20 -0
  87. package/dist/Fx/combinators/gen.d.ts.map +1 -0
  88. package/dist/Fx/combinators/gen.js +14 -0
  89. package/dist/Fx/combinators/genScoped.d.ts +20 -0
  90. package/dist/Fx/combinators/genScoped.d.ts.map +1 -0
  91. package/dist/Fx/combinators/genScoped.js +13 -0
  92. package/dist/Fx/combinators/index.d.ts +62 -0
  93. package/dist/Fx/combinators/index.d.ts.map +1 -0
  94. package/dist/Fx/combinators/index.js +61 -0
  95. package/dist/Fx/combinators/keyed.d.ts +44 -0
  96. package/dist/Fx/combinators/keyed.d.ts.map +1 -0
  97. package/dist/Fx/combinators/keyed.js +199 -0
  98. package/dist/Fx/combinators/loop.d.ts +16 -0
  99. package/dist/Fx/combinators/loop.d.ts.map +1 -0
  100. package/dist/Fx/combinators/loop.js +14 -0
  101. package/dist/Fx/combinators/loopCause.d.ts +16 -0
  102. package/dist/Fx/combinators/loopCause.d.ts.map +1 -0
  103. package/dist/Fx/combinators/loopCause.js +13 -0
  104. package/dist/Fx/combinators/loopCauseEffect.d.ts +17 -0
  105. package/dist/Fx/combinators/loopCauseEffect.d.ts.map +1 -0
  106. package/dist/Fx/combinators/loopCauseEffect.js +13 -0
  107. package/dist/Fx/combinators/loopEffect.d.ts +16 -0
  108. package/dist/Fx/combinators/loopEffect.d.ts.map +1 -0
  109. package/dist/Fx/combinators/loopEffect.js +13 -0
  110. package/dist/Fx/combinators/map.d.ts +14 -0
  111. package/dist/Fx/combinators/map.d.ts.map +1 -0
  112. package/dist/Fx/combinators/map.js +12 -0
  113. package/dist/Fx/combinators/mapBoth.d.ts +21 -0
  114. package/dist/Fx/combinators/mapBoth.d.ts.map +1 -0
  115. package/dist/Fx/combinators/mapBoth.js +14 -0
  116. package/dist/Fx/combinators/mapEffect.d.ts +15 -0
  117. package/dist/Fx/combinators/mapEffect.d.ts.map +1 -0
  118. package/dist/Fx/combinators/mapEffect.js +12 -0
  119. package/dist/Fx/combinators/mapError.d.ts +17 -0
  120. package/dist/Fx/combinators/mapError.d.ts.map +1 -0
  121. package/dist/Fx/combinators/mapError.js +16 -0
  122. package/dist/Fx/combinators/mergeAll.d.ts +11 -0
  123. package/dist/Fx/combinators/mergeAll.d.ts.map +1 -0
  124. package/dist/Fx/combinators/mergeAll.js +15 -0
  125. package/dist/Fx/combinators/mergeOrdered.d.ts +14 -0
  126. package/dist/Fx/combinators/mergeOrdered.d.ts.map +1 -0
  127. package/dist/Fx/combinators/mergeOrdered.js +89 -0
  128. package/dist/Fx/combinators/onError.d.ts +17 -0
  129. package/dist/Fx/combinators/onError.d.ts.map +1 -0
  130. package/dist/Fx/combinators/onError.js +14 -0
  131. package/dist/Fx/combinators/onExit.d.ts +16 -0
  132. package/dist/Fx/combinators/onExit.d.ts.map +1 -0
  133. package/dist/Fx/combinators/onExit.js +39 -0
  134. package/dist/Fx/combinators/onInterrupt.d.ts +16 -0
  135. package/dist/Fx/combinators/onInterrupt.d.ts.map +1 -0
  136. package/dist/Fx/combinators/onInterrupt.js +38 -0
  137. package/dist/Fx/combinators/provide.d.ts +56 -0
  138. package/dist/Fx/combinators/provide.d.ts.map +1 -0
  139. package/dist/Fx/combinators/provide.js +54 -0
  140. package/dist/Fx/combinators/result.d.ts +23 -0
  141. package/dist/Fx/combinators/result.d.ts.map +1 -0
  142. package/dist/Fx/combinators/result.js +32 -0
  143. package/dist/Fx/combinators/scan.d.ts +33 -0
  144. package/dist/Fx/combinators/scan.d.ts.map +1 -0
  145. package/dist/Fx/combinators/scan.js +38 -0
  146. package/dist/Fx/combinators/skip.d.ts +27 -0
  147. package/dist/Fx/combinators/skip.d.ts.map +1 -0
  148. package/dist/Fx/combinators/skip.js +22 -0
  149. package/dist/Fx/combinators/skipRepeats.d.ts +11 -0
  150. package/dist/Fx/combinators/skipRepeats.d.ts.map +1 -0
  151. package/dist/Fx/combinators/skipRepeats.js +12 -0
  152. package/dist/Fx/combinators/skipRepeatsWith.d.ts +12 -0
  153. package/dist/Fx/combinators/skipRepeatsWith.d.ts.map +1 -0
  154. package/dist/Fx/combinators/skipRepeatsWith.js +20 -0
  155. package/dist/Fx/combinators/skipWhile.d.ts +49 -0
  156. package/dist/Fx/combinators/skipWhile.d.ts.map +1 -0
  157. package/dist/Fx/combinators/skipWhile.js +66 -0
  158. package/dist/Fx/combinators/slice.d.ts +36 -0
  159. package/dist/Fx/combinators/slice.d.ts.map +1 -0
  160. package/dist/Fx/combinators/slice.js +23 -0
  161. package/dist/Fx/combinators/switchMap.d.ts +13 -0
  162. package/dist/Fx/combinators/switchMap.d.ts.map +1 -0
  163. package/dist/Fx/combinators/switchMap.js +33 -0
  164. package/dist/Fx/combinators/switchMapEffect.d.ts +13 -0
  165. package/dist/Fx/combinators/switchMapEffect.d.ts.map +1 -0
  166. package/dist/Fx/combinators/switchMapEffect.js +14 -0
  167. package/dist/Fx/combinators/take.d.ts +27 -0
  168. package/dist/Fx/combinators/take.d.ts.map +1 -0
  169. package/dist/Fx/combinators/take.js +22 -0
  170. package/dist/Fx/combinators/takeUntil.d.ts +42 -0
  171. package/dist/Fx/combinators/takeUntil.d.ts.map +1 -0
  172. package/dist/Fx/combinators/takeUntil.js +45 -0
  173. package/dist/Fx/combinators/takeWhile.d.ts +29 -0
  174. package/dist/Fx/combinators/takeWhile.d.ts.map +1 -0
  175. package/dist/Fx/combinators/takeWhile.js +23 -0
  176. package/dist/Fx/combinators/tapEffect.d.ts +15 -0
  177. package/dist/Fx/combinators/tapEffect.d.ts.map +1 -0
  178. package/dist/Fx/combinators/tapEffect.js +18 -0
  179. package/dist/Fx/combinators/tuple.d.ts +27 -0
  180. package/dist/Fx/combinators/tuple.d.ts.map +1 -0
  181. package/dist/Fx/combinators/tuple.js +46 -0
  182. package/dist/Fx/combinators/unwrap.d.ts +12 -0
  183. package/dist/Fx/combinators/unwrap.d.ts.map +1 -0
  184. package/dist/Fx/combinators/unwrap.js +14 -0
  185. package/dist/Fx/combinators/unwrapScoped.d.ts +15 -0
  186. package/dist/Fx/combinators/unwrapScoped.d.ts.map +1 -0
  187. package/dist/Fx/combinators/unwrapScoped.js +16 -0
  188. package/dist/Fx/combinators/when.d.ts +36 -0
  189. package/dist/Fx/combinators/when.d.ts.map +1 -0
  190. package/dist/Fx/combinators/when.js +28 -0
  191. package/dist/Fx/combinators/withSpan.d.ts +4 -0
  192. package/dist/Fx/combinators/withSpan.d.ts.map +1 -0
  193. package/dist/Fx/combinators/withSpan.js +6 -0
  194. package/dist/Fx/combinators/zip.d.ts +75 -0
  195. package/dist/Fx/combinators/zip.d.ts.map +1 -0
  196. package/dist/Fx/combinators/zip.js +100 -0
  197. package/dist/Fx/constructors/at.d.ts +16 -0
  198. package/dist/Fx/constructors/at.d.ts.map +1 -0
  199. package/dist/Fx/constructors/at.js +13 -0
  200. package/dist/Fx/constructors/die.d.ts +11 -0
  201. package/dist/Fx/constructors/die.d.ts.map +1 -0
  202. package/dist/Fx/constructors/die.js +12 -0
  203. package/dist/Fx/constructors/empty.d.ts +8 -0
  204. package/dist/Fx/constructors/empty.d.ts.map +1 -0
  205. package/dist/Fx/constructors/empty.js +8 -0
  206. package/dist/Fx/constructors/fail.d.ts +11 -0
  207. package/dist/Fx/constructors/fail.d.ts.map +1 -0
  208. package/dist/Fx/constructors/fail.js +12 -0
  209. package/dist/Fx/constructors/failCause.d.ts +12 -0
  210. package/dist/Fx/constructors/failCause.d.ts.map +1 -0
  211. package/dist/Fx/constructors/failCause.js +11 -0
  212. package/dist/Fx/constructors/fn.d.ts +47 -0
  213. package/dist/Fx/constructors/fn.d.ts.map +1 -0
  214. package/dist/Fx/constructors/fn.js +23 -0
  215. package/dist/Fx/constructors/fromEffect.d.ts +21 -0
  216. package/dist/Fx/constructors/fromEffect.d.ts.map +1 -0
  217. package/dist/Fx/constructors/fromEffect.js +21 -0
  218. package/dist/Fx/constructors/fromFailures.d.ts +10 -0
  219. package/dist/Fx/constructors/fromFailures.d.ts.map +1 -0
  220. package/dist/Fx/constructors/fromFailures.js +13 -0
  221. package/dist/Fx/constructors/fromIterable.d.ts +12 -0
  222. package/dist/Fx/constructors/fromIterable.d.ts.map +1 -0
  223. package/dist/Fx/constructors/fromIterable.js +12 -0
  224. package/dist/Fx/constructors/fromSchedule.d.ts +13 -0
  225. package/dist/Fx/constructors/fromSchedule.d.ts.map +1 -0
  226. package/dist/Fx/constructors/fromSchedule.js +13 -0
  227. package/dist/Fx/constructors/fromYieldable.d.ts +12 -0
  228. package/dist/Fx/constructors/fromYieldable.d.ts.map +1 -0
  229. package/dist/Fx/constructors/fromYieldable.js +12 -0
  230. package/dist/Fx/constructors/index.d.ts +16 -0
  231. package/dist/Fx/constructors/index.d.ts.map +1 -0
  232. package/dist/Fx/constructors/index.js +15 -0
  233. package/dist/Fx/constructors/interrupt.d.ts +10 -0
  234. package/dist/Fx/constructors/interrupt.d.ts.map +1 -0
  235. package/dist/Fx/constructors/interrupt.js +12 -0
  236. package/dist/Fx/constructors/make.d.ts +40 -0
  237. package/dist/Fx/constructors/make.d.ts.map +1 -0
  238. package/dist/Fx/constructors/make.js +61 -0
  239. package/dist/Fx/constructors/periodic.d.ts +12 -0
  240. package/dist/Fx/constructors/periodic.d.ts.map +1 -0
  241. package/dist/Fx/constructors/periodic.js +12 -0
  242. package/dist/Fx/constructors/succeed.d.ts +32 -0
  243. package/dist/Fx/constructors/succeed.d.ts.map +1 -0
  244. package/dist/Fx/constructors/succeed.js +32 -0
  245. package/dist/Fx/constructors/suspend.d.ts +3 -0
  246. package/dist/Fx/constructors/suspend.d.ts.map +1 -0
  247. package/dist/Fx/constructors/suspend.js +3 -0
  248. package/dist/Fx/index.d.ts +7 -0
  249. package/dist/Fx/index.d.ts.map +1 -0
  250. package/dist/Fx/index.js +6 -0
  251. package/dist/Fx/internal/DeferredRef.d.ts +29 -0
  252. package/dist/Fx/internal/DeferredRef.d.ts.map +1 -0
  253. package/dist/Fx/internal/DeferredRef.js +63 -0
  254. package/dist/Fx/internal/UnionToTuple.d.ts.map +1 -0
  255. package/dist/Fx/internal/UnionToTuple.js +1 -0
  256. package/dist/Fx/internal/diff.d.ts +44 -0
  257. package/dist/Fx/internal/diff.d.ts.map +1 -0
  258. package/dist/Fx/internal/diff.js +106 -0
  259. package/dist/Fx/internal/equivalence.d.ts +4 -0
  260. package/dist/Fx/internal/equivalence.d.ts.map +1 -0
  261. package/dist/Fx/internal/equivalence.js +10 -0
  262. package/dist/Fx/internal/multicast.d.ts +10 -0
  263. package/dist/Fx/internal/multicast.d.ts.map +1 -0
  264. package/dist/Fx/internal/multicast.js +32 -0
  265. package/dist/Fx/internal/ring-buffer.d.ts +14 -0
  266. package/dist/Fx/internal/ring-buffer.d.ts.map +1 -0
  267. package/dist/Fx/internal/ring-buffer.js +52 -0
  268. package/dist/Fx/internal/scope.d.ts +11 -0
  269. package/dist/Fx/internal/scope.d.ts.map +1 -0
  270. package/dist/Fx/internal/scope.js +12 -0
  271. package/dist/Fx/internal/yieldable.d.ts +17 -0
  272. package/dist/Fx/internal/yieldable.d.ts.map +1 -0
  273. package/dist/Fx/internal/yieldable.js +20 -0
  274. package/dist/Fx/run/collect.d.ts +45 -0
  275. package/dist/Fx/run/collect.d.ts.map +1 -0
  276. package/dist/Fx/run/collect.js +51 -0
  277. package/dist/Fx/run/first.d.ts +14 -0
  278. package/dist/Fx/run/first.d.ts.map +1 -0
  279. package/dist/Fx/run/first.js +16 -0
  280. package/dist/Fx/run/fork.d.ts +29 -0
  281. package/dist/Fx/run/fork.d.ts.map +1 -0
  282. package/dist/Fx/run/fork.js +27 -0
  283. package/dist/Fx/run/index.d.ts +6 -0
  284. package/dist/Fx/run/index.d.ts.map +1 -0
  285. package/dist/Fx/run/index.js +5 -0
  286. package/dist/Fx/run/observe.d.ts +53 -0
  287. package/dist/Fx/run/observe.d.ts.map +1 -0
  288. package/dist/Fx/run/observe.js +55 -0
  289. package/dist/Fx/run/runPromise.d.ts +25 -0
  290. package/dist/Fx/run/runPromise.d.ts.map +1 -0
  291. package/dist/Fx/run/runPromise.js +23 -0
  292. package/dist/Fx/stream.d.ts +7 -0
  293. package/dist/Fx/stream.d.ts.map +1 -0
  294. package/dist/Fx/stream.js +7 -0
  295. package/dist/Fx.d.ts +2 -0
  296. package/dist/Fx.d.ts.map +1 -0
  297. package/dist/Fx.js +1 -0
  298. package/dist/Push/Push.d.ts +375 -0
  299. package/dist/Push/Push.d.ts.map +1 -0
  300. package/dist/Push/Push.js +346 -0
  301. package/dist/Push/index.d.ts +2 -0
  302. package/dist/Push/index.d.ts.map +1 -0
  303. package/dist/Push/index.js +1 -0
  304. package/dist/Push.d.ts +2 -0
  305. package/dist/Push.d.ts.map +1 -0
  306. package/dist/Push.js +1 -0
  307. package/dist/RefSubject/RefArray.d.ts +328 -0
  308. package/dist/RefSubject/RefArray.d.ts.map +1 -0
  309. package/dist/RefSubject/RefArray.js +302 -0
  310. package/dist/RefSubject/RefBigDecimal.d.ts +183 -0
  311. package/dist/RefSubject/RefBigDecimal.d.ts.map +1 -0
  312. package/dist/RefSubject/RefBigDecimal.js +161 -0
  313. package/dist/RefSubject/RefBigInt.d.ts +138 -0
  314. package/dist/RefSubject/RefBigInt.d.ts.map +1 -0
  315. package/dist/RefSubject/RefBigInt.js +126 -0
  316. package/dist/RefSubject/RefBoolean.d.ts +135 -0
  317. package/dist/RefSubject/RefBoolean.d.ts.map +1 -0
  318. package/dist/RefSubject/RefBoolean.js +124 -0
  319. package/dist/RefSubject/RefCause.d.ts +100 -0
  320. package/dist/RefSubject/RefCause.d.ts.map +1 -0
  321. package/dist/RefSubject/RefCause.js +93 -0
  322. package/dist/RefSubject/RefChunk.d.ts +316 -0
  323. package/dist/RefSubject/RefChunk.d.ts.map +1 -0
  324. package/dist/RefSubject/RefChunk.js +286 -0
  325. package/dist/RefSubject/RefDateTime.d.ts +155 -0
  326. package/dist/RefSubject/RefDateTime.d.ts.map +1 -0
  327. package/dist/RefSubject/RefDateTime.js +101 -0
  328. package/dist/RefSubject/RefDuration.d.ts +126 -0
  329. package/dist/RefSubject/RefDuration.d.ts.map +1 -0
  330. package/dist/RefSubject/RefDuration.js +115 -0
  331. package/dist/RefSubject/RefGraph.d.ts +239 -0
  332. package/dist/RefSubject/RefGraph.d.ts.map +1 -0
  333. package/dist/RefSubject/RefGraph.js +272 -0
  334. package/dist/RefSubject/RefHashMap.d.ts +228 -0
  335. package/dist/RefSubject/RefHashMap.d.ts.map +1 -0
  336. package/dist/RefSubject/RefHashMap.js +212 -0
  337. package/dist/RefSubject/RefHashRing.d.ts +123 -0
  338. package/dist/RefSubject/RefHashRing.d.ts.map +1 -0
  339. package/dist/RefSubject/RefHashRing.js +115 -0
  340. package/dist/RefSubject/RefHashSet.d.ts +179 -0
  341. package/dist/RefSubject/RefHashSet.d.ts.map +1 -0
  342. package/dist/RefSubject/RefHashSet.js +164 -0
  343. package/dist/RefSubject/RefIterable.d.ts +257 -0
  344. package/dist/RefSubject/RefIterable.d.ts.map +1 -0
  345. package/dist/RefSubject/RefIterable.js +237 -0
  346. package/dist/RefSubject/RefOption.d.ts +124 -0
  347. package/dist/RefSubject/RefOption.d.ts.map +1 -0
  348. package/dist/RefSubject/RefOption.js +115 -0
  349. package/dist/RefSubject/RefRecord.d.ts +264 -0
  350. package/dist/RefSubject/RefRecord.d.ts.map +1 -0
  351. package/dist/RefSubject/RefRecord.js +249 -0
  352. package/dist/RefSubject/RefResult.d.ts +121 -0
  353. package/dist/RefSubject/RefResult.d.ts.map +1 -0
  354. package/dist/RefSubject/RefResult.js +107 -0
  355. package/dist/RefSubject/RefString.d.ts +147 -0
  356. package/dist/RefSubject/RefString.d.ts.map +1 -0
  357. package/dist/RefSubject/RefString.js +137 -0
  358. package/dist/RefSubject/RefStruct.d.ts +123 -0
  359. package/dist/RefSubject/RefStruct.d.ts.map +1 -0
  360. package/dist/RefSubject/RefStruct.js +113 -0
  361. package/dist/RefSubject/RefSubject.d.ts +1057 -0
  362. package/dist/RefSubject/RefSubject.d.ts.map +1 -0
  363. package/dist/RefSubject/RefSubject.js +1389 -0
  364. package/dist/RefSubject/RefTrie.d.ts +216 -0
  365. package/dist/RefSubject/RefTrie.d.ts.map +1 -0
  366. package/dist/RefSubject/RefTrie.js +201 -0
  367. package/dist/RefSubject/RefTuple.d.ts +107 -0
  368. package/dist/RefSubject/RefTuple.d.ts.map +1 -0
  369. package/dist/RefSubject/RefTuple.js +94 -0
  370. package/dist/RefSubject/index.d.ts +22 -0
  371. package/dist/RefSubject/index.d.ts.map +1 -0
  372. package/dist/RefSubject/index.js +21 -0
  373. package/dist/RefSubject.d.ts +2 -0
  374. package/dist/RefSubject.d.ts.map +1 -0
  375. package/dist/RefSubject.js +1 -0
  376. package/dist/Sink/Sink.d.ts +94 -0
  377. package/dist/Sink/Sink.d.ts.map +1 -0
  378. package/dist/Sink/Sink.js +34 -0
  379. package/dist/Sink/combinators.d.ts +228 -0
  380. package/dist/Sink/combinators.d.ts.map +1 -0
  381. package/dist/Sink/combinators.js +689 -0
  382. package/dist/Sink/index.d.ts +3 -0
  383. package/dist/Sink/index.d.ts.map +1 -0
  384. package/dist/Sink/index.js +2 -0
  385. package/dist/Sink.d.ts +2 -0
  386. package/dist/Sink.d.ts.map +1 -0
  387. package/dist/Sink.js +1 -0
  388. package/dist/Subject/Subject.d.ts +152 -0
  389. package/dist/Subject/Subject.d.ts.map +1 -0
  390. package/dist/Subject/Subject.js +272 -0
  391. package/dist/Subject/index.d.ts +2 -0
  392. package/dist/Subject/index.d.ts.map +1 -0
  393. package/dist/Subject/index.js +1 -0
  394. package/dist/Subject.d.ts +2 -0
  395. package/dist/Subject.d.ts.map +1 -0
  396. package/dist/Subject.js +1 -0
  397. package/dist/Versioned/Versioned.d.ts +206 -0
  398. package/dist/Versioned/Versioned.d.ts.map +1 -0
  399. package/dist/Versioned/Versioned.js +246 -0
  400. package/dist/Versioned/index.d.ts +2 -0
  401. package/dist/Versioned/index.d.ts.map +1 -0
  402. package/dist/Versioned/index.js +1 -0
  403. package/dist/Versioned.d.ts +2 -0
  404. package/dist/Versioned.d.ts.map +1 -0
  405. package/dist/Versioned.js +1 -0
  406. package/dist/index.d.ts +8 -0
  407. package/dist/index.d.ts.map +1 -0
  408. package/dist/index.js +7 -0
  409. package/package.json +26 -195
  410. package/src/Fx/Fx.ts +164 -0
  411. package/src/Fx/TypeId.ts +25 -0
  412. package/src/Fx/combinators/additive.ts +142 -0
  413. package/src/Fx/combinators/catch.ts +421 -0
  414. package/src/Fx/combinators/causes.ts +23 -0
  415. package/src/Fx/combinators/changesWithEffect.ts +66 -0
  416. package/src/Fx/combinators/compact.ts +15 -0
  417. package/src/Fx/combinators/continueWith.ts +78 -0
  418. package/src/Fx/combinators/dropUntil.ts +47 -0
  419. package/src/Fx/combinators/ensuring.ts +23 -0
  420. package/src/Fx/combinators/exhaustLatestMap.ts +74 -0
  421. package/src/Fx/combinators/exhaustLatestMapEffect.ts +25 -0
  422. package/src/Fx/combinators/exhaustMap.ts +36 -0
  423. package/src/Fx/combinators/exhaustMapEffect.ts +23 -0
  424. package/src/Fx/combinators/exit.ts +15 -0
  425. package/src/Fx/combinators/filter.ts +22 -0
  426. package/src/Fx/combinators/filterEffect.ts +31 -0
  427. package/src/Fx/combinators/filterMap.ts +23 -0
  428. package/src/Fx/combinators/filterMapEffect.ts +32 -0
  429. package/src/Fx/combinators/filterMapLoop.ts +35 -0
  430. package/src/Fx/combinators/filterMapLoopCause.ts +36 -0
  431. package/src/Fx/combinators/filterMapLoopCauseEffect.ts +46 -0
  432. package/src/Fx/combinators/filterMapLoopEffect.ts +36 -0
  433. package/src/Fx/combinators/flatMap.ts +51 -0
  434. package/src/Fx/combinators/flatMapConcurrently.ts +39 -0
  435. package/src/Fx/combinators/flatMapConcurrentlyEffect.ts +26 -0
  436. package/src/Fx/combinators/flatMapEffect.ts +42 -0
  437. package/src/Fx/combinators/flip.ts +14 -0
  438. package/src/Fx/combinators/gen.ts +24 -0
  439. package/src/Fx/combinators/genScoped.ts +24 -0
  440. package/src/Fx/combinators/index.ts +61 -0
  441. package/src/Fx/combinators/keyed.ts +369 -0
  442. package/src/Fx/combinators/loop.ts +27 -0
  443. package/src/Fx/combinators/loopCause.ts +34 -0
  444. package/src/Fx/combinators/loopCauseEffect.ts +36 -0
  445. package/src/Fx/combinators/loopEffect.ts +34 -0
  446. package/src/Fx/combinators/map.ts +22 -0
  447. package/src/Fx/combinators/mapBoth.ts +40 -0
  448. package/src/Fx/combinators/mapEffect.ts +32 -0
  449. package/src/Fx/combinators/mapError.ts +28 -0
  450. package/src/Fx/combinators/mergeAll.ts +22 -0
  451. package/src/Fx/combinators/mergeOrdered.ts +123 -0
  452. package/src/Fx/combinators/onError.ts +40 -0
  453. package/src/Fx/combinators/onExit.ts +82 -0
  454. package/src/Fx/combinators/onInterrupt.ts +87 -0
  455. package/src/Fx/combinators/provide.ts +124 -0
  456. package/src/Fx/combinators/result.ts +39 -0
  457. package/src/Fx/combinators/scan.ts +82 -0
  458. package/src/Fx/combinators/skip.ts +41 -0
  459. package/src/Fx/combinators/skipRepeats.ts +15 -0
  460. package/src/Fx/combinators/skipRepeatsWith.ts +40 -0
  461. package/src/Fx/combinators/skipWhile.ts +100 -0
  462. package/src/Fx/combinators/slice.ts +55 -0
  463. package/src/Fx/combinators/switchMap.ts +55 -0
  464. package/src/Fx/combinators/switchMapEffect.ts +25 -0
  465. package/src/Fx/combinators/take.ts +38 -0
  466. package/src/Fx/combinators/takeUntil.ts +88 -0
  467. package/src/Fx/combinators/takeWhile.ts +47 -0
  468. package/src/Fx/combinators/tapEffect.ts +39 -0
  469. package/src/Fx/combinators/tuple.ts +79 -0
  470. package/src/Fx/combinators/unwrap.ts +21 -0
  471. package/src/Fx/combinators/unwrapScoped.ts +26 -0
  472. package/src/Fx/combinators/when.ts +64 -0
  473. package/src/Fx/combinators/withSpan.ts +24 -0
  474. package/src/Fx/combinators/zip.ts +175 -0
  475. package/src/Fx/constructors/at.ts +23 -0
  476. package/src/Fx/constructors/die.ts +17 -0
  477. package/src/Fx/constructors/empty.ts +10 -0
  478. package/src/Fx/constructors/fail.ts +14 -0
  479. package/src/Fx/constructors/failCause.ts +14 -0
  480. package/src/Fx/constructors/fn.ts +245 -0
  481. package/src/Fx/constructors/fromEffect.ts +24 -0
  482. package/src/Fx/constructors/fromFailures.ts +19 -0
  483. package/src/Fx/constructors/fromIterable.ts +15 -0
  484. package/src/Fx/constructors/fromSchedule.ts +18 -0
  485. package/src/Fx/constructors/fromYieldable.ts +17 -0
  486. package/src/Fx/constructors/index.ts +15 -0
  487. package/src/Fx/constructors/interrupt.ts +13 -0
  488. package/src/Fx/constructors/make.ts +103 -0
  489. package/src/Fx/constructors/periodic.ts +15 -0
  490. package/src/Fx/constructors/succeed.ts +37 -0
  491. package/src/Fx/constructors/suspend.ts +6 -0
  492. package/src/Fx/index.ts +6 -0
  493. package/src/Fx/internal/DeferredRef.ts +87 -0
  494. package/src/Fx/internal/UnionToTuple.ts +12 -0
  495. package/src/Fx/internal/diff.ts +191 -0
  496. package/src/Fx/internal/equivalence.ts +12 -0
  497. package/src/Fx/internal/multicast.ts +51 -0
  498. package/src/Fx/internal/ring-buffer.ts +60 -0
  499. package/src/Fx/internal/scope.ts +58 -0
  500. package/src/Fx/internal/yieldable.ts +31 -0
  501. package/src/Fx/run/collect.ts +79 -0
  502. package/src/Fx/run/first.ts +20 -0
  503. package/src/Fx/run/fork.ts +40 -0
  504. package/src/Fx/run/index.ts +5 -0
  505. package/src/Fx/run/observe.ts +114 -0
  506. package/src/Fx/run/runPromise.ts +32 -0
  507. package/src/Fx/stream.ts +42 -0
  508. package/src/Fx.additive-combinators.test.ts +126 -0
  509. package/src/Fx.catch-additive.test.ts +206 -0
  510. package/src/Fx.catch.test.ts +60 -0
  511. package/src/Fx.dropUntil.test.ts +61 -0
  512. package/src/Fx.fn.test.ts +51 -0
  513. package/src/Fx.lifecycle.test.ts +79 -0
  514. package/src/Fx.mapError-mapBoth.test.ts +101 -0
  515. package/src/Fx.provide-combinators.test.ts +94 -0
  516. package/src/Fx.result-changesWithEffect.test.ts +112 -0
  517. package/src/Fx.scan.test.ts +73 -0
  518. package/src/Fx.takeWhile-skipWhile.test.ts +84 -0
  519. package/src/Fx.test.ts +71 -0
  520. package/src/Fx.ts +1 -2591
  521. package/src/Fx.zip-merge-additive.test.ts +171 -0
  522. package/src/Fx.zip.test.ts +133 -0
  523. package/src/Push/Push.ts +1072 -0
  524. package/src/Push/index.ts +1 -0
  525. package/src/Push.additive.test.ts +256 -0
  526. package/src/Push.test.ts +26 -0
  527. package/src/Push.ts +1 -480
  528. package/src/RefSubject/RefArray.ts +512 -0
  529. package/src/RefSubject/RefBigDecimal.test.ts +56 -0
  530. package/src/RefSubject/RefBigDecimal.ts +295 -0
  531. package/src/RefSubject/RefBigInt.test.ts +56 -0
  532. package/src/RefSubject/RefBigInt.ts +189 -0
  533. package/src/RefSubject/RefBoolean.test.ts +57 -0
  534. package/src/RefSubject/RefBoolean.ts +185 -0
  535. package/src/RefSubject/RefCause.test.ts +53 -0
  536. package/src/RefSubject/RefCause.ts +146 -0
  537. package/src/RefSubject/RefChunk.ts +510 -0
  538. package/src/RefSubject/RefDateTime.test.ts +43 -0
  539. package/src/RefSubject/RefDateTime.ts +264 -0
  540. package/src/RefSubject/RefDuration.test.ts +49 -0
  541. package/src/RefSubject/RefDuration.ts +188 -0
  542. package/src/RefSubject/RefGraph.ts +650 -0
  543. package/src/RefSubject/RefHashMap.ts +465 -0
  544. package/src/RefSubject/RefHashRing.ts +262 -0
  545. package/src/RefSubject/RefHashSet.ts +308 -0
  546. package/src/RefSubject/RefIterable.ts +445 -0
  547. package/src/RefSubject/RefOption.test.ts +67 -0
  548. package/src/RefSubject/RefOption.ts +193 -0
  549. package/src/RefSubject/RefRecord.ts +612 -0
  550. package/src/RefSubject/RefResult.test.ts +63 -0
  551. package/src/RefSubject/RefResult.ts +209 -0
  552. package/src/RefSubject/RefString.test.ts +61 -0
  553. package/src/RefSubject/RefString.ts +256 -0
  554. package/src/RefSubject/RefStruct.test.ts +60 -0
  555. package/src/RefSubject/RefStruct.ts +253 -0
  556. package/src/RefSubject/RefSubject.ts +2646 -0
  557. package/src/RefSubject/RefTrie.ts +356 -0
  558. package/src/RefSubject/RefTuple.test.ts +60 -0
  559. package/src/RefSubject/RefTuple.ts +231 -0
  560. package/src/RefSubject/index.ts +21 -0
  561. package/src/RefSubject.additive-parity.test.ts +101 -0
  562. package/src/RefSubject.test.ts +65 -0
  563. package/src/RefSubject.ts +1 -2488
  564. package/src/Sink/Sink.ts +159 -0
  565. package/src/Sink/combinators.ts +1115 -0
  566. package/src/Sink/index.ts +2 -0
  567. package/src/Sink.combinators.test.ts +88 -0
  568. package/src/Sink.reduce-collect-head-last.test.ts +107 -0
  569. package/src/Sink.ts +1 -1044
  570. package/src/Subject/Subject.ts +441 -0
  571. package/src/Subject/index.ts +1 -0
  572. package/src/Subject.test.ts +47 -0
  573. package/src/Subject.ts +1 -330
  574. package/src/Versioned/Versioned.ts +597 -0
  575. package/src/Versioned/index.ts +1 -0
  576. package/src/Versioned.filterMap.test.ts +91 -0
  577. package/src/Versioned.test.ts +23 -0
  578. package/src/Versioned.ts +1 -357
  579. package/src/index.ts +7 -130
  580. package/AsyncData/package.json +0 -6
  581. package/Emitter/package.json +0 -6
  582. package/Form/package.json +0 -6
  583. package/FormEntry/package.json +0 -6
  584. package/Fx/package.json +0 -6
  585. package/Idle/package.json +0 -6
  586. package/LICENSE +0 -21
  587. package/Match/package.json +0 -6
  588. package/Pull/package.json +0 -6
  589. package/Push/package.json +0 -6
  590. package/RefArray/package.json +0 -6
  591. package/RefChunk/package.json +0 -6
  592. package/RefHashMap/package.json +0 -6
  593. package/RefHashSet/package.json +0 -6
  594. package/RefSubject/package.json +0 -6
  595. package/Sink/package.json +0 -6
  596. package/Stream/package.json +0 -6
  597. package/Subject/package.json +0 -6
  598. package/TypeId/package.json +0 -6
  599. package/Typeclass/package.json +0 -6
  600. package/Versioned/package.json +0 -6
  601. package/dist/cjs/AsyncData.js +0 -188
  602. package/dist/cjs/AsyncData.js.map +0 -1
  603. package/dist/cjs/Emitter.js +0 -44
  604. package/dist/cjs/Emitter.js.map +0 -1
  605. package/dist/cjs/Form.js +0 -178
  606. package/dist/cjs/Form.js.map +0 -1
  607. package/dist/cjs/FormEntry.js +0 -110
  608. package/dist/cjs/FormEntry.js.map +0 -1
  609. package/dist/cjs/Fx.js +0 -998
  610. package/dist/cjs/Fx.js.map +0 -1
  611. package/dist/cjs/Idle.js +0 -190
  612. package/dist/cjs/Idle.js.map +0 -1
  613. package/dist/cjs/Match.js +0 -191
  614. package/dist/cjs/Match.js.map +0 -1
  615. package/dist/cjs/Pull.js +0 -52
  616. package/dist/cjs/Pull.js.map +0 -1
  617. package/dist/cjs/Push.js +0 -168
  618. package/dist/cjs/Push.js.map +0 -1
  619. package/dist/cjs/RefArray.js +0 -253
  620. package/dist/cjs/RefArray.js.map +0 -1
  621. package/dist/cjs/RefChunk.js +0 -212
  622. package/dist/cjs/RefChunk.js.map +0 -1
  623. package/dist/cjs/RefHashMap.js +0 -198
  624. package/dist/cjs/RefHashMap.js.map +0 -1
  625. package/dist/cjs/RefHashSet.js +0 -99
  626. package/dist/cjs/RefHashSet.js.map +0 -1
  627. package/dist/cjs/RefSubject.js +0 -1115
  628. package/dist/cjs/RefSubject.js.map +0 -1
  629. package/dist/cjs/Sink.js +0 -662
  630. package/dist/cjs/Sink.js.map +0 -1
  631. package/dist/cjs/Stream.js +0 -87
  632. package/dist/cjs/Stream.js.map +0 -1
  633. package/dist/cjs/Subject.js +0 -205
  634. package/dist/cjs/Subject.js.map +0 -1
  635. package/dist/cjs/TypeId.js +0 -32
  636. package/dist/cjs/TypeId.js.map +0 -1
  637. package/dist/cjs/Typeclass.js +0 -380
  638. package/dist/cjs/Typeclass.js.map +0 -1
  639. package/dist/cjs/Versioned.js +0 -172
  640. package/dist/cjs/Versioned.js.map +0 -1
  641. package/dist/cjs/index.js +0 -89
  642. package/dist/cjs/index.js.map +0 -1
  643. package/dist/cjs/internal/DeferredRef.js +0 -67
  644. package/dist/cjs/internal/DeferredRef.js.map +0 -1
  645. package/dist/cjs/internal/UnionToTuple.js +0 -6
  646. package/dist/cjs/internal/UnionToTuple.js.map +0 -1
  647. package/dist/cjs/internal/bounds.js +0 -26
  648. package/dist/cjs/internal/bounds.js.map +0 -1
  649. package/dist/cjs/internal/core.js +0 -1783
  650. package/dist/cjs/internal/core.js.map +0 -1
  651. package/dist/cjs/internal/diff.js +0 -122
  652. package/dist/cjs/internal/diff.js.map +0 -1
  653. package/dist/cjs/internal/effect-loop-operator.js +0 -288
  654. package/dist/cjs/internal/effect-loop-operator.js.map +0 -1
  655. package/dist/cjs/internal/effect-operator.js +0 -156
  656. package/dist/cjs/internal/effect-operator.js.map +0 -1
  657. package/dist/cjs/internal/effect-producer.js +0 -74
  658. package/dist/cjs/internal/effect-producer.js.map +0 -1
  659. package/dist/cjs/internal/helpers.js +0 -317
  660. package/dist/cjs/internal/helpers.js.map +0 -1
  661. package/dist/cjs/internal/keyed.js +0 -168
  662. package/dist/cjs/internal/keyed.js.map +0 -1
  663. package/dist/cjs/internal/loop-operator.js +0 -213
  664. package/dist/cjs/internal/loop-operator.js.map +0 -1
  665. package/dist/cjs/internal/operator.js +0 -79
  666. package/dist/cjs/internal/operator.js.map +0 -1
  667. package/dist/cjs/internal/protos.js +0 -48
  668. package/dist/cjs/internal/protos.js.map +0 -1
  669. package/dist/cjs/internal/provide.js +0 -100
  670. package/dist/cjs/internal/provide.js.map +0 -1
  671. package/dist/cjs/internal/requestIdleCallback.js +0 -22
  672. package/dist/cjs/internal/requestIdleCallback.js.map +0 -1
  673. package/dist/cjs/internal/share.js +0 -74
  674. package/dist/cjs/internal/share.js.map +0 -1
  675. package/dist/cjs/internal/strategies.js +0 -34
  676. package/dist/cjs/internal/strategies.js.map +0 -1
  677. package/dist/cjs/internal/sync-operator.js +0 -120
  678. package/dist/cjs/internal/sync-operator.js.map +0 -1
  679. package/dist/cjs/internal/sync-producer.js +0 -118
  680. package/dist/cjs/internal/sync-producer.js.map +0 -1
  681. package/dist/cjs/internal/withKey.js +0 -63
  682. package/dist/cjs/internal/withKey.js.map +0 -1
  683. package/dist/dts/AsyncData.d.ts +0 -179
  684. package/dist/dts/AsyncData.d.ts.map +0 -1
  685. package/dist/dts/Emitter.d.ts +0 -24
  686. package/dist/dts/Emitter.d.ts.map +0 -1
  687. package/dist/dts/Form.d.ts +0 -145
  688. package/dist/dts/Form.d.ts.map +0 -1
  689. package/dist/dts/FormEntry.d.ts +0 -65
  690. package/dist/dts/FormEntry.d.ts.map +0 -1
  691. package/dist/dts/Fx.d.ts +0 -1678
  692. package/dist/dts/Fx.d.ts.map +0 -1
  693. package/dist/dts/Idle.d.ts +0 -84
  694. package/dist/dts/Idle.d.ts.map +0 -1
  695. package/dist/dts/Match.d.ts +0 -60
  696. package/dist/dts/Match.d.ts.map +0 -1
  697. package/dist/dts/Pull.d.ts +0 -37
  698. package/dist/dts/Pull.d.ts.map +0 -1
  699. package/dist/dts/Push.d.ts +0 -176
  700. package/dist/dts/Push.d.ts.map +0 -1
  701. package/dist/dts/RefArray.d.ts +0 -278
  702. package/dist/dts/RefArray.d.ts.map +0 -1
  703. package/dist/dts/RefChunk.d.ts +0 -230
  704. package/dist/dts/RefChunk.d.ts.map +0 -1
  705. package/dist/dts/RefHashMap.d.ts +0 -189
  706. package/dist/dts/RefHashMap.d.ts.map +0 -1
  707. package/dist/dts/RefHashSet.d.ts +0 -100
  708. package/dist/dts/RefHashSet.d.ts.map +0 -1
  709. package/dist/dts/RefSubject.d.ts +0 -601
  710. package/dist/dts/RefSubject.d.ts.map +0 -1
  711. package/dist/dts/Sink.d.ts +0 -252
  712. package/dist/dts/Sink.d.ts.map +0 -1
  713. package/dist/dts/Stream.d.ts +0 -66
  714. package/dist/dts/Stream.d.ts.map +0 -1
  715. package/dist/dts/Subject.d.ts +0 -61
  716. package/dist/dts/Subject.d.ts.map +0 -1
  717. package/dist/dts/TypeId.d.ts +0 -51
  718. package/dist/dts/TypeId.d.ts.map +0 -1
  719. package/dist/dts/Typeclass.d.ts +0 -284
  720. package/dist/dts/Typeclass.d.ts.map +0 -1
  721. package/dist/dts/Versioned.d.ts +0 -117
  722. package/dist/dts/Versioned.d.ts.map +0 -1
  723. package/dist/dts/index.d.ts +0 -111
  724. package/dist/dts/index.d.ts.map +0 -1
  725. package/dist/dts/internal/DeferredRef.d.ts +0 -22
  726. package/dist/dts/internal/DeferredRef.d.ts.map +0 -1
  727. package/dist/dts/internal/UnionToTuple.d.ts.map +0 -1
  728. package/dist/dts/internal/bounds.d.ts +0 -9
  729. package/dist/dts/internal/bounds.d.ts.map +0 -1
  730. package/dist/dts/internal/core.d.ts +0 -237
  731. package/dist/dts/internal/core.d.ts.map +0 -1
  732. package/dist/dts/internal/diff.d.ts +0 -42
  733. package/dist/dts/internal/diff.d.ts.map +0 -1
  734. package/dist/dts/internal/effect-loop-operator.d.ts +0 -34
  735. package/dist/dts/internal/effect-loop-operator.d.ts.map +0 -1
  736. package/dist/dts/internal/effect-operator.d.ts +0 -40
  737. package/dist/dts/internal/effect-operator.d.ts.map +0 -1
  738. package/dist/dts/internal/effect-producer.d.ts +0 -25
  739. package/dist/dts/internal/effect-producer.d.ts.map +0 -1
  740. package/dist/dts/internal/helpers.d.ts +0 -60
  741. package/dist/dts/internal/helpers.d.ts.map +0 -1
  742. package/dist/dts/internal/keyed.d.ts +0 -4
  743. package/dist/dts/internal/keyed.d.ts.map +0 -1
  744. package/dist/dts/internal/loop-operator.d.ts +0 -40
  745. package/dist/dts/internal/loop-operator.d.ts.map +0 -1
  746. package/dist/dts/internal/operator.d.ts +0 -16
  747. package/dist/dts/internal/operator.d.ts.map +0 -1
  748. package/dist/dts/internal/protos.d.ts +0 -23
  749. package/dist/dts/internal/protos.d.ts.map +0 -1
  750. package/dist/dts/internal/provide.d.ts +0 -46
  751. package/dist/dts/internal/provide.d.ts.map +0 -1
  752. package/dist/dts/internal/requestIdleCallback.d.ts +0 -3
  753. package/dist/dts/internal/requestIdleCallback.d.ts.map +0 -1
  754. package/dist/dts/internal/share.d.ts +0 -33
  755. package/dist/dts/internal/share.d.ts.map +0 -1
  756. package/dist/dts/internal/strategies.d.ts +0 -9
  757. package/dist/dts/internal/strategies.d.ts.map +0 -1
  758. package/dist/dts/internal/sync-operator.d.ts +0 -32
  759. package/dist/dts/internal/sync-operator.d.ts.map +0 -1
  760. package/dist/dts/internal/sync-producer.d.ts +0 -36
  761. package/dist/dts/internal/sync-producer.d.ts.map +0 -1
  762. package/dist/dts/internal/withKey.d.ts +0 -4
  763. package/dist/dts/internal/withKey.d.ts.map +0 -1
  764. package/dist/esm/AsyncData.js +0 -156
  765. package/dist/esm/AsyncData.js.map +0 -1
  766. package/dist/esm/Emitter.js +0 -33
  767. package/dist/esm/Emitter.js.map +0 -1
  768. package/dist/esm/Form.js +0 -163
  769. package/dist/esm/Form.js.map +0 -1
  770. package/dist/esm/FormEntry.js +0 -100
  771. package/dist/esm/FormEntry.js.map +0 -1
  772. package/dist/esm/Fx.js +0 -984
  773. package/dist/esm/Fx.js.map +0 -1
  774. package/dist/esm/Idle.js +0 -178
  775. package/dist/esm/Idle.js.map +0 -1
  776. package/dist/esm/Match.js +0 -185
  777. package/dist/esm/Match.js.map +0 -1
  778. package/dist/esm/Pull.js +0 -41
  779. package/dist/esm/Pull.js.map +0 -1
  780. package/dist/esm/Push.js +0 -159
  781. package/dist/esm/Push.js.map +0 -1
  782. package/dist/esm/RefArray.js +0 -234
  783. package/dist/esm/RefArray.js.map +0 -1
  784. package/dist/esm/RefChunk.js +0 -196
  785. package/dist/esm/RefChunk.js.map +0 -1
  786. package/dist/esm/RefHashMap.js +0 -176
  787. package/dist/esm/RefHashMap.js.map +0 -1
  788. package/dist/esm/RefHashSet.js +0 -86
  789. package/dist/esm/RefHashSet.js.map +0 -1
  790. package/dist/esm/RefSubject.js +0 -1076
  791. package/dist/esm/RefSubject.js.map +0 -1
  792. package/dist/esm/Sink.js +0 -673
  793. package/dist/esm/Sink.js.map +0 -1
  794. package/dist/esm/Stream.js +0 -76
  795. package/dist/esm/Stream.js.map +0 -1
  796. package/dist/esm/Subject.js +0 -198
  797. package/dist/esm/Subject.js.map +0 -1
  798. package/dist/esm/TypeId.js +0 -26
  799. package/dist/esm/TypeId.js.map +0 -1
  800. package/dist/esm/Typeclass.js +0 -375
  801. package/dist/esm/Typeclass.js.map +0 -1
  802. package/dist/esm/Versioned.js +0 -149
  803. package/dist/esm/Versioned.js.map +0 -1
  804. package/dist/esm/index.js +0 -111
  805. package/dist/esm/index.js.map +0 -1
  806. package/dist/esm/internal/DeferredRef.js +0 -57
  807. package/dist/esm/internal/DeferredRef.js.map +0 -1
  808. package/dist/esm/internal/UnionToTuple.js +0 -2
  809. package/dist/esm/internal/UnionToTuple.js.map +0 -1
  810. package/dist/esm/internal/bounds.js +0 -13
  811. package/dist/esm/internal/bounds.js.map +0 -1
  812. package/dist/esm/internal/core.js +0 -1647
  813. package/dist/esm/internal/core.js.map +0 -1
  814. package/dist/esm/internal/diff.js +0 -92
  815. package/dist/esm/internal/diff.js.map +0 -1
  816. package/dist/esm/internal/effect-loop-operator.js +0 -269
  817. package/dist/esm/internal/effect-loop-operator.js.map +0 -1
  818. package/dist/esm/internal/effect-operator.js +0 -134
  819. package/dist/esm/internal/effect-operator.js.map +0 -1
  820. package/dist/esm/internal/effect-producer.js +0 -47
  821. package/dist/esm/internal/effect-producer.js.map +0 -1
  822. package/dist/esm/internal/helpers.js +0 -299
  823. package/dist/esm/internal/helpers.js.map +0 -1
  824. package/dist/esm/internal/keyed.js +0 -153
  825. package/dist/esm/internal/keyed.js.map +0 -1
  826. package/dist/esm/internal/loop-operator.js +0 -186
  827. package/dist/esm/internal/loop-operator.js.map +0 -1
  828. package/dist/esm/internal/operator.js +0 -68
  829. package/dist/esm/internal/operator.js.map +0 -1
  830. package/dist/esm/internal/protos.js +0 -39
  831. package/dist/esm/internal/protos.js.map +0 -1
  832. package/dist/esm/internal/provide.js +0 -72
  833. package/dist/esm/internal/provide.js.map +0 -1
  834. package/dist/esm/internal/requestIdleCallback.js +0 -16
  835. package/dist/esm/internal/requestIdleCallback.js.map +0 -1
  836. package/dist/esm/internal/share.js +0 -62
  837. package/dist/esm/internal/share.js.map +0 -1
  838. package/dist/esm/internal/strategies.js +0 -8
  839. package/dist/esm/internal/strategies.js.map +0 -1
  840. package/dist/esm/internal/sync-operator.js +0 -95
  841. package/dist/esm/internal/sync-operator.js.map +0 -1
  842. package/dist/esm/internal/sync-producer.js +0 -90
  843. package/dist/esm/internal/sync-producer.js.map +0 -1
  844. package/dist/esm/internal/withKey.js +0 -56
  845. package/dist/esm/internal/withKey.js.map +0 -1
  846. package/dist/esm/package.json +0 -4
  847. package/src/AsyncData.ts +0 -453
  848. package/src/Emitter.ts +0 -59
  849. package/src/Form.ts +0 -489
  850. package/src/FormEntry.ts +0 -214
  851. package/src/Idle.ts +0 -294
  852. package/src/Match.ts +0 -314
  853. package/src/Pull.ts +0 -95
  854. package/src/RefArray.ts +0 -514
  855. package/src/RefChunk.ts +0 -407
  856. package/src/RefHashMap.ts +0 -335
  857. package/src/RefHashSet.ts +0 -179
  858. package/src/Stream.ts +0 -140
  859. package/src/TypeId.ts +0 -59
  860. package/src/Typeclass.ts +0 -459
  861. package/src/internal/DeferredRef.ts +0 -72
  862. package/src/internal/UnionToTuple.ts +0 -11
  863. package/src/internal/bounds.ts +0 -21
  864. package/src/internal/core.ts +0 -3091
  865. package/src/internal/diff.ts +0 -171
  866. package/src/internal/effect-loop-operator.ts +0 -466
  867. package/src/internal/effect-operator.ts +0 -317
  868. package/src/internal/effect-producer.ts +0 -125
  869. package/src/internal/helpers.ts +0 -538
  870. package/src/internal/keyed.ts +0 -235
  871. package/src/internal/loop-operator.ts +0 -266
  872. package/src/internal/operator.ts +0 -87
  873. package/src/internal/protos.ts +0 -57
  874. package/src/internal/provide.ts +0 -151
  875. package/src/internal/requestIdleCallback.ts +0 -19
  876. package/src/internal/share.ts +0 -97
  877. package/src/internal/strategies.ts +0 -15
  878. package/src/internal/sync-operator.ts +0 -166
  879. package/src/internal/sync-producer.ts +0 -148
  880. package/src/internal/withKey.ts +0 -82
  881. /package/dist/{dts → Fx}/internal/UnionToTuple.d.ts +0 -0
@@ -0,0 +1,1057 @@
1
+ /** @effect-diagnostics missingEffectError:skip-file */
2
+ /** @effect-diagnostics missingEffectContext:skip-file */
3
+ import type * as Cause from "effect/Cause";
4
+ import * as Effect from "effect/Effect";
5
+ import type { Equivalence } from "effect/Equivalence";
6
+ import * as Layer from "effect/Layer";
7
+ import * as Option from "effect/Option";
8
+ import * as Scope from "effect/Scope";
9
+ import * as ServiceMap from "effect/ServiceMap";
10
+ import * as Stream from "effect/Stream";
11
+ import type { Error as FxError, Fx } from "../Fx/index.js";
12
+ import type { UnionToTuple } from "../Fx/internal/UnionToTuple.js";
13
+ import * as Subject from "../Subject/Subject.js";
14
+ import * as Versioned from "../Versioned/Versioned.js";
15
+ export declare const RefSubjectTypeId: unique symbol;
16
+ export type RefSubjectTypeId = typeof RefSubjectTypeId;
17
+ export declare const ComputedTypeId: unique symbol;
18
+ export type ComputedTypeId = typeof ComputedTypeId;
19
+ export declare const FilteredTypeId: unique symbol;
20
+ export type FilteredTypeId = typeof FilteredTypeId;
21
+ /**
22
+ * A `Computed` is a read-only view of a value that can change over time.
23
+ * It is an `Fx` that emits the current value and subsequent updates.
24
+ * It is also an `Effect` that samples the current value.
25
+ *
26
+ * @example
27
+ * ```ts
28
+ * import { Effect } from "effect"
29
+ * import * as RefSubject from "@typed/fx/RefSubject"
30
+ * import { Fx } from "@typed/fx"
31
+ *
32
+ * // Create a RefSubject and derive a Computed from it
33
+ * const program = Effect.gen(function* () {
34
+ * const count = yield* RefSubject.make(0)
35
+ *
36
+ * // Create a computed that doubles the count
37
+ * const doubled = RefSubject.map(count, (n) => n * 2)
38
+ *
39
+ * // Sample the computed value
40
+ * const value = yield* doubled
41
+ * console.log(value) // 0
42
+ *
43
+ * // Update the source
44
+ * yield* RefSubject.set(count, 5)
45
+ *
46
+ * // The computed automatically reflects the change
47
+ * const newValue = yield* doubled
48
+ * console.log(newValue) // 10
49
+ * })
50
+ * ```
51
+ *
52
+ * @since 1.0.0
53
+ * @category models
54
+ */
55
+ export interface Computed<out A, out E = never, out R = never> extends Versioned.Versioned<R, E, A, E, R | Scope.Scope, A, E, R> {
56
+ readonly [ComputedTypeId]: ComputedTypeId;
57
+ }
58
+ export declare namespace Computed {
59
+ type Any = Computed<any, any, any> | Computed<never, any, any> | Computed<any, never, any> | Computed<never, never, any>;
60
+ }
61
+ /**
62
+ * A `Filtered` is a `Computed` that may not always have a value.
63
+ * It is essentially a `Computed<Option<A>>` with helper methods.
64
+ *
65
+ * @example
66
+ * ```ts
67
+ * import { Effect, Option } from "effect"
68
+ * import * as RefSubject from "@typed/fx/RefSubject"
69
+ *
70
+ * // Create a RefSubject and filter it
71
+ * const program = Effect.gen(function* () {
72
+ * const numbers = yield* RefSubject.make([1, 2, 3, 4, 5])
73
+ *
74
+ * // Get the first even number (filtered)
75
+ * const firstEven = RefSubject.filterMap(
76
+ * numbers,
77
+ * (arr) => Option.fromNullable(arr.find((n) => n % 2 === 0))
78
+ * )
79
+ *
80
+ * // Try to get the value (may fail with NoSuchElementError)
81
+ * const value = yield* firstEven
82
+ * console.log(value) // 2
83
+ *
84
+ * // Or convert back to Option
85
+ * const option = firstEven.asComputed()
86
+ * const maybeValue = yield* option
87
+ * console.log(Option.isSome(maybeValue)) // true
88
+ * })
89
+ * ```
90
+ *
91
+ * @since 1.0.0
92
+ * @category models
93
+ */
94
+ export interface Filtered<out A, out E = never, out R = never> extends Versioned.Versioned<R, E, A, E, R | Scope.Scope, A, E | Cause.NoSuchElementError, R> {
95
+ readonly [FilteredTypeId]: FilteredTypeId;
96
+ /**
97
+ * Converts the Filtered back to a Computed of Option.
98
+ *
99
+ * @example
100
+ * ```ts
101
+ * import { Effect, Option } from "effect"
102
+ * import * as RefSubject from "@typed/fx/RefSubject"
103
+ *
104
+ * const program = Effect.gen(function* () {
105
+ * const filtered = RefSubject.filterMap(
106
+ * yield* RefSubject.make([1, 2, 3]),
107
+ * (arr) => Option.fromNullable(arr.find((n) => n > 5))
108
+ * )
109
+ *
110
+ * // Convert to Computed<Option<number>>
111
+ * const computed = filtered.asComputed()
112
+ * const option = yield* computed
113
+ * console.log(Option.isNone(option)) // true (no number > 5)
114
+ * })
115
+ * ```
116
+ */
117
+ asComputed(): Computed<Option.Option<A>, E, R>;
118
+ }
119
+ export declare namespace Filtered {
120
+ type Any = Filtered<any, any, any> | Filtered<never, any, any> | Filtered<any, never, any> | Filtered<never, never, any>;
121
+ }
122
+ /**
123
+ * Interface for basic RefSubject operations: get, set, delete.
124
+ * @since 1.0.0
125
+ * @category models
126
+ */
127
+ export interface GetSetDelete<A, E = never, R = never> {
128
+ readonly get: Effect.Effect<A, E, R>;
129
+ readonly set: (a: A) => Effect.Effect<A, E, R>;
130
+ readonly delete: Effect.Effect<Option.Option<A>, E, R>;
131
+ }
132
+ /**
133
+ * A `RefSubject` is a mutable reference that can be observed as an Fx.
134
+ * It combines the capabilities of a `Ref` (get/set/update) with a `Subject` (subscribe).
135
+ *
136
+ * @example
137
+ * ```ts
138
+ * import { Effect } from "effect"
139
+ * import * as RefSubject from "@typed/fx/RefSubject"
140
+ * import { Fx } from "@typed/fx"
141
+ *
142
+ * // Create a RefSubject with an initial value
143
+ * const program = Effect.gen(function* () {
144
+ * const count = yield* RefSubject.make(0)
145
+ *
146
+ * // Get the current value
147
+ * const current = yield* count
148
+ * console.log(current) // 0
149
+ *
150
+ * // Update the value
151
+ * yield* RefSubject.set(count, 5)
152
+ * const updated = yield* count
153
+ * console.log(updated) // 5
154
+ *
155
+ * // Use as an Fx to observe changes
156
+ * yield* Fx.observe(
157
+ * count,
158
+ * (value) => Effect.sync(() => console.log("Count changed:", value))
159
+ * )
160
+ *
161
+ * // Increment
162
+ * yield* RefSubject.increment(count)
163
+ * // Output: "Count changed: 6"
164
+ * })
165
+ * ```
166
+ *
167
+ * @since 1.0.0
168
+ * @category models
169
+ */
170
+ export interface RefSubject<A, E = never, R = never> extends Computed<A, E, R>, Subject.Subject<A, E, R> {
171
+ readonly [RefSubjectTypeId]: RefSubjectTypeId;
172
+ /**
173
+ * Runs an effect that can modify the RefSubject transactionally.
174
+ * All operations within the transaction are atomic and serialized.
175
+ *
176
+ * @example
177
+ * ```ts
178
+ * import { Effect } from "effect"
179
+ * import * as RefSubject from "@typed/fx/RefSubject"
180
+ *
181
+ * const program = Effect.gen(function* () {
182
+ * const balance = yield* RefSubject.make(100)
183
+ *
184
+ * // Transfer money atomically
185
+ * yield* balance.updates((ref) =>
186
+ * Effect.gen(function* () {
187
+ * const current = yield* ref.get
188
+ * if (current >= 50) {
189
+ * yield* ref.set(current - 50)
190
+ * return "Transfer successful"
191
+ * }
192
+ * return "Insufficient funds"
193
+ * })
194
+ * )
195
+ * })
196
+ * ```
197
+ */
198
+ readonly updates: <B, E2, R2>(f: (ref: GetSetDelete<A, E, R>) => Effect.Effect<B, E2, R2>) => Effect.Effect<B, E | E2, R | R2>;
199
+ /**
200
+ * Interrupts the RefSubject, stopping all subscriptions and cleaning up resources.
201
+ *
202
+ * @example
203
+ * ```ts
204
+ * import { Effect } from "effect"
205
+ * import * as RefSubject from "@typed/fx/RefSubject"
206
+ *
207
+ * const program = Effect.gen(function* () {
208
+ * const ref = yield* RefSubject.make(0)
209
+ *
210
+ * // Later, clean up
211
+ * yield* ref.interrupt
212
+ * })
213
+ * ```
214
+ */
215
+ readonly interrupt: Effect.Effect<void, never, R>;
216
+ }
217
+ export declare namespace RefSubject {
218
+ type Any = RefSubject<any, any, any> | RefSubject<any, any> | RefSubject<any, never, any> | RefSubject<any>;
219
+ interface Service<Self, Id extends string, A, E> extends RefSubject<A, E, Self> {
220
+ readonly id: Id;
221
+ readonly service: ServiceMap.Service<Self, RefSubject<A, E>>;
222
+ readonly make: <R = never>(value: A | Effect.Effect<A, E, R> | Fx<A, E, R>, options?: RefSubjectOptions<A> & {
223
+ readonly skip?: number;
224
+ readonly take?: number;
225
+ }) => Layer.Layer<Self, never, Exclude<R, Scope.Scope>>;
226
+ readonly layer: <E2, R2>(make: Effect.Effect<RefSubject<A, E>, E2, R2 | Scope.Scope>) => Layer.Layer<Self, E2, Exclude<R2, Scope.Scope>>;
227
+ }
228
+ interface Class<Self, Id extends string, A, E> extends RefSubject.Service<Self, Id, A, E> {
229
+ new (): RefSubject.Service<Self, Id, A, E>;
230
+ }
231
+ }
232
+ export declare const CurrentComputedBehavior: ServiceMap.Reference<"one" | "multiple">;
233
+ export declare function makeComputed<R0, E0, A, E, R, E2, R2, C, E3, R3>(input: Versioned.Versioned<R0, E0, A, E, R, A, E2, R2>, f: (a: A) => Effect.Effect<C, E3, R3>): Computed<C, E0 | E | E2 | E3, R0 | R2 | R3 | Exclude<R, Scope.Scope>>;
234
+ export declare function makeFiltered<R0, E0, A, E, R, E2, R2, C, E3, R3>(input: Versioned.Versioned<R0, E0, A, E, R, A, E2, R2>, f: (a: A) => Effect.Effect<Option.Option<C>, E3, R3>): Filtered<C, E0 | E | E2 | E3, R0 | Exclude<R, Scope.Scope> | R2 | R3>;
235
+ export interface RefSubjectOptions<A> {
236
+ readonly eq?: Equivalence<A>;
237
+ }
238
+ /**
239
+ * Creates a new `RefSubject` from a value, `Effect`, or `Fx`.
240
+ *
241
+ * @example
242
+ * ```ts
243
+ * import { Effect } from "effect"
244
+ * import * as RefSubject from "@typed/fx/RefSubject"
245
+ * import { Fx } from "@typed/fx"
246
+ *
247
+ * // From a plain value
248
+ * const program1 = Effect.gen(function* () {
249
+ * const ref = yield* RefSubject.make(42)
250
+ * const value = yield* ref
251
+ * console.log(value) // 42
252
+ * })
253
+ *
254
+ * // From an Effect
255
+ * const program2 = Effect.gen(function* () {
256
+ * const ref = yield* RefSubject.make(
257
+ * Effect.succeed("Hello")
258
+ * )
259
+ * const value = yield* ref
260
+ * console.log(value) // "Hello"
261
+ * })
262
+ *
263
+ * // From an Fx (tracks the latest value)
264
+ * const program3 = Effect.gen(function* () {
265
+ * const ref = yield* RefSubject.make(
266
+ * Fx.fromIterable([1, 2, 3])
267
+ * )
268
+ * const value = yield* ref
269
+ * console.log(value) // 3 (latest value)
270
+ * })
271
+ * ```
272
+ *
273
+ * @since 1.0.0
274
+ * @category constructors
275
+ */
276
+ export declare function make<A, E = never, R = never>(effect: A | Effect.Effect<A, E, R> | Stream.Stream<A, E, R> | Fx<A, E, R>, options?: RefSubjectOptions<A>): Effect.Effect<RefSubject<A, E>, never, R | Scope.Scope>;
277
+ /**
278
+ * Creates a `RefSubject` from an `Effect`.
279
+ *
280
+ * @example
281
+ * ```ts
282
+ * import { Effect } from "effect"
283
+ * import * as RefSubject from "@typed/fx/RefSubject"
284
+ *
285
+ * const program = Effect.gen(function* () {
286
+ * const ref = yield* RefSubject.fromEffect(
287
+ * Effect.succeed("Initial value")
288
+ * )
289
+ *
290
+ * const value = yield* ref
291
+ * console.log(value) // "Initial value"
292
+ * })
293
+ * ```
294
+ *
295
+ * @since 1.0.0
296
+ * @category constructors
297
+ */
298
+ export declare function fromEffect<A, E, R>(effect: Effect.Effect<A, E, R>, options?: RefSubjectOptions<A>): Effect.Effect<RefSubject<A, E>, never, R | Scope.Scope>;
299
+ /**
300
+ * Creates a `RefSubject` from an `Fx`, tracking the latest emitted value.
301
+ *
302
+ * @example
303
+ * ```ts
304
+ * import { Effect } from "effect"
305
+ * import * as RefSubject from "@typed/fx/RefSubject"
306
+ * import { Fx } from "@typed/fx"
307
+ *
308
+ * const program = Effect.gen(function* () {
309
+ * // Create an Fx that emits multiple values
310
+ * const numbers = Fx.fromIterable([1, 2, 3, 4, 5])
311
+ *
312
+ * // Create a RefSubject that tracks the latest value
313
+ * const ref = yield* RefSubject.fromFx(numbers)
314
+ *
315
+ * // Get the latest value
316
+ * const latest = yield* ref
317
+ * console.log(latest) // 5
318
+ * })
319
+ * ```
320
+ *
321
+ * @since 1.0.0
322
+ * @category constructors
323
+ */
324
+ export declare function fromFx<A, E, R>(fx: Fx<A, E, R>, options?: RefSubjectOptions<A>): Effect.Effect<RefSubject<A, E>, never, R | Scope.Scope>;
325
+ export declare function fromStream<A, E, R>(stream: Stream.Stream<A, E, R>, options?: RefSubjectOptions<A>): Effect.Effect<RefSubject<A, E>, never, R | Scope.Scope>;
326
+ /**
327
+ * Creates a `RefSubject` from an `Option` value.
328
+ *
329
+ * @example
330
+ * ```ts
331
+ * import { Effect, Option } from "effect"
332
+ * import * as RefSubject from "@typed/fx/RefSubject"
333
+ *
334
+ * const program = Effect.gen(function* () {
335
+ * const ref = yield* RefSubject.fromOption(Option.some(42))
336
+ * const value = yield* ref
337
+ * console.log(Option.isSome(value)) // true
338
+ * })
339
+ * ```
340
+ *
341
+ * @since 1.0.0
342
+ * @category constructors
343
+ */
344
+ export declare function fromOption<A>(option: Option.Option<A>, options?: RefSubjectOptions<Option.Option<A>>): Effect.Effect<RefSubject<Option.Option<A>>, never, Scope.Scope>;
345
+ export declare function fromNullable<A>(value: A | null | undefined, options?: RefSubjectOptions<Option.Option<NonNullable<A>>>): Effect.Effect<RefSubject<Option.Option<NonNullable<A>>>, never, Scope.Scope>;
346
+ /**
347
+ * Sets the value of a `RefSubject`.
348
+ *
349
+ * @example
350
+ * ```ts
351
+ * import { Effect } from "effect"
352
+ * import * as RefSubject from "@typed/fx/RefSubject"
353
+ *
354
+ * const program = Effect.gen(function* () {
355
+ * const count = yield* RefSubject.make(0)
356
+ *
357
+ * // Set the value
358
+ * yield* RefSubject.set(count, 10)
359
+ * const value = yield* count
360
+ * console.log(value) // 10
361
+ *
362
+ * // Can also use pipe syntax
363
+ * yield* count.pipe(RefSubject.set(20))
364
+ * const newValue = yield* count
365
+ * console.log(newValue) // 20
366
+ * })
367
+ * ```
368
+ *
369
+ * @since 1.0.0
370
+ * @category combinators
371
+ */
372
+ export declare const set: {
373
+ <A>(value: A): <E, R>(ref: RefSubject<A, E, R>) => Effect.Effect<A, E, R>;
374
+ <A, E, R>(ref: RefSubject<A, E, R>, a: A): Effect.Effect<A, E, R>;
375
+ };
376
+ /**
377
+ * Resets a `RefSubject` to its initial value, returning the previous value if it existed.
378
+ *
379
+ * @example
380
+ * ```ts
381
+ * import { Effect, Option } from "effect"
382
+ * import * as RefSubject from "@typed/fx/RefSubject"
383
+ *
384
+ * const program = Effect.gen(function* () {
385
+ * const count = yield* RefSubject.make(0)
386
+ *
387
+ * yield* RefSubject.set(count, 5)
388
+ * const before = yield* count
389
+ * console.log(before) // 5
390
+ *
391
+ * // Reset to initial value
392
+ * const previous = yield* RefSubject.reset(count)
393
+ * console.log(Option.isSome(previous)) // true
394
+ * console.log(previous.value) // 5
395
+ *
396
+ * const after = yield* count
397
+ * console.log(after) // 0
398
+ * })
399
+ * ```
400
+ *
401
+ * @since 1.0.0
402
+ * @category combinators
403
+ */
404
+ export declare function reset<A, E, R>(ref: RefSubject<A, E, R>): Effect.Effect<Option.Option<A>, E, R>;
405
+ export {
406
+ /**
407
+ * Deletes the current value of a `RefSubject`, resetting it to its initial state.
408
+ *
409
+ * @example
410
+ * ```ts
411
+ * import { Effect, Option } from "effect"
412
+ * import * as RefSubject from "@typed/fx/RefSubject"
413
+ *
414
+ * const program = Effect.gen(function* () {
415
+ * const ref = yield* RefSubject.make(10)
416
+ * yield* RefSubject.set(ref, 20)
417
+ *
418
+ * // Delete the current value
419
+ * const deleted = yield* RefSubject.delete(ref)
420
+ * console.log(Option.isSome(deleted)) // true
421
+ * console.log(deleted.value) // 20
422
+ *
423
+ * // Value is reset to initial
424
+ * const current = yield* ref
425
+ * console.log(current) // 10
426
+ * })
427
+ * ```
428
+ *
429
+ * @since 1.20.0
430
+ * @category combinators
431
+ */
432
+ reset as delete, };
433
+ /**
434
+ * Updates a `RefSubject` using an `Effect`ful function.
435
+ *
436
+ * @example
437
+ * ```ts
438
+ * import { Effect } from "effect"
439
+ * import * as RefSubject from "@typed/fx/RefSubject"
440
+ *
441
+ * const program = Effect.gen(function* () {
442
+ * const count = yield* RefSubject.make(5)
443
+ *
444
+ * // Update with an async operation
445
+ * yield* RefSubject.updateEffect(count, (value) =>
446
+ * Effect.succeed(value * 2)
447
+ * )
448
+ *
449
+ * const result = yield* count
450
+ * console.log(result) // 10
451
+ * })
452
+ * ```
453
+ *
454
+ * @since 1.0.0
455
+ * @category combinators
456
+ */
457
+ export declare const updateEffect: {
458
+ <A, E2, R2>(f: (value: A) => Effect.Effect<A, E2, R2>): <E, R>(ref: RefSubject<A, E, R>) => Effect.Effect<A, E | E2, R | R2>;
459
+ <A, E, R, E2, R2>(ref: RefSubject<A, E, R>, f: (value: A) => Effect.Effect<A, E2, R2>): Effect.Effect<A, E | E2, R | R2>;
460
+ };
461
+ /**
462
+ * Updates a `RefSubject` using a pure function.
463
+ *
464
+ * @example
465
+ * ```ts
466
+ * import { Effect } from "effect"
467
+ * import * as RefSubject from "@typed/fx/RefSubject"
468
+ *
469
+ * const program = Effect.gen(function* () {
470
+ * const count = yield* RefSubject.make(5)
471
+ *
472
+ * // Increment by 1
473
+ * yield* RefSubject.update(count, (n) => n + 1)
474
+ * const value = yield* count
475
+ * console.log(value) // 6
476
+ *
477
+ * // Can also use pipe syntax
478
+ * yield* count.pipe(RefSubject.update((n) => n * 2))
479
+ * const doubled = yield* count
480
+ * console.log(doubled) // 12
481
+ * })
482
+ * ```
483
+ *
484
+ * @since 1.0.0
485
+ * @category combinators
486
+ */
487
+ export declare const update: {
488
+ <A>(f: (value: A) => A): <E, R>(ref: RefSubject<A, E, R>) => Effect.Effect<A, E, R>;
489
+ <A, E, R>(ref: RefSubject<A, E, R>, f: (value: A) => A): Effect.Effect<A, E, R>;
490
+ };
491
+ /**
492
+ * Modifies a `RefSubject` using an `Effect`ful function that returns both a result and a new value.
493
+ *
494
+ * @example
495
+ * ```ts
496
+ * import { Effect } from "effect"
497
+ * import * as RefSubject from "@typed/fx/RefSubject"
498
+ *
499
+ * const program = Effect.gen(function* () {
500
+ * const count = yield* RefSubject.make(5)
501
+ *
502
+ * // Get the old value and set a new one, returning the old value
503
+ * const oldValue = yield* RefSubject.modifyEffect(count, (value) =>
504
+ * Effect.succeed([value, value + 10] as const)
505
+ * )
506
+ *
507
+ * console.log(oldValue) // 5
508
+ * const newValue = yield* count
509
+ * console.log(newValue) // 15
510
+ * })
511
+ * ```
512
+ *
513
+ * @since 1.0.0
514
+ * @category combinators
515
+ */
516
+ export declare const modifyEffect: {
517
+ <A, B, E2, R2>(f: (value: A) => Effect.Effect<readonly [B, A], E2, R2>): <E, R>(ref: RefSubject<A, E, R>) => Effect.Effect<B, E | E2, R | R2>;
518
+ <A, E, R, B, E2, R2>(ref: RefSubject<A, E, R>, f: (value: A) => Effect.Effect<readonly [B, A], E2, R2>): Effect.Effect<B, E | E2, R | R2>;
519
+ };
520
+ /**
521
+ * Modifies a `RefSubject` using a pure function that returns both a result and a new value.
522
+ *
523
+ * @example
524
+ * ```ts
525
+ * import { Effect } from "effect"
526
+ * import * as RefSubject from "@typed/fx/RefSubject"
527
+ *
528
+ * const program = Effect.gen(function* () {
529
+ * const count = yield* RefSubject.make(5)
530
+ *
531
+ * // Get the old value and increment, returning the old value
532
+ * const oldValue = yield* RefSubject.modify(count, (value) => [value, value + 1] as const)
533
+ *
534
+ * console.log(oldValue) // 5
535
+ * const newValue = yield* count
536
+ * console.log(newValue) // 6
537
+ * })
538
+ * ```
539
+ *
540
+ * @since 1.0.0
541
+ * @category combinators
542
+ */
543
+ export declare const modify: {
544
+ <A, B>(f: (value: A) => readonly [B, A]): <E, R>(ref: RefSubject<A, E, R>) => Effect.Effect<B, E, R>;
545
+ <A, E, R, B>(ref: RefSubject<A, E, R>, f: (value: A) => readonly [B, A]): Effect.Effect<B, E, R>;
546
+ };
547
+ /**
548
+ * Checks if a value is a `RefSubject`.
549
+ *
550
+ * @example
551
+ * ```ts
552
+ * import { Effect } from "effect"
553
+ * import * as RefSubject from "@typed/fx/RefSubject"
554
+ *
555
+ * const program = Effect.gen(function* () {
556
+ * const ref = yield* RefSubject.make(42)
557
+ * const isRef = RefSubject.isRefSubject(ref)
558
+ * console.log(isRef) // true
559
+ *
560
+ * const notRef = { value: 42 }
561
+ * const isNotRef = RefSubject.isRefSubject(notRef)
562
+ * console.log(isNotRef) // false
563
+ * })
564
+ * ```
565
+ *
566
+ * @since 1.0.0
567
+ * @category guards
568
+ */
569
+ export declare function isRefSubject(value: any): value is RefSubject<any, any, any>;
570
+ /**
571
+ * Runs an effect that can modify a `RefSubject` transactionally, with optional interrupt handling.
572
+ *
573
+ * @example
574
+ * ```ts
575
+ * import { Effect } from "effect"
576
+ * import * as RefSubject from "@typed/fx/RefSubject"
577
+ *
578
+ * const program = Effect.gen(function* () {
579
+ * const balance = yield* RefSubject.make(100)
580
+ *
581
+ * // Transfer money atomically with interrupt handling
582
+ * yield* RefSubject.runUpdates(
583
+ * balance,
584
+ * (ref) =>
585
+ * Effect.gen(function* () {
586
+ * const current = yield* ref.get
587
+ * if (current >= 50) {
588
+ * yield* ref.set(current - 50)
589
+ * return "Transfer successful"
590
+ * }
591
+ * return "Insufficient funds"
592
+ * }),
593
+ * {
594
+ * onInterrupt: (value) => Effect.sync(() => console.log(`Interrupted at balance: ${value}`)),
595
+ * value: "initial"
596
+ * }
597
+ * )
598
+ * })
599
+ * ```
600
+ *
601
+ * @since 1.0.0
602
+ * @category combinators
603
+ */
604
+ export declare const runUpdates: {
605
+ <A, E, R, B, E2, R2, R3 = never, E3 = never, C = never>(f: (ref: GetSetDelete<A, E, R>) => Effect.Effect<B, E2, R2>, options?: {
606
+ readonly onInterrupt: (value: A) => Effect.Effect<C, E3, R3>;
607
+ readonly value?: "initial" | "current";
608
+ }): (ref: RefSubject<A, E, R>) => Effect.Effect<B, E | E2 | E3, R | R2 | R3>;
609
+ <A, E, R, B, E2, R2, R3 = never, E3 = never, C = never>(ref: RefSubject<A, E, R>, f: (ref: GetSetDelete<A, E, R>) => Effect.Effect<B, E2, R2>, options?: {
610
+ readonly onInterrupt: (value: A) => Effect.Effect<C, E3, R3>;
611
+ readonly value?: "initial" | "current";
612
+ } | undefined): Effect.Effect<B, E | E2 | E3, R | R2 | R3>;
613
+ };
614
+ /**
615
+ * Increments a numeric `RefSubject` by 1.
616
+ *
617
+ * @example
618
+ * ```ts
619
+ * import { Effect } from "effect"
620
+ * import * as RefSubject from "@typed/fx/RefSubject"
621
+ *
622
+ * const program = Effect.gen(function* () {
623
+ * const count = yield* RefSubject.make(0)
624
+ *
625
+ * yield* RefSubject.increment(count)
626
+ * const value = yield* count
627
+ * console.log(value) // 1
628
+ *
629
+ * yield* RefSubject.increment(count)
630
+ * const newValue = yield* count
631
+ * console.log(newValue) // 2
632
+ * })
633
+ * ```
634
+ *
635
+ * @since 1.0.0
636
+ * @category combinators
637
+ */
638
+ export declare function increment<E, R>(ref: RefSubject<number, E, R>): Effect.Effect<number, E, R>;
639
+ /**
640
+ * Decrements a numeric `RefSubject` by 1.
641
+ *
642
+ * @example
643
+ * ```ts
644
+ * import { Effect } from "effect"
645
+ * import * as RefSubject from "@typed/fx/RefSubject"
646
+ *
647
+ * const program = Effect.gen(function* () {
648
+ * const count = yield* RefSubject.make(10)
649
+ *
650
+ * yield* RefSubject.decrement(count)
651
+ * const value = yield* count
652
+ * console.log(value) // 9
653
+ *
654
+ * yield* RefSubject.decrement(count)
655
+ * const newValue = yield* count
656
+ * console.log(newValue) // 8
657
+ * })
658
+ * ```
659
+ *
660
+ * @since 1.0.0
661
+ * @category combinators
662
+ */
663
+ export declare function decrement<E, R>(ref: RefSubject<number, E, R>): Effect.Effect<number, E, R>;
664
+ export declare function Service<Self, A, E = never>(): <const Id extends string>(id: Id) => RefSubject.Class<Self, Id, A, E>;
665
+ /**
666
+ * Extract all values from an object using a Proxy.
667
+ * Allows accessing nested properties of a `Computed` or `Filtered` object/array as individual computed values.
668
+ *
669
+ * @example
670
+ * ```ts
671
+ * import { Effect } from "effect"
672
+ * import * as RefSubject from "@typed/fx/RefSubject"
673
+ *
674
+ * const program = Effect.gen(function* () {
675
+ * const user = yield* RefSubject.make({ name: "Alice", age: 30 })
676
+ *
677
+ * // Create a proxy to access nested properties
678
+ * const proxied = RefSubject.proxy(user)
679
+ *
680
+ * // Access individual properties as Computed values
681
+ * const name = yield* proxied.name
682
+ * console.log(name) // "Alice"
683
+ *
684
+ * const age = yield* proxied.age
685
+ * console.log(age) // 30
686
+ *
687
+ * // Update the source
688
+ * yield* RefSubject.set(user, { name: "Bob", age: 25 })
689
+ *
690
+ * // Proxied values automatically update
691
+ * const newName = yield* proxied.name
692
+ * console.log(newName) // "Bob"
693
+ * })
694
+ * ```
695
+ *
696
+ * @since 2.0.0
697
+ * @category combinators
698
+ */
699
+ export declare const proxy: {
700
+ <A extends ReadonlyArray<any> | Readonly<Record<PropertyKey, any>>, E, R>(source: Computed<A, E, R>): {
701
+ readonly [K in keyof A]: Computed<A[K], E, R>;
702
+ };
703
+ <A extends ReadonlyArray<any> | Readonly<Record<PropertyKey, any>>, E, R>(source: Filtered<A, E, R>): {
704
+ readonly [K in keyof A]: Filtered<A[K], E, R>;
705
+ };
706
+ };
707
+ export type Services<T> = T extends RefSubject<infer _A, infer _E, infer R> ? R : T extends Computed<infer _A, infer _E, infer R> ? R : T extends Filtered<infer _A, infer _E, infer R> ? R : never;
708
+ export type Error<T> = T extends RefSubject<infer _A, infer E, infer _R> ? E : T extends Computed<infer _A, infer E, infer _R> ? E : T extends Filtered<infer _A, infer E, infer _R> ? E : never;
709
+ export type Success<T> = T extends RefSubject<infer A, infer _E, infer _R> ? A : T extends Computed<infer A, infer _E, infer _R> ? A : T extends Filtered<infer A, infer _E, infer _R> ? A : never;
710
+ export type Identifier<T> = T extends RefSubject.Service<infer R, infer _Id, infer _A, infer _E> ? R : never;
711
+ /**
712
+ * Transforms a `RefSubject`, `Computed`, or `Filtered` using an `Effect`ful function.
713
+ *
714
+ * @example
715
+ * ```ts
716
+ * import { Effect } from "effect"
717
+ * import * as RefSubject from "@typed/fx/RefSubject"
718
+ *
719
+ * const program = Effect.gen(function* () {
720
+ * const count = yield* RefSubject.make(5)
721
+ *
722
+ * // Transform with an async operation
723
+ * const doubled = RefSubject.mapEffect(count, (n) =>
724
+ * Effect.succeed(n * 2)
725
+ * )
726
+ *
727
+ * const value = yield* doubled
728
+ * console.log(value) // 10
729
+ *
730
+ * // Update source
731
+ * yield* RefSubject.set(count, 7)
732
+ *
733
+ * // Computed automatically updates
734
+ * const newValue = yield* doubled
735
+ * console.log(newValue) // 14
736
+ * })
737
+ * ```
738
+ *
739
+ * @since 1.0.0
740
+ * @category combinators
741
+ */
742
+ export declare const mapEffect: {
743
+ <T extends RefSubject.Any | Computed.Any | Filtered.Any, B, E2, R2>(f: (a: Success<T>) => Effect.Effect<B, E2, R2>): (ref: T) => T extends Filtered.Any ? Filtered<B, Error<T> | E2, Services<T> | R2> : Computed<B, Error<T> | E2, Services<T> | R2>;
744
+ <A, E, R, B, E2, R2>(ref: RefSubject<A, E, R> | Computed<A, E, R>, f: (a: A) => Effect.Effect<B, E2, R2>): Computed<B, E | E2, R | R2>;
745
+ <A, E, R, B, E2, R2>(ref: Filtered<A, E, R>, f: (a: A) => Effect.Effect<B, E2, R2>): Filtered<B, E | E2, R | R2>;
746
+ <R0, E0, A, E, R, E2, R2, C, E3, R3>(versioned: Versioned.Versioned<R0, E0, A, E, R, A, E2, R2>, f: (a: A) => Effect.Effect<C, E3, R3>): Computed<C, E0 | E | E2 | E3, R0 | R2 | R3 | Exclude<R, Scope.Scope>>;
747
+ };
748
+ /**
749
+ * Transforms a `RefSubject`, `Computed`, or `Filtered` using a pure function.
750
+ *
751
+ * @example
752
+ * ```ts
753
+ * import { Effect } from "effect"
754
+ * import * as RefSubject from "@typed/fx/RefSubject"
755
+ *
756
+ * const program = Effect.gen(function* () {
757
+ * const count = yield* RefSubject.make(5)
758
+ *
759
+ * // Create a computed that doubles the count
760
+ * const doubled = RefSubject.map(count, (n) => n * 2)
761
+ *
762
+ * const value = yield* doubled
763
+ * console.log(value) // 10
764
+ *
765
+ * // Update source
766
+ * yield* RefSubject.set(count, 7)
767
+ *
768
+ * // Computed automatically updates
769
+ * const newValue = yield* doubled
770
+ * console.log(newValue) // 14
771
+ * })
772
+ * ```
773
+ *
774
+ * @since 1.0.0
775
+ * @category combinators
776
+ */
777
+ export declare const map: {
778
+ <T extends RefSubject.Any | Computed.Any | Filtered.Any, B>(f: (a: Success<T>) => B): (ref: T) => T extends Filtered.Any ? Filtered<B, Error<T>, Services<T>> : Computed<B, Error<T>, Services<T>>;
779
+ <A, E, R, B>(ref: RefSubject<A, E, R> | Computed<A, E, R>, f: (a: A) => B): Computed<B, E, R>;
780
+ <A, E, R, B>(filtered: Filtered<A, E, R>, f: (a: A) => B): Filtered<B, E, R>;
781
+ <R0, E0, A, E, R, B, E2, R2>(versioned: Versioned.Versioned<R0, E0, A, E, R, A, E2, R2>, f: (a: A) => B): Computed<B, E0 | E | E2, R0 | R2 | Exclude<R, Scope.Scope>> | Filtered<B, E0 | E | E2, R0 | R2 | Exclude<R, Scope.Scope>>;
782
+ };
783
+ /**
784
+ * Filters and transforms a `RefSubject`, `Computed`, or `Filtered` using an `Effect`ful function that returns an `Option`.
785
+ *
786
+ * @example
787
+ * ```ts
788
+ * import { Effect, Option } from "effect"
789
+ * import * as RefSubject from "@typed/fx/RefSubject"
790
+ *
791
+ * const program = Effect.gen(function* () {
792
+ * const numbers = yield* RefSubject.make([1, 2, 3, 4, 5])
793
+ *
794
+ * // Find the first even number
795
+ * const firstEven = RefSubject.filterMapEffect(numbers, (arr) =>
796
+ * Effect.succeed(Option.fromNullable(arr.find((n) => n % 2 === 0)))
797
+ * )
798
+ *
799
+ * const value = yield* firstEven
800
+ * console.log(value) // 2
801
+ * })
802
+ * ```
803
+ *
804
+ * @since 1.0.0
805
+ * @category combinators
806
+ */
807
+ export declare const filterMapEffect: {
808
+ <A, B, E2, R2>(f: (a: A) => Effect.Effect<Option.Option<B>, E2, R2>): {
809
+ <E, R>(ref: RefSubject<A, E, R> | Computed<A, E, R>): Filtered<B, E | E2, R | R2>;
810
+ <E, R>(ref: Filtered<A, E, R>): Filtered<B, E | E2, R | R2>;
811
+ <R0, E0, B, E, R, E2, R2>(versioned: Versioned.Versioned<R0, E0, A, E, R, A, E2, R2>, f: (a: A) => Effect.Effect<Option.Option<B>, E2, R2>): Filtered<B, E0 | E | E2, R0 | R2>;
812
+ };
813
+ <A, E, R, B, E2, R2>(ref: RefSubject<A, E, R> | Computed<A, E, R> | Filtered<A, E, R>, f: (a: A) => Effect.Effect<Option.Option<B>, E2, R2>): Filtered<B, E | E2, R | R2>;
814
+ <R0, E0, A, E, R, B, E2, R2, R3, E3>(versioned: Versioned.Versioned<R0, E0, A, E, R, A, E2, R2>, f: (a: A) => Effect.Effect<Option.Option<B>, E3, R3>): Filtered<B, E0 | E | E2 | E3, R0 | R2 | R3 | Exclude<R, Scope.Scope>>;
815
+ };
816
+ /**
817
+ * Filters and transforms a `RefSubject`, `Computed`, or `Filtered` using a pure function that returns an `Option`.
818
+ *
819
+ * @example
820
+ * ```ts
821
+ * import { Effect, Option } from "effect"
822
+ * import * as RefSubject from "@typed/fx/RefSubject"
823
+ *
824
+ * const program = Effect.gen(function* () {
825
+ * const numbers = yield* RefSubject.make([1, 2, 3, 4, 5])
826
+ *
827
+ * // Get the first even number
828
+ * const firstEven = RefSubject.filterMap(numbers, (arr) =>
829
+ * Option.fromNullable(arr.find((n) => n % 2 === 0))
830
+ * )
831
+ *
832
+ * const value = yield* firstEven
833
+ * console.log(value) // 2
834
+ * })
835
+ * ```
836
+ *
837
+ * @since 1.0.0
838
+ * @category combinators
839
+ */
840
+ export declare const filterMap: {
841
+ <A, B>(f: (a: A) => Option.Option<B>): {
842
+ <E, R>(ref: RefSubject<A, E, R> | Computed<A, E, R> | Filtered<A, E, R>): Filtered<B, E, R>;
843
+ <R0, E0, B, E, R, E2, R2>(versioned: Versioned.Versioned<R0, E0, A, E, R, A, E2, R2>, f: (a: A) => Option.Option<B>): Filtered<B, E0 | E | E2, R0 | R2>;
844
+ };
845
+ <R0, E0, A, E, R, B, E2, R2>(versioned: Versioned.Versioned<R0, E0, A, E, R, A, E2, R2>, f: (a: A) => Option.Option<B>): Filtered<B, E0 | E | E2, R0 | R2 | Exclude<R, Scope.Scope>>;
846
+ <A, E, R, B>(ref: RefSubject<A, E, R> | Computed<A, E, R> | Filtered<A, E, R>, f: (a: A) => Option.Option<B>): Filtered<B, E, R>;
847
+ };
848
+ /**
849
+ * Converts a `Computed` or `Filtered` of `Option<A>` into a `Filtered<A>`, filtering out `None` values.
850
+ *
851
+ * @example
852
+ * ```ts
853
+ * import { Effect, Option } from "effect"
854
+ * import * as RefSubject from "@typed/fx/RefSubject"
855
+ *
856
+ * const program = Effect.gen(function* () {
857
+ * const maybeValue = yield* RefSubject.make(Option.some(42))
858
+ *
859
+ * // Compact the Option
860
+ * const filtered = RefSubject.compact(maybeValue)
861
+ *
862
+ * const value = yield* filtered
863
+ * console.log(value) // 42
864
+ *
865
+ * // If the Option becomes None, the Filtered will fail
866
+ * yield* RefSubject.set(maybeValue, Option.none())
867
+ * // yield* filtered would fail with NoSuchElementError
868
+ * })
869
+ * ```
870
+ *
871
+ * @since 1.0.0
872
+ * @category combinators
873
+ */
874
+ export declare const compact: {
875
+ <A, E, R>(ref: Computed<Option.Option<A>, E, R>): Filtered<A>;
876
+ <A, E, R>(ref: Filtered<Option.Option<A>, E, R>): Filtered<A>;
877
+ <R0, E0, A, E, R, E2, R2>(versioned: Versioned.Versioned<R0, E0, Option.Option<A>, E, R, Option.Option<A>, E2, R2>): Filtered<A, E0 | E | Exclude<E, Cause.NoSuchElementError> | Exclude<E2, Cause.NoSuchElementError>, R0 | R2 | Exclude<R, Scope.Scope>>;
878
+ };
879
+ /**
880
+ * Returns a `Computed` that yields the value inside the `Option`, or the fallback when `None`.
881
+ * Works with `Computed<Option<A>>` (e.g. from `fromOption` / `fromNullable`) and with `Filtered<A>`.
882
+ *
883
+ * @example
884
+ * ```ts
885
+ * import { Effect, Option } from "effect"
886
+ * import * as RefSubject from "@typed/fx/RefSubject"
887
+ *
888
+ * const program = Effect.gen(function* () {
889
+ * const ref = yield* RefSubject.fromOption(Option.some(42))
890
+ * const withDefault = RefSubject.getOrElse(ref, () => 0)
891
+ * expect(yield* withDefault).toBe(42)
892
+ *
893
+ * const empty = yield* RefSubject.fromNullable(null)
894
+ * const fallback = RefSubject.getOrElse(empty, () => 99)
895
+ * expect(yield* fallback).toBe(99)
896
+ * })
897
+ * ```
898
+ *
899
+ * @since 1.0.0
900
+ * @category combinators
901
+ */
902
+ export declare const getOrElse: {
903
+ <A>(fallback: () => A): <E, R>(ref: Computed<Option.Option<A>, E, R> | Filtered<A, E, R>) => Computed<A, E, R>;
904
+ <A, E, R>(ref: Computed<Option.Option<A>, E, R> | Filtered<A, E, R>, fallback: () => A): Computed<A, E, R>;
905
+ };
906
+ export declare const slice: {
907
+ (skip: number, take: number): <A, E, R>(ref: RefSubject<A, E, R>) => RefSubject<A, E, R>;
908
+ <A, E, R>(ref: RefSubject<A, E, R>, skip: number, take: number): RefSubject<A, E, R>;
909
+ };
910
+ /**
911
+ * Transforms a `RefSubject` invariantly using bidirectional mapping functions.
912
+ *
913
+ * @example
914
+ * ```ts
915
+ * import { Effect } from "effect"
916
+ * import * as RefSubject from "@typed/fx/RefSubject"
917
+ *
918
+ * const program = Effect.gen(function* () {
919
+ * const count = yield* RefSubject.make(5)
920
+ *
921
+ * // Transform to string and back
922
+ * const countStr = RefSubject.transform(
923
+ * count,
924
+ * (n) => n.toString(),
925
+ * (s) => parseInt(s, 10)
926
+ * )
927
+ *
928
+ * const value = yield* countStr
929
+ * console.log(value) // "5"
930
+ *
931
+ * // Set using the transformed type
932
+ * yield* RefSubject.set(countStr, "10")
933
+ *
934
+ * // Original reflects the change
935
+ * const original = yield* count
936
+ * console.log(original) // 10
937
+ * })
938
+ * ```
939
+ *
940
+ * @since 1.0.0
941
+ * @category combinators
942
+ */
943
+ export declare const transform: {
944
+ <A, B>(toB: (a: A) => B, toA: (b: B) => A): <E, R>(ref: RefSubject<A, E, R>) => RefSubject<B, E, R>;
945
+ <A, E, R, B>(ref: RefSubject<A, E, R>, toB: (a: A) => B, toA: (b: B) => A): RefSubject<B, E, R>;
946
+ };
947
+ type RefKind = "r" | "c" | "f";
948
+ type StructFrom<Refs extends Readonly<Record<string, RefSubject.Any | Computed.Any | Filtered.Any>>> = {
949
+ c: [ComputedStructFrom<Refs>] extends [Computed<infer A, infer E, infer R>] ? Computed<A, E, R> : never;
950
+ f: [FilteredStructFrom<Refs>] extends [Filtered<infer A, infer E, infer R>] ? Filtered<A, E, R> : never;
951
+ r: [RefSubjectStructFrom<Refs>] extends [RefSubject<infer A, infer E, infer R>] ? RefSubject<A, E, R> : never;
952
+ }[GetStructKind<Refs>];
953
+ type GetStructKind<Refs extends Readonly<Record<string, RefSubject.Any | Computed.Any | Filtered.Any>>> = MergeKinds<UnionToTuple<{
954
+ [K in keyof Refs]: MatchKind<Refs[K]>;
955
+ }[keyof Refs]>>;
956
+ type Ref = RefSubject.Any | Computed.Any | Filtered.Any;
957
+ type MatchKind<T extends Ref> = [T] extends [Filtered.Any] ? "f" : [T] extends [RefSubject.Any] ? "r" : "c";
958
+ type MergeKind<A extends RefKind, B extends RefKind> = A extends "f" ? A : B extends "f" ? B : A extends "r" ? B : B extends "r" ? A : "c";
959
+ type MergeKinds<Kinds extends ReadonlyArray<any>> = Kinds extends readonly [
960
+ infer Head extends RefKind,
961
+ ...infer Tail extends ReadonlyArray<RefKind>
962
+ ] ? MergeKind<Head, MergeKinds<Tail>> : "r";
963
+ type FilteredStructFrom<Refs extends Readonly<Record<string, RefSubject.Any | Computed.Any | Filtered.Any>>> = Filtered<{
964
+ readonly [K in keyof Refs]: Effect.Success<Refs[K]>;
965
+ }, FxError<Refs[keyof Refs]>, Effect.Services<Refs[keyof Refs]>>;
966
+ type ComputedStructFrom<Refs extends Readonly<Record<string, RefSubject.Any | Computed.Any | Filtered.Any>>> = Computed<{
967
+ readonly [K in keyof Refs]: Effect.Success<Refs[K]>;
968
+ }, Effect.Error<Refs[keyof Refs]>, Effect.Services<Refs[keyof Refs]>>;
969
+ type RefSubjectStructFrom<Refs extends Readonly<Record<string, RefSubject.Any | Computed.Any | Filtered.Any>>> = RefSubject<{
970
+ readonly [K in keyof Refs]: Effect.Success<Refs[K]>;
971
+ }, Effect.Error<Refs[keyof Refs]>, Effect.Services<Refs[keyof Refs]>>;
972
+ type TupleFrom<Refs extends ReadonlyArray<RefSubject<any, any, any> | Computed<any, any, any> | Filtered<any, any, any>>> = {
973
+ c: [ComputedTupleFrom<Refs>] extends [Computed<infer A, infer E, infer R>] ? Computed<A, E, R> : never;
974
+ f: [FilteredTupleFrom<Refs>] extends [Filtered<infer A, infer E, infer R>] ? Filtered<A, E, R> : never;
975
+ r: [RefSubjectTupleFrom<Refs>] extends [RefSubject<infer A, infer E, infer R>] ? RefSubject<A, E, R> : never;
976
+ }[GetTupleKind<Refs>];
977
+ type GetTupleKind<Refs extends ReadonlyArray<Ref>, Kind extends RefKind = "r"> = Refs extends readonly [infer Head extends Ref, ...infer Tail extends ReadonlyArray<Ref>] ? GetTupleKind<Tail, MergeKind<Kind, MatchKind<Head>>> : Kind;
978
+ type FilteredTupleFrom<Refs extends ReadonlyArray<RefSubject<any, any, any> | Computed<any, any, any> | Filtered<any, any, any>>> = Filtered<{
979
+ readonly [K in keyof Refs]: Effect.Success<Refs[K]>;
980
+ }, FxError<Refs[number]>, Effect.Services<Refs[number]>>;
981
+ type ComputedTupleFrom<Refs extends ReadonlyArray<RefSubject<any, any, any> | Computed<any, any, any> | Filtered<any, any, any>>> = Computed<{
982
+ readonly [K in keyof Refs]: Effect.Success<Refs[K]>;
983
+ }, Effect.Error<Refs[number]>, Effect.Services<Refs[number]>>;
984
+ type RefSubjectTupleFrom<Refs extends ReadonlyArray<RefSubject<any, any, any> | Computed<any, any, any> | Filtered<any, any, any>>> = RefSubject<{
985
+ readonly [K in keyof Refs]: Effect.Success<Refs[K]>;
986
+ }, Effect.Error<Refs[number]>, Effect.Services<Refs[number]>>;
987
+ /**
988
+ * Combines multiple `RefSubject`, `Computed`, or `Filtered` instances into a single struct.
989
+ *
990
+ * @example
991
+ * ```ts
992
+ * import { Effect } from "effect"
993
+ * import * as RefSubject from "@typed/fx/RefSubject"
994
+ *
995
+ * const program = Effect.gen(function* () {
996
+ * const firstName = yield* RefSubject.make("Alice")
997
+ * const lastName = yield* RefSubject.make("Smith")
998
+ * const age = yield* RefSubject.make(30)
999
+ *
1000
+ * // Combine into a struct
1001
+ * const person = RefSubject.struct({
1002
+ * firstName,
1003
+ * lastName,
1004
+ * age
1005
+ * })
1006
+ *
1007
+ * const fullPerson = yield* person
1008
+ * console.log(fullPerson) // { firstName: "Alice", lastName: "Smith", age: 30 }
1009
+ *
1010
+ * // Update one field
1011
+ * yield* RefSubject.set(firstName, "Bob")
1012
+ *
1013
+ * // Struct automatically updates
1014
+ * const updated = yield* person
1015
+ * console.log(updated.firstName) // "Bob"
1016
+ * })
1017
+ * ```
1018
+ *
1019
+ * @since 1.0.0
1020
+ * @category combinators
1021
+ */
1022
+ export declare function struct<const Refs extends Readonly<Record<string, RefSubject.Any | Computed.Any | Filtered.Any>>>(refs: Refs): StructFrom<Refs>;
1023
+ /**
1024
+ * Combines multiple `RefSubject`, `Computed`, or `Filtered` instances into a single tuple.
1025
+ *
1026
+ * @example
1027
+ * ```ts
1028
+ * import { Effect } from "effect"
1029
+ * import * as RefSubject from "@typed/fx/RefSubject"
1030
+ *
1031
+ * const program = Effect.gen(function* () {
1032
+ * const x = yield* RefSubject.make(10)
1033
+ * const y = yield* RefSubject.make(20)
1034
+ * const z = yield* RefSubject.make(30)
1035
+ *
1036
+ * // Combine into a tuple
1037
+ * const point = RefSubject.tuple([x, y, z])
1038
+ *
1039
+ * const coords = yield* point
1040
+ * console.log(coords) // [10, 20, 30]
1041
+ *
1042
+ * // Update one value
1043
+ * yield* RefSubject.set(x, 15)
1044
+ *
1045
+ * // Tuple automatically updates
1046
+ * const updated = yield* point
1047
+ * console.log(updated) // [15, 20, 30]
1048
+ * })
1049
+ * ```
1050
+ *
1051
+ * @since 1.0.0
1052
+ * @category combinators
1053
+ */
1054
+ export declare function tuple<const Refs extends ReadonlyArray<Ref>>(refs: Refs): TupleFrom<Refs>;
1055
+ export declare function computedFromService<R, A, E, R2>(effect: Effect.Effect<Computed<A, E, R2>, never, R>): Computed<A, E, R | R2>;
1056
+ export declare function filteredFromService<R, A, E, R2>(effect: Effect.Effect<Filtered<A, E, R2>, never, R>): Filtered<A, E, R | R2>;
1057
+ //# sourceMappingURL=RefSubject.d.ts.map