@typed/fx 1.18.4 → 1.20.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (423) hide show
  1. package/AsyncData/package.json +6 -0
  2. package/Emitter/package.json +6 -0
  3. package/Form/package.json +6 -0
  4. package/FormEntry/package.json +6 -0
  5. package/Fx/package.json +6 -0
  6. package/Guard/package.json +6 -0
  7. package/Idle/package.json +6 -0
  8. package/Match/package.json +6 -0
  9. package/Pull/package.json +6 -0
  10. package/Push/package.json +6 -0
  11. package/RefArray/package.json +6 -0
  12. package/RefChunk/package.json +6 -0
  13. package/RefHashMap/package.json +6 -0
  14. package/RefHashSet/package.json +6 -0
  15. package/RefSubject/package.json +6 -0
  16. package/Sink/package.json +6 -0
  17. package/Stream/package.json +6 -0
  18. package/Subject/package.json +6 -0
  19. package/TypeId/package.json +6 -0
  20. package/Typeclass/package.json +6 -0
  21. package/Versioned/package.json +6 -0
  22. package/dist/cjs/AsyncData.js +177 -0
  23. package/dist/cjs/AsyncData.js.map +1 -0
  24. package/dist/cjs/Emitter.js +24 -21
  25. package/dist/cjs/Emitter.js.map +1 -1
  26. package/dist/cjs/Form.js +78 -21
  27. package/dist/cjs/Form.js.map +1 -1
  28. package/dist/cjs/FormEntry.js +75 -48
  29. package/dist/cjs/FormEntry.js.map +1 -1
  30. package/dist/cjs/Fx.js +517 -872
  31. package/dist/cjs/Fx.js.map +1 -1
  32. package/dist/cjs/Guard.js +21 -13
  33. package/dist/cjs/Guard.js.map +1 -1
  34. package/dist/cjs/Idle.js +49 -37
  35. package/dist/cjs/Idle.js.map +1 -1
  36. package/dist/cjs/Match.js +99 -61
  37. package/dist/cjs/Match.js.map +1 -1
  38. package/dist/cjs/Pull.js.map +1 -1
  39. package/dist/cjs/Push.js +168 -0
  40. package/dist/cjs/Push.js.map +1 -0
  41. package/dist/cjs/RefArray.js +32 -30
  42. package/dist/cjs/RefArray.js.map +1 -1
  43. package/dist/cjs/RefChunk.js +26 -24
  44. package/dist/cjs/RefChunk.js.map +1 -1
  45. package/dist/cjs/RefHashMap.js +20 -20
  46. package/dist/cjs/RefHashMap.js.map +1 -1
  47. package/dist/cjs/RefHashSet.js +11 -8
  48. package/dist/cjs/RefHashSet.js.map +1 -1
  49. package/dist/cjs/RefSubject.js +899 -158
  50. package/dist/cjs/RefSubject.js.map +1 -1
  51. package/dist/cjs/Sink.js +588 -62
  52. package/dist/cjs/Sink.js.map +1 -1
  53. package/dist/cjs/Stream.js +15 -10
  54. package/dist/cjs/Stream.js.map +1 -1
  55. package/dist/cjs/Subject.js +153 -55
  56. package/dist/cjs/Subject.js.map +1 -1
  57. package/dist/cjs/TypeId.js +10 -5
  58. package/dist/cjs/TypeId.js.map +1 -1
  59. package/dist/cjs/Typeclass.js +28 -31
  60. package/dist/cjs/Typeclass.js.map +1 -1
  61. package/dist/cjs/Versioned.js +118 -57
  62. package/dist/cjs/Versioned.js.map +1 -1
  63. package/dist/cjs/index.js +44 -8
  64. package/dist/cjs/index.js.map +1 -1
  65. package/dist/cjs/internal/{deferred-ref.js → DeferredRef.js} +45 -13
  66. package/dist/cjs/internal/DeferredRef.js.map +1 -0
  67. package/dist/cjs/internal/UnionToTuple.js +6 -0
  68. package/dist/cjs/internal/UnionToTuple.js.map +1 -0
  69. package/dist/cjs/internal/core.js +1590 -779
  70. package/dist/cjs/internal/core.js.map +1 -1
  71. package/dist/cjs/internal/diff.js +114 -0
  72. package/dist/cjs/internal/diff.js.map +1 -0
  73. package/dist/cjs/internal/effect-loop-operator.js +288 -0
  74. package/dist/cjs/internal/effect-loop-operator.js.map +1 -0
  75. package/dist/cjs/internal/effect-operator.js +46 -37
  76. package/dist/cjs/internal/effect-operator.js.map +1 -1
  77. package/dist/cjs/internal/effect-producer.js +74 -0
  78. package/dist/cjs/internal/effect-producer.js.map +1 -0
  79. package/dist/cjs/internal/helpers.js +158 -128
  80. package/dist/cjs/internal/helpers.js.map +1 -1
  81. package/dist/cjs/internal/keyed.js +136 -173
  82. package/dist/cjs/internal/keyed.js.map +1 -1
  83. package/dist/cjs/internal/loop-operator.js +213 -0
  84. package/dist/cjs/internal/loop-operator.js.map +1 -0
  85. package/dist/cjs/internal/operator.js +79 -0
  86. package/dist/cjs/internal/operator.js.map +1 -0
  87. package/dist/cjs/internal/protos.js +19 -81
  88. package/dist/cjs/internal/protos.js.map +1 -1
  89. package/dist/cjs/internal/provide.js +47 -25
  90. package/dist/cjs/internal/provide.js.map +1 -1
  91. package/dist/cjs/internal/requestIdleCallback.js +5 -5
  92. package/dist/cjs/internal/requestIdleCallback.js.map +1 -1
  93. package/dist/cjs/internal/share.js +12 -15
  94. package/dist/cjs/internal/share.js.map +1 -1
  95. package/dist/cjs/internal/sync-operator.js +50 -22
  96. package/dist/cjs/internal/sync-operator.js.map +1 -1
  97. package/dist/cjs/internal/sync-producer.js +114 -0
  98. package/dist/cjs/internal/sync-producer.js.map +1 -0
  99. package/dist/cjs/internal/withKey.js +45 -51
  100. package/dist/cjs/internal/withKey.js.map +1 -1
  101. package/dist/dts/AsyncData.d.ts +185 -0
  102. package/dist/dts/AsyncData.d.ts.map +1 -0
  103. package/dist/dts/Emitter.d.ts +13 -20
  104. package/dist/dts/Emitter.d.ts.map +1 -1
  105. package/dist/dts/Form.d.ts +45 -28
  106. package/dist/dts/Form.d.ts.map +1 -1
  107. package/dist/dts/FormEntry.d.ts +25 -13
  108. package/dist/dts/FormEntry.d.ts.map +1 -1
  109. package/dist/dts/Fx.d.ts +983 -1387
  110. package/dist/dts/Fx.d.ts.map +1 -1
  111. package/dist/dts/Guard.d.ts +8 -1
  112. package/dist/dts/Guard.d.ts.map +1 -1
  113. package/dist/dts/Idle.d.ts +3 -3
  114. package/dist/dts/Idle.d.ts.map +1 -1
  115. package/dist/dts/Match.d.ts +8 -8
  116. package/dist/dts/Match.d.ts.map +1 -1
  117. package/dist/dts/Pull.d.ts +5 -5
  118. package/dist/dts/Pull.d.ts.map +1 -1
  119. package/dist/dts/Push.d.ts +170 -0
  120. package/dist/dts/Push.d.ts.map +1 -0
  121. package/dist/dts/RefArray.d.ts +21 -23
  122. package/dist/dts/RefArray.d.ts.map +1 -1
  123. package/dist/dts/RefChunk.d.ts +17 -19
  124. package/dist/dts/RefChunk.d.ts.map +1 -1
  125. package/dist/dts/RefHashMap.d.ts +19 -20
  126. package/dist/dts/RefHashMap.d.ts.map +1 -1
  127. package/dist/dts/RefHashSet.d.ts +12 -16
  128. package/dist/dts/RefHashSet.d.ts.map +1 -1
  129. package/dist/dts/RefSubject.d.ts +396 -187
  130. package/dist/dts/RefSubject.d.ts.map +1 -1
  131. package/dist/dts/Sink.d.ts +193 -93
  132. package/dist/dts/Sink.d.ts.map +1 -1
  133. package/dist/dts/Stream.d.ts +7 -1
  134. package/dist/dts/Stream.d.ts.map +1 -1
  135. package/dist/dts/Subject.d.ts +27 -36
  136. package/dist/dts/Subject.d.ts.map +1 -1
  137. package/dist/dts/TypeId.d.ts +10 -0
  138. package/dist/dts/TypeId.d.ts.map +1 -1
  139. package/dist/dts/Typeclass.d.ts +2 -2
  140. package/dist/dts/Typeclass.d.ts.map +1 -1
  141. package/dist/dts/Versioned.d.ts +50 -78
  142. package/dist/dts/Versioned.d.ts.map +1 -1
  143. package/dist/dts/index.d.ts +66 -6
  144. package/dist/dts/index.d.ts.map +1 -1
  145. package/dist/dts/internal/DeferredRef.d.ts +20 -0
  146. package/dist/dts/internal/DeferredRef.d.ts.map +1 -0
  147. package/dist/dts/internal/UnionToTuple.d.ts +6 -0
  148. package/dist/dts/internal/UnionToTuple.d.ts.map +1 -0
  149. package/dist/dts/internal/core.d.ts +218 -450
  150. package/dist/dts/internal/core.d.ts.map +1 -1
  151. package/dist/dts/internal/diff.d.ts +38 -0
  152. package/dist/dts/internal/diff.d.ts.map +1 -0
  153. package/dist/dts/internal/effect-loop-operator.d.ts +34 -0
  154. package/dist/dts/internal/effect-loop-operator.d.ts.map +1 -0
  155. package/dist/dts/internal/effect-operator.d.ts +8 -5
  156. package/dist/dts/internal/effect-operator.d.ts.map +1 -1
  157. package/dist/dts/internal/effect-producer.d.ts +25 -0
  158. package/dist/dts/internal/effect-producer.d.ts.map +1 -0
  159. package/dist/dts/internal/helpers.d.ts +33 -24
  160. package/dist/dts/internal/helpers.d.ts.map +1 -1
  161. package/dist/dts/internal/keyed.d.ts +3 -3
  162. package/dist/dts/internal/keyed.d.ts.map +1 -1
  163. package/dist/dts/internal/loop-operator.d.ts +40 -0
  164. package/dist/dts/internal/loop-operator.d.ts.map +1 -0
  165. package/dist/dts/internal/operator.d.ts +16 -0
  166. package/dist/dts/internal/operator.d.ts.map +1 -0
  167. package/dist/dts/internal/protos.d.ts +16 -43
  168. package/dist/dts/internal/protos.d.ts.map +1 -1
  169. package/dist/dts/internal/provide.d.ts +7 -1
  170. package/dist/dts/internal/provide.d.ts.map +1 -1
  171. package/dist/dts/internal/share.d.ts +12 -9
  172. package/dist/dts/internal/share.d.ts.map +1 -1
  173. package/dist/dts/internal/sync-operator.d.ts +7 -3
  174. package/dist/dts/internal/sync-operator.d.ts.map +1 -1
  175. package/dist/dts/internal/sync-producer.d.ts +36 -0
  176. package/dist/dts/internal/sync-producer.d.ts.map +1 -0
  177. package/dist/dts/internal/withKey.d.ts +3 -3
  178. package/dist/dts/internal/withKey.d.ts.map +1 -1
  179. package/dist/esm/AsyncData.js +151 -0
  180. package/dist/esm/AsyncData.js.map +1 -0
  181. package/dist/esm/Emitter.js +24 -21
  182. package/dist/esm/Emitter.js.map +1 -1
  183. package/dist/esm/Form.js +69 -14
  184. package/dist/esm/Form.js.map +1 -1
  185. package/dist/esm/FormEntry.js +77 -52
  186. package/dist/esm/FormEntry.js.map +1 -1
  187. package/dist/esm/Fx.js +509 -874
  188. package/dist/esm/Fx.js.map +1 -1
  189. package/dist/esm/Guard.js +5 -1
  190. package/dist/esm/Guard.js.map +1 -1
  191. package/dist/esm/Idle.js +49 -39
  192. package/dist/esm/Idle.js.map +1 -1
  193. package/dist/esm/Match.js +103 -63
  194. package/dist/esm/Match.js.map +1 -1
  195. package/dist/esm/Pull.js.map +1 -1
  196. package/dist/esm/Push.js +159 -0
  197. package/dist/esm/Push.js.map +1 -0
  198. package/dist/esm/RefArray.js +32 -30
  199. package/dist/esm/RefArray.js.map +1 -1
  200. package/dist/esm/RefChunk.js +26 -24
  201. package/dist/esm/RefChunk.js.map +1 -1
  202. package/dist/esm/RefHashMap.js +20 -20
  203. package/dist/esm/RefHashMap.js.map +1 -1
  204. package/dist/esm/RefHashSet.js +11 -8
  205. package/dist/esm/RefHashSet.js.map +1 -1
  206. package/dist/esm/RefSubject.js +873 -150
  207. package/dist/esm/RefSubject.js.map +1 -1
  208. package/dist/esm/Sink.js +608 -57
  209. package/dist/esm/Sink.js.map +1 -1
  210. package/dist/esm/Stream.js +13 -9
  211. package/dist/esm/Stream.js.map +1 -1
  212. package/dist/esm/Subject.js +151 -56
  213. package/dist/esm/Subject.js.map +1 -1
  214. package/dist/esm/TypeId.js +9 -4
  215. package/dist/esm/TypeId.js.map +1 -1
  216. package/dist/esm/Typeclass.js +29 -29
  217. package/dist/esm/Typeclass.js.map +1 -1
  218. package/dist/esm/Versioned.js +110 -53
  219. package/dist/esm/Versioned.js.map +1 -1
  220. package/dist/esm/index.js +66 -6
  221. package/dist/esm/index.js.map +1 -1
  222. package/dist/esm/internal/DeferredRef.js +54 -0
  223. package/dist/esm/internal/DeferredRef.js.map +1 -0
  224. package/dist/esm/internal/UnionToTuple.js +2 -0
  225. package/dist/esm/internal/UnionToTuple.js.map +1 -0
  226. package/dist/esm/internal/core.js +1439 -719
  227. package/dist/esm/internal/core.js.map +1 -1
  228. package/dist/esm/internal/diff.js +82 -0
  229. package/dist/esm/internal/diff.js.map +1 -0
  230. package/dist/esm/internal/effect-loop-operator.js +269 -0
  231. package/dist/esm/internal/effect-loop-operator.js.map +1 -0
  232. package/dist/esm/internal/effect-operator.js +44 -37
  233. package/dist/esm/internal/effect-operator.js.map +1 -1
  234. package/dist/esm/internal/effect-producer.js +47 -0
  235. package/dist/esm/internal/effect-producer.js.map +1 -0
  236. package/dist/esm/internal/helpers.js +157 -129
  237. package/dist/esm/internal/helpers.js.map +1 -1
  238. package/dist/esm/internal/keyed.js +128 -139
  239. package/dist/esm/internal/keyed.js.map +1 -1
  240. package/dist/esm/internal/loop-operator.js +186 -0
  241. package/dist/esm/internal/loop-operator.js.map +1 -0
  242. package/dist/esm/internal/operator.js +68 -0
  243. package/dist/esm/internal/operator.js.map +1 -0
  244. package/dist/esm/internal/protos.js +16 -75
  245. package/dist/esm/internal/protos.js.map +1 -1
  246. package/dist/esm/internal/provide.js +33 -25
  247. package/dist/esm/internal/provide.js.map +1 -1
  248. package/dist/esm/internal/requestIdleCallback.js +5 -5
  249. package/dist/esm/internal/requestIdleCallback.js.map +1 -1
  250. package/dist/esm/internal/share.js +12 -12
  251. package/dist/esm/internal/share.js.map +1 -1
  252. package/dist/esm/internal/sync-operator.js +49 -21
  253. package/dist/esm/internal/sync-operator.js.map +1 -1
  254. package/dist/esm/internal/sync-producer.js +88 -0
  255. package/dist/esm/internal/sync-producer.js.map +1 -0
  256. package/dist/esm/internal/withKey.js +46 -47
  257. package/dist/esm/internal/withKey.js.map +1 -1
  258. package/package.json +22 -62
  259. package/src/AsyncData.ts +447 -0
  260. package/src/Emitter.ts +47 -38
  261. package/src/Form.ts +185 -65
  262. package/src/FormEntry.ts +142 -109
  263. package/src/Fx.ts +1685 -1851
  264. package/src/Guard.ts +12 -1
  265. package/src/Idle.ts +76 -62
  266. package/src/Match.ts +149 -93
  267. package/src/Pull.ts +8 -8
  268. package/src/Push.ts +472 -0
  269. package/src/RefArray.ts +53 -51
  270. package/src/RefChunk.ts +44 -41
  271. package/src/RefHashMap.ts +57 -43
  272. package/src/RefHashSet.ts +21 -31
  273. package/src/RefSubject.ts +1984 -457
  274. package/src/Sink.ts +922 -171
  275. package/src/Stream.ts +32 -20
  276. package/src/Subject.ts +230 -87
  277. package/src/TypeId.ts +16 -4
  278. package/src/Typeclass.ts +31 -32
  279. package/src/Versioned.ts +220 -168
  280. package/src/index.ts +78 -6
  281. package/src/internal/DeferredRef.ts +62 -0
  282. package/src/internal/UnionToTuple.ts +11 -0
  283. package/src/internal/core.ts +2491 -1950
  284. package/src/internal/diff.ts +157 -0
  285. package/src/internal/effect-loop-operator.ts +466 -0
  286. package/src/internal/effect-operator.ts +89 -54
  287. package/src/internal/effect-producer.ts +125 -0
  288. package/src/internal/helpers.ts +275 -205
  289. package/src/internal/keyed.ts +192 -241
  290. package/src/internal/loop-operator.ts +266 -0
  291. package/src/internal/operator.ts +87 -0
  292. package/src/internal/protos.ts +29 -104
  293. package/src/internal/provide.ts +48 -40
  294. package/src/internal/requestIdleCallback.ts +5 -6
  295. package/src/internal/share.ts +26 -24
  296. package/src/internal/sync-operator.ts +68 -27
  297. package/src/internal/sync-producer.ts +146 -0
  298. package/src/internal/withKey.ts +64 -74
  299. package/dist/cjs/Computed.js +0 -115
  300. package/dist/cjs/Computed.js.map +0 -1
  301. package/dist/cjs/Filtered.js +0 -95
  302. package/dist/cjs/Filtered.js.map +0 -1
  303. package/dist/cjs/Model.js +0 -119
  304. package/dist/cjs/Model.js.map +0 -1
  305. package/dist/cjs/RefAsyncData.js +0 -187
  306. package/dist/cjs/RefAsyncData.js.map +0 -1
  307. package/dist/cjs/RefAsyncDataArray.js +0 -38
  308. package/dist/cjs/RefAsyncDataArray.js.map +0 -1
  309. package/dist/cjs/RefBoolean.js +0 -45
  310. package/dist/cjs/RefBoolean.js.map +0 -1
  311. package/dist/cjs/RefNumber.js +0 -49
  312. package/dist/cjs/RefNumber.js.map +0 -1
  313. package/dist/cjs/internal/core-ref-subject.js +0 -254
  314. package/dist/cjs/internal/core-ref-subject.js.map +0 -1
  315. package/dist/cjs/internal/core-subject.js +0 -108
  316. package/dist/cjs/internal/core-subject.js.map +0 -1
  317. package/dist/cjs/internal/deferred-ref.js.map +0 -1
  318. package/dist/cjs/internal/effect-primitive.js +0 -47
  319. package/dist/cjs/internal/effect-primitive.js.map +0 -1
  320. package/dist/cjs/internal/fx-effect-proto.js +0 -58
  321. package/dist/cjs/internal/fx-effect-proto.js.map +0 -1
  322. package/dist/cjs/internal/fx-primitive.js +0 -193
  323. package/dist/cjs/internal/fx-primitive.js.map +0 -1
  324. package/dist/cjs/internal/fx.js +0 -240
  325. package/dist/cjs/internal/fx.js.map +0 -1
  326. package/dist/cjs/internal/matchers.js +0 -34
  327. package/dist/cjs/internal/matchers.js.map +0 -1
  328. package/dist/cjs/internal/run.js +0 -54
  329. package/dist/cjs/internal/run.js.map +0 -1
  330. package/dist/cjs/internal/schema-ref-subject.js +0 -132
  331. package/dist/cjs/internal/schema-ref-subject.js.map +0 -1
  332. package/dist/cjs/internal/versioned-transform.js +0 -46
  333. package/dist/cjs/internal/versioned-transform.js.map +0 -1
  334. package/dist/dts/Computed.d.ts +0 -106
  335. package/dist/dts/Computed.d.ts.map +0 -1
  336. package/dist/dts/Filtered.d.ts +0 -97
  337. package/dist/dts/Filtered.d.ts.map +0 -1
  338. package/dist/dts/Model.d.ts +0 -200
  339. package/dist/dts/Model.d.ts.map +0 -1
  340. package/dist/dts/RefAsyncData.d.ts +0 -236
  341. package/dist/dts/RefAsyncData.d.ts.map +0 -1
  342. package/dist/dts/RefAsyncDataArray.d.ts +0 -56
  343. package/dist/dts/RefAsyncDataArray.d.ts.map +0 -1
  344. package/dist/dts/RefBoolean.d.ts +0 -47
  345. package/dist/dts/RefBoolean.d.ts.map +0 -1
  346. package/dist/dts/RefNumber.d.ts +0 -48
  347. package/dist/dts/RefNumber.d.ts.map +0 -1
  348. package/dist/dts/internal/core-ref-subject.d.ts +0 -100
  349. package/dist/dts/internal/core-ref-subject.d.ts.map +0 -1
  350. package/dist/dts/internal/core-subject.d.ts +0 -5
  351. package/dist/dts/internal/core-subject.d.ts.map +0 -1
  352. package/dist/dts/internal/deferred-ref.d.ts +0 -12
  353. package/dist/dts/internal/deferred-ref.d.ts.map +0 -1
  354. package/dist/dts/internal/effect-primitive.d.ts +0 -6
  355. package/dist/dts/internal/effect-primitive.d.ts.map +0 -1
  356. package/dist/dts/internal/fx-effect-proto.d.ts +0 -30
  357. package/dist/dts/internal/fx-effect-proto.d.ts.map +0 -1
  358. package/dist/dts/internal/fx-primitive.d.ts +0 -109
  359. package/dist/dts/internal/fx-primitive.d.ts.map +0 -1
  360. package/dist/dts/internal/fx.d.ts +0 -245
  361. package/dist/dts/internal/fx.d.ts.map +0 -1
  362. package/dist/dts/internal/matchers.d.ts +0 -33
  363. package/dist/dts/internal/matchers.d.ts.map +0 -1
  364. package/dist/dts/internal/run.d.ts +0 -8
  365. package/dist/dts/internal/run.d.ts.map +0 -1
  366. package/dist/dts/internal/schema-ref-subject.d.ts +0 -5
  367. package/dist/dts/internal/schema-ref-subject.d.ts.map +0 -1
  368. package/dist/dts/internal/versioned-transform.d.ts +0 -17
  369. package/dist/dts/internal/versioned-transform.d.ts.map +0 -1
  370. package/dist/esm/Computed.js +0 -103
  371. package/dist/esm/Computed.js.map +0 -1
  372. package/dist/esm/Filtered.js +0 -83
  373. package/dist/esm/Filtered.js.map +0 -1
  374. package/dist/esm/Model.js +0 -100
  375. package/dist/esm/Model.js.map +0 -1
  376. package/dist/esm/RefAsyncData.js +0 -163
  377. package/dist/esm/RefAsyncData.js.map +0 -1
  378. package/dist/esm/RefAsyncDataArray.js +0 -27
  379. package/dist/esm/RefAsyncDataArray.js.map +0 -1
  380. package/dist/esm/RefBoolean.js +0 -31
  381. package/dist/esm/RefBoolean.js.map +0 -1
  382. package/dist/esm/RefNumber.js +0 -35
  383. package/dist/esm/RefNumber.js.map +0 -1
  384. package/dist/esm/internal/core-ref-subject.js +0 -242
  385. package/dist/esm/internal/core-ref-subject.js.map +0 -1
  386. package/dist/esm/internal/core-subject.js +0 -90
  387. package/dist/esm/internal/core-subject.js.map +0 -1
  388. package/dist/esm/internal/deferred-ref.js +0 -23
  389. package/dist/esm/internal/deferred-ref.js.map +0 -1
  390. package/dist/esm/internal/effect-primitive.js +0 -41
  391. package/dist/esm/internal/effect-primitive.js.map +0 -1
  392. package/dist/esm/internal/fx-effect-proto.js +0 -43
  393. package/dist/esm/internal/fx-effect-proto.js.map +0 -1
  394. package/dist/esm/internal/fx-primitive.js +0 -175
  395. package/dist/esm/internal/fx-primitive.js.map +0 -1
  396. package/dist/esm/internal/fx.js +0 -216
  397. package/dist/esm/internal/fx.js.map +0 -1
  398. package/dist/esm/internal/matchers.js +0 -38
  399. package/dist/esm/internal/matchers.js.map +0 -1
  400. package/dist/esm/internal/run.js +0 -32
  401. package/dist/esm/internal/run.js.map +0 -1
  402. package/dist/esm/internal/schema-ref-subject.js +0 -121
  403. package/dist/esm/internal/schema-ref-subject.js.map +0 -1
  404. package/dist/esm/internal/versioned-transform.js +0 -37
  405. package/dist/esm/internal/versioned-transform.js.map +0 -1
  406. package/src/Computed.ts +0 -289
  407. package/src/Filtered.ts +0 -274
  408. package/src/Model.ts +0 -483
  409. package/src/RefAsyncData.ts +0 -547
  410. package/src/RefAsyncDataArray.ts +0 -135
  411. package/src/RefBoolean.ts +0 -71
  412. package/src/RefNumber.ts +0 -77
  413. package/src/internal/core-ref-subject.ts +0 -528
  414. package/src/internal/core-subject.ts +0 -143
  415. package/src/internal/deferred-ref.ts +0 -26
  416. package/src/internal/effect-primitive.ts +0 -230
  417. package/src/internal/fx-effect-proto.ts +0 -56
  418. package/src/internal/fx-primitive.ts +0 -223
  419. package/src/internal/fx.ts +0 -619
  420. package/src/internal/matchers.ts +0 -83
  421. package/src/internal/run.ts +0 -51
  422. package/src/internal/schema-ref-subject.ts +0 -163
  423. package/src/internal/versioned-transform.ts +0 -48
package/dist/dts/Fx.d.ts CHANGED
@@ -1,116 +1,96 @@
1
1
  /**
2
- * Fx<R, E, A> is a representation of an `Effect`-ful workflow that exists over
3
- * the time dimension. It operates within a context `R`, can fail with an `E`,
4
- * and succeed with an `A`.
5
- *
6
- * Any `Fx`, shorthand for "Effects", can emit 0 or more errors or events over an
7
- * indefinite period of time. This is in contrast to `Effect` which can only
8
- * produce exactly 1 error or event.
9
- *
10
- * It is defined as a super-type of `Effect`, `Stream`, and `Cause`. This
11
- * allows for all operators that accept an `Fx` to also capable of
12
- * accepting an `Effect`, `Stream`, or `Cause`. An Effect or Cause represents a single
13
- * event or error, while a Stream represents a series of events or errors that will
14
- * be pulled from the producer as soon as possible.
15
- *
16
- * @since 1.18.0
2
+ * Fx is a push-based reactive primitive built atop of Effect.
3
+ * @since 1.20.0
17
4
  */
18
- import type * as Context from "@typed/context";
19
- import type { Stream } from "effect";
5
+ import type * as Ctx from "@typed/context";
6
+ import type { ConfigProvider, Duration, Equivalence, ExecutionStrategy, Exit, Fiber, FiberId, FiberRef, HashSet, Pipeable, Predicate, PubSub, Request, Runtime, Scope, Tracer } from "effect";
20
7
  import * as Cause from "effect/Cause";
21
- import type * as Chunk from "effect/Chunk";
22
8
  import type { DurationInput } from "effect/Duration";
23
9
  import * as Effect from "effect/Effect";
24
10
  import * as Either from "effect/Either";
25
- import type { Equivalence } from "effect/Equivalence";
26
- import type * as Exit from "effect/Exit";
27
- import type * as Fiber from "effect/Fiber";
28
- import type * as FiberId from "effect/FiberId";
29
- import type { FiberRef } from "effect/FiberRef";
30
- import type * as HashSet from "effect/HashSet";
31
- import type { Inspectable } from "effect/Inspectable";
32
- import type * as Layer from "effect/Layer";
11
+ import * as Layer from "effect/Layer";
33
12
  import * as Option from "effect/Option";
34
- import type { Pipeable } from "effect/Pipeable";
35
- import type * as PubSub from "effect/PubSub";
36
- import type * as Queue from "effect/Queue";
37
- import type * as Request from "effect/Request";
38
- import type * as Runtime from "effect/Runtime";
39
- import type * as Schedule from "effect/Schedule";
40
- import type { Scheduler } from "effect/Scheduler";
41
- import type * as Scope from "effect/Scope";
42
- import type * as Tracer from "effect/Tracer";
43
- import type { Emitter } from "./Emitter.js";
44
- import * as primitive from "./internal/fx-primitive.js";
45
- import * as internalProtos from "./internal/protos.js";
13
+ import * as Queue from "effect/Queue";
14
+ import * as Schedule from "effect/Schedule";
15
+ import type * as Types from "effect/Types";
16
+ import * as Emitter from "./Emitter.js";
17
+ import * as core from "./internal/core.js";
18
+ import * as protos from "./internal/protos.js";
46
19
  import { type RefSubject } from "./RefSubject.js";
47
- import type * as Sink from "./Sink.js";
48
- import type { Subject } from "./Subject.js";
20
+ import * as Sink from "./Sink.js";
21
+ import type * as Subject from "./Subject.js";
49
22
  import { TypeId } from "./TypeId.js";
50
23
  /**
51
- * Fx<R, E, A> is a representation of an `Effect`-ful workflow that exists over
52
- * the time dimension. It operates within a context `R`, can fail with an `E`,
53
- * and succeed with an `A`.
54
- *
55
- * @since 1.18.0
56
- * @category models
24
+ * Fx is a push-based reactive primitive built atop of Effect.
25
+ * @since 1.20.0
57
26
  */
58
- export interface Fx<R, E, A> extends Fx.Variance<R, E, A>, Pipeable, Inspectable {
27
+ export interface Fx<out R, out E, out A> extends Pipeable.Pipeable {
28
+ readonly [TypeId]: Fx.Variance<R, E, A>;
29
+ /**
30
+ * @since 1.20.0
31
+ */
32
+ run<R2 = never>(sink: Sink.Sink<R2, E, A>): Effect.Effect<R | R2, never, unknown>;
59
33
  }
60
34
  /**
61
- * FxInput<R, E, A> are all the types that can be transformed into an Fx
62
- *
63
- * @since 1.18.0
64
- * @category models
65
- */
66
- export type FxInput<R, E, A> = Fx<R, E, A> | Effect.Effect<R, E, A> | Cause.Cause<E> | Iterable<A>;
67
- /**
68
- * @since 1.18.0
35
+ * @since 1.20.0
69
36
  */
70
37
  export declare namespace Fx {
71
38
  /**
72
- * Extract the Context, Error, or Success type from an Fx
73
- * @since 1.18.0
39
+ * @since 1.20.0
40
+ */
41
+ interface Variance<R, E, A> {
42
+ readonly _R: Types.Covariant<R>;
43
+ readonly _E: Types.Covariant<E>;
44
+ readonly _A: Types.Covariant<A>;
45
+ }
46
+ /**
47
+ * @since 1.20.0
74
48
  */
75
49
  type Context<T> = T extends Fx<infer R, infer _E, infer _A> ? R : never;
76
50
  /**
77
- * Extract the Error type from an Fx
78
- * @since 1.18.0
51
+ * @since 1.20.0
79
52
  */
80
53
  type Error<T> = T extends Fx<infer _R, infer E, infer _A> ? E : never;
81
54
  /**
82
- * Extract the Success type from an Fx
83
- * @since 1.18.0
55
+ * @since 1.20.0
84
56
  */
85
57
  type Success<T> = T extends Fx<infer _R, infer _E, infer A> ? A : never;
86
58
  /**
87
- * Configures the variance of an Fx
88
- * @since 1.18.0
89
- * @category models
90
- */
91
- interface Variance<R, E, A> {
92
- readonly [TypeId]: {
93
- readonly _R: (_: never) => R;
94
- readonly _E: (_: never) => E;
95
- readonly _A: (_: never) => A;
96
- };
97
- }
98
- /**
99
- * @since 1.18.0
59
+ * @since 1.20.0
100
60
  */
101
- type FromInput<T extends FxInput<any, any, any>> = [T] extends [ReadonlyArray<infer A>] ? Fx<never, never, A> : [T] extends [Iterable<infer A>] ? Fx<never, never, A> : [T] extends [Cause.Cause<infer E>] ? Fx<never, E, never> : [T] extends [Fx<infer R, infer E, infer A>] ? Fx<R, E, A> : [T] extends [Effect.Effect<infer R, infer E, infer A>] ? Fx<R, E, A> : never;
61
+ type Unify<T> = T extends Fx<infer R, infer E, infer A> | infer _ ? Fx<R, E, A> : never;
102
62
  }
63
+ /**
64
+ * @since 1.20.0
65
+ */
66
+ export type Context<T> = Fx.Context<T>;
67
+ /**
68
+ * @since 1.20.0
69
+ */
70
+ export type Error<T> = Fx.Error<T>;
71
+ /**
72
+ * @since 1.20.0
73
+ */
74
+ export type Success<T> = Fx.Success<T>;
75
+ /**
76
+ * @since 1.20.0
77
+ */
78
+ export type Unify<T> = Fx.Unify<T>;
79
+ /**
80
+ * @since 1.20.0
81
+ */
82
+ export declare function isFx<R, E, A>(u: unknown): u is Fx<R, E, A>;
103
83
  /**
104
84
  * FlattenStrategy is a representation of how higher-order effect operators should flatten
105
85
  * nested Fx.
106
86
  *
107
- * @since 1.18.0
87
+ * @since 1.20.0
108
88
  * @category FlattenStrategy
109
89
  */
110
90
  export type FlattenStrategy = Unbounded | Bounded | Switch | Exhaust | ExhaustLatest;
111
91
  /**
112
92
  * Strategy which will allow for an unbounded number of concurrent effects to be run.
113
- * @since 1.18.0
93
+ * @since 1.20.0
114
94
  * @category FlattenStrategy
115
95
  */
116
96
  export interface Unbounded {
@@ -118,13 +98,13 @@ export interface Unbounded {
118
98
  }
119
99
  /**
120
100
  * Singleton instance of Unbounded
121
- * @since 1.18.0
101
+ * @since 1.20.0
122
102
  * @category FlattenStrategy
123
103
  */
124
104
  export declare const Unbounded: Unbounded;
125
105
  /**
126
106
  * Strategy which will allow for a bounded number of concurrent effects to be run.
127
- * @since 1.18.0
107
+ * @since 1.20.0
128
108
  * @category FlattenStrategy
129
109
  */
130
110
  export interface Bounded {
@@ -133,13 +113,13 @@ export interface Bounded {
133
113
  }
134
114
  /**
135
115
  * Construct a Bounded strategy
136
- * @since 1.18.0
116
+ * @since 1.20.0
137
117
  * @category FlattenStrategy
138
118
  */
139
119
  export declare const Bounded: (capacity: number) => Bounded;
140
120
  /**
141
121
  * Strategy which will switch to a new effect as soon as it is available.
142
- * @since 1.18.0
122
+ * @since 1.20.0
143
123
  * @category FlattenStrategy
144
124
  */
145
125
  export interface Switch {
@@ -147,7 +127,7 @@ export interface Switch {
147
127
  }
148
128
  /**
149
129
  * Singleton instance of Switch
150
- * @since 1.18.0
130
+ * @since 1.20.0
151
131
  * @category FlattenStrategy
152
132
  */
153
133
  export declare const Switch: Switch;
@@ -156,7 +136,7 @@ export declare const Switch: Switch;
156
136
  * the first Fx is still running. When the first Fx finished, the next event
157
137
  * will execute.
158
138
  *
159
- * @since 1.18.0
139
+ * @since 1.20.0
160
140
  * @category FlattenStrategy
161
141
  */
162
142
  export interface Exhaust {
@@ -164,7 +144,7 @@ export interface Exhaust {
164
144
  }
165
145
  /**
166
146
  * Singleton instance of Exhaust
167
- * @since 1.18.0
147
+ * @since 1.20.0
168
148
  * @category FlattenStrategy
169
149
  */
170
150
  export declare const Exhaust: Exhaust;
@@ -173,7 +153,7 @@ export declare const Exhaust: Exhaust;
173
153
  * the latest Fx is still running. When the latest Fx finishes, the last seend event
174
154
  * will execute.
175
155
  *
176
- * @since 1.18.0
156
+ * @since 1.20.0
177
157
  * @category FlattenStrategy
178
158
  */
179
159
  export interface ExhaustLatest {
@@ -181,19 +161,19 @@ export interface ExhaustLatest {
181
161
  }
182
162
  /**
183
163
  * Singleton instance of ExhaustLatest
184
- * @since 1.18.0
164
+ * @since 1.20.0
185
165
  * @category FlattenStrategy
186
166
  */
187
167
  export declare const ExhaustLatest: ExhaustLatest;
188
168
  /**
189
169
  * MergeStrategy is a representation of how multiple Fx should be merged together.
190
- * @since 1.18.0
170
+ * @since 1.20.0
191
171
  * @category MergeStrategy
192
172
  */
193
173
  export type MergeStrategy = Unordered | Ordered | Switch;
194
174
  /**
195
175
  * Strategy which will merge Fx in an unordered fashion.
196
- * @since 1.18.0
176
+ * @since 1.20.0
197
177
  * @category MergeStrategy
198
178
  */
199
179
  export interface Unordered {
@@ -202,14 +182,14 @@ export interface Unordered {
202
182
  }
203
183
  /**
204
184
  * Construct an Unordered strategy
205
- * @since 1.18.0
185
+ * @since 1.20.0
206
186
  * @category MergeStrategy
207
187
  */
208
188
  export declare const Unordered: (concurrency: number) => Unordered;
209
189
  /**
210
190
  * Strategy which will merge Fx in an ordered fashion with
211
191
  * the specified level of concurrency.
212
- * @since 1.18.0
192
+ * @since 1.20.0
213
193
  * @category MergeStrategy
214
194
  */
215
195
  export interface Ordered {
@@ -218,1797 +198,1413 @@ export interface Ordered {
218
198
  }
219
199
  /**
220
200
  * Construct an Ordered strategy
221
- * @since 1.18.0
201
+ * @since 1.20.0
222
202
  * @category MergeStrategy
223
203
  */
224
204
  export declare const Ordered: (concurrency: number) => Ordered;
225
205
  /**
226
- * An Fx which will immediately end producing 0 events and 0 errors.
227
- * @since 1.18.0
228
- * @category constructors
206
+ * Type-alias for a Effect.forkIn(scope) that returns a Fiber
207
+ * @since 1.20.0
208
+ * @category models
229
209
  */
230
- export declare const empty: Fx<never, never, never>;
210
+ export type ScopedFork = <R, E, A>(effect: Effect.Effect<R, E, A>) => Effect.Effect<R, never, Fiber.Fiber<E, A>>;
231
211
  /**
232
- * Construct an Fx<never, E, A> from a Cause<E>
233
- * @since 1.18.0
234
- * @category constructors
212
+ * Type-alias for Effect.forkIn(scope) which runs the Effect runtime
213
+ * of an Fx in a Scope. Used in for higher-order operators.
214
+ *
215
+ * @since 1.20.0
216
+ * @category models
235
217
  */
236
- export declare const failCause: <E>(cause: Cause.Cause<E>) => Fx<never, E, never>;
218
+ export type FxFork = <R>(effect: Effect.Effect<R, never, void>) => Effect.Effect<R, never, void>;
237
219
  /**
238
- * Construct an Fx<never, never, never> from a defect
239
- * @since 1.18.0
240
- * @category constructors
220
+ * @since 1.20.0
241
221
  */
242
- export declare const die: (defect: unknown) => Fx<never, never, never>;
222
+ export declare const make: {
223
+ <R, E, A>(run: (sink: Sink.Sink<never, E, A>) => Effect.Effect<R, never, unknown>): Fx<R, E, A>;
224
+ <E, A>(run: (sink: Sink.Sink<never, E, A>) => Effect.Effect<never, never, unknown>): Fx<never, E, A>;
225
+ <A>(run: (sink: Sink.Sink<never, never, A>) => Effect.Effect<never, never, unknown>): Fx<never, never, A>;
226
+ };
243
227
  /**
244
- * Interrupt the current Fx with the specified FiberId
245
- * @since 1.18.0
246
- * @category constructors
228
+ * @since 1.20.0
247
229
  */
248
- export declare const interrupt: (id: FiberId.FiberId) => Fx<never, never, never>;
230
+ export declare const succeed: <A>(value: A) => Fx<never, never, A>;
249
231
  /**
250
- * Construct an Fx which will fail with the specified error.
251
- * @since 1.18.0
252
- * @category constructors
232
+ * @since 1.20.0
253
233
  */
254
- export declare const fail: <E>(error: E) => Fx<never, E, never>;
234
+ export declare const sync: <A>(f: () => A) => Fx<never, never, A>;
255
235
  /**
256
- * Construct an Fx<R, E, A> from an Effect<R, E, A>
257
- * @since 1.18.0
258
- * @category constructors
236
+ * @since 1.20.0
237
+ */
238
+ export declare const fromArray: <const A extends ReadonlyArray<any>>(array: A) => Fx<never, never, A[number]>;
239
+ /**
240
+ * @since 1.20.0
241
+ */
242
+ export declare const fromIterable: <A>(iterable: Iterable<A>) => Fx<never, never, A>;
243
+ /**
244
+ * @since 1.20.0
259
245
  */
260
246
  export declare const fromEffect: <R, E, A>(effect: Effect.Effect<R, E, A>) => Fx<R, E, A>;
261
247
  /**
262
- * Construct an Fx from an Iterable
263
- * @since 1.18.0
264
- * @category constructors
248
+ * @since 1.20.0
265
249
  */
266
- export declare const fromIterable: {
267
- <A extends ReadonlyArray<any>>(array: A): Fx<never, never, A[number]>;
268
- <A>(iterable: Iterable<A>): Fx<never, never, A>;
250
+ export declare const fromScheduled: {
251
+ <R2, I, O>(schedule: Schedule.Schedule<R2, I, O>): <R, E>(input: Effect.Effect<R, E, I>) => Fx<R | R2, E, O>;
252
+ <R, E, I, R2, O>(input: Effect.Effect<R, E, I>, schedule: Schedule.Schedule<R2, I, O>): Fx<R | R2, E, O>;
269
253
  };
270
254
  /**
271
- * Construct an Fx<R, E, A> from an Effect<R, E, A>
272
- * @since 1.18.0
273
- * @category constructors
255
+ * @since 1.20.0
274
256
  */
275
- export declare const fromStream: <R, E, A>(effect: Stream.Stream<R, E, A>) => Fx<R, E, A>;
257
+ export declare const schedule: {
258
+ <R2, O>(schedule: Schedule.Schedule<R2, unknown, O>): <R, E, A>(input: Effect.Effect<R, E, A>) => Fx<R | R2, E, A>;
259
+ <R, E, A, R2, O>(input: Effect.Effect<R, E, A>, schedule: Schedule.Schedule<R2, unknown, O>): Fx<R | R2, E, A>;
260
+ };
276
261
  /**
277
- * Construct an Fx<R, E, A> from an Effect<R, E, A>
278
- * @since 1.18.0
279
- * @category constructors
262
+ * @since 1.20.0
280
263
  */
281
- export declare const from: {
282
- <A extends ReadonlyArray<any>>(array: A): Fx<never, never, A[number]>;
283
- <A>(iterable: Iterable<A>): Fx<never, never, A>;
284
- <E>(cause: Cause.Cause<E>): Fx<never, E, never>;
285
- <R, E, A>(fx: FxInput<R, E, A>): Fx<R, E, A>;
286
- <A>(value: A): Fx<never, never, A>;
264
+ export declare const periodic: {
265
+ (period: Duration.DurationInput): <R, E, A>(iterator: Effect.Effect<R, E, A>) => Fx<R, E, A>;
266
+ <R, E, A>(iterator: Effect.Effect<R, E, A>, period: Duration.DurationInput): Fx<R, E, A>;
287
267
  };
288
268
  /**
289
- * Construct an Fx by describing an Effectful workflow that has access to a Sink
290
- * to emit events and errors.
291
- * @since 1.18.0
292
- * @category constructors
269
+ * @since 1.20.0
293
270
  */
294
- export declare const fromSink: <R, E, A>(f: (sink: Sink.Sink<E, A>) => Effect.Effect<R, E, unknown>) => Fx<R, E, A>;
271
+ export declare const failCause: <E>(cause: Cause.Cause<E>) => Fx<never, E, never>;
295
272
  /**
296
- * Construct an Fx by describing an Scoped Effect that has access to an Emitter
297
- * to emit events and errors.
298
- * @since 1.18.0
299
- * @category constructors
273
+ * @since 1.20.0
300
274
  */
301
- export declare const fromEmitter: <R, E, A>(f: (emitter: Emitter<E, A>) => Effect.Effect<R | Scope.Scope, never, unknown>) => Fx<Exclude<R, Scope.Scope>, E, A>;
275
+ export declare const fail: <E>(error: E) => Fx<never, E, never>;
302
276
  /**
303
- * An Fx which will never emit any errors or events, and will never end
304
- * @since 1.18.0
305
- * @category constructors
277
+ * @since 1.20.0
306
278
  */
307
- export declare const never: Fx<never, never, never>;
279
+ export declare const die: (error: unknown) => Fx<never, never, never>;
308
280
  /**
309
- * Construct an Fx which will emit the specified value and then end.
310
- * @since 1.18.0
311
- * @category constructors
281
+ * @since 1.20.0
312
282
  */
313
- export declare const succeed: <A>(value: A) => Fx<never, never, A>;
283
+ export declare const map: {
284
+ <A, B>(f: (a: A) => B): <R, E>(fx: Fx<R, E, A>) => Fx<R, E, B>;
285
+ <R, E, A, B>(fx: Fx<R, E, A>, f: (a: A) => B): Fx<R, E, B>;
286
+ };
314
287
  /**
315
- * Construct an Fx which will emit the return of a synchronous function and then end.
316
- * @since 1.18.0
317
- * @category constructors
288
+ * @since 1.20.0
318
289
  */
319
- export declare const sync: <A>(f: () => A) => Fx<never, never, A>;
290
+ export declare const filter: {
291
+ <A, B extends A>(f: Predicate.Refinement<A, B>): <R, E>(fx: Fx<R, E, A>) => Fx<R, E, B>;
292
+ <A>(f: Predicate.Predicate<A>): <R, E>(fx: Fx<R, E, A>) => Fx<R, E, A>;
293
+ <R, E, A, B extends A>(fx: Fx<R, E, A>, f: Predicate.Refinement<A, B>): Fx<R, E, B>;
294
+ <R, E, A>(fx: Fx<R, E, A>, f: Predicate.Predicate<A>): Fx<R, E, A>;
295
+ };
320
296
  /**
321
- * Lazily construct an Fx.
322
- * @since 1.18.0
323
- * @category constructors
297
+ * @since 1.20.0
324
298
  */
325
- export declare const suspend: <R, E, A>(f: () => Fx<R, E, A>) => Fx<R, E, A>;
299
+ export declare const filterMap: {
300
+ <A, B>(f: (a: A) => Option.Option<B>): <R, E>(fx: Fx<R, E, A>) => Fx<R, E, B>;
301
+ <R, E, A, B>(fx: Fx<R, E, A>, f: (a: A) => Option.Option<B>): Fx<R, E, B>;
302
+ };
326
303
  /**
327
- * Helper for constructing your own custom subtypes of an Fx
328
- * @since 1.18.0
329
- * @category Subtyping
304
+ * @since 1.20.0
330
305
  */
331
- export declare abstract class ToFx<R, E, A> extends primitive.ToFx<R, E, A> implements Fx<R, E, A> {
332
- /**
333
- * Your implementation of an Fx is returned by this function.
334
- * @since 1.18.0
335
- */
336
- abstract toFx(): Fx<R, E, A>;
337
- }
306
+ export declare const compact: <R, E, A>(fx: Fx<R, E, Option.Option<A>>) => Fx<R, E, A>;
338
307
  /**
339
- * Create an Fx which will emit a value after waiting for a specified duration.
340
- * @since 1.18.0
341
- * @category constructors
308
+ * @since 1.20.0
342
309
  */
343
- export declare const at: {
344
- (delay: DurationInput): <A>(value: A) => Fx<never, never, A>;
345
- <A>(value: A, delay: DurationInput): Fx<never, never, A>;
310
+ export declare const mapEffect: {
311
+ <A, R2, E2, B>(f: (a: A) => Effect.Effect<R2, E2, B>): <R, E>(fx: Fx<R, E, A>) => Fx<R | R2, E | E2, B>;
312
+ <R, E, A, R2, E2, B>(fx: Fx<R, E, A>, f: (a: A) => Effect.Effect<R2, E2, B>): Fx<R | R2, E | E2, B>;
346
313
  };
347
314
  /**
348
- * Type-alias for a Effect.forkIn(scope) that returns a Fiber
349
- * @since 1.18.0
350
- * @category models
315
+ * @since 1.20.0
351
316
  */
352
- export type ScopedFork = <R, E, A>(effect: Effect.Effect<R, E, A>) => Effect.Effect<R, never, Fiber.Fiber<E, A>>;
317
+ export declare const filterMapEffect: {
318
+ <A, R2, E2, B>(f: (a: A) => Effect.Effect<R2, E2, Option.Option<B>>): <R, E>(fx: Fx<R, E, A>) => Fx<R | R2, E | E2, B>;
319
+ <R, E, A, R2, E2, B>(fx: Fx<R, E, A>, f: (a: A) => Effect.Effect<R2, E2, Option.Option<B>>): Fx<R | R2, E | E2, B>;
320
+ };
353
321
  /**
354
- * Type-alias for Effect.forkIn(scope) which runs the Effect runtime
355
- * of an Fx in a Scope. Used in for higher-order operators.
356
- *
357
- * @since 1.18.0
358
- * @category models
322
+ * @since 1.20.0
359
323
  */
360
- export type FxFork = <R>(effect: Effect.Effect<R, never, void>) => Effect.Effect<R, never, void>;
324
+ export declare const filterEffect: {
325
+ <A, R2, E2>(f: (a: A) => Effect.Effect<R2, E2, boolean>): <R, E>(fx: Fx<R, E, A>) => Fx<R | R2, E | E2, A>;
326
+ <R, E, A, R2, E2>(fx: Fx<R, E, A>, f: (a: A) => Effect.Effect<R2, E2, boolean>): Fx<R | R2, E | E2, A>;
327
+ };
361
328
  /**
362
- * Params for withScopedFork
363
- * @since 1.18.0
364
- * @category params
329
+ * @since 1.20.0
365
330
  */
366
- export type WithScopedForkParams<E, A> = {
367
- readonly sink: Sink.Sink<E, A>;
368
- readonly fork: ScopedFork;
369
- readonly scope: Scope.Scope;
331
+ export declare const tapEffect: {
332
+ <A, R2, E2>(f: (a: A) => Effect.Effect<R2, E2, unknown>): <R, E>(fx: Fx<R, E, A>) => Fx<R | R2, E | E2, A>;
333
+ <R, E, A, R2, E2>(fx: Fx<R, E, A>, f: (a: A) => Effect.Effect<R2, E2, unknown>): Fx<R | R2, E | E2, A>;
370
334
  };
371
335
  /**
372
- * Construct an Fx which can fork effects into a Scope.
373
- * @since 1.18.0
374
- * @category constructors
336
+ * @since 1.20.0
375
337
  */
376
- export declare const withScopedFork: <R, E, A>(f: (params: WithScopedForkParams<E, A>) => Effect.Effect<R, never, unknown>) => Fx<R, E, A>;
338
+ export declare const tap: {
339
+ <A>(f: (a: A) => unknown): <R, E>(fx: Fx<R, E, A>) => Fx<R, E, A>;
340
+ <R, E, A>(fx: Fx<R, E, A>, f: (a: A) => unknown): Fx<R, E, A>;
341
+ };
377
342
  /**
378
- * Params for withEarlyExit
379
- * @since 1.18.0
380
- * @category params
343
+ * @since 1.20.0
381
344
  */
382
- export type WithEarlyExitParams<E, A> = {
383
- readonly sink: Sink.WithEarlyExit<E, A>;
384
- readonly fork: ScopedFork;
385
- readonly scope: Scope.Scope;
345
+ export declare const loop: {
346
+ <B, A, C>(seed: B, f: (acc: B, a: A) => readonly [C, B]): <R, E>(fx: Fx<R, E, A>) => Fx<R, E, C>;
347
+ <R, E, A, B, C>(fx: Fx<R, E, A>, seed: B, f: (acc: B, a: A) => readonly [C, B]): Fx<R, E, C>;
386
348
  };
387
349
  /**
388
- * Construct an Fx which can exit early from a Scope.
389
- * @since 1.18.0
390
- * @category constructors
350
+ * @since 1.20.0
391
351
  */
392
- export declare const withEarlyExit: <R, E, A>(f: (params: WithEarlyExitParams<E, A>) => Effect.Effect<R, never, unknown>) => Fx<R, E, A>;
352
+ export declare const filterMapLoop: {
353
+ <B, A, C>(seed: B, f: (acc: B, a: A) => readonly [Option.Option<C>, B]): <R, E>(fx: Fx<R, E, A>) => Fx<R, E, C>;
354
+ <R, E, A, B, C>(fx: Fx<R, E, A>, seed: B, f: (acc: B, a: A) => readonly [Option.Option<C>, B]): Fx<R, E, C>;
355
+ };
393
356
  /**
394
- * Params for withFlattenStrategy
395
- * @since 1.18.0
396
- * @category params
357
+ * @since 1.20.0
397
358
  */
398
- export type WithFlattenStrategyParams<E, A> = {
399
- readonly sink: Sink.Sink<E, A>;
400
- readonly fork: FxFork;
401
- readonly scope: Scope.Scope;
359
+ export declare const loopEffect: {
360
+ <R2, E2, B, A, C>(seed: B, f: (acc: B, a: A) => Effect.Effect<R2, E2, readonly [C, B]>): <R, E>(fx: Fx<R, E, A>) => Fx<R | R2, E | E2, C>;
361
+ <R, E, A, R2, E2, B, C>(fx: Fx<R, E, A>, seed: B, f: (acc: B, a: A) => Effect.Effect<R2, E2, readonly [C, B]>): Fx<R | R2, E | E2, C>;
402
362
  };
403
363
  /**
404
- * Construct an Fx which can flatten nested Fx.
405
- * @since 1.18.0
406
- * @category constructors
364
+ * @since 1.20.0
407
365
  */
408
- export declare const withFlattenStrategy: <R, E, A>(f: (params: WithFlattenStrategyParams<E, A>) => Effect.Effect<R, never, unknown>, strategy: FlattenStrategy) => Fx<R, E, A>;
366
+ export declare const filterMapLoopEffect: {
367
+ <R2, E2, B, A, C>(seed: B, f: (acc: B, a: A) => Effect.Effect<R2, E2, readonly [Option.Option<C>, B]>): <R, E>(fx: Fx<R, E, A>) => Fx<R | R2, E | E2, C>;
368
+ <R, E, A, R2, E2, B, C>(fx: Fx<R, E, A>, seed: B, f: (acc: B, a: A) => Effect.Effect<R2, E2, readonly [Option.Option<C>, B]>): Fx<R | R2, E | E2, C>;
369
+ };
409
370
  /**
410
- * Acquire a resource, use it to construct an Fx, and then release the resource
411
- * after the Fx has exited.
412
- *
413
- * @since 1.18.0
414
- * @category constructors
371
+ * @since 1.20.0
415
372
  */
416
- export declare const acquireUseRelease: {
417
- <A, R2, E2, B, R3, E3>(use: (a: A) => FxInput<R2, E2, B>, release: (a: A, exit: Exit.Exit<unknown, unknown>) => Effect.Effect<R3, E3, unknown>): <R, E>(acquire: Effect.Effect<R, E, A>) => Fx<R | R2 | R3, E | E2 | E3, B>;
418
- <R, E, A, R2, E2, B, R3, E3>(acquire: Effect.Effect<R, E, A>, use: (a: A) => FxInput<R2, E2, B>, release: (a: A, exit: Exit.Exit<unknown, unknown>) => Effect.Effect<R3, E3, unknown>): Fx<R | R2 | R3, E | E2 | E3, B>;
373
+ export declare const observe: {
374
+ <A, R2, E2, B>(f: (a: A) => Effect.Effect<R2, E2, B>): <R, E>(fx: Fx<R, E, A>) => Effect.Effect<R | R2, E | E2, void>;
375
+ <R, E, A, R2, E2, B>(fx: Fx<R, E, A>, f: (a: A) => Effect.Effect<R2, E2, B>): Effect.Effect<R | R2, E | E2, void>;
419
376
  };
420
377
  /**
421
- * Combine multiple Fx into a single Fx that will emit the results of all Fx
422
- * as a tuple of values.
423
- *
424
- * @since 1.18.0
425
- * @category constructors
378
+ * @since 1.20.0
426
379
  */
427
- export declare const combine: <const FX extends ReadonlyArray<Fx<any, any, any>>>(fxs: FX) => Fx<Fx.Context<FX[number]>, Fx.Error<FX[number]>, {
428
- readonly [K in keyof FX]: Fx.Success<FX[K]>;
429
- }>;
380
+ export declare const drain: <R, E, A>(fx: Fx<R, E, A>) => Effect.Effect<R, E, void>;
430
381
  /**
431
- * Combine a record of Fx into a single Fx that will emit the results of all Fx
432
- * as a record of values.
433
- *
434
- * @since 1.18.0
435
- * @category constructors
382
+ * @since 1.20.0
436
383
  */
437
- export declare const struct: <const FX extends Readonly<Record<string, Fx<any, any, any>>>>(fxs: FX) => Fx<Fx.Context<FX[string]>, Fx.Error<FX[string]>, {
438
- readonly [K in keyof FX]: Fx.Success<FX[K]>;
439
- }>;
384
+ export declare const reduce: {
385
+ <A, B>(seed: B, f: (acc: B, a: A) => B): <R, E>(fx: Fx<R, E, A>) => Effect.Effect<R, E, B>;
386
+ <R, E, A, B>(fx: Fx<R, E, A>, seed: B, f: (acc: B, a: A) => B): Effect.Effect<R, E, B>;
387
+ };
440
388
  /**
441
- * Combine multiple Fx into a single Fx that will emit the results of all Fx
442
- * as they occur.
443
- * @since 1.18.0
444
- * @category constructors
389
+ * @since 1.20.0
445
390
  */
446
- export declare const merge: <const FX extends ReadonlyArray<Fx<any, any, any>>>(fxs: FX) => Fx<Fx.Context<FX[number]>, Fx.Error<FX[number]>, Fx.Success<FX[number]>>;
391
+ export declare const toReadonlyArray: <R, E, A>(fx: Fx<R, E, A>) => Effect.Effect<R, E, ReadonlyArray<A>>;
447
392
  /**
448
- * Combine multiple Fx into a single Fx that will emit the results of all Fx
449
- * as they occur, but only allowing `n` concurrent Fx to run at a time.
450
- *
451
- * @since 1.18.0
452
- * @category constructors
393
+ * @since 1.20.0
453
394
  */
454
- export declare const mergeConcurrently: {
455
- (concurrency: number): <const FX extends ReadonlyArray<Fx<any, any, any>>>(fxs: FX) => Fx<Fx.Context<FX[number]>, Fx.Error<FX[number]>, Fx.Success<FX[number]>>;
456
- <const FX extends ReadonlyArray<Fx<any, any, any>>>(fxs: FX, concurrency: number): Fx<Fx.Context<FX[number]>, Fx.Error<FX[number]>, Fx.Success<FX[number]>>;
395
+ export declare const slice: {
396
+ (drop: number, take: number): <R, E, A>(fx: Fx<R, E, A>) => Fx<R, E, A>;
397
+ <R, E, A>(fx: Fx<R, E, A>, drop: number, take: number): Fx<R, E, A>;
457
398
  };
458
399
  /**
459
- * Combine multiple Fx into a single Fx that will emit the results of all Fx
460
- * in the order the Fx were provided. All Fx will be executed concurrently,
461
- * and the results will be buffered if necessary to preserve ordering.
462
- *
463
- * @since 1.18.0
464
- * @category constructors
400
+ * @since 1.20.0
465
401
  */
466
- export declare const mergeBuffer: <const FX extends ReadonlyArray<Fx<any, any, any>>>(fxs: FX) => Fx<Fx.Context<FX[number]>, Fx.Error<FX[number]>, Fx.Success<FX[number]>>;
402
+ export declare const take: {
403
+ (n: number): <R, E, A>(fx: Fx<R, E, A>) => Fx<R, E, A>;
404
+ <R, E, A>(fx: Fx<R, E, A>, n: number): Fx<R, E, A>;
405
+ };
467
406
  /**
468
- * Combine multiple Fx into a single Fx that will emit the results of all Fx
469
- * in the order the Fx were provided. All Fx will be executed concurrently, limited
470
- * by the provided concurrency, and the results will be buffered if necessary to preserve ordering.
471
- *
472
- * @since 1.18.0
473
- * @category constructors
407
+ * @since 1.20.0
474
408
  */
475
- export declare const mergeBufferConcurrently: {
476
- (concurrency: number): <const FX extends ReadonlyArray<Fx<any, any, any>>>(fxs: FX) => Fx<Fx.Context<FX[number]>, Fx.Error<FX[number]>, Fx.Success<FX[number]>>;
477
- <const FX extends ReadonlyArray<Fx<any, any, any>>>(fxs: FX, concurrency: number): Fx<Fx.Context<FX[number]>, Fx.Error<FX[number]>, Fx.Success<FX[number]>>;
409
+ export declare const drop: {
410
+ (n: number): <R, E, A>(fx: Fx<R, E, A>) => Fx<R, E, A>;
411
+ <R, E, A>(fx: Fx<R, E, A>, n: number): Fx<R, E, A>;
478
412
  };
479
413
  /**
480
- * Merge together multiple Fx into a single Fx that will emit the results of all Fx
481
- * allowing only 1 Fx to run at a time.
482
- *
483
- * @since 1.18.0
484
- * @category constructors
414
+ * @since 1.20.0
485
415
  */
486
- export declare const mergeSwitch: <const FX extends readonly Fx<any, any, any>[]>(fxs: FX) => Fx<Fx.Context<FX[number]>, Fx.Error<FX[number]>, Fx.Success<FX[number]>>;
416
+ export declare const skipRepeats: <R, E, A>(fx: Fx<R, E, A>) => Fx<R, E, A>;
487
417
  /**
488
- * Merge together multiple Fx into a single Fx that will emit the results of the
489
- * first Fx to emit a value.
490
- *
491
- * @since 1.18.0
492
- * @category constructors
418
+ * @since 1.20.0
493
419
  */
494
- export declare const race: <const FX extends ReadonlyArray<Fx<any, any, any>>>(fxs: FX) => Fx<Fx.Context<FX[number]>, Fx.Error<FX[number]>, Fx.Success<FX[number]>>;
420
+ export declare const skipRepeatsWith: {
421
+ <A>(eq: Equivalence.Equivalence<A>): <R, E>(fx: Fx<R, E, A>) => Fx<R, E, A>;
422
+ <R, E, A>(fx: Fx<R, E, A>, eq: Equivalence.Equivalence<A>): Fx<R, E, A>;
423
+ };
495
424
  /**
496
- * Schedule an Effect to run using the provided Schedule, emitting its success of failure
497
- * at the intervals specified by the Schedule.
498
- *
499
- * @since 1.18.0
500
- * @category constructors
425
+ * @since 1.20.0
501
426
  */
502
- export declare const fromScheduled: {
503
- <R2>(scheduled: Schedule.Schedule<R2, unknown, unknown>): <R, E, A>(fx: Effect.Effect<R, E, A>) => Fx<R | R2, E, A>;
504
- <R, E, A, R2>(fx: Effect.Effect<R, E, A>, scheduled: Schedule.Schedule<R2, unknown, unknown>): Fx<R | R2, E, A>;
505
- };
427
+ export declare const empty: Fx<never, never, never>;
506
428
  /**
507
- * Schedule an Effect to run at the specified duration.
508
- *
509
- * @since 1.18.0
510
- * @category constructors
429
+ * @since 1.20.0
511
430
  */
512
- export declare const periodic: {
513
- (duration: DurationInput): <R, E, A>(fx: Effect.Effect<R, E, A>) => Fx<R, E, A>;
514
- <R, E, A>(fx: Effect.Effect<R, E, A>, duration: DurationInput): Fx<R, E, A>;
515
- };
431
+ export declare const never: Fx<never, never, never>;
516
432
  /**
517
- * Consume a Dequeue as soon as values become available and emit them as a Fx.
518
- * @since 1.18.0
519
- * @category constructors
433
+ * @since 1.20.0
520
434
  */
521
- export declare const fromDequeue: {
522
- <A>(dequeue: Queue.Dequeue<A>): Fx<never, never, A>;
523
- <I, A>(dequeue: Context.Dequeue<I, A>): Fx<I, never, A>;
435
+ export declare const padWith: {
436
+ <B, C>(start: Iterable<B>, end: Iterable<C>): <R, E, A>(fx: Fx<R, E, A>) => Fx<R, E, A | B | C>;
437
+ <R, E, A, B, C>(fx: Fx<R, E, A>, start: Iterable<B>, end: Iterable<C>): Fx<R, E, A | B | C>;
524
438
  };
525
439
  /**
526
- * Consume a PubSub as soon as values become available and emit them as a Fx.
527
- * @since 1.18.0
528
- * @category constructors
440
+ * @since 1.20.0
529
441
  */
530
- export declare const fromPubSub: {
531
- <A>(PubSub: PubSub.PubSub<A>): Fx<Scope.Scope, never, A>;
532
- <I, A>(PubSub: Context.PubSub<I, A>): Fx<Scope.Scope | I, never, A>;
442
+ export declare const prependAll: {
443
+ <B>(start: Iterable<B>): <R, E, A>(fx: Fx<R, E, A>) => Fx<R, E, A | B>;
444
+ <R, E, A, B>(fx: Fx<R, E, A>, start: Iterable<B>): Fx<R, E, A | B>;
533
445
  };
534
446
  /**
535
- * Run an Fx to completion with the provided Sink. The
536
- * Effect will resolve with the first Error of the Fx.
537
- * @since 1.18.0
538
- * @category running
447
+ * @since 1.20.0
539
448
  */
540
- export declare const run: {
541
- <E, A, R2>(sink: Sink.WithContext<R2, E, A>): <R>(fx: Fx<R, E, A>) => Effect.Effect<R | R2, never, unknown>;
542
- <R, E, A, R2>(fx: Fx<R, E, A>, sink: Sink.WithContext<R2, E, A>): Effect.Effect<R | R2, never, unknown>;
449
+ export declare const appendAll: {
450
+ <C>(end: Iterable<C>): <R, E, A>(fx: Fx<R, E, A>) => Fx<R, E, A | C>;
451
+ <R, E, A, C>(fx: Fx<R, E, A>, end: Iterable<C>): Fx<R, E, A | C>;
543
452
  };
544
453
  /**
545
- * Observe an Fx with the provided success value handler. The
546
- * Effect will resolve with the first Error of the Fx.
547
- *
548
- * @since 1.18.0
549
- * @category running
454
+ * @since 1.20.0
550
455
  */
551
- export declare const observe: {
552
- <A, R2, E2>(onSuccees: (a: A) => Effect.Effect<R2, E2, unknown>): <R, E>(fx: Fx<R, E, A>) => Effect.Effect<R | R2, E | E2, void>;
553
- <R, E, A, R2, E2>(fx: Fx<R, E, A>, onSuccees: (a: A) => Effect.Effect<R2, E2, unknown>): Effect.Effect<R | R2, E | E2, void>;
456
+ export declare const prepend: {
457
+ <B>(start: B): <R, E, A>(fx: Fx<R, E, A>) => Fx<R, E, A | B>;
458
+ <R, E, A, B>(fx: Fx<R, E, A>, start: B): Fx<R, E, A | B>;
554
459
  };
555
460
  /**
556
- * Run an Fx to completion. The Effect will resolve with the first Error of the Fx.
557
- *
558
- * @since 1.18.0
559
- * @category running
461
+ * @since 1.20.0
560
462
  */
561
- export declare const drain: <R, E, A>(fx: Fx<R, E, A>) => Effect.Effect<R, E, void>;
463
+ export declare const append: {
464
+ <C>(end: C): <R, E, A>(fx: Fx<R, E, A>) => Fx<R, E, A | C>;
465
+ <R, E, A, C>(fx: Fx<R, E, A>, end: C): Fx<R, E, A | C>;
466
+ };
562
467
  /**
563
- * Reduce an Fx to a single value.
564
- * @since 1.18.0
565
- * @category running
468
+ * @since 1.20.0
566
469
  */
567
- export declare const reduce: {
568
- <A, B>(seed: B, f: (acc: B, a: A) => B): <R, E>(fx: Fx<R, E, A>) => Effect.Effect<R, E, B>;
569
- <R, E, A, B>(fx: Fx<R, E, A>, seed: B, f: (acc: B, a: A) => B): Effect.Effect<R, E, B>;
470
+ export declare const scan: {
471
+ <B, A>(seed: B, f: (b: B, a: A) => B): <R, E>(fx: Fx<R, E, A>) => Fx<R, E, B>;
472
+ <R, E, A, B>(fx: Fx<R, E, A>, seed: B, f: (b: B, a: A) => B): Fx<R, E, B>;
570
473
  };
571
474
  /**
572
- * Run an Fx to completion, collecting all emitted values into an Array.
573
- * @since 1.18.0
574
- * @category running
475
+ * @since 1.20.0
575
476
  */
576
- export declare const toArray: <R, E, A>(fx: Fx<R, E, A>) => Effect.Effect<R, E, Array<A>>;
477
+ export declare const flatMapWithStrategy: {
478
+ <A, R2, E2, B>(f: (a: A) => Fx<R2, E2, B>, strategy: FlattenStrategy, executionStrategy?: ExecutionStrategy.ExecutionStrategy): <R, E>(fx: Fx<R, E, A>) => Fx<R | R2 | Scope.Scope, E | E2, B>;
479
+ <R, E, A, R2, E2, B>(fx: Fx<R, E, A>, f: (a: A) => Fx<R2, E2, B>, strategy: FlattenStrategy, executionStrategy?: ExecutionStrategy.ExecutionStrategy): Fx<R | R2 | Scope.Scope, E | E2, B>;
480
+ };
577
481
  /**
578
- * Run an Fx to completion, collecting all emitted values into a ReadonlyArray.
579
- * @since 1.18.0
580
- * @category running
482
+ * @since 1.20.0
581
483
  */
582
- export declare const toReadonlyArray: <R, E, A>(fx: Fx<R, E, A>) => Effect.Effect<R, E, ReadonlyArray<A>>;
484
+ export declare const flatMap: {
485
+ <A, R2, E2, B>(f: (a: A) => Fx<R2, E2, B>, executionStrategy?: ExecutionStrategy.ExecutionStrategy | undefined): <R, E>(fx: Fx<R, E, A>) => Fx<R | R2 | Scope.Scope, E | E2, B>;
486
+ <R, E, A, R2, E2, B>(fx: Fx<R, E, A>, f: (a: A) => Fx<R2, E2, B>, executionStrategy?: ExecutionStrategy.ExecutionStrategy | undefined): Fx<R | R2 | Scope.Scope, E | E2, B>;
487
+ };
583
488
  /**
584
- * Run an Fx to completion, collecting all emitted values into a Chunk.
585
- * @since 1.18.0
586
- * @category running
489
+ * @since 1.20.0
587
490
  */
588
- export declare const toChunk: <R, E, A>(fx: Fx<R, E, A>) => Effect.Effect<R, E, Chunk.Chunk<A>>;
491
+ export declare const flatMapEffect: {
492
+ <A, R2, E2, B>(f: (a: A) => Effect.Effect<R2, E2, B>, executionStrategy?: ExecutionStrategy.ExecutionStrategy | undefined): <R, E>(fx: Fx<R, E, A>) => Fx<R | R2 | Scope.Scope, E | E2, B>;
493
+ <R, E, A, R2, E2, B>(fx: Fx<R, E, A>, f: (a: A) => Effect.Effect<R2, E2, B>, executionStrategy?: ExecutionStrategy.ExecutionStrategy | undefined): Fx<R | R2 | Scope.Scope, E | E2, B>;
494
+ };
589
495
  /**
590
- * Consume an Fx and place its values into an Enqueue.
591
- * @since 1.18.0
592
- * @category running
496
+ * @since 1.20.0
593
497
  */
594
- export declare const toEnqueue: {
595
- <A, B>(enqueue: Queue.Enqueue<A | B>): <R, E>(fx: Fx<R, E, A>) => Effect.Effect<R, E, void>;
596
- <I, A, B>(enqueue: Context.Enqueue<I, A | B>): <R, E>(fx: Fx<R, E, A>) => Effect.Effect<I | R, E, void>;
597
- <R, E, A, B>(fx: Fx<R, E, A>, enqueue: Queue.Enqueue<A | B>): Effect.Effect<R, E, void>;
598
- <R, E, I, A, B>(fx: Fx<R, E, A>, enqueue: Context.Enqueue<I, A | B>): Effect.Effect<R, E, void>;
498
+ export declare const switchMap: {
499
+ <A, R2, E2, B>(f: (a: A) => Fx<R2, E2, B>, executionStrategy?: ExecutionStrategy.ExecutionStrategy | undefined): <R, E>(fx: Fx<R, E, A>) => Fx<R | R2 | Scope.Scope, E | E2, B>;
500
+ <R, E, A, R2, E2, B>(fx: Fx<R, E, A>, f: (a: A) => Fx<R2, E2, B>, executionStrategy?: ExecutionStrategy.ExecutionStrategy | undefined): Fx<R | R2 | Scope.Scope, E | E2, B>;
599
501
  };
600
502
  /**
601
- * Map over the success value of an Fx.
602
- * @since 1.18.0
603
- * @category combinators
503
+ * @since 1.20.0
604
504
  */
605
- export declare const map: {
606
- <A, B>(f: (a: A) => B): <R, E>(fx: Fx<R, E, A>) => Fx<R, E, B>;
607
- <R, E, A, B>(fx: Fx<R, E, A>, f: (a: A) => B): Fx<R, E, B>;
505
+ export declare const switchMapEffect: {
506
+ <A, R2, E2, B>(f: (a: A) => Effect.Effect<R2, E2, B>, executionStrategy?: ExecutionStrategy.ExecutionStrategy | undefined): <R, E>(fx: Fx<R, E, A>) => Fx<R | R2 | Scope.Scope, E | E2, B>;
507
+ <R, E, A, R2, E2, B>(fx: Fx<R, E, A>, f: (a: A) => Effect.Effect<R2, E2, B>, executionStrategy?: ExecutionStrategy.ExecutionStrategy | undefined): Fx<R | R2 | Scope.Scope, E | E2, B>;
608
508
  };
609
509
  /**
610
- * Map over both failure and success values of an Fx.
611
- * @since 1.18.0
612
- * @category combinators
510
+ * @since 1.20.0
613
511
  */
614
- export declare const mapBoth: {
615
- <E, E2, A, B>(options: {
616
- readonly onFailure: (e: E) => E2;
617
- readonly onSuccess: (a: A) => B;
618
- }): <R>(fx: Fx<R, E, A>) => Fx<R, E2, B>;
619
- <R, E, A, E2, B>(fx: Fx<R, E, A>, options: {
620
- readonly onFailure: (e: E) => E2;
621
- readonly onSuccess: (a: A) => B;
622
- }): Fx<R, E2, B>;
512
+ export declare const exhaustMap: {
513
+ <A, R2, E2, B>(f: (a: A) => Fx<R2, E2, B>, executionStrategy?: ExecutionStrategy.ExecutionStrategy | undefined): <R, E>(fx: Fx<R, E, A>) => Fx<R | R2 | Scope.Scope, E | E2, B>;
514
+ <R, E, A, R2, E2, B>(fx: Fx<R, E, A>, f: (a: A) => Fx<R2, E2, B>, executionStrategy?: ExecutionStrategy.ExecutionStrategy | undefined): Fx<R | R2 | Scope.Scope, E | E2, B>;
623
515
  };
624
516
  /**
625
- * Filter the success value of an Fx.
626
- * @since 1.18.0
627
- * @category combinators
517
+ * @since 1.20.0
628
518
  */
629
- export declare const filter: {
630
- <A, B extends A>(f: (a: A) => a is B): <R, E>(fx: Fx<R, E, A>) => Fx<R, E, B>;
631
- <A>(f: (a: A) => boolean): <R, E>(fx: Fx<R, E, A>) => Fx<R, E, A>;
632
- <R, E, A, B extends A>(fx: Fx<R, E, A>, f: (a: A) => a is B): Fx<R, E, B>;
633
- <R, E, A>(fx: Fx<R, E, A>, f: (a: A) => boolean): Fx<R, E, A>;
519
+ export declare const exhaustMapEffect: {
520
+ <A, R2, E2, B>(f: (a: A) => Effect.Effect<R2, E2, B>, executionStrategy?: ExecutionStrategy.ExecutionStrategy | undefined): <R, E>(fx: Fx<R, E, A>) => Fx<R | R2 | Scope.Scope, E | E2, B>;
521
+ <R, E, A, R2, E2, B>(fx: Fx<R, E, A>, f: (a: A) => Effect.Effect<R2, E2, B>, executionStrategy?: ExecutionStrategy.ExecutionStrategy | undefined): Fx<R | R2 | Scope.Scope, E | E2, B>;
634
522
  };
635
523
  /**
636
- * Filter and map the success value of an Fx.
637
- * @since 1.18.0
638
- * @category combinators
524
+ * @since 1.20.0
639
525
  */
640
- export declare const filterMap: {
641
- <A, B>(f: (a: A) => Option.Option<B>): <R, E>(fx: Fx<R, E, A>) => Fx<R, E, B>;
642
- <R, E, A, B>(fx: Fx<R, E, A>, f: (a: A) => Option.Option<B>): Fx<R, E, B>;
526
+ export declare const exhaustMapLatest: {
527
+ <A, R2, E2, B>(f: (a: A) => Fx<R2, E2, B>, executionStrategy?: ExecutionStrategy.ExecutionStrategy | undefined): <R, E>(fx: Fx<R, E, A>) => Fx<R | R2 | Scope.Scope, E | E2, B>;
528
+ <R, E, A, R2, E2, B>(fx: Fx<R, E, A>, f: (a: A) => Fx<R2, E2, B>, executionStrategy?: ExecutionStrategy.ExecutionStrategy | undefined): Fx<R | R2 | Scope.Scope, E | E2, B>;
643
529
  };
644
530
  /**
645
- * Unwrap Options by filtering any None values.
646
- * @since 1.18.0
647
- * @category combinators
531
+ * @since 1.20.0
648
532
  */
649
- export declare const compact: <R, E, A>(fx: Fx<R, E, Option.Option<A>>) => Fx<R, E, A>;
533
+ export declare const exhaustMapLatestEffect: {
534
+ <A, R2, E2, B>(f: (a: A) => Effect.Effect<R2, E2, B>, executionStrategy?: ExecutionStrategy.ExecutionStrategy | undefined): <R, E>(fx: Fx<R, E, A>) => Fx<R | R2 | Scope.Scope, E | E2, B>;
535
+ <R, E, A, R2, E2, B>(fx: Fx<R, E, A>, f: (a: A) => Effect.Effect<R2, E2, B>, executionStrategy?: ExecutionStrategy.ExecutionStrategy | undefined): Fx<R | R2 | Scope.Scope, E | E2, B>;
536
+ };
650
537
  /**
651
- * Map over the Cause of an Fx.
652
- * @since 1.18.0
653
- * @category errors
538
+ * @since 1.20.0
654
539
  */
655
- export declare const mapErrorCause: {
656
- <E, E2>(f: (a: Cause.Cause<E>) => Cause.Cause<E2>): <R, A>(fx: Fx<R, E, A>) => Fx<R, E2, A>;
657
- <R, E, A, E2>(fx: Fx<R, E, A>, f: (a: Cause.Cause<E>) => Cause.Cause<E2>): Fx<R, E2, A>;
540
+ export declare const flatMapConcurrently: {
541
+ <A, R2, E2, B>(f: (a: A) => Fx<R2, E2, B>, capacity: number, executionStrategy?: ExecutionStrategy.ExecutionStrategy | undefined): <R, E>(fx: Fx<R, E, A>) => Fx<R | R2 | Scope.Scope, E | E2, B>;
542
+ <R, E, A, R2, E2, B>(fx: Fx<R, E, A>, f: (a: A) => Fx<R2, E2, B>, capacity: number, executionStrategy?: ExecutionStrategy.ExecutionStrategy | undefined): Fx<R | R2 | Scope.Scope, E | E2, B>;
658
543
  };
659
544
  /**
660
- * Map over the Error of an Fx.
661
- * @since 1.18.0
662
- * @category errors
545
+ * @since 1.20.0
663
546
  */
664
- export declare const mapError: {
665
- <E, E2>(f: (a: E) => E2): <R, A>(fx: Fx<R, E, A>) => Fx<R, E2, A>;
666
- <R, E, A, E2>(fx: Fx<R, E, A>, f: (a: E) => E2): Fx<R, E2, A>;
547
+ export declare const flatMapConcurrentlyEffect: {
548
+ <A, R2, E2, B>(f: (a: A) => Effect.Effect<R2, E2, B>, capacity: number, executionStrategy?: ExecutionStrategy.ExecutionStrategy | undefined): <R, E>(fx: Fx<R, E, A>) => Fx<R | R2 | Scope.Scope, E | E2, B>;
549
+ <R, E, A, R2, E2, B>(fx: Fx<R, E, A>, f: (a: A) => Effect.Effect<R2, E2, B>, capacity: number, executionStrategy?: ExecutionStrategy.ExecutionStrategy | undefined): Fx<R | R2 | Scope.Scope, E | E2, B>;
667
550
  };
668
551
  /**
669
- * Filter the Cause of an Fx.
670
- * @since 1.18.0
671
- * @category errors
552
+ * @since 1.20.0
672
553
  */
673
- export declare const filterErrorCause: {
674
- <E, E2 extends E>(f: (a: Cause.Cause<E>) => a is Cause.Cause<E2>): <R, A>(fx: Fx<R, E, A>) => Fx<R, E2, A>;
675
- <E>(f: (a: Cause.Cause<E>) => boolean): <R, A>(fx: Fx<R, E, A>) => Fx<R, E, A>;
676
- <R, E, E2 extends E, A>(fx: Fx<R, E, A>, f: (a: Cause.Cause<E>) => a is Cause.Cause<E2>): Fx<R, E2, A>;
677
- <R, E, A>(fx: Fx<R, E, A>, f: (a: Cause.Cause<E>) => boolean): Fx<R, E, A>;
554
+ export declare const concatMap: {
555
+ <A, R2, E2, B>(f: (a: A) => Fx<R2, E2, B>, executionStrategy?: ExecutionStrategy.ExecutionStrategy | undefined): <R, E>(fx: Fx<R, E, A>) => Fx<Scope.Scope | R | R2, E | E2, B>;
556
+ <R, E, A, R2, E2, B>(fx: Fx<R, E, A>, f: (a: A) => Fx<R2, E2, B>, executionStrategy?: ExecutionStrategy.ExecutionStrategy | undefined): Fx<Scope.Scope | R | R2, E | E2, B>;
678
557
  };
679
558
  /**
680
- * Filter and map the Cause of an Fx.
681
- * @since 1.18.0
682
- * @category errors
559
+ * @since 1.20.0
683
560
  */
684
- export declare const filterMapCause: {
685
- <E, E2>(f: (a: Cause.Cause<E>) => Option.Option<Cause.Cause<E2>>): <R, A>(fx: Fx<R, E, A>) => Fx<R, E2, A>;
686
- <R, E, A, E2>(fx: Fx<R, E, A>, f: (a: Cause.Cause<E>) => Option.Option<Cause.Cause<E2>>): Fx<R, E2, A>;
687
- };
561
+ export declare const fromFxEffect: <R, E, R2, E2, B>(effect: Effect.Effect<R, E, Fx<R2, E2, B>>) => Fx<R | R2, E | E2, B>;
688
562
  /**
689
- * Filter the Error of an Fx.
690
- * @since 1.18.0
691
- * @category errors
563
+ * @since 1.20.0
692
564
  */
693
- export declare const filterError: {
694
- <E, E2 extends E>(f: (a: E) => a is E2): <R, A>(fx: Fx<R, E, A>) => Fx<R, E2, A>;
695
- <E>(f: (a: E) => boolean): <R, A>(fx: Fx<R, E, A>) => Fx<R, E, A>;
696
- <R, E, E2 extends E, A>(fx: Fx<R, E, A>, f: (a: E) => a is E2): Fx<R, E2, A>;
697
- <R, E, A>(fx: Fx<R, E, A>, f: (a: E) => boolean): Fx<R, E, A>;
565
+ export declare const continueWith: {
566
+ <R2, E2, B>(f: () => Fx<R2, E2, B>): <R, E, A>(fx: Fx<R, E, A>) => Fx<R | R2, E | E2, A | B>;
567
+ <R, E, A, R2, E2, B>(fx: Fx<R, E, A>, f: () => Fx<R2, E2, B>): Fx<R | R2, E | E2, A | B>;
698
568
  };
699
569
  /**
700
- * Filter and map the error of an Fx.
701
- * @since 1.18.0
702
- * @category errors
570
+ * @since 1.20.0
703
571
  */
704
- export declare const filterMapError: {
705
- <E, E2>(f: (a: E) => Option.Option<E2>): <R, A>(fx: Fx<R, E, A>) => Fx<R, E2, A>;
706
- <R, E, A, E2>(fx: Fx<R, E, A>, f: (a: E) => Option.Option<E2>): Fx<R, E2, A>;
572
+ export declare const orElseCause: {
573
+ <E, R2, E2, B>(f: (cause: Cause.Cause<E>) => Fx<R2, E2, B>): <R, A>(fx: Fx<R, E, A>) => Fx<R | R2, E2, A | B>;
574
+ <R, E, A, R2, E2, B>(fx: Fx<R, E, A>, f: (cause: Cause.Cause<E>) => Fx<R2, E2, B>): Fx<R | R2, E2, A | B>;
707
575
  };
708
576
  /**
709
- * Filter and map the error of an Fx using an Effect.
710
- * @since 1.18.0
711
- * @category errors
577
+ * @since 1.20.0
712
578
  */
713
- export declare const filterMapErrorEffect: {
714
- <E, R2, E2, B>(f: (e: E) => Effect.Effect<R2, E2, Option.Option<B>>): <R, A>(fx: Fx<R, E, A>) => Fx<R2 | R, E2 | B, A>;
715
- <R, E, A, R2, E2, B>(fx: Fx<R, E, A>, f: (e: E) => Effect.Effect<R2, E2, Option.Option<B>>): Fx<R | R2, E2 | B, A>;
579
+ export declare const orElse: {
580
+ <E, R2, E2, B>(f: (error: E) => Fx<R2, E2, B>): <R, A>(fx: Fx<R, E, A>) => Fx<R | R2, E2, A | B>;
581
+ <R, E, A, R2, E2, B>(fx: Fx<R, E, A>, f: (error: E) => Fx<R2, E2, B>): Fx<R | R2, E2, A | B>;
716
582
  };
717
583
  /**
718
- * Map the success value of an Fx to another Fx, flattening the result
719
- * with the provided FlattenStrategy.
720
- * @since 1.18.0
721
- * @category flattening
584
+ * @since 1.20.0
722
585
  */
723
- export declare const flatMapWithStrategy: {
724
- <A, R2, E2, B>(f: (a: A) => FxInput<R2, E2, B>, strategy: FlattenStrategy): <R, E>(fx: Fx<R, E, A>) => Fx<R | R2, E | E2, B>;
725
- <R, E, A, R2, E2, B>(fx: Fx<R, E, A>, f: (a: A) => FxInput<R2, E2, B>, strategy: FlattenStrategy): Fx<R | R2, E | E2, B>;
726
- };
586
+ export declare const suspend: <R, E, A>(f: () => Fx<R, E, A>) => Fx<R, E, A>;
727
587
  /**
728
- * Map the success value of an Fx to another Fx, switching to the latest
729
- * Fx emitted and interrupting the previous.
730
- * @since 1.18.0
731
- * @category flattening
588
+ * @since 1.20.0
732
589
  */
733
- export declare const switchMap: {
734
- <A, R2 = never, E2 = never, B = never>(f: (a: A) => FxInput<R2, E2, B>): <R, E>(fx: Fx<R, E, A>) => Fx<R | R2, E | E2, B>;
735
- <R, E, A, R2 = never, E2 = never, B = never>(fx: Fx<R, E, A>, f: (a: A) => FxInput<R2, E2, B>): Fx<R | R2, E | E2, B>;
590
+ export declare const mergeWithStrategy: {
591
+ (strategy: MergeStrategy): <FX extends ReadonlyArray<Fx<any, any, any>>>(fx: FX) => Fx<Fx.Context<FX[number]>, Fx.Error<FX[number]>, Fx.Success<FX[number]>>;
592
+ <const FX extends ReadonlyArray<Fx<any, any, any>>>(fx: FX, stategy: MergeStrategy): Fx<Fx.Context<FX[number]>, Fx.Error<FX[number]>, Fx.Success<FX[number]>>;
736
593
  };
737
594
  /**
738
- * Map the success value of an Fx to another Fx, switching to the latest
739
- * Fx emitted and interrupting the previous.
740
- * @since 1.18.0
741
- * @category flattening
595
+ * @since 1.20.0
742
596
  */
743
- export declare const switchLatest: {
744
- <R, E, R2, E2, B>(fx: Fx<R, E, FxInput<R2, E2, B>>): Fx<R | R2, E | E2, B>;
597
+ export declare const merge: {
598
+ <R2, E2, B>(other: Fx<R2, E2, B>): <R, E, A>(fx: Fx<R, E, A>) => Fx<R | R2, E | E2, A | B>;
599
+ <R, E, A, R2, E2, B>(fx: Fx<R, E, A>, other: Fx<R2, E2, B>): Fx<R | R2, E | E2, A | B>;
745
600
  };
746
601
  /**
747
- * Map the success value of an Fx to another Fx, prefering the first
748
- * Fx emitted and dropping any subsequent Fx until it has completed.
749
- * @since 1.18.0
750
- * @category flattening
602
+ * @since 1.20.0
751
603
  */
752
- export declare const exhaustMap: {
753
- <A, R2 = never, E2 = never, B = never>(f: (a: A) => FxInput<R2, E2, B>): <R, E>(fx: Fx<R, E, A>) => Fx<R | R2, E | E2, B>;
754
- <R, E, A, R2 = never, E2 = never, B = never>(fx: Fx<R, E, A>, f: (a: A) => FxInput<R2, E2, B>): Fx<R | R2, E | E2, B>;
755
- };
604
+ export declare const mergeAll: <FX extends ReadonlyArray<Fx<any, any, any>>>(fx: FX) => Fx<Fx.Context<FX[number]>, Fx.Error<FX[number]>, Fx.Success<FX[number]>>;
756
605
  /**
757
- * Flatten a nested Fx, prefering the first
758
- * Fx emitted and dropping any subsequent Fx until it has completed.
759
- * @since 1.18.0
760
- * @category flattening
606
+ * @since 1.20.0
761
607
  */
762
- export declare const exhaust: <R, E, R2, E2, A>(fx: Fx<R, E, Fx<R2, E2, A>>) => Fx<R | R2, E | E2, A>;
608
+ export declare const mergeOrdered: <FX extends ReadonlyArray<Fx<any, any, any>>>(fx: FX) => Fx<Fx.Context<FX[number]>, Fx.Error<FX[number]>, Fx.Success<FX[number]>>;
763
609
  /**
764
- * Map the success value of an Fx to another Fx, prefering the first
765
- * until completion, and then running the last emitted Fx if they are not
766
- * the same Fx.
767
- *
768
- * @since 1.18.0
769
- * @category flattening
610
+ * @since 1.20.0
770
611
  */
771
- export declare const exhaustMapLatest: {
772
- <A, R2 = never, E2 = never, B = never>(f: (a: A) => FxInput<R2, E2, B>): <R, E>(fx: Fx<R, E, A>) => Fx<R | R2, E | E2, B>;
773
- <R, E, A, R2 = never, E2 = never, B = never>(fx: Fx<R, E, A>, f: (a: A) => FxInput<R2, E2, B>): Fx<R | R2, E | E2, B>;
774
- };
612
+ export declare const mergeOrderedConcurrently: <FX extends ReadonlyArray<Fx<any, any, any>>>(fx: FX, concurrency: number) => Fx<Fx.Context<FX[number]>, Fx.Error<FX[number]>, Fx.Success<FX[number]>>;
775
613
  /**
776
- * Flatten a nested Fx, prefering the first until completion, and then running the last emitted Fx if they are not
777
- * the same Fx.
778
- *
779
- * @since 1.18.0
780
- * @category flattening
614
+ * @since 1.20.0
781
615
  */
782
- export declare const exhaustLatest: <R, E, R2, E2, A>(fx: Fx<R, E, Fx<R2, E2, A>>) => Fx<R | R2, E | E2, A>;
616
+ export declare const mergeSwitch: <FX extends ReadonlyArray<Fx<any, any, any>>>(fx: FX) => Fx<Fx.Context<FX[number]>, Fx.Error<FX[number]>, Fx.Success<FX[number]>>;
783
617
  /**
784
- * Map the success value of an Fx to another Fx with unbounded concurrency.
785
- *
786
- * @since 1.18.0
787
- * @category flattening
618
+ * @since 1.20.0
788
619
  */
789
- export declare const flatMap: {
790
- <A, R2 = never, E2 = never, B = never>(f: (a: A) => FxInput<R2, E2, B>): <R, E>(fx: Fx<R, E, A>) => Fx<R | R2, E | E2, B>;
791
- <R, E, A, R2 = never, E2 = never, B = never>(fx: Fx<R, E, A>, f: (a: A) => FxInput<R2, E2, B>): Fx<R | R2, E | E2, B>;
620
+ export declare const takeWhile: {
621
+ <A, B extends A>(f: Predicate.Refinement<A, B>): <R, E>(fx: Fx<R, E, A>) => Fx<R, E, B>;
622
+ <A>(f: Predicate.Predicate<A>): <R, E>(fx: Fx<R, E, A>) => Fx<R, E, A>;
623
+ <R, E, A, B extends A>(fx: Fx<R, E, A>, f: Predicate.Refinement<A, B>): Fx<R, E, B>;
624
+ <R, E, A>(fx: Fx<R, E, A>, f: Predicate.Predicate<A>): Fx<R, E, A>;
792
625
  };
793
626
  /**
794
- * Map the success value of an Fx to another Fx with unbounded concurrency.
795
- *
796
- * @since 1.18.0
797
- * @category flattening
627
+ * @since 1.20.0
798
628
  */
799
- export declare const flatten: <R, E, R2, E2, A>(fx: Fx<R, E, Fx<R2, E2, A>>) => Fx<R | R2, E | E2, A>;
629
+ export declare const takeUntil: {
630
+ <A, B extends A>(f: Predicate.Refinement<A, B>): <R, E>(fx: Fx<R, E, A>) => Fx<R, E, Exclude<A, B>>;
631
+ <A>(f: Predicate.Predicate<A>): <R, E>(fx: Fx<R, E, A>) => Fx<R, E, A>;
632
+ <R, E, A, B extends A>(fx: Fx<R, E, A>, f: Predicate.Refinement<A, B>): Fx<R, E, Exclude<A, B>>;
633
+ <R, E, A>(fx: Fx<R, E, A>, f: Predicate.Predicate<A>): Fx<R, E, A>;
634
+ };
800
635
  /**
801
- * Map the success value of an Fx to another Fx with the specified concurrency.
802
- *
803
- * @since 1.18.0
804
- * @category flattening
636
+ * @since 1.20.0
805
637
  */
806
- export declare const flatMapConcurrently: {
807
- <A, R2 = never, E2 = never, B = never>(f: (a: A) => FxInput<R2, E2, B>, concurrency: number): <R, E>(fx: Fx<R, E, A>) => Fx<R | R2, E | E2, B>;
808
- <R, E, A, R2 = never, E2 = never, B = never>(fx: Fx<R, E, A>, f: (a: A) => FxInput<R2, E2, B>, concurrency: number): Fx<R | R2, E | E2, B>;
638
+ export declare const dropWhile: {
639
+ <A, B extends A>(f: Predicate.Refinement<A, B>): <R, E>(fx: Fx<R, E, A>) => Fx<R, E, Exclude<A, B>>;
640
+ <A>(f: Predicate.Predicate<A>): <R, E>(fx: Fx<R, E, A>) => Fx<R, E, A>;
641
+ <R, E, A, B extends A>(fx: Fx<R, E, A>, f: Predicate.Refinement<A, B>): Fx<R, E, Exclude<A, B>>;
642
+ <R, E, A>(fx: Fx<R, E, A>, f: Predicate.Predicate<A>): Fx<R, E, A>;
809
643
  };
810
644
  /**
811
- * Map the success value of an Fx to another Fx one at a time.
812
- *
813
- * @since 1.18.0
814
- * @category flattening
645
+ * @since 1.20.0
815
646
  */
816
- export declare const concatMap: {
817
- <A, R2 = never, E2 = never, B = never>(f: (a: A) => FxInput<R2, E2, B>): <R, E>(fx: Fx<R, E, A>) => Fx<R | R2, E | E2, B>;
818
- <R, E, A, R2 = never, E2 = never, B = never>(fx: Fx<R, E, A>, f: (a: A) => FxInput<R2, E2, B>): Fx<R | R2, E | E2, B>;
647
+ export declare const dropUntil: {
648
+ <A, B extends A>(f: Predicate.Refinement<A, B>): <R, E>(fx: Fx<R, E, A>) => Fx<R, E, A | B>;
649
+ <A>(f: Predicate.Predicate<A>): <R, E>(fx: Fx<R, E, A>) => Fx<R, E, A>;
650
+ <R, E, A, B extends A>(fx: Fx<R, E, A>, f: Predicate.Refinement<A, B>): Fx<R, E, A | B>;
651
+ <R, E, A>(fx: Fx<R, E, A>, f: Predicate.Predicate<A>): Fx<R, E, A>;
819
652
  };
820
653
  /**
821
- * Skip and take a number of values from an Fx.
822
- *
823
- * @since 1.18.0
824
- * @category slicing
654
+ * @since 1.20.0
825
655
  */
826
- export declare const slice: {
827
- (skip: number, take: number): <R, E, A>(fx: Fx<R, E, A>) => Fx<R, E, A>;
828
- <R, E, A>(fx: Fx<R, E, A>, skip: number, take: number): Fx<R, E, A>;
656
+ export declare const dropAfter: {
657
+ <A, B extends A>(f: Predicate.Refinement<A, B>): <R, E>(fx: Fx<R, E, A>) => Fx<R, E, Exclude<A, B>>;
658
+ <A>(f: Predicate.Predicate<A>): <R, E>(fx: Fx<R, E, A>) => Fx<R, E, A>;
659
+ <R, E, A, B extends A>(fx: Fx<R, E, A>, f: Predicate.Refinement<A, B>): Fx<R, E, Exclude<A, B>>;
660
+ <R, E, A>(fx: Fx<R, E, A>, f: Predicate.Predicate<A>): Fx<R, E, A>;
829
661
  };
830
662
  /**
831
- * Take a number of values from an Fx.
832
- *
833
- * @since 1.18.0
834
- * @category slicing
663
+ * @since 1.20.0
835
664
  */
836
- export declare const take: {
837
- (n: number): <R, E, A>(fx: Fx<R, E, A>) => Fx<R, E, A>;
838
- <R, E, A>(fx: Fx<R, E, A>, n: number): Fx<R, E, A>;
665
+ export declare const takeWhileEffect: {
666
+ <A, R2, E2>(f: (a: A) => Effect.Effect<R2, E2, boolean>): <R, E>(fx: Fx<R, E, A>) => Fx<R | R2, E | E2, A>;
667
+ <R, E, A, R2, E2>(fx: Fx<R, E, A>, f: (a: A) => Effect.Effect<R2, E2, boolean>): Fx<R | R2, E | E2, A>;
839
668
  };
840
669
  /**
841
- * Drop a number of values from an Fx.
842
- *
843
- * @since 1.18.0
844
- * @category slicing
670
+ * @since 1.20.0
845
671
  */
846
- export declare const drop: {
847
- (n: number): <R, E, A>(fx: Fx<R, E, A>) => Fx<R, E, A>;
848
- <R, E, A>(fx: Fx<R, E, A>, n: number): Fx<R, E, A>;
672
+ export declare const takeUntiEffect: {
673
+ <A, R2, E2>(f: (a: A) => Effect.Effect<R2, E2, boolean>): <R, E>(fx: Fx<R, E, A>) => Fx<R | R2, E | E2, A>;
674
+ <R, E, A, R2, E2>(fx: Fx<R, E, A>, f: (a: A) => Effect.Effect<R2, E2, boolean>): Fx<R | R2, E | E2, A>;
849
675
  };
850
676
  /**
851
- * Take values from an Fx while the predicate returns true.
852
- *
853
- * @since 1.18.0
854
- * @category slicing
677
+ * @since 1.20.0
855
678
  */
856
- export declare const takeWhile: {
857
- <A, R2, E2>(predicate: (a: A) => Effect.Effect<R2, E2, boolean>): <R, E>(fx: Fx<R, E, A>) => Fx<R | R2, E | E2, A>;
858
- <R, E, A, R2, E2>(fx: Fx<R, E, A>, predicate: (a: A) => Effect.Effect<R2, E2, boolean>): Fx<R | R2, E | E2, A>;
679
+ export declare const dropWhileEffect: {
680
+ <A, R2, E2>(f: (a: A) => Effect.Effect<R2, E2, boolean>): <R, E>(fx: Fx<R, E, A>) => Fx<R | R2, E | E2, A>;
681
+ <R, E, A, R2, E2>(fx: Fx<R, E, A>, f: (a: A) => Effect.Effect<R2, E2, boolean>): Fx<R | R2, E | E2, A>;
859
682
  };
860
683
  /**
861
- * Take values from an Fx until the predicate returns true.
862
- *
863
- * @since 1.18.0
864
- * @category slicing
684
+ * @since 1.20.0
865
685
  */
866
- export declare const takeUntil: {
867
- <A, R2, E2>(predicate: (a: A) => Effect.Effect<R2, E2, boolean>): <R, E>(fx: Fx<R, E, A>) => Fx<R | R2, E | E2, A>;
868
- <R, E, A, R2, E2>(fx: Fx<R, E, A>, predicate: (a: A) => Effect.Effect<R2, E2, boolean>): Fx<R | R2, E | E2, A>;
686
+ export declare const dropUntilEffect: {
687
+ <A, R2, E2>(f: (a: A) => Effect.Effect<R2, E2, boolean>): <R, E>(fx: Fx<R, E, A>) => Fx<R | R2, E | E2, A>;
688
+ <R, E, A, R2, E2>(fx: Fx<R, E, A>, f: (a: A) => Effect.Effect<R2, E2, boolean>): Fx<R | R2, E | E2, A>;
869
689
  };
870
690
  /**
871
- * Drop values from an Fx while the predicate returns true.
872
- *
873
- * @since 1.18.0
874
- * @category slicing
691
+ * @since 1.20.0
875
692
  */
876
- export declare const dropWhile: {
877
- <A, R2, E2>(predicate: (a: A) => Effect.Effect<R2, E2, boolean>): <R, E>(fx: Fx<R, E, A>) => Fx<R | R2, E | E2, A>;
878
- <R, E, A, R2, E2>(fx: Fx<R, E, A>, predicate: (a: A) => Effect.Effect<R2, E2, boolean>): Fx<R | R2, E | E2, A>;
693
+ export declare const dropAfterEffect: {
694
+ <A, R2, E2>(f: (a: A) => Effect.Effect<R2, E2, boolean>): <R, E>(fx: Fx<R, E, A>) => Fx<R | R2, E | E2, A>;
695
+ <R, E, A, R2, E2>(fx: Fx<R, E, A>, f: (a: A) => Effect.Effect<R2, E2, boolean>): Fx<R | R2, E | E2, A>;
879
696
  };
880
697
  /**
881
- * Drop values from an Fx until the predicate returns true.
882
- *
883
- * @since 1.18.0
884
- * @category slicing
698
+ * @since 1.20.0
885
699
  */
886
- export declare const dropUntil: {
887
- <A, R2, E2>(predicate: (a: A) => Effect.Effect<R2, E2, boolean>): <R, E>(fx: Fx<R, E, A>) => Fx<R | R2, E | E2, A>;
888
- <R, E, A, R2, E2>(fx: Fx<R, E, A>, predicate: (a: A) => Effect.Effect<R2, E2, boolean>): Fx<R | R2, E | E2, A>;
700
+ export declare const during: {
701
+ <R2, E2, A, R3, E3, B>(window: Fx<R2, E2, Fx<R3, E3, B>>): <R, E>(fx: Fx<R, E, A>) => Fx<R | R2 | R3 | Scope.Scope, E | E2 | E3, A>;
702
+ <R, E, A, R2, E2, R3, E3, B>(fx: Fx<R, E, A>, window: Fx<R2, E2, Fx<R3, E3, B>>): Fx<R | R2 | R3 | Scope.Scope, E | E2 | E3, A>;
889
703
  };
890
704
  /**
891
- * Drop values from an Fx after the predicate returns true.
892
- *
893
- * @since 1.18.0
894
- * @category slicing
705
+ * @since 1.20.0
895
706
  */
896
- export declare const dropAfter: {
897
- <A, R2, E2>(predicate: (a: A) => Effect.Effect<R2, E2, boolean>): <R, E>(fx: Fx<R, E, A>) => Fx<R | R2, E | E2, A>;
898
- <R, E, A, R2, E2>(fx: Fx<R, E, A>, predicate: (a: A) => Effect.Effect<R2, E2, boolean>): Fx<R | R2, E | E2, A>;
707
+ export declare const since: {
708
+ <R2, E2, B>(window: Fx<R2, E2, B>): <R, E, A>(fx: Fx<R, E, A>) => Fx<R | R2 | Scope.Scope, E | E2, A>;
709
+ <R, E, A, R2, E2, B>(fx: Fx<R, E, A>, window: Fx<R2, E2, B>): Fx<R | R2 | Scope.Scope, E | E2, A>;
899
710
  };
900
711
  /**
901
- * Concatenate an Fx after the successful completion of another Fx
902
- *
903
- * @since 1.18.0
904
- * @category combinators
712
+ * @since 1.20.0
905
713
  */
906
- export declare const continueWith: {
907
- <R2, E2, B>(f: () => Fx<R2, E2, B>): <R, E, A>(fx: Fx<R, E, A>) => Fx<R | R2, E | E2, A | B>;
908
- <R, E, A, R2, E2, B>(fx: Fx<R, E, A>, f: () => Fx<R2, E2, B>): Fx<R | R2, E | E2, A | B>;
714
+ export declare const until: {
715
+ <R2, E2, B>(window: Fx<R2, E2, B>): <R, E, A>(fx: Fx<R, E, A>) => Fx<R | R2 | Scope.Scope, E | E2, A>;
716
+ <R, E, A, R2, E2, B>(fx: Fx<R, E, A>, window: Fx<R2, E2, B>): Fx<R | R2 | Scope.Scope, E | E2, A>;
909
717
  };
910
718
  /**
911
- * Concatenate an Fx after the failure of another Fx
912
- *
913
- * @since 1.18.0
914
- * @category combinators
719
+ * @since 1.20.0
915
720
  */
916
- export declare const orElse: {
917
- <E, R2, E2, B>(f: (cause: Cause.Cause<E>) => FxInput<R2, E2, B>): <R, A>(fx: Fx<R, E, A>) => Fx<R | R2, E2, A | B>;
918
- <R, E, A, R2, E2, B>(fx: Fx<R, E, A>, f: (cause: Cause.Cause<E>) => Fx<R2, E2, A>): Fx<R | R2, E2, A | B>;
721
+ export declare const middleware: {
722
+ <R, R3, E, A>(effect: (effect: Effect.Effect<R, never, unknown>) => Effect.Effect<R3, never, unknown>, sink?: ((sink: Sink.Sink<never, E, A>) => Sink.Sink<R, E, A>) | undefined): <E, A>(fx: Fx<R, E, A>) => Fx<R3, E, A>;
723
+ <R, E, A, R3>(fx: Fx<R, E, A>, effect: (effect: Effect.Effect<R, never, unknown>) => Effect.Effect<R3, never, unknown>, sink?: ((sink: Sink.Sink<never, E, A>) => Sink.Sink<R, E, A>) | undefined): Fx<R3, E, A>;
919
724
  };
920
725
  /**
921
- * Map the success value of an Fx to an Effect, doesn't fork any fibers like flatMap* etc.
922
- *
923
- * @since 1.18.0
924
- * @category combinators
726
+ * @since 1.20.0
925
727
  */
926
- export declare const mapEffect: {
927
- <A, R2, E2, B>(f: (a: A) => Effect.Effect<R2, E2, B>): <R, E>(fx: Fx<R, E, A>) => Fx<R | R2, E | E2, B>;
928
- <R, E, A, R2, E2, B>(fx: Fx<R, E, A>, f: (a: A) => Effect.Effect<R2, E2, B>): Fx<R | R2, E | E2, B>;
728
+ export declare const onExit: {
729
+ <R2>(f: (exit: Exit.Exit<never, unknown>) => Effect.Effect<R2, never, unknown>): <R, E, A>(fx: Fx<R, E, A>) => Fx<R2, E, A>;
730
+ <R, E, A, R2>(fx: Fx<R, E, A>, f: (exit: Exit.Exit<never, unknown>) => Effect.Effect<R2, never, unknown>): Fx<R | R2, E, A>;
929
731
  };
930
732
  /**
931
- * Perform an Effect for each value emitted by an Fx, not affecting the output of the Fx.
932
- *
933
- * @since 1.18.0
934
- * @category combinators
733
+ * @since 1.20.0
935
734
  */
936
- export declare const tap: {
937
- <A, R2, E2, B>(f: (a: A) => Effect.Effect<R2, E2, B>): <R, E>(fx: Fx<R, E, A>) => Fx<R | R2, E | E2, A>;
938
- <R, E, A, R2, E2, B>(fx: Fx<R, E, A>, f: (a: A) => Effect.Effect<R2, E2, B>): Fx<R | R2, E | E2, A>;
735
+ export declare const onInterrupt: {
736
+ <R2>(f: (interruptors: HashSet.HashSet<FiberId.FiberId>) => Effect.Effect<R2, never, unknown>): <R, E, A>(fx: Fx<R, E, A>) => Fx<R2, E, A>;
737
+ <R, E, A, R2>(fx: Fx<R, E, A>, f: (interruptors: HashSet.HashSet<FiberId.FiberId>) => Effect.Effect<R2, never, unknown>): Fx<R | R2, E, A>;
939
738
  };
940
739
  /**
941
- * Filter the success value of an Fx with an Effect.
942
- *
943
- * @since 1.18.0
944
- * @category combinators
740
+ * @since 1.20.0
945
741
  */
946
- export declare const filterEffect: {
947
- <A, R2, E2>(predicate: (a: A) => Effect.Effect<R2, E2, boolean>): <R, E>(fx: Fx<R, E, A>) => Fx<R | R2, E | E2, A>;
948
- <R, E, A, R2, E2>(fx: Fx<R, E, A>, predicate: (a: A) => Effect.Effect<R2, E2, boolean>): Fx<R | R2, E | E2, A>;
742
+ export declare const onError: {
743
+ <R2>(f: (cause: Cause.Cause<never>) => Effect.Effect<R2, never, unknown>): <R, E, A>(fx: Fx<R, E, A>) => Fx<R2, E, A>;
744
+ <R, E, A, R2>(fx: Fx<R, E, A>, f: (cause: Cause.Cause<never>) => Effect.Effect<R2, never, unknown>): Fx<R | R2, E, A>;
949
745
  };
950
746
  /**
951
- * Filter and map the success value of an Fx with an Effect.
952
- *
953
- * @since 1.18.0
954
- * @category combinators
747
+ * @since 1.20.0
955
748
  */
956
- export declare const filterMapEffect: {
957
- <A, R2, E2, B>(f: (a: A) => Effect.Effect<R2, E2, Option.Option<B>>): <R, E>(fx: Fx<R, E, A>) => Fx<R | R2, E | E2, B>;
958
- <R, E, A, R2, E2, B>(fx: Fx<R, E, A>, f: (a: A) => Effect.Effect<R2, E2, Option.Option<B>>): Fx<R | R2, E | E2, B>;
959
- };
749
+ export declare const scoped: <R, E, A>(fx: Fx<R, E, A>) => Fx<Exclude<R, Scope.Scope>, E, A>;
960
750
  /**
961
- * Apply a function to the constructed Effect that represents the running Fx.
962
- *
963
- * @since 1.18.0
964
- * @category combinators
751
+ * @since 1.20.0
965
752
  */
966
- export declare const middleware: {
967
- <R, E, A, R2>(f: (effect: Effect.Effect<R, never, unknown>) => Effect.Effect<R2, never, unknown>, g?: (sink: Sink.Sink<E, A>) => Sink.Sink<E, A>): (fx: Fx<R, E, A>) => Fx<R2, E, A>;
968
- <R, E, A, R2>(fx: Fx<R, E, A>, f: (effect: Effect.Effect<R, never, unknown>) => Effect.Effect<R2, never, unknown>, g?: (sink: Sink.Sink<E, A>) => Sink.Sink<E, A>): Fx<R2, E, A>;
753
+ export declare const annotateLogs: {
754
+ (key: string | Record<string, unknown>, value?: unknown): <R, E, A>(fx: Fx<R, E, A>) => Fx<R, E, A>;
755
+ <R, E, A>(fx: Fx<R, E, A>, key: string | Record<string, unknown>, value?: unknown): Fx<R, E, A>;
969
756
  };
970
757
  /**
971
- * Accumulate a value over the success values of an Fx and atomically produce derived value.
972
- *
973
- * @since 1.18.0
974
- * @category combinators
758
+ * @since 1.20.0
975
759
  */
976
- export declare const loop: {
977
- <A, B, C>(seed: B, f: (acc: B, a: A) => readonly [C, B]): <R, E>(fx: Fx<R, E, A>) => Fx<R, E, C>;
978
- <R, E, A, B, C>(fx: Fx<R, E, A>, seed: B, f: (acc: B, a: A) => readonly [C, B]): Fx<R, E, C>;
760
+ export declare const annotateSpans: {
761
+ (key: string | Record<string, unknown>, value?: unknown): <R, E, A>(fx: Fx<R, E, A>) => Fx<R, E, A>;
762
+ <R, E, A>(fx: Fx<R, E, A>, key: string | Record<string, unknown>, value?: unknown): Fx<R, E, A>;
979
763
  };
980
764
  /**
981
- * Emit values with their previously emitted values when possible.
982
- *
983
- * @since 1.18.0
984
- * @category combinators
765
+ * @since 1.20.0
985
766
  */
986
- export declare const withPrevious: <R, E, A>(fx: Fx<R, E, A>) => Fx<R, E, readonly [previous: Option.Option<A>, current: A]>;
767
+ export declare const interruptible: <R, E, A>(fx: Fx<R, E, A>) => Fx<R, E, A>;
987
768
  /**
988
- * Accumulate a value over the success values of an Fx and atomically produce derived value
989
- * useing an Effect. A SynchronizedRef is utilized to ensure ordering of events.
990
- *
991
- * @since 1.18.0
992
- * @category combinators
769
+ * @since 1.20.0
993
770
  */
994
- export declare const loopEffect: {
995
- <B, A, R2, E2, C>(seed: B, f: (acc: B, a: A) => Effect.Effect<R2, E2, readonly [C, B]>): <R, E>(fx: Fx<R, E, A>) => Fx<R | R2, E | E2, C>;
996
- <R, E, A, B, R2, E2, C>(fx: Fx<R, E, A>, seed: B, f: (acc: B, a: A) => Effect.Effect<R2, E2, readonly [C, B]>): Fx<R | R2, E | E2, C>;
997
- };
771
+ export declare const uninterruptible: <R, E, A>(fx: Fx<R, E, A>) => Fx<R, E, A>;
998
772
  /**
999
- * Prepends a value to the beginning of an Fx.
1000
- *
1001
- * @since 1.18.0
1002
- * @category combinators
773
+ * @since 1.20.0
1003
774
  */
1004
- export declare const startWith: {
1005
- <B>(value: B): <R, E, A>(fx: Fx<R, E, A>) => Fx<R, E, A | B>;
1006
- <R, E, A, B>(fx: Fx<R, E, A>, value: B): Fx<R, E, A | B>;
775
+ export declare const locally: {
776
+ <A>(self: FiberRef.FiberRef<A>, value: A): <R, E, B>(fx: Fx<R, E, B>) => Fx<R, E, B>;
777
+ <R, E, B, A>(use: Fx<R, E, B>, self: FiberRef.FiberRef<A>, value: A): Fx<R, E, B>;
1007
778
  };
1008
779
  /**
1009
- * Appends a value to the end of an Fx.
1010
- *
1011
- * @since 1.18.0
1012
- * @category combinators
780
+ * @since 1.20.0
1013
781
  */
1014
- export declare const endWith: {
1015
- <B>(value: B): <R, E, A>(fx: Fx<R, E, A>) => Fx<R, E, A | B>;
1016
- <R, E, A, B>(fx: Fx<R, E, A>, value: B): Fx<R, E, A | B>;
782
+ export declare const locallyWith: {
783
+ <A>(self: FiberRef.FiberRef<A>, f: (a: A) => A): <R, E, B>(fx: Fx<R, E, B>) => Fx<R, E, B>;
784
+ <R, E, B, A>(use: Fx<R, E, B>, self: FiberRef.FiberRef<A>, f: (a: A) => A): Fx<R, E, B>;
1017
785
  };
1018
786
  /**
1019
- * Run a reducer over the success values of an Fx.
1020
- *
1021
- * @since 1.18.0
1022
- * @category combinators
787
+ * @since 1.20.0
1023
788
  */
1024
- export declare const scan: {
1025
- <A, B>(seed: B, f: (acc: B, a: A) => B): <R, E>(fx: Fx<R, E, A>) => Fx<R, E, B>;
1026
- <R, E, A, B>(fx: Fx<R, E, A>, seed: B, f: (acc: B, a: A) => B): Fx<R, E, B>;
789
+ export declare const withTracerTiming: {
790
+ (enabled: boolean): <R, E, A>(fx: Fx<R, E, A>) => Fx<R, E, A>;
791
+ <R, E, A>(fx: Fx<R, E, A>, enabled: boolean): Fx<R, E, A>;
1027
792
  };
1028
793
  /**
1029
- * Run an Effect-ful reducer over the success values of an Fx.
1030
- *
1031
- * @since 1.18.0
1032
- * @category combinators
794
+ * @since 1.20.0
1033
795
  */
1034
- export declare const scanEffect: {
1035
- <A, B, R2, E2>(seed: B, f: (acc: B, a: A) => Effect.Effect<R2, E2, B>): <R, E>(fx: Fx<R, E, A>) => Fx<R | R2, E | E2, B>;
1036
- <R, E, A, B, R2, E2>(fx: Fx<R, E, A>, seed: B, f: (acc: B, a: A) => Effect.Effect<R2, E2, B>): Fx<R | R2, E | E2, B>;
796
+ export declare const withConcurrency: {
797
+ (concurrency: number | "unbounded"): <R, E, A>(fx: Fx<R, E, A>) => Fx<R, E, A>;
798
+ <R, E, A>(fx: Fx<R, E, A>, concurrency: number | "unbounded"): Fx<R, E, A>;
1037
799
  };
1038
800
  /**
1039
- * Map the failures of an Fx to another Fx, flattening the result
1040
- * with the provided FlattenStrategy.
1041
- * @since 1.18.0
1042
- * @category flattening
801
+ * @since 1.20.0
1043
802
  */
1044
- export declare const flatMapCauseWithStrategy: {
1045
- <E, R2 = never, E2 = never, B = never>(f: (cause: Cause.Cause<E>) => FxInput<R2, E2, B>, strategy: FlattenStrategy): <R, A>(fx: Fx<R, E, A>) => Fx<R | R2, E2, A | B>;
1046
- <R, E, A, R2 = never, E2 = never, B = never>(fx: Fx<R, E, A>, f: (cause: Cause.Cause<E>) => FxInput<R2, E2, B>, strategy: FlattenStrategy): Fx<R | R2, E2, A | B>;
803
+ export declare const withConfigProvider: {
804
+ (configProvider: ConfigProvider.ConfigProvider): <R, E, A>(fx: Fx<R, E, A>) => Fx<R, E, A>;
805
+ <R, E, A>(fx: Fx<R, E, A>, configProvider: ConfigProvider.ConfigProvider): Fx<R, E, A>;
1047
806
  };
1048
807
  /**
1049
- * Map the failures of an Fx to another Fx, flattening the result
1050
- * with the provided FlattenStrategy.
1051
- * @since 1.18.0
1052
- * @category flattening
808
+ * @since 1.20.0
1053
809
  */
1054
- export declare const flatMapErrorWithStrategy: {
1055
- <E, R2 = never, E2 = never, B = never>(f: (error: E) => FxInput<R2, E2, B>, strategy: FlattenStrategy): <R, A>(fx: Fx<R, E, A>) => Fx<R2 | R, E2, B | A>;
1056
- <R, E, A, R2 = never, E2 = never, B = never>(fx: Fx<R, E, A>, f: (error: E) => FxInput<R2, E2, B>, strategy: FlattenStrategy): Fx<R | R2, E2, A | B>;
810
+ export declare const withLogSpan: {
811
+ (span: string): <R, E, A>(fx: Fx<R, E, A>) => Fx<R, E, A>;
812
+ <R, E, A>(fx: Fx<R, E, A>, span: string): Fx<R, E, A>;
1057
813
  };
1058
814
  /**
1059
- * Map the failures of an Fx to another Fx, flattening the result with unbounded concurrency.
1060
- *
1061
- * @since 1.18.0
1062
- * @category flattening
815
+ * @since 1.20.0
1063
816
  */
1064
- export declare const flatMapCause: {
1065
- <E, R2 = never, E2 = never, B = never>(f: (cause: Cause.Cause<E>) => FxInput<R2, E2, B>): <R, A>(fx: Fx<R, E, A>) => Fx<R | R2, E2, A | B>;
1066
- <R, E, A, R2 = never, E2 = never, B = never>(fx: Fx<R, E, A>, f: (cause: Cause.Cause<E>) => FxInput<R2, E2, B>): Fx<R | R2, E2, A | B>;
817
+ export declare const withMaxOpsBeforeYield: {
818
+ (maxOps: number): <R, E, A>(fx: Fx<R, E, A>) => Fx<R, E, A>;
819
+ <R, E, A>(fx: Fx<R, E, A>, maxOps: number): Fx<R, E, A>;
1067
820
  };
1068
821
  /**
1069
- * Map the failures of an Fx to another Fx, flattening the result with unbounded concurrency.
1070
- *
1071
- * @since 1.18.0
1072
- * @category flattening
822
+ * @since 1.20.0
1073
823
  */
1074
- export declare const flatMapError: {
1075
- <E, R2 = never, E2 = never, B = never>(f: (error: E) => FxInput<R2, E2, B>): <R, A>(fx: Fx<R, E, A>) => Fx<R | R2, E2, A | B>;
1076
- <R, E, A, R2 = never, E2 = never, B = never>(fx: Fx<R, E, A>, f: (error: E) => FxInput<R2, E2, B>): Fx<R | R2, E2, A | B>;
824
+ export declare const withParentSpan: {
825
+ (parentSpan: Tracer.ParentSpan): <R, E, A>(fx: Fx<R, E, A>) => Fx<R, E, A>;
826
+ <R, E, A>(fx: Fx<R, E, A>, parentSpan: Tracer.ParentSpan): Fx<R, E, A>;
1077
827
  };
1078
828
  /**
1079
- * Map the failures of an Fx to another Fx with the specified concurrency.
1080
- *
1081
- * @since 1.18.0
1082
- * @category flattening
829
+ * @since 1.20.0
1083
830
  */
1084
- export declare const flatMapCauseConcurrently: {
1085
- <E, R2 = never, E2 = never, B = never>(f: (cause: Cause.Cause<E>) => FxInput<R2, E2, B>, concurrency: number): <R, A>(fx: Fx<R, E, A>) => Fx<R | R2, E2, A | B>;
1086
- <R, E, A, R2 = never, E2 = never, B = never>(fx: Fx<R, E, A>, f: (cause: Cause.Cause<E>) => FxInput<R2, E2, B>, concurrency: number): Fx<R | R2, E2, A | B>;
831
+ export declare const withRequestBatching: {
832
+ (requestBatching: boolean): <R, E, A>(fx: Fx<R, E, A>) => Fx<R, E, A>;
833
+ <R, E, A>(fx: Fx<R, E, A>, requestBatching: boolean): Fx<R, E, A>;
1087
834
  };
1088
835
  /**
1089
- * Map the failures of an Fx to another Fx with the specified concurrency.
1090
- *
1091
- * @since 1.18.0
1092
- * @category flattening
836
+ * @since 1.20.0
1093
837
  */
1094
- export declare const flatMapErrorConcurrently: {
1095
- <E, R2 = never, E2 = never, B = never>(f: (error: E) => FxInput<R2, E2, B>, concurrency: number): <R, A>(fx: Fx<R, E, A>) => Fx<R2 | R, E2, B | A>;
1096
- <R, E, A, R2 = never, E2 = never, B = never>(fx: Fx<R, E, A>, f: (error: E) => FxInput<R2, E2, B>, concurrency: number): Fx<R | R2, E2, A | B>;
838
+ export declare const withRequestCache: {
839
+ (cache: Request.Cache): <R, E, A>(fx: Fx<R, E, A>) => Fx<R, E, A>;
840
+ <R, E, A>(fx: Fx<R, E, A>, cache: Request.Cache): Fx<R, E, A>;
1097
841
  };
1098
842
  /**
1099
- * Map the failures of an Fx to another Fx, switching to the latest
1100
- * Fx emitted and interrupting the previous.
1101
- *
1102
- * @since 1.18.0
1103
- * @category flattening
843
+ * @since 1.20.0
1104
844
  */
1105
- export declare const switchMapCause: {
1106
- <E, R2 = never, E2 = never, B = never>(f: (cause: Cause.Cause<E>) => FxInput<R2, E2, B>): <R, A>(fx: Fx<R, E, A>) => Fx<R | R2, E2, A | B>;
1107
- <R, E, A, R2 = never, E2 = never, B = never>(fx: Fx<R, E, A>, f: (cause: Cause.Cause<E>) => FxInput<R2, E2, B>): Fx<R | R2, E2, A | B>;
845
+ export declare const withRequestCaching: {
846
+ (requestCaching: boolean): <R, E, A>(fx: Fx<R, E, A>) => Fx<R, E, A>;
847
+ <R, E, A>(fx: Fx<R, E, A>, requestCaching: boolean): Fx<R, E, A>;
1108
848
  };
1109
849
  /**
1110
- * Map the failures of an Fx to another Fx, switching to the latest
1111
- * Fx emitted and interrupting the previous.
1112
- *
1113
- * @since 1.18.0
1114
- * @category flattening
850
+ * @since 1.20.0
1115
851
  */
1116
- export declare const switchMapError: {
1117
- <E, R2 = never, E2 = never, B = never>(f: (error: E) => FxInput<R2, E2, B>): <R, A>(fx: Fx<R, E, A>) => Fx<R2 | R, E2, B | A>;
1118
- <R, E, A, R2 = never, E2 = never, B = never>(fx: Fx<R, E, A>, f: (error: E) => FxInput<R2, E2, B>): Fx<R | R2, E2, A | B>;
852
+ export declare const withTracer: {
853
+ (tracer: Tracer.Tracer): <R, E, A>(fx: Fx<R, E, A>) => Fx<R, E, A>;
854
+ <R, E, A>(fx: Fx<R, E, A>, tracer: Tracer.Tracer): Fx<R, E, A>;
1119
855
  };
1120
856
  /**
1121
- * Map the failures of an Fx to another Fx, prefering the first
1122
- * Fx emitted and dropping any subsequent Fx until it has completed.
1123
- *
1124
- * @since 1.18.0
1125
- * @category flattening
857
+ * @since 1.20.0
1126
858
  */
1127
- export declare const exhaustMapCause: {
1128
- <E, R2 = never, E2 = never, B = never>(f: (cause: Cause.Cause<E>) => FxInput<R2, E2, B>): <R, A>(fx: Fx<R, E, A>) => Fx<R | R2, E2, A | B>;
1129
- <R, E, A, R2 = never, E2 = never, B = never>(fx: Fx<R, E, A>, f: (cause: Cause.Cause<E>) => FxInput<R2, E2, B>): Fx<R | R2, E2, A | B>;
859
+ export declare const acquireUseRelease: {
860
+ <A, R2, E2, B, R3, E3, C>(use: (a: A) => Fx<R2, E2, B>, release: (a: A, exit: Exit.Exit<unknown, unknown>) => Effect.Effect<R3, E3, C>): <R, E>(acquire: Effect.Effect<R, E, A>) => Fx<R | R2 | R3, E | E2 | E3, B>;
861
+ <R, E, A, R2, E2, B, R3, E3, C>(acquire: Effect.Effect<R, E, A>, use: (a: A) => Fx<R2, E2, B>, release: (a: A, exit: Exit.Exit<unknown, unknown>) => Effect.Effect<R3, E3, C>): Fx<R | R2 | R3, E | E2 | E3, B>;
1130
862
  };
1131
863
  /**
1132
- * Map the failures of an Fx to another Fx, prefering the first
1133
- * Fx emitted and dropping any subsequent Fx until it has completed.
1134
- *
1135
- * @since 1.18.0
1136
- * @category flattening
864
+ * @since 1.20.0
1137
865
  */
1138
- export declare const exhaustMapError: {
1139
- <E, R2 = never, E2 = never, B = never>(f: (error: E) => FxInput<R2, E2, B>): <R, A>(fx: Fx<R, E, A>) => Fx<R2 | R, E2, B | A>;
1140
- <R, E, A, R2 = never, E2 = never, B = never>(fx: Fx<R, E, A>, f: (error: E) => FxInput<R2, E2, B>): Fx<R | R2, E2, A | B>;
866
+ export declare const withSpan: {
867
+ (name: string, options?: {
868
+ readonly attributes?: Record<string, unknown>;
869
+ readonly links?: ReadonlyArray<Tracer.SpanLink>;
870
+ readonly parent?: Tracer.ParentSpan;
871
+ readonly root?: boolean;
872
+ readonly context?: Ctx.Context<never>;
873
+ }): <R, E, A>(self: Fx<R, E, A>) => Fx<R, E, A>;
874
+ <R, E, A>(self: Fx<R, E, A>, name: string, options?: {
875
+ readonly attributes?: Record<string, unknown>;
876
+ readonly links?: ReadonlyArray<Tracer.SpanLink>;
877
+ readonly parent?: Tracer.ParentSpan;
878
+ readonly root?: boolean;
879
+ readonly context?: Ctx.Context<never>;
880
+ }): Fx<R, E, A>;
1141
881
  };
1142
882
  /**
1143
- * Map the failures of an Fx to another Fx, prefering the first
1144
- * until completion, and then running the last emitted Fx if they are not
1145
- * the same Fx.
1146
- *
1147
- * @since 1.18.0
1148
- * @category flattening
883
+ * @since 1.20.0
1149
884
  */
1150
- export declare const exhaustMapLatestCause: {
1151
- <E, R2 = never, E2 = never, B = never>(f: (cause: Cause.Cause<E>) => FxInput<R2, E2, B>): <R, A>(fx: Fx<R, E, A>) => Fx<R | R2, E2, A | B>;
1152
- <R, E, A, R2 = never, E2 = never, B = never>(fx: Fx<R, E, A>, f: (cause: Cause.Cause<E>) => FxInput<R2, E2, B>): Fx<R | R2, E2, A | B>;
885
+ export declare const provideContext: {
886
+ <R2>(context: Ctx.Context<R2>): <R, E, A>(fx: Fx<R, E, A>) => Fx<Exclude<R, R2>, E, A>;
887
+ <R, E, A, R2>(fx: Fx<R, E, A>, context: Ctx.Context<R2>): Fx<Exclude<R, R2>, E, A>;
1153
888
  };
1154
889
  /**
1155
- * Map the failures of an Fx to another Fx, prefering the first
1156
- * until completion, and then running the last emitted Fx if they are not
1157
- * the same Fx.
1158
- *
1159
- * @since 1.18.0
1160
- * @category flattening
890
+ * @since 1.20.0
1161
891
  */
1162
- export declare const exhaustMapLatestError: {
1163
- <E, R2 = never, E2 = never, B = never>(f: (error: E) => FxInput<R2, E2, B>): <R, A>(fx: Fx<R, E, A>) => Fx<R2 | R, E2, B | A>;
1164
- <R, E, A, R2 = never, E2 = never, B = never>(fx: Fx<R, E, A>, f: (error: E) => FxInput<R2, E2, B>): Fx<R | R2, E2, A | B>;
892
+ export declare const provideLayer: {
893
+ <R2, E2, S>(layer: Layer.Layer<R2, E2, S>): <R, E, A>(fx: Fx<R, E, A>) => Fx<R2 | Exclude<R, S>, E | E2, A>;
894
+ <R, E, A, R2, E2, S>(fx: Fx<R, E, A>, layer: Layer.Layer<R2, E2, S>): Fx<R2 | Exclude<R, S>, E | E2, A>;
1165
895
  };
1166
896
  /**
1167
- * Map over the failures and successes of an Fx, flattening both using the same strategy.
1168
- *
1169
- * @since 1.18.0
1170
- * @category flattening
897
+ * @since 1.20.0
1171
898
  */
1172
- export declare const matchCauseWithStrategy: {
1173
- <E, R2 = never, E2 = never, B = never, A = never, R3 = never, E3 = never, C = never>(options: {
1174
- readonly onFailure: (cause: Cause.Cause<E>) => FxInput<R2, E2, B>;
1175
- readonly onSuccess: (a: A) => FxInput<R3, E3, C>;
1176
- readonly strategy: FlattenStrategy;
1177
- }): <R, A>(fx: Fx<R, E, A>) => Fx<R2 | R, E2, B | A>;
1178
- <R, E, A, R2 = never, E2 = never, B = never, R3 = never, E3 = never, C = never>(fx: Fx<R, E, A>, options: {
1179
- readonly onFailure: (cause: Cause.Cause<E>) => FxInput<R2, E2, B>;
1180
- readonly onSuccess: (a: A) => FxInput<R3, E3, C>;
1181
- readonly strategy: FlattenStrategy;
1182
- }): Fx<R | R2, E2 | E3, B | C>;
1183
- };
1184
- /**
1185
- * Map over the failures and successes of an Fx, flattening both using the same strategy.
1186
- *
1187
- * @since 1.18.0
1188
- * @category flattening
1189
- */
1190
- export declare const matchErrorWithStrategy: {
1191
- <E, R2 = never, E2 = never, B = never, A = never, R3 = never, E3 = never, C = never>(options: {
1192
- readonly onFailure: (error: E) => FxInput<R2, E2, B>;
1193
- readonly onSuccess: (a: A) => FxInput<R3, E3, C>;
1194
- readonly strategy: FlattenStrategy;
1195
- }): <R, A>(fx: Fx<R, E, A>) => Fx<R2 | R, E2, B | A>;
1196
- <R, E, A, R2 = never, E2 = never, B = never, R3 = never, E3 = never, C = never>(fx: Fx<R, E, A>, options: {
1197
- readonly onFailure: (error: E) => FxInput<R2, E2, B>;
1198
- readonly onSuccess: (a: A) => FxInput<R3, E3, C>;
1199
- readonly strategy: FlattenStrategy;
1200
- }): Fx<R | R2, E2 | E3, B | C>;
1201
- };
1202
- /**
1203
- * Map over the failures and successes of an Fx, flattening both with unbounded concurrency.
1204
- *
1205
- * @since 1.18.0
1206
- * @category flattening
1207
- */
1208
- export declare const matchCause: {
1209
- <E, R2 = never, E2 = never, B = never, A = never, R3 = never, E3 = never, C = never>(options: {
1210
- readonly onFailure: (cause: Cause.Cause<E>) => FxInput<R2, E2, B>;
1211
- readonly onSuccess: (a: A) => FxInput<R3, E3, C>;
1212
- }): <R>(fx: Fx<R, E, A>) => Fx<R2 | R3 | R, E2 | E3, B | C>;
1213
- <R, E, A, R2 = never, E2 = never, B = never, R3 = never, E3 = never, C = never>(fx: Fx<R, E, A>, options: {
1214
- readonly onFailure: (cause: Cause.Cause<E>) => FxInput<R2, E2, B>;
1215
- readonly onSuccess: (a: A) => FxInput<R3, E3, C>;
1216
- }): Fx<R | R2 | R3, E2 | E3, B | C>;
899
+ export declare const provideRuntime: {
900
+ <R2>(runtime: Runtime.Runtime<R2>): <R, E, A>(fx: Fx<R, E, A>) => Fx<Exclude<R, R2>, E, A>;
901
+ <R, E, A, R2>(fx: Fx<R, E, A>, runtime: Runtime.Runtime<R2>): Fx<Exclude<R, R2>, E, A>;
1217
902
  };
1218
903
  /**
1219
- * Map over the failures and successes of an Fx, flattening both with unbounded concurrency.
1220
- *
1221
- * @since 1.18.0
1222
- * @category flattening
904
+ * @since 1.20.0
1223
905
  */
1224
- export declare const match: {
1225
- <E, R2 = never, E2 = never, B = never, A = never, R3 = never, E3 = never, C = never>(options: {
1226
- readonly onFailure: (error: E) => FxInput<R2, E2, B>;
1227
- readonly onSuccess: (a: A) => FxInput<R3, E3, C>;
1228
- }): <R>(fx: Fx<R, E, A>) => Fx<R2 | R3 | R, E2 | E3, B | C>;
1229
- <R, E, A, R2 = never, E2 = never, B = never, R3 = never, E3 = never, C = never>(fx: Fx<R, E, A>, options: {
1230
- readonly onFailure: (error: E) => FxInput<R2, E2, B>;
1231
- readonly onSuccess: (a: A) => FxInput<R3, E3, C>;
1232
- }): Fx<R | R2 | R3, E2 | E3, B | C>;
906
+ export declare const provideService: {
907
+ <I, S>(service: Ctx.Tag<I, S>, instance: S): <R, E, A>(fx: Fx<R, E, A>) => Fx<Exclude<R, I>, E, A>;
908
+ <R, E, A, I, S>(fx: Fx<R, E, A>, service: Ctx.Tag<I, S>, instance: S): Fx<Exclude<R, I>, E, A>;
1233
909
  };
1234
910
  /**
1235
- * Map over the failures and successes of an Fx, flattening both with the specified concurrency.
1236
- *
1237
- * @since 1.18.0
1238
- * @category flattening
1239
- */
1240
- export declare const matchCauseConcurrently: {
1241
- <E, R2 = never, E2 = never, B = never, A = never, R3 = never, E3 = never, C = never>(options: {
1242
- readonly onFailure: (cause: Cause.Cause<E>) => FxInput<R2, E2, B>;
1243
- readonly onSuccess: (a: A) => FxInput<R3, E3, C>;
1244
- readonly concurrency: number;
1245
- }): <R>(fx: Fx<R, E, A>) => Fx<R2 | R3 | R, E2 | E3, B | C>;
1246
- <R, E, A, R2 = never, E2 = never, B = never, R3 = never, E3 = never, C = never>(fx: Fx<R, E, A>, options: {
1247
- readonly onFailure: (cause: Cause.Cause<E>) => FxInput<R2, E2, B>;
1248
- readonly onSuccess: (a: A) => FxInput<R3, E3, C>;
1249
- readonly concurrency: number;
1250
- }): Fx<R | R2 | R3, E2 | E3, B | C>;
1251
- };
1252
- /**
1253
- * Map over the failures and successes of an Fx, flattening both with the specified concurrency.
1254
- *
1255
- * @since 1.18.0
1256
- * @category flattening
911
+ * @since 1.20.0
1257
912
  */
1258
- export declare const matchErrorConcurrently: {
1259
- <E, R2 = never, E2 = never, B = never, A = never, R3 = never, E3 = never, C = never>(options: {
1260
- readonly onFailure: (error: E) => FxInput<R2, E2, B>;
1261
- readonly onSuccess: (a: A) => FxInput<R3, E3, C>;
1262
- readonly concurrency: number;
1263
- }): <R>(fx: Fx<R, E, A>) => Fx<R2 | R3 | R, E2 | E3, B | C>;
1264
- <R, E, A, R2 = never, E2 = never, B = never, R3 = never, E3 = never, C = never>(fx: Fx<R, E, A>, options: {
1265
- readonly onFailure: (error: E) => FxInput<R2, E2, B>;
1266
- readonly onSuccess: (a: A) => FxInput<R3, E3, C>;
1267
- readonly concurrency: number;
1268
- }): Fx<R | R2 | R3, E2 | E3, B | C>;
1269
- };
1270
- /**
1271
- * Map over the failures and successes of an Fx, switching to the latest
1272
- * Fx emitted and interrupting the previous.
1273
- *
1274
- * @since 1.18.0
1275
- * @category flattening
913
+ export declare const provideServiceEffect: {
914
+ <I, S, R2, E2>(service: Ctx.Tag<I, S>, instance: Effect.Effect<R2, E2, S>): <R, E, A>(fx: Fx<R, E, A>) => Fx<R2 | Exclude<R, I>, E | E2, A>;
915
+ <R, E, A, I, S, R2, E2>(fx: Fx<R, E, A>, service: Ctx.Tag<I, S>, instance: Effect.Effect<R2, E2, S>): Fx<R2 | Exclude<R, I>, E | E2, A>;
916
+ };
917
+ /**
918
+ * @since 1.20.0
1276
919
  */
1277
- export declare const switchMatchCause: {
1278
- <E, R2 = never, E2 = never, B = never, A = never, R3 = never, E3 = never, C = never>(options: {
1279
- readonly onFailure: (cause: Cause.Cause<E>) => FxInput<R2, E2, B>;
1280
- readonly onSuccess: (a: A) => FxInput<R3, E3, C>;
1281
- }): <R>(fx: Fx<R, E, A>) => Fx<R2 | R3 | R, E2 | E3, B | C>;
1282
- <R, E, A, R2 = never, E2 = never, B = never, R3 = never, E3 = never, C = never>(fx: Fx<R, E, A>, options: {
1283
- readonly onFailure: (cause: Cause.Cause<E>) => FxInput<R2, E2, B>;
1284
- readonly onSuccess: (a: A) => FxInput<R3, E3, C>;
1285
- }): Fx<R | R2 | R3, E2 | E3, B | C>;
1286
- };
1287
- /**
1288
- * Map over the failures and successes of an Fx, switching to the latest
1289
- * Fx emitted and interrupting the previous.
1290
- *
1291
- * @since 1.18.0
1292
- * @category flattening
920
+ export declare const provide: {
921
+ <R2>(context: Ctx.Context<R2>): <R, E, A>(fx: Fx<R, E, A>) => Fx<Exclude<R, R2>, E, A>;
922
+ <R2>(runtime: Runtime.Runtime<R2>): <R, E, A>(fx: Fx<R, E, A>) => Fx<Exclude<R, R2>, E, A>;
923
+ <R2, E2, S>(layer: Layer.Layer<R2, E2, S>): <R, E, A>(fx: Fx<R, E, A>) => Fx<R2 | Exclude<R, S>, E | E2, A>;
924
+ <R2 = never, E2 = never, S = never>(provide: Layer.Layer<R2, E2, S> | Ctx.Context<S> | Runtime.Runtime<S>): <R, E, A>(fx: Fx<R, E, A>) => Fx<R2 | Exclude<R, S>, E | E2, A>;
925
+ <R, E, A, R2>(fx: Fx<R, E, A>, context: Ctx.Context<R2>): Fx<Exclude<R, R2>, E, A>;
926
+ <R, E, A, R2>(fx: Fx<R, E, A>, runtime: Runtime.Runtime<R2>): Fx<Exclude<R, R2>, E, A>;
927
+ <R, E, A, R2, E2, S>(fx: Fx<R, E, A>, layer: Layer.Layer<R2, E2, S>): Fx<R2 | Exclude<R, S>, E | E2, A>;
928
+ <R, E, A, R2 = never, E2 = never, S = never>(fx: Fx<R, E, A>, provide: Layer.Layer<R2, E2, S> | Ctx.Context<S> | Runtime.Runtime<S>): Fx<R2 | Exclude<R, S>, E | E2, A>;
929
+ };
930
+ /**
931
+ * @since 1.20.0
1293
932
  */
1294
- export declare const switchMatch: {
1295
- <E, R2 = never, E2 = never, B = never, A = never, R3 = never, E3 = never, C = never>(options: {
1296
- readonly onFailure: (error: E) => FxInput<R2, E2, B>;
1297
- readonly onSuccess: (a: A) => FxInput<R3, E3, C>;
1298
- }): <R>(fx: Fx<R, E, A>) => Fx<R2 | R3 | R, E2 | E3, B | C>;
1299
- <R, E, A, R2 = never, E2 = never, B = never, R3 = never, E3 = never, C = never>(fx: Fx<R, E, A>, options: {
1300
- readonly onFailure: (error: E) => FxInput<R2, E2, B>;
1301
- readonly onSuccess: (a: A) => FxInput<R3, E3, C>;
1302
- }): Fx<R | R2 | R3, E2 | E3, B | C>;
933
+ export declare const share: {
934
+ <R2, E2, A>(subject: Subject.Subject<R2, E2, A>): <R, E>(fx: Fx<R, E, A>) => Fx<R | R2 | Scope.Scope, E, A>;
935
+ <R, E, A, R2>(fx: Fx<R, E, A>, subject: Subject.Subject<R2, E, A>): Fx<R | R2 | Scope.Scope, E, A>;
1303
936
  };
1304
937
  /**
1305
- * Map over the failures and successes of an Fx, prefering the first
1306
- * Fx emitted and dropping any subsequent Fx until it has completed.
1307
- *
1308
- * @since 1.18.0
1309
- * @category flattening
938
+ * @since 1.20.0
1310
939
  */
1311
- export declare const exhaustMatchCause: {
1312
- <E, R2 = never, E2 = never, B = never, A = never, R3 = never, E3 = never, C = never>(options: {
1313
- readonly onFailure: (cause: Cause.Cause<E>) => FxInput<R2, E2, B>;
1314
- readonly onSuccess: (a: A) => FxInput<R3, E3, C>;
1315
- }): <R>(fx: Fx<R, E, A>) => Fx<R2 | R3 | R, E2 | E3, B | C>;
1316
- <R, E, A, R2 = never, E2 = never, B = never, R3 = never, E3 = never, C = never>(fx: Fx<R, E, A>, options: {
1317
- readonly onFailure: (cause: Cause.Cause<E>) => FxInput<R2, E2, B>;
1318
- readonly onSuccess: (a: A) => FxInput<R3, E3, C>;
1319
- }): Fx<R | R2 | R3, E2 | E3, B | C>;
1320
- };
1321
- /**
1322
- * Map over the failures and successes of an Fx, prefering the first
1323
- * Fx emitted and dropping any subsequent Fx until it has completed.
1324
- *
1325
- * @since 1.18.0
1326
- * @category flattening
1327
- */
1328
- export declare const exhaustMatch: {
1329
- <E, R2 = never, E2 = never, B = never, A = never, R3 = never, E3 = never, C = never>(options: {
1330
- readonly onFailure: (error: E) => FxInput<R2, E2, B>;
1331
- readonly onSuccess: (a: A) => FxInput<R3, E3, C>;
1332
- }): <R>(fx: Fx<R, E, A>) => Fx<R2 | R3 | R, E2 | E3, B | C>;
1333
- <R, E, A, R2 = never, E2 = never, B = never, R3 = never, E3 = never, C = never>(fx: Fx<R, E, A>, options: {
1334
- readonly onFailure: (error: E) => FxInput<R2, E2, B>;
1335
- readonly onSuccess: (a: A) => FxInput<R3, E3, C>;
1336
- }): Fx<R | R2 | R3, E2 | E3, B | C>;
1337
- };
1338
- /**
1339
- * Map over the failures and successes of an Fx, prefering the first
1340
- * Fx emitted and starting the latest Fx when the first completes
1341
- * if they are not the same Fx.
1342
- *
1343
- * @since 1.18.0
1344
- * @category flattening
1345
- */
1346
- export declare const exhaustLatestMatchCause: {
1347
- <E, R2 = never, E2 = never, B = never, A = never, R3 = never, E3 = never, C = never>(options: {
1348
- readonly onFailure: (cause: Cause.Cause<E>) => FxInput<R2, E2, B>;
1349
- readonly onSuccess: (a: A) => FxInput<R3, E3, C>;
1350
- }): <R>(fx: Fx<R, E, A>) => Fx<R2 | R3 | R, E2 | E3, B | C>;
1351
- <R, E, A, R2 = never, E2 = never, B = never, R3 = never, E3 = never, C = never>(fx: Fx<R, E, A>, options: {
1352
- readonly onFailure: (cause: Cause.Cause<E>) => FxInput<R2, E2, B>;
1353
- readonly onSuccess: (a: A) => FxInput<R3, E3, C>;
1354
- }): Fx<R | R2 | R3, E2 | E3, B | C>;
1355
- };
1356
- /**
1357
- * Map over the failures and successes of an Fx, prefering the first
1358
- * Fx emitted and starting the latest Fx when the first completes
1359
- * if they are not the same Fx.
1360
- *
1361
- * @since 1.18.0
1362
- * @category flattening
1363
- */
1364
- export declare const exhaustLatestMatch: {
1365
- <E, R2 = never, E2 = never, B = never, A = never, R3 = never, E3 = never, C = never>(options: {
1366
- readonly onFailure: (error: E) => FxInput<R2, E2, B>;
1367
- readonly onSuccess: (a: A) => FxInput<R3, E3, C>;
1368
- }): <R>(fx: Fx<R, E, A>) => Fx<R2 | R3 | R, E2 | E3, B | C>;
1369
- <R, E, A, R2 = never, E2 = never, B = never, R3 = never, E3 = never, C = never>(fx: Fx<R, E, A>, options: {
1370
- readonly onFailure: (error: E) => FxInput<R2, E2, B>;
1371
- readonly onSuccess: (a: A) => FxInput<R3, E3, C>;
1372
- }): Fx<R | R2 | R3, E2 | E3, B | C>;
1373
- };
1374
- /**
1375
- * Listen to the events of an Fx within the provided window. When the window Fx
1376
- * emits the inner stream, the fx will begin allowing events to pass through,
1377
- * and when the inner stream emits, the fx will be interrupted.
1378
- *
1379
- * @since 1.18.0
1380
- * @category time slicing
940
+ export declare const multicast: <R, E, A>(fx: Fx<R, E, A>) => Fx<Scope.Scope | R, E, A>;
941
+ /**
942
+ * @since 1.20.0
1381
943
  */
1382
- export declare const during: {
1383
- <R2, E2, R3, E3>(window: Fx<R2, E2, Fx<R3, E3, unknown>>): <R, E, A>(fx: Fx<R, E, A>) => Fx<R | R2 | R3, E | E2 | E3, A>;
1384
- <R, E, A, R2, E2, R3, E3>(fx: Fx<R, E, A>, window: Fx<R2, E2, Fx<R3, E3, unknown>>): Fx<R | R2 | R3, E | E2 | E3, A>;
1385
- };
944
+ export declare const hold: <R, E, A>(fx: Fx<R, E, A>) => Fx<Scope.Scope | R, E, A>;
1386
945
  /**
1387
- * Listen to the events of an Fx after the provided window emits.
1388
- *
1389
- * @since 1.18.0
1390
- * @category time slicing
946
+ * @since 1.20.0
1391
947
  */
1392
- export declare const since: {
1393
- <R2, E2>(window: Fx<R2, E2, unknown>): <R, E, A>(fx: Fx<R, E, A>) => Fx<R | R2, E | E2, A>;
1394
- <R, E, A, R2, E2>(fx: Fx<R, E, A>, window: Fx<R2, E2, unknown>): Fx<R | R2, E | E2, A>;
948
+ export declare const replay: {
949
+ (capacity: number): <R, E, A>(fx: Fx<R, E, A>) => Fx<Scope.Scope | R, E, A>;
950
+ <R, E, A>(fx: Fx<R, E, A>, capacity: number): Fx<Scope.Scope | R, E, A>;
1395
951
  };
1396
952
  /**
1397
- * Listen to the events of an Fx until the provided window emits.
1398
- *
1399
- * @since 1.18.0
1400
- * @category time slicing
953
+ * @since 1.20.0
1401
954
  */
1402
- export declare const until: {
1403
- <R2, E2>(window: Fx<R2, E2, unknown>): <R, E, A>(fx: Fx<R, E, A>) => Fx<R | R2, E | E2, A>;
1404
- <R, E, A, R2, E2>(fx: Fx<R, E, A>, window: Fx<R2, E2, unknown>): Fx<R | R2, E | E2, A>;
955
+ export declare const mapCause: {
956
+ <E, E2>(f: (cause: Cause.Cause<E>) => Cause.Cause<E2>): <R, A>(fx: Fx<R, E, A>) => Fx<R, E2, A>;
957
+ <R, E, A, E2>(fx: Fx<R, E, A>, f: (cause: Cause.Cause<E>) => Cause.Cause<E2>): Fx<R, E2, A>;
1405
958
  };
1406
959
  /**
1407
- * Provide the environment to an Fx.
1408
- *
1409
- * @since 1.18.0
1410
- * @category context
960
+ * @since 1.20.0
1411
961
  */
1412
- export declare const provide: {
1413
- <R2, E2, S>(layer: Layer.Layer<R2, E2, S>): <R, E, A>(fx: Fx<R, E, A>) => Fx<R2 | Exclude<R, S>, E2 | E, A>;
1414
- <R2>(runtime: Runtime.Runtime<R2>): <R, E, A>(fx: Fx<R, E, A>) => Fx<Exclude<R, R2>, E, A>;
1415
- <R2>(context: Context.Context<R2>): <R, E, A>(fx: Fx<R, E, A>) => Fx<Exclude<R, R2>, E, A>;
1416
- <R, E, A, R2, E2, S>(fx: Fx<R, E, A>, layer: Layer.Layer<R2, E2, S>): Fx<Exclude<R, S> | R2, E | E2, A>;
1417
- <R, E, A, R2>(fx: Fx<R, E, A>, runtime: Runtime.Runtime<R2>): Fx<Exclude<R, R2>, E, A>;
1418
- <R, E, A, R2>(fx: Fx<R, E, A>, context: Context.Context<R2>): Fx<Exclude<R, R2>, E, A>;
962
+ export declare const mapError: {
963
+ <E, E2>(f: (e: E) => E2): <R, A>(fx: Fx<R, E, A>) => Fx<R, E2, A>;
964
+ <R, E, A, E2>(fx: Fx<R, E, A>, f: (e: E) => E2): Fx<R, E2, A>;
1419
965
  };
1420
966
  /**
1421
- * Provide a service to an Fx using a Tag.
1422
- * @since 1.18.0
1423
- * @category context
967
+ * @since 1.20.0
1424
968
  */
1425
- export declare const provideService: {
1426
- <I, S>(tag: Context.Tag<I, S>, service: S): <R, E, A>(fx: Fx<R, E, A>) => Fx<Exclude<R, I>, E, A>;
1427
- <R, E, A, I, S>(fx: Fx<R, E, A>, tag: Context.Tag<I, S>, service: S): Fx<Exclude<R, I>, E, A>;
969
+ export declare const mapBoth: {
970
+ <E, E2, A, B>(f: (e: E) => E2, g: (a: A) => B): <R>(fx: Fx<R, E, A>) => Fx<R, E2, B>;
971
+ <R, E, A, B, C>(fx: Fx<R, E, A>, f: (e: E) => B, g: (a: A) => C): Fx<R, B, C>;
1428
972
  };
1429
973
  /**
1430
- * Provide a service using an Effect to an Fx using a Tag.
1431
- *
1432
- * @since 1.18.0
1433
- * @category context
974
+ * @since 1.20.0
1434
975
  */
1435
- export declare const provideServiceEffect: {
1436
- <I, S, R2, E2>(tag: Context.Tag<I, S>, service: Effect.Effect<R2, E2, S>): <R, E, A>(fx: Fx<R, E, A>) => Fx<R2 | Exclude<R, I>, E, A>;
1437
- <R, E, A, I, S, R2, E2>(fx: Fx<R, E, A>, tag: Context.Tag<I, S>, service: Effect.Effect<R2, E2, S>): Fx<R2 | Exclude<R, I>, E, A>;
976
+ export declare const filterCause: {
977
+ <E>(f: (cause: Cause.Cause<E>) => boolean): <R, A>(fx: Fx<R, E, A>) => Fx<R, E, A>;
978
+ <R, E, A>(fx: Fx<R, E, A>, f: (cause: Cause.Cause<E>) => boolean): Fx<R, E, A>;
1438
979
  };
1439
980
  /**
1440
- * Skip repeated values, using the provided Equivalence to compare values.
1441
- *
1442
- * @since 1.18.0
1443
- * @category slicing
981
+ * @since 1.20.0
1444
982
  */
1445
- export declare const skipRepeatsWith: {
1446
- <A>(eq: Equivalence<A>): <R, E>(fx: Fx<R, E, A>) => Fx<R, E, A>;
1447
- <R, E, A>(fx: Fx<R, E, A>, eq: Equivalence<A>): Fx<R, E, A>;
983
+ export declare const filterError: {
984
+ <E>(f: (e: E) => boolean): <R, A>(fx: Fx<R, E, A>) => Fx<R, E, A>;
985
+ <R, E, A>(fx: Fx<R, E, A>, f: (e: E) => boolean): Fx<R, E, A>;
1448
986
  };
1449
987
  /**
1450
- * Skip repeated values, using @effect/data/Equal for value comparison.
1451
- *
1452
- * @since 1.18.0
1453
- * @category slicing
988
+ * @since 1.20.0
1454
989
  */
1455
- export declare const skipRepeats: <R, E, A>(fx: Fx<R, E, A>) => Fx<R, E, A>;
990
+ export declare const filterMapCause: {
991
+ <E, E2>(f: (cause: Cause.Cause<E>) => Option.Option<Cause.Cause<E2>>): <R, A>(fx: Fx<R, E, A>) => Fx<R, E2, A>;
992
+ <R, E, A, E2>(fx: Fx<R, E, A>, f: (cause: Cause.Cause<E>) => Option.Option<Cause.Cause<E2>>): Fx<R, E2, A>;
993
+ };
1456
994
  /**
1457
- * Sample the values of an Fx, or Effect, during the events of another Fx.
1458
- *
1459
- * @since 1.18.0
1460
- * @category combinators
995
+ * @since 1.20.0
1461
996
  */
1462
- export declare const snapshot: {
1463
- <R2 = never, E2 = never, B = never, A = never, R3 = never, E3 = never, C = never>(sampled: FxInput<R2, E2, B>, f: (a: A, b: B) => Effect.Effect<R3, E3, C>): <R, E>(fx: Fx<R, E, A>) => Fx<R | R2 | R3, E | E2 | E3, C>;
1464
- <R, E, A, R2 = never, E2 = never, B = never, R3 = never, E3 = never, C = never>(fx: Fx<R, E, A>, sampled: FxInput<R2, E2, B>, f: (a: A, b: B) => Effect.Effect<R3, E3, C>): Fx<R | R2 | R3, E | E2 | E3, C>;
997
+ export declare const filterMapError: {
998
+ <E, E2>(f: (e: E) => Option.Option<E2>): <R, A>(fx: Fx<R, E, A>) => Fx<R, E2, A>;
999
+ <R, E, A, E2>(fx: Fx<R, E, A>, f: (e: E) => Option.Option<E2>): Fx<R, E2, A>;
1465
1000
  };
1466
1001
  /**
1467
- * Share the output of an Fx, or Effect, with other Fx's using the behavior of the
1468
- * provided Subject.
1469
- *
1470
- * @since 1.18.0
1471
- * @category sharing
1002
+ * @since 1.20.0
1472
1003
  */
1473
- export declare const share: <R, E, A, R2>(fx: Fx<R, E, A>, subject: Subject<R2, E, A>) => Fx<R | R2, E, A>;
1004
+ export declare const mapCauseEffect: {
1005
+ <R2, E2, E3>(f: (cause: Cause.Cause<E2>) => Effect.Effect<R2, E3, Cause.Cause<E3>>): <R, E, A>(fx: Fx<R, E, A>) => Fx<R | R2, E2 | E3, A>;
1006
+ <R, E, A, R2, E2, E3>(fx: Fx<R, E, A>, f: (cause: Cause.Cause<E>) => Effect.Effect<R2, E2, Cause.Cause<E3>>): Fx<R | R2, E2 | E3, A>;
1007
+ };
1474
1008
  /**
1475
- * Effeciently share an underlying stream with multiple subscribers.
1476
- *
1477
- * @since 1.18.0
1478
- * @category sharing
1009
+ * @since 1.20.0
1479
1010
  */
1480
- export declare const multicast: <R, E, A>(fx: Fx<R, E, A>) => Fx<R, E, A>;
1011
+ export declare const mapErrorEffect: {
1012
+ <R2, E2, E3>(f: (e: E2) => Effect.Effect<R2, E3, E3>): <R, E, A>(fx: Fx<R, E, A>) => Fx<R | R2, E2 | E3, A>;
1013
+ <R, E, A, R2, E2, E3>(fx: Fx<R, E, A>, f: (e: E) => Effect.Effect<R2, E2, E3>): Fx<R | R2, E2 | E3, A>;
1014
+ };
1481
1015
  /**
1482
- * Effeciently share an underlying stream with multiple subscribers, saving the most
1483
- * recent event and emitting it to new subscribers.
1484
- *
1485
- * @since 1.18.0
1486
- * @category sharing
1016
+ * @since 1.20.0
1487
1017
  */
1488
- export declare const hold: <R, E, A>(fx: Fx<R, E, A>) => Fx<R, E, A>;
1018
+ export declare const filterCauseEffect: {
1019
+ <E, R2, E2>(f: (cause: Cause.Cause<E>) => Effect.Effect<R2, E2, boolean>): <R, A>(fx: Fx<R, E, A>) => Fx<R | R2, E2, A>;
1020
+ <R, E, A, R2, E2>(fx: Fx<R, E, A>, f: (cause: Cause.Cause<E>) => Effect.Effect<R2, E2, boolean>): Fx<R | R2, E2, A>;
1021
+ };
1489
1022
  /**
1490
- * Effeciently share an underlying stream with multiple subscribers,
1491
- * saving up to the most recent `n` events and emitting them to new subscribers.
1492
- *
1493
- * @since 1.18.0
1494
- * @category sharing
1023
+ * @since 1.20.0
1495
1024
  */
1496
- export declare const replay: {
1497
- (capacity: number): <R, E, A>(fx: Fx<R, E, A>) => Fx<R, E, A>;
1498
- <R, E, A>(fx: Fx<R, E, A>, capacity: number): Fx<R, E, A>;
1025
+ export declare const filterErrorEffect: {
1026
+ <E, R2, E2>(f: (e: E) => Effect.Effect<R2, E2, boolean>): <R, A>(fx: Fx<R, E, A>) => Fx<R | R2, E2, A>;
1027
+ <R, E, A, R2, E2>(fx: Fx<R, E, A>, f: (e: E) => Effect.Effect<R2, E2, boolean>): Fx<R | R2, E2, A>;
1499
1028
  };
1500
1029
  /**
1501
- * Create an Fx which will wait a specified duration of time where no
1502
- * events have occurred before emitting a value.
1503
- * @since 1.18.0
1504
- * @category time slicing
1030
+ * @since 1.20.0
1505
1031
  */
1506
- export declare const debounce: {
1507
- (delay: DurationInput): <R, E, A>(fx: Fx<R, E, A>) => Fx<R, E, A>;
1508
- <R, E, A>(fx: Fx<R, E, A>, delay: DurationInput): Fx<R, E, A>;
1032
+ export declare const filterMapCauseEffect: {
1033
+ <R2, E2, E3>(f: (cause: Cause.Cause<E2>) => Effect.Effect<R2, E2, Option.Option<Cause.Cause<E3>>>): <R, E, A>(fx: Fx<R, E, A>) => Fx<R | R2, E2 | E3, A>;
1034
+ <R, E, A, R2, E2, E3>(fx: Fx<R, E, A>, f: (cause: Cause.Cause<E>) => Effect.Effect<R2, E2, Option.Option<Cause.Cause<E3>>>): Fx<R | R2, E2 | E3, A>;
1509
1035
  };
1510
1036
  /**
1511
- * Create an Fx which will wait a specified duration of time before emitting
1512
- * an event after the last event.
1513
- * @since 1.18.0
1514
- * @category time slicing
1037
+ * @since 1.20.0
1515
1038
  */
1516
- export declare const throttle: {
1517
- (delay: DurationInput): <R, E, A>(fx: Fx<R, E, A>) => Fx<R, E, A>;
1518
- <R, E, A>(fx: Fx<R, E, A>, delay: DurationInput): Fx<R, E, A>;
1039
+ export declare const filterMapErrorEffect: {
1040
+ <E, R2, E2, E3>(f: (e: E) => Effect.Effect<R2, E2, Option.Option<E3>>): <R, A>(fx: Fx<R, E, A>) => Fx<R | R2, E2 | E3, A>;
1041
+ <R, E, A, R2, E2, E3>(fx: Fx<R, E, A>, f: (e: E) => Effect.Effect<R2, E2, Option.Option<E3>>): Fx<R | R2, E2 | E3, A>;
1519
1042
  };
1520
1043
  /**
1521
- * Create an Fx which will wait a specified duration of time where no
1522
- * events have occurred before emitting a value.
1523
- * @since 1.18.0
1524
- * @category combinators
1044
+ * @since 1.20.0
1525
1045
  */
1526
- export declare const delay: {
1527
- (delay: DurationInput): <R, E, A>(fx: Fx<R, E, A>) => Fx<R, E, A>;
1528
- <R, E, A>(fx: Fx<R, E, A>, delay: DurationInput): Fx<R, E, A>;
1046
+ export declare const loopCause: {
1047
+ <B, E, C>(seed: B, f: (b: B, cause: Cause.Cause<E>) => readonly [Cause.Cause<C>, B]): <R, A>(fx: Fx<R, E, A>) => Fx<R, C, A>;
1048
+ <R, E, A, B, C>(fx: Fx<R, E, A>, seed: B, f: (b: B, cause: Cause.Cause<E>) => readonly [Cause.Cause<C>, B]): Fx<R, C, A>;
1529
1049
  };
1530
1050
  /**
1531
- * Run an Effect to produce an Fx to run.
1532
- * @since 1.18.0
1533
- * @category constructors
1051
+ * @since 1.20.0
1534
1052
  */
1535
- export declare const fromFxEffect: <R, E, R2, E2, B>(fxEffect: Effect.Effect<R, E, Fx<R2, E2, B>>) => Fx<R | R2, E | E2, B>;
1053
+ export declare const loopError: {
1054
+ <B, E, C>(seed: B, f: (b: B, e: E) => readonly [C, B]): <R, A>(fx: Fx<R, E, A>) => Fx<R, C, A>;
1055
+ <R, E, A, B, C>(fx: Fx<R, E, A>, seed: B, f: (b: B, e: E) => readonly [C, B]): Fx<R, C, A>;
1056
+ };
1536
1057
  /**
1537
- * Extract the context from an EffectGen
1538
- * @since 1.18.0
1058
+ * @since 1.20.0
1539
1059
  */
1540
- export type EffectGenContext<T> = [T] extends [never] ? never : [T] extends [Effect.EffectGen<infer R, any, any>] ? R : never;
1060
+ export declare const loopCauseEffect: {
1061
+ <B, E, R2, E2, C>(seed: B, f: (b: B, cause: Cause.Cause<E>) => Effect.Effect<R2, E2, readonly [Cause.Cause<C>, B]>): <R, A>(fx: Fx<R, E, A>) => Fx<R | R2, E2 | C, A>;
1062
+ <R, E, A, R2, E2, B, C>(fx: Fx<R, E, A>, seed: B, f: (b: B, cause: Cause.Cause<E>) => Effect.Effect<R2, E2, readonly [Cause.Cause<C>, B]>): Fx<R | R2, E2 | C, A>;
1063
+ };
1541
1064
  /**
1542
- * Extract the error from an EffectGen
1543
- * @since 1.18.0
1065
+ * @since 1.20.0
1544
1066
  */
1545
- export type EffectGenError<T> = [T] extends [never] ? never : [T] extends [Effect.EffectGen<any, infer E, any>] ? E : never;
1067
+ export declare const loopErrorEffect: {
1068
+ <B, E, R2, E2, C>(seed: B, f: (b: B, e: E) => Effect.Effect<R2, E2, readonly [C, B]>): <R, A>(fx: Fx<R, E, A>) => Fx<R | R2, E2 | C, A>;
1069
+ <R, E, A, R2, E2, B, C>(fx: Fx<R, E, A>, seed: B, f: (b: B, e: E) => Effect.Effect<R2, E2, readonly [C, B]>): Fx<R | R2, E2 | C, A>;
1070
+ };
1546
1071
  /**
1547
- * Extract the success value from an EffectGen
1548
- * @since 1.18.0
1072
+ * @since 1.20.0
1549
1073
  */
1550
- export type EffectGenSuccess<T> = [T] extends [never] ? never : [T] extends [Effect.EffectGen<any, any, infer A>] ? A : never;
1074
+ export declare const filterMapLoopCause: {
1075
+ <B, E, R2, E2, C>(seed: B, f: (b: B, cause: Cause.Cause<E>) => Effect.Effect<R2, E2, readonly [Option.Option<Cause.Cause<C>>, B]>): <R, A>(fx: Fx<R, E, A>) => Fx<R | R2, E2 | C, A>;
1076
+ <R, E, A, B, C>(fx: Fx<R, E, A>, seed: B, f: (b: B, cause: Cause.Cause<E>) => readonly [Option.Option<Cause.Cause<C>>, B]): Fx<R, C, A>;
1077
+ };
1551
1078
  /**
1552
- * Utilize Effect.gen to construct an Fx
1553
- * @since 1.18.0
1554
- * @category constructors
1079
+ * @since 1.20.0
1555
1080
  */
1556
- export declare function gen<Yield extends Effect.EffectGen<any, any, any>, R, E, A>(f: (_: Effect.Adapter) => Generator<Yield, Fx<R, E, A>, any>): Fx<R | EffectGenContext<Yield>, E | EffectGenError<Yield>, A>;
1081
+ export declare const filterMapLoopError: {
1082
+ <B, E, R2, E2, C>(seed: B, f: (b: B, e: E) => Effect.Effect<R2, E2, readonly [Option.Option<C>, B]>): <R, A>(fx: Fx<R, E, A>) => Fx<R | R2, E2 | C, A>;
1083
+ <R, E, A, B, C>(fx: Fx<R, E, A>, seed: B, f: (b: B, e: E) => readonly [Option.Option<C>, B]): Fx<R, C, A>;
1084
+ };
1557
1085
  /**
1558
- * Utilize Effect.gen to construct an Fx
1559
- * @since 1.18.0
1560
- * @category constructors
1086
+ * @since 1.20.0
1561
1087
  */
1562
- export declare function genScoped<Yield extends Effect.EffectGen<any, any, any>, R, E, A>(f: (_: Effect.Adapter) => Generator<Yield, Fx<R, E, A>, any>): Fx<Exclude<R | EffectGenContext<Yield>, Scope.Scope>, E | EffectGenError<Yield>, A>;
1088
+ export declare const filterMapLoopCauseEffect: {
1089
+ <B, E, R2, E2, C>(seed: B, f: (b: B, cause: Cause.Cause<E>) => Effect.Effect<R2, E2, readonly [Option.Option<Cause.Cause<C>>, B]>): <R, A>(fx: Fx<R, E, A>) => Fx<R | R2, E2 | C, A>;
1090
+ <R, E, A, R2, E2, B, C>(fx: Fx<R, E, A>, seed: B, f: (b: B, cause: Cause.Cause<E>) => Effect.Effect<R2, E2, readonly [Option.Option<Cause.Cause<C>>, B]>): Fx<R | R2, E2 | C, A>;
1091
+ };
1563
1092
  /**
1564
- * Run an Effect when an Fx exits
1565
- * @since 1.18.0
1566
- * @category lifecycles
1093
+ * @since 1.20.0
1567
1094
  */
1568
- export declare const onExit: {
1569
- <R2>(f: (exit: Exit.Exit<never, unknown>) => Effect.Effect<R2, never, unknown>): <R, E, A>(fx: Fx<R, E, A>) => Fx<R | R2, E, A>;
1570
- <R, E, A, R2>(fx: Fx<R, E, A>, f: (exit: Exit.Exit<never, unknown>) => Effect.Effect<R2, never, unknown>): Fx<R | R2, E, A>;
1095
+ export declare const filterMapLoopErrorEffect: {
1096
+ <B, E, R2, E2, C>(seed: B, f: (b: B, e: E) => Effect.Effect<R2, E2, readonly [Option.Option<C>, B]>): <R, A>(fx: Fx<R, E, A>) => Fx<R | R2, E2 | C, A>;
1097
+ <R, E, A, R2, E2, B, C>(fx: Fx<R, E, A>, seed: B, f: (b: B, e: E) => Effect.Effect<R2, E2, readonly [Option.Option<C>, B]>): Fx<R | R2, E2 | C, A>;
1571
1098
  };
1572
1099
  /**
1573
- * Run an Effect when an Fx is interrupted
1574
- * @since 1.18.0
1575
- * @category lifecycles
1100
+ * @since 1.20.0
1576
1101
  */
1577
- export declare const onInterrupt: {
1578
- <R2>(f: (interruptors: HashSet.HashSet<FiberId.FiberId>) => Effect.Effect<R2, never, unknown>): <R, E, A>(fx: Fx<R, E, A>) => Fx<R | R2, E, A>;
1579
- <R, E, A, R2>(fx: Fx<R, E, A>, f: (interruptors: HashSet.HashSet<FiberId.FiberId>) => Effect.Effect<R2, never, unknown>): Fx<R | R2, E, A>;
1102
+ export declare const flatMapCauseWithStrategy: {
1103
+ <E, R2, E2, B>(f: (cause: Cause.Cause<E>) => Fx<R2, E2, B>, flattenStrategy: FlattenStrategy, executionStrategy?: ExecutionStrategy.ExecutionStrategy): <R, A>(fx: Fx<R, E, A>) => Fx<R | R2 | Scope.Scope, E2, A | B>;
1104
+ <R, E, A, R2, E2, B>(fx: Fx<R, E, A>, f: (cause: Cause.Cause<E>) => Fx<R2, E2, B>, flattenStrategy: FlattenStrategy, executionStrategy?: ExecutionStrategy.ExecutionStrategy): Fx<R | R2 | Scope.Scope, E2, A | B>;
1580
1105
  };
1581
1106
  /**
1582
- * Run an Effect when an Fx ends with an error
1583
- * @since 1.18.0
1584
- * @category lifecycles
1107
+ * @since 1.20.0
1585
1108
  */
1586
- export declare const onError: {
1587
- <R2>(f: (cause: Cause.Cause<never>) => Effect.Effect<R2, never, unknown>): <R, E, A>(fx: Fx<R, E, A>) => Fx<R | R2, E, A>;
1588
- <R, E, A, R2>(fx: Fx<R, E, A>, f: (cause: Cause.Cause<never>) => Effect.Effect<R2, never, unknown>): Fx<R | R2, E, A>;
1109
+ export declare const flatMapErrorWithStrategy: {
1110
+ <E, R2, E2, B>(f: (e: E) => Fx<R2, E2, B>, flattenStrategy: FlattenStrategy, executionStrategy?: ExecutionStrategy.ExecutionStrategy): <R, A>(fx: Fx<R, E, A>) => Fx<R | R2 | Scope.Scope, E2, A | B>;
1111
+ <R, E, A, R2, E2, B>(fx: Fx<R, E, A>, f: (e: E) => Fx<R2, E2, B>, flattenStrategy: FlattenStrategy, executionStrategy?: ExecutionStrategy.ExecutionStrategy): Fx<R | R2 | Scope.Scope, E2, A | B>;
1589
1112
  };
1590
1113
  /**
1591
- * Provide a Scope to an Fx
1592
- * @since 1.18.0
1593
- * @category context
1114
+ * @since 1.20.0
1594
1115
  */
1595
- export declare const scoped: <R, E, A>(fx: Fx<R, E, A>) => Fx<Exclude<R, Scope.Scope>, E, A>;
1116
+ export declare const switchMapCause: {
1117
+ <R, E, A, R2, E2, B>(fx: Fx<R, E, A>, f: (cause: Cause.Cause<E>) => Fx<R2, E2, B>, executionStrategy?: ExecutionStrategy.ExecutionStrategy | undefined): Fx<R | R2 | Scope.Scope, E2, A | B>;
1118
+ <E, R2, E2, B>(f: (cause: Cause.Cause<E>) => Fx<R2, E2, B>, executionStrategy?: ExecutionStrategy.ExecutionStrategy | undefined): <R, A>(fx: Fx<R, E, A>) => Fx<R | R2 | Scope.Scope, E2, A | B>;
1119
+ };
1596
1120
  /**
1597
- * Annotate the logs of an Fx
1598
- * @since 1.18.0
1599
- * @category combinators
1121
+ * @since 1.20.0
1600
1122
  */
1601
- export declare const annotateLogs: {
1602
- (key: string, value: unknown): <R, E, A>(fx: Fx<R, E, A>) => Fx<R, E, A>;
1603
- (values: Record<string, unknown>): <R, E, A>(fx: Fx<R, E, A>) => Fx<R, E, A>;
1604
- <R, E, A>(fx: Fx<R, E, A>, key: string, value: unknown): Fx<R, E, A>;
1605
- <R, E, A>(fx: Fx<R, E, A>, values: Record<string, unknown>): Fx<R, E, A>;
1123
+ export declare const switchMapError: {
1124
+ <E, R2, E2, B>(f: (e: E) => Fx<R2, E2, B>, executionStrategy?: ExecutionStrategy.ExecutionStrategy | undefined): <R, A>(fx: Fx<R, E, A>) => Fx<R | R2 | Scope.Scope, E2, A | B>;
1125
+ <R, E, A, R2, E2, B>(fx: Fx<R, E, A>, f: (e: E) => Fx<R2, E2, B>, executionStrategy?: ExecutionStrategy.ExecutionStrategy | undefined): Fx<R | R2 | Scope.Scope, E2, A | B>;
1606
1126
  };
1607
1127
  /**
1608
- * Annotate the spans of an Fx
1609
- * @since 1.18.0
1610
- * @category combinators
1128
+ * @since 1.20.0
1611
1129
  */
1612
- export declare const annotateSpans: {
1613
- (key: string, value: unknown): <R, E, A>(fx: Fx<R, E, A>) => Fx<R, E, A>;
1614
- (values: Record<string, unknown>): <R, E, A>(fx: Fx<R, E, A>) => Fx<R, E, A>;
1615
- <R, E, A>(fx: Fx<R, E, A>, key: string, value: unknown): Fx<R, E, A>;
1616
- <R, E, A>(fx: Fx<R, E, A>, values: Record<string, unknown>): Fx<R, E, A>;
1130
+ export declare const flatMapCause: {
1131
+ <E, R2, E2, B>(f: (cause: Cause.Cause<E>) => Fx<R2, E2, B>, executionStrategy?: ExecutionStrategy.ExecutionStrategy | undefined): <R, A>(fx: Fx<R, E, A>) => Fx<R | R2 | Scope.Scope, E2, A | B>;
1132
+ <R, E, A, R2, E2, B>(fx: Fx<R, E, A>, f: (cause: Cause.Cause<E>) => Fx<R2, E2, B>, executionStrategy?: ExecutionStrategy.ExecutionStrategy | undefined): Fx<R | R2 | Scope.Scope, E2, A | B>;
1617
1133
  };
1618
1134
  /**
1619
- * Create an Fx which will succeed with Option.None
1620
- * @since 1.18.0
1621
- * @category constructors
1135
+ * @since 1.20.0
1622
1136
  */
1623
- export declare const succeedNone: <A = never>() => Fx<never, never, Option.Option<A>>;
1137
+ export declare const flatMapError: {
1138
+ <E, R2, E2, B>(f: (e: E) => Fx<R2, E2, B>, executionStrategy?: ExecutionStrategy.ExecutionStrategy | undefined): <R, A>(fx: Fx<R, E, A>) => Fx<R | R2 | Scope.Scope, E2, A | B>;
1139
+ <R, E, A, R2, E2, B>(fx: Fx<R, E, A>, f: (e: E) => Fx<R2, E2, B>, executionStrategy?: ExecutionStrategy.ExecutionStrategy | undefined): Fx<R | R2 | Scope.Scope, E2, A | B>;
1140
+ };
1624
1141
  /**
1625
- * Create an Fx which will succeed with Option.Some
1626
- * @since 1.18.0
1627
- * @category constructors
1142
+ * @since 1.20.0
1628
1143
  */
1629
- export declare const succeedSome: <A>(value: A) => Fx<never, never, Option.Option<A>>;
1144
+ export declare const flatMapCauseConcurrently: {
1145
+ <E, R2, E2, B>(f: (cause: Cause.Cause<E>) => Fx<R2, E2, B>, concurrency: number, executionStrategy?: ExecutionStrategy.ExecutionStrategy | undefined): <R, A>(fx: Fx<R, E, A>) => Fx<R | R2 | Scope.Scope, E2, A | B>;
1146
+ <R, E, A, R2, E2, B>(fx: Fx<R, E, A>, f: (cause: Cause.Cause<E>) => Fx<R2, E2, B>, concurrency: number, executionStrategy?: ExecutionStrategy.ExecutionStrategy | undefined): Fx<R | R2 | Scope.Scope, E2, A | B>;
1147
+ };
1630
1148
  /**
1631
- * Do simulation
1632
- * @since 1.18.0
1633
- * @category Do
1149
+ * @since 1.20.0
1634
1150
  */
1635
- export declare const Do: Fx<never, never, {}>;
1151
+ export declare const flatMapErrorConcurrently: {
1152
+ <E, R2, E2, B>(f: (e: E) => Fx<R2, E2, B>, concurrency: number, executionStrategy?: ExecutionStrategy.ExecutionStrategy | undefined): <R, A>(fx: Fx<R, E, A>) => Fx<R | R2 | Scope.Scope, E2, A | B>;
1153
+ <R, E, A, R2, E2, B>(fx: Fx<R, E, A>, f: (e: E) => Fx<R2, E2, B>, concurrency: number, executionStrategy?: ExecutionStrategy.ExecutionStrategy | undefined): Fx<R | R2 | Scope.Scope, E2, A | B>;
1154
+ };
1636
1155
  /**
1637
- * Do simulation
1638
- * @since 1.18.0
1639
- * @category Do
1156
+ * @since 1.20.0
1640
1157
  */
1641
- export declare const bind: {
1642
- <N extends string, A extends object, R2, E2, B>(name: Exclude<N, keyof A>, f: (a: A) => Fx<R2, E2, B>): <R1, E1>(self: Fx<R1, E1, A>) => Fx<R2 | R1, E2 | E1, {
1643
- [K in N | keyof A]: K extends keyof A ? A[K] : B;
1644
- }>;
1645
- <R1, E1, A1 extends object, N extends string, R2, E2, B>(self: Fx<R1, E1, A1>, name: Exclude<N, keyof A1>, f: (a: A1) => Fx<R2, E2, B>): Fx<R1 | R2, E1 | E2, {
1646
- [K in N | keyof A1]: K extends keyof A1 ? A1[K] : B;
1647
- }>;
1158
+ export declare const exhaustMapCause: {
1159
+ <E, R2, E2, B>(f: (cause: Cause.Cause<E>) => Fx<R2, E2, B>, executionStrategy?: ExecutionStrategy.ExecutionStrategy | undefined): <R, A>(fx: Fx<R, E, A>) => Fx<R | R2 | Scope.Scope, E2, A | B>;
1160
+ <R, E, A, R2, E2, B>(fx: Fx<R, E, A>, f: (cause: Cause.Cause<E>) => Fx<R2, E2, B>, executionStrategy?: ExecutionStrategy.ExecutionStrategy | undefined): Fx<R | R2 | Scope.Scope, E2, A | B>;
1648
1161
  };
1649
1162
  /**
1650
- * Do simulation
1651
- * @since 1.18.0
1652
- * @category Do
1163
+ * @since 1.20.0
1653
1164
  */
1654
- export declare const bindTo: {
1655
- <N extends string>(name: N): <R, E, A>(self: Fx<R, E, A>) => Fx<R, E, {
1656
- [K in N]: A;
1657
- }>;
1658
- <R, E, A, N extends string>(self: Fx<R, E, A>, name: N): Fx<R, E, {
1659
- [K_1 in N]: A;
1660
- }>;
1661
- };
1662
- declare const let_: {
1663
- <N extends string, A extends object, B>(name: Exclude<N, keyof A>, f: (a: A) => B): <R1, E1>(self: Fx<R1, E1, A>) => Fx<R1, E1, {
1664
- [K in N | keyof A]: K extends keyof A ? A[K] : B;
1665
- }>;
1666
- <R1, E1, A1 extends object, N extends string, B>(self: Fx<R1, E1, A1>, name: Exclude<N, keyof A1>, f: (a: A1) => B): Fx<R1, E1, {
1667
- [K in N | keyof A1]: K extends keyof A1 ? A1[K] : B;
1668
- }>;
1165
+ export declare const exhaustMapError: {
1166
+ <E, R2, E2, B>(f: (e: E) => Fx<R2, E2, B>, executionStrategy?: ExecutionStrategy.ExecutionStrategy | undefined): <R, A>(fx: Fx<R, E, A>) => Fx<R | R2 | Scope.Scope, E2, A | B>;
1167
+ <R, E, A, R2, E2, B>(fx: Fx<R, E, A>, f: (e: E) => Fx<R2, E2, B>, executionStrategy?: ExecutionStrategy.ExecutionStrategy | undefined): Fx<R | R2 | Scope.Scope, E2, A | B>;
1669
1168
  };
1670
- export {
1671
1169
  /**
1672
- * Do simulation
1673
- * @since 1.18.0
1674
- * @category Do
1170
+ * @since 1.20.0
1675
1171
  */
1676
- let_ as let };
1172
+ export declare const exhaustMapLatestCause: {
1173
+ <E, R2, E2, B>(f: (cause: Cause.Cause<E>) => Fx<R2, E2, B>, executionStrategy?: ExecutionStrategy.ExecutionStrategy | undefined): <R, A>(fx: Fx<R, E, A>) => Fx<R | R2 | Scope.Scope, E2, A | B>;
1174
+ <R, E, A, R2, E2, B>(fx: Fx<R, E, A>, f: (cause: Cause.Cause<E>) => Fx<R2, E2, B>, executionStrategy?: ExecutionStrategy.ExecutionStrategy | undefined): Fx<R | R2 | Scope.Scope, E2, A | B>;
1175
+ };
1677
1176
  /**
1678
- * Ensure a finalizer runs on Fx ext.
1679
- * @since 1.18.0
1680
- * @category combinators
1177
+ * @since 1.20.0
1681
1178
  */
1682
- export declare const ensuring: {
1683
- <R2>(finalizer: Effect.Effect<R2, never, unknown>): <R, E, A>(self: Fx<R, E, A>) => Fx<R2 | R, E, A>;
1684
- <R, E, A, R2>(self: Fx<R, E, A>, finalizer: Effect.Effect<R2, never, unknown>): Fx<R | R2, E, A>;
1179
+ export declare const exhaustMapLatestError: {
1180
+ <E, R2, E2, B>(f: (e: E) => Fx<R2, E2, B>, executionStrategy?: ExecutionStrategy.ExecutionStrategy | undefined): <R, A>(fx: Fx<R, E, A>) => Fx<R | R2 | Scope.Scope, E2, A | B>;
1181
+ <R, E, A, R2, E2, B>(fx: Fx<R, E, A>, f: (e: E) => Fx<R2, E2, B>, executionStrategy?: ExecutionStrategy.ExecutionStrategy | undefined): Fx<R | R2 | Scope.Scope, E2, A | B>;
1685
1182
  };
1686
1183
  /**
1687
- * Capture the errors and success values as Exit
1688
- * @since 1.18.0
1689
- * @category combinators
1184
+ * @since 1.20.0
1690
1185
  */
1691
- export declare const exit: <R, E, A>(fx: Fx<R, E, A>) => Fx<R, never, Exit.Exit<E, A>>;
1186
+ export type MatchCauseOptions<E, A, R2, E2, B, R3, E3, C> = {
1187
+ readonly onFailure: (cause: Cause.Cause<E>) => Fx<R2, E2, B>;
1188
+ readonly onSuccess: (a: A) => Fx<R3, E3, C>;
1189
+ readonly executionStrategy?: ExecutionStrategy.ExecutionStrategy | undefined;
1190
+ };
1692
1191
  /**
1693
- * Capture the errors and success values as Either
1694
- * @since 1.18.0
1695
- * @category combinators
1192
+ * @since 1.20.0
1696
1193
  */
1697
- export declare const either: <R, E, A>(fx: Fx<R, E, A>) => Fx<R, never, Either.Either<E, A>>;
1194
+ export type MatchErrorOptions<E, A, R2, E2, B, R3, E3, C> = {
1195
+ readonly onFailure: (e: E) => Fx<R2, E2, B>;
1196
+ readonly onSuccess: (a: A) => Fx<R3, E3, C>;
1197
+ readonly executionStrategy?: ExecutionStrategy.ExecutionStrategy | undefined;
1198
+ };
1698
1199
  /**
1699
- * Run an Fx until finding a value which satisfies the predicate.
1700
- * @since 1.18.0
1701
- * @category running
1200
+ * @since 1.20.0
1702
1201
  */
1703
- export declare const findFirst: {
1704
- <A, R2, E2>(f: (a: A) => Effect.Effect<R2, E2, boolean>): <R, E>(fx: Fx<R, E, A>) => Effect.Effect<R2 | R, E2 | E, Option.Option<A>>;
1705
- <R, E, A, R2, E2>(fx: Fx<R, E, A>, f: (a: A) => Effect.Effect<R2, E2, boolean>): Effect.Effect<R | R2, E | E2, Option.Option<A>>;
1202
+ export declare const matchCauseWithStrategy: {
1203
+ <E, A, R2, E2, B, R3, E3, C>(opts: MatchCauseOptions<E, A, R2, E2, B, R3, E3, C>): <R>(fx: Fx<R, E, A>) => Fx<R | R2 | R3 | Scope.Scope, E2 | E3, B | C>;
1204
+ <R, E, A, R2, E2, B, R3, E3, C>(fx: Fx<R, E, A>, flattenStrategy: FlattenStrategy, opts: MatchCauseOptions<E, A, R2, E2, B, R3, E3, C>): Fx<R | R2 | R3 | Scope.Scope, E2 | E3, B | C>;
1706
1205
  };
1707
1206
  /**
1708
- * Grab the first value emitted by an Fx
1709
- * @since 1.18.0
1710
- * @category running
1207
+ * @since 1.20.0
1711
1208
  */
1712
- export declare const first: <R, E, A>(fx: Fx<R, E, A>) => Effect.Effect<R, E, Option.Option<A>>;
1209
+ export declare const matchErrorWithStrategy: {
1210
+ <E, A, R2, E2, B, R3, E3, C>({ executionStrategy, onFailure, onSuccess }: MatchErrorOptions<E, A, R2, E2, B, R3, E3, C>): <R>(fx: Fx<R, E, A>) => Fx<R | R2 | R3 | Scope.Scope, E2 | E3, B | C>;
1211
+ <R, E, A, R2, E2, B, R3, E3, C>(fx: Fx<R, E, A>, flattenStrategy: FlattenStrategy, { executionStrategy, onFailure, onSuccess }: MatchErrorOptions<E, A, R2, E2, B, R3, E3, C>): Fx<Scope.Scope | R | R2 | R3, E2 | E3, B | C>;
1212
+ };
1713
1213
  /**
1714
- * Transform success values into failures and failures into successes.
1715
- * @since 1.18.0
1716
- * @category combinators
1214
+ * @since 1.20.0
1717
1215
  */
1718
- export declare const flip: <R, E, A>(fx: Fx<R, E, A>) => Fx<R, A, E>;
1216
+ export declare const matchCause: {
1217
+ <E, A, R2, E2, B, R3, E3, C>(opts: MatchCauseOptions<E, A, R2, E2, B, R3, E3, C>): <R>(fx: Fx<R, E, A>) => Fx<R | R2 | R3 | Scope.Scope, E2 | E3, B | C>;
1218
+ <R, E, A, R2, E2, B, R3, E3, C>(fx: Fx<R, E, A>, opts: MatchCauseOptions<E, A, R2, E2, B, R3, E3, C>): Fx<Scope.Scope | R | R2 | R3, E2 | E3, B | C>;
1219
+ };
1719
1220
  /**
1720
- * Lift a nullable value into an Fx
1721
- * @since 1.18.0
1722
- * @category constructors
1221
+ * @since 1.20.0
1723
1222
  */
1724
- export declare const fromNullable: <A>(value: void | A | null | undefined) => Fx<never, never, NonNullable<A>>;
1725
- declare const if_: {
1726
- <R2, E2, B, R3, E3, C>(onTrue: Fx<R2, E2, B>, onFalse: Fx<R3, E3, C>): {
1727
- <R, E>(bool: Fx<R, E, boolean>): Fx<R2 | R3 | R, E2 | E3 | E, B | C>;
1728
- (bool: boolean): Fx<R2 | R3, E2 | E3, B | C>;
1729
- };
1730
- <R, E, R2, E2, B, R3, E3, C>(bool: Fx<R, E, boolean>, onTrue: Fx<R2, E2, B>, onFalse: Fx<R3, E3, C>): Fx<R | R2 | R3, E | E2 | E3, B | C>;
1731
- <R2, E2, B, R3, E3, C>(bool: boolean, onTrue: Fx<R2, E2, B>, onFalse: Fx<R3, E3, C>): Fx<R2 | R3, E2 | E3, B | C>;
1223
+ export declare const matchError: {
1224
+ <E, A, R2, E2, B, R3, E3, C>(opts: MatchErrorOptions<E, A, R2, E2, B, R3, E3, C>): <R>(fx: Fx<R, E, A>) => Fx<R | R2 | R3 | Scope.Scope, E2 | E3, B | C>;
1225
+ <R, E, A, R2, E2, B, R3, E3, C>(fx: Fx<R, E, A>, opts: core.MatchErrorOptions<E, A, R2, E2, B, R3, E3, C>): Fx<R | R2 | R3 | Scope.Scope, E2 | E3, B | C>;
1732
1226
  };
1733
- export {
1734
1227
  /**
1735
- * Logical if/else using Fx.
1736
- * @since 1.18.0
1737
- * @category combinators
1228
+ * @since 1.20.0
1738
1229
  */
1739
- if_ as if };
1230
+ export declare const matchCauseConcurrently: {
1231
+ <E, A, R2, E2, B, R3, E3, C>(concurrency: number, opts: MatchCauseOptions<E, A, R2, E2, B, R3, E3, C>): <R>(fx: Fx<R, E, A>) => Fx<R | R2 | R3 | Scope.Scope, E2 | E3, B | C>;
1232
+ <R, E, A, R2, E2, B, R3, E3, C>(fx: Fx<R, E, A>, concurrency: number, opts: core.MatchCauseOptions<E, A, R2, E2, B, R3, E3, C>): Fx<R | R2 | R3 | Scope.Scope, E2 | E3, B | C>;
1233
+ };
1740
1234
  /**
1741
- * Logical if/else using static values.
1742
- * @since 1.18.0
1743
- * @category combinators
1235
+ * @since 1.20.0
1744
1236
  */
1745
- export declare const when: {
1746
- <B, C>(onTrue: B, onFalse: C): {
1747
- <R, E>(bool: Fx<R, E, boolean>): Fx<R, E, B | C>;
1748
- (bool: boolean): Fx<never, never, B | C>;
1749
- };
1750
- <R, E, B, C>(bool: Fx<R, E, boolean>, onTrue: B, onFalse: C): Fx<R, E, B | C>;
1751
- <B, C>(bool: boolean, onTrue: B, onFalse: C): Fx<never, never, B | C>;
1237
+ export declare const matchErrorConcurrently: {
1238
+ <E, A, R2, E2, B, R3, E3, C>(concurrency: number, opts: MatchErrorOptions<E, A, R2, E2, B, R3, E3, C>): <R>(fx: Fx<R, E, A>) => Fx<R | R2 | R3 | Scope.Scope, E2 | E3, B | C>;
1239
+ <R, E, A, R2, E2, B, R3, E3, C>(fx: Fx<R, E, A>, concurrency: number, opts: core.MatchErrorOptions<E, A, R2, E2, B, R3, E3, C>): Fx<Scope.Scope | R | R2 | R3, E2 | E3, B | C>;
1752
1240
  };
1753
1241
  /**
1754
- * Mark an Fx as interruptible
1755
- * @since 1.18.0
1756
- * @category combinators
1242
+ * @since 1.20.0
1757
1243
  */
1758
- export declare const interruptible: <R, E, A>(fx: Fx<R, E, A>) => Fx<R, E, A>;
1244
+ export declare const switchMatchCause: {
1245
+ <E, A, R2, E2, B, R3, E3, C>(opts: MatchCauseOptions<E, A, R2, E2, B, R3, E3, C>): <R>(fx: Fx<R, E, A>) => Fx<R | R2 | R3 | Scope.Scope, E2 | E3, B | C>;
1246
+ <R, E, A, R2, E2, B, R3, E3, C>(fx: Fx<R, E, A>, opts: MatchCauseOptions<E, A, R2, E2, B, R3, E3, C>): Fx<Scope.Scope | R | R2 | R3, E2 | E3, B | C>;
1247
+ };
1759
1248
  /**
1760
- * Mark an Fx as uninterruptible
1761
- * @since 1.18.0
1762
- * @category combinators
1249
+ * @since 1.20.0
1763
1250
  */
1764
- export declare const uninterruptible: <R, E, A>(fx: Fx<R, E, A>) => Fx<R, E, A>;
1251
+ export declare const switchMatchError: {
1252
+ <E, A, R2, E2, B, R3, E3, C>(opts: MatchErrorOptions<E, A, R2, E2, B, R3, E3, C>): <R>(fx: Fx<R, E, A>) => Fx<R | R2 | R3 | Scope.Scope, E2 | E3, B | C>;
1253
+ <R, E, A, R2, E2, B, R3, E3, C>(fx: Fx<R, E, A>, opts: core.MatchErrorOptions<E, A, R2, E2, B, R3, E3, C>): Fx<R | R2 | R3 | Scope.Scope, E2 | E3, B | C>;
1254
+ };
1765
1255
  /**
1766
- * Locally set the value of a FiberRef
1767
- * @since 1.18.0
1768
- * @category FiberRef
1256
+ * @since 1.20.0
1769
1257
  */
1770
- export declare const locally: {
1771
- <A>(self: FiberRef<A>, value: A): <R, E, B>(use: Fx<R, E, B>) => Fx<R, E, B>;
1772
- <R, E, B, A>(use: Fx<R, E, B>, self: FiberRef<A>, value: A): Fx<R, E, B>;
1258
+ export declare const exhaustMatchCause: {
1259
+ <E, A, R2, E2, B, R3, E3, C>(opts: MatchCauseOptions<E, A, R2, E2, B, R3, E3, C>): <R>(fx: Fx<R, E, A>) => Fx<R | R2 | R3 | Scope.Scope, E2 | E3, B | C>;
1260
+ <R, E, A, R2, E2, B, R3, E3, C>(fx: Fx<R, E, A>, opts: MatchCauseOptions<E, A, R2, E2, B, R3, E3, C>): Fx<Scope.Scope | R | R2 | R3, E2 | E3, B | C>;
1773
1261
  };
1774
1262
  /**
1775
- * Locally set the value of a FiberRef by updating the current value
1776
- * @since 1.18.0
1777
- * @category FiberRef
1263
+ * @since 1.20.0
1778
1264
  */
1779
- export declare const locallyWith: {
1780
- <A>(self: FiberRef<A>, f: (a: A) => A): <R, E, B>(use: Fx<R, E, B>) => Fx<R, E, B>;
1781
- <R, E, B, A>(use: Fx<R, E, B>, self: FiberRef<A>, f: (a: A) => A): Fx<R, E, B>;
1265
+ export declare const exhaustMatchError: {
1266
+ <E, A, R2, E2, B, R3, E3, C>(opts: MatchErrorOptions<E, A, R2, E2, B, R3, E3, C>): <R>(fx: Fx<R, E, A>) => Fx<R | R2 | R3 | Scope.Scope, E2 | E3, B | C>;
1267
+ <R, E, A, R2, E2, B, R3, E3, C>(fx: Fx<R, E, A>, opts: core.MatchErrorOptions<E, A, R2, E2, B, R3, E3, C>): Fx<R | R2 | R3 | Scope.Scope, E2 | E3, B | C>;
1782
1268
  };
1783
1269
  /**
1784
- * Enable/disable tracer timing for an Fx
1785
- * @since 1.18.0
1786
- * @category tracing
1270
+ * @since 1.20.0
1787
1271
  */
1788
- export declare const withTracerTiming: {
1789
- (enabled: boolean): <R, E, A>(fx: Fx<R, E, A>) => Fx<R, E, A>;
1790
- <R, E, A>(fx: Fx<R, E, A>, enabled: boolean): Fx<R, E, A>;
1272
+ export declare const exhaustMatchLatestCause: {
1273
+ <E, A, R2, E2, B, R3, E3, C>(opts: MatchCauseOptions<E, A, R2, E2, B, R3, E3, C>): <R>(fx: Fx<R, E, A>) => Fx<R | R2 | R3 | Scope.Scope, E2 | E3, B | C>;
1274
+ <R, E, A, R2, E2, B, R3, E3, C>(fx: Fx<R, E, A>, opts: MatchCauseOptions<E, A, R2, E2, B, R3, E3, C>): Fx<Scope.Scope | R | R2 | R3, E2 | E3, B | C>;
1791
1275
  };
1792
1276
  /**
1793
- * Configure the concurreny limit of Fibers running within an Fx
1794
- * @since 1.18.0
1795
- * @category concurrency
1277
+ * @since 1.20.0
1796
1278
  */
1797
- export declare const withConcurrency: {
1798
- (concurrency: number | "unbounded"): <R, E, A>(fx: Fx<R, E, A>) => Fx<R, E, A>;
1799
- <R, E, A>(fx: Fx<R, E, A>, concurrency: number | "unbounded"): Fx<R, E, A>;
1279
+ export declare const exhaustMatchLatestError: {
1280
+ <E, A, R2, E2, B, R3, E3, C>(opts: MatchErrorOptions<E, A, R2, E2, B, R3, E3, C>): <R>(fx: Fx<R, E, A>) => Fx<R | R2 | R3 | Scope.Scope, E2 | E3, B | C>;
1281
+ <R, E, A, R2, E2, B, R3, E3, C>(fx: Fx<R, E, A>, opts: core.MatchErrorOptions<E, A, R2, E2, B, R3, E3, C>): Fx<R | R2 | R3 | Scope.Scope, E2 | E3, B | C>;
1800
1282
  };
1801
1283
  /**
1802
- * Add a span to your log messages
1803
- * @since 1.18.0
1804
- * @category logging
1284
+ * @since 1.20.0
1805
1285
  */
1806
- export declare const withLogSpan: {
1807
- (span: string): <R, E, A>(fx: Fx<R, E, A>) => Fx<R, E, A>;
1808
- <R, E, A>(fx: Fx<R, E, A>, span: string): Fx<R, E, A>;
1809
- };
1286
+ export declare const exit: <R, E, A>(fx: Fx<R, E, A>) => Fx<R, never, Exit.Exit<E, A>>;
1810
1287
  /**
1811
- * Configure the maximum number of operations to run before yielding to the runtime
1812
- * @since 1.18.0
1813
- * @category concurrency
1288
+ * @since 1.20.0
1814
1289
  */
1815
- export declare const withMaxOpsBeforeYield: {
1816
- (maxOps: number): <R, E, A>(fx: Fx<R, E, A>) => Fx<R, E, A>;
1817
- <R, E, A>(fx: Fx<R, E, A>, maxOps: number): Fx<R, E, A>;
1818
- };
1290
+ export declare const either: <R, E, A>(fx: Fx<R, E, A>) => Fx<R, never, Either.Either<E, A>>;
1819
1291
  /**
1820
- * Set the parent Span of an Fx
1821
- * @since 1.18.0
1822
- * @category tracing
1292
+ * @since 1.20.0
1823
1293
  */
1824
- export declare const withParentSpan: {
1825
- (parentSpan: Tracer.ParentSpan): <R, E, A>(fx: Fx<R, E, A>) => Fx<R, E, A>;
1826
- <R, E, A>(fx: Fx<R, E, A>, parentSpan: Tracer.ParentSpan): Fx<R, E, A>;
1827
- };
1294
+ export declare const tuple: <const FX extends ReadonlyArray<Fx<any, any, any>>>(fx: FX) => Fx<Fx.Context<FX[number]>, Fx.Error<FX[number]>, {
1295
+ readonly [K in keyof FX]: Fx.Success<FX[K]>;
1296
+ }>;
1828
1297
  /**
1829
- * Enable/disable request batching within an Fx
1830
- * @since 1.18.0
1831
- * @category batching
1298
+ * @since 1.20.0
1832
1299
  */
1833
- export declare const withRequestBatching: {
1834
- (requestBatching: boolean): <R, E, A>(fx: Fx<R, E, A>) => Fx<R, E, A>;
1835
- <R, E, A>(fx: Fx<R, E, A>, requestBatching: boolean): Fx<R, E, A>;
1836
- };
1300
+ export declare const struct: <const FX extends Readonly<Record<string, Fx<any, any, any>>>>(fx: FX) => Fx<Fx.Context<FX[string]>, Fx.Error<FX[string]>, {
1301
+ readonly [K in keyof FX]: Fx.Success<FX[K]>;
1302
+ }>;
1837
1303
  /**
1838
- * Set the request cache Effects running within an Fx
1839
- * @since 1.18.0
1840
- * @category batching
1304
+ * @since 1.20.0
1841
1305
  */
1842
- export declare const withRequestCache: {
1843
- (cache: Request.Cache): <R, E, A>(fx: Fx<R, E, A>) => Fx<R, E, A>;
1844
- <R, E, A>(fx: Fx<R, E, A>, cache: Request.Cache): Fx<R, E, A>;
1306
+ export declare const all: {
1307
+ <const FX extends ReadonlyArray<Fx<any, any, any>>>(fx: FX): Fx<Fx.Context<FX[number]>, Fx.Error<FX[number]>, {
1308
+ readonly [K in keyof FX]: Fx.Success<FX[K]>;
1309
+ }>;
1310
+ <const FX extends Readonly<Record<string, Fx<any, any, any>>>>(fx: FX): Fx<Fx.Context<FX[string]>, Fx.Error<FX[string]>, {
1311
+ readonly [K in keyof FX]: Fx.Success<FX[K]>;
1312
+ }>;
1845
1313
  };
1846
1314
  /**
1847
- * Enable/disable request caching within an Fx
1848
- * @since 1.18.0
1849
- * @category batching
1315
+ * @since 1.20.0
1850
1316
  */
1851
- export declare const withRequestCaching: {
1852
- (requestCaching: boolean): <R, E, A>(fx: Fx<R, E, A>) => Fx<R, E, A>;
1853
- <R, E, A>(fx: Fx<R, E, A>, requestCaching: boolean): Fx<R, E, A>;
1317
+ export declare const toEnqueue: {
1318
+ <R2 = never, A = never>(queue: Ctx.Enqueue<R2, A> | Queue.Enqueue<A>): <R, E>(fx: Fx<R, E, A>) => Effect.Effect<R | R2, E, void>;
1319
+ <R, E, A, R2 = never>(fx: Fx<R, E, A>, queue: Ctx.Enqueue<R2, A> | Queue.Enqueue<A>): Effect.Effect<R | R2, E, void>;
1854
1320
  };
1855
1321
  /**
1856
- * Configure the scheduler to use within an Fx
1857
- * @since 1.18.0
1858
- * @category concurrency
1322
+ * @since 1.20.0
1859
1323
  */
1860
- export declare const withScheduler: {
1861
- (scheduler: Scheduler): <R, E, A>(fx: Fx<R, E, A>) => Fx<R, E, A>;
1862
- <R, E, A>(fx: Fx<R, E, A>, scheduler: Scheduler): Fx<R, E, A>;
1324
+ export declare const debounce: {
1325
+ (delay: Duration.DurationInput): <R, E, A>(fx: Fx<R, E, A>) => Fx<R | Scope.Scope, E, A>;
1326
+ <R, E, A>(fx: Fx<R, E, A>, delay: Duration.DurationInput): Fx<R | Scope.Scope, E, A>;
1863
1327
  };
1864
1328
  /**
1865
- * Set the span of an Fx
1866
- * @since 1.18.0
1867
- * @category tracing
1329
+ * @since 1.20.0
1868
1330
  */
1869
- export declare const withSpan: {
1870
- (name: string, options?: {
1871
- readonly attributes?: Record<string, unknown>;
1872
- readonly links?: ReadonlyArray<Tracer.SpanLink>;
1873
- readonly parent?: Tracer.ParentSpan;
1874
- readonly root?: boolean;
1875
- readonly context?: Context.Context<never>;
1876
- }): <R, E, A>(self: Fx<R, E, A>) => Fx<R, E, A>;
1877
- <R, E, A>(self: Fx<R, E, A>, name: string, options?: {
1878
- readonly attributes?: Record<string, unknown>;
1879
- readonly links?: ReadonlyArray<Tracer.SpanLink>;
1880
- readonly parent?: Tracer.ParentSpan;
1881
- readonly root?: boolean;
1882
- readonly context?: Context.Context<never>;
1883
- }): Fx<R, E, A>;
1331
+ export declare const throttle: {
1332
+ (delay: Duration.DurationInput): <R, E, A>(fx: Fx<R, E, A>) => Fx<R | Scope.Scope, E, A>;
1333
+ <R, E, A>(fx: Fx<R, E, A>, delay: Duration.DurationInput): Fx<R | Scope.Scope, E, A>;
1884
1334
  };
1885
1335
  /**
1886
- * Set the tracer used within an Fx
1887
- * @since 1.18.0
1888
- * @category tracing
1336
+ * @since 1.20.0
1889
1337
  */
1890
- export declare const withTracer: {
1891
- (tracer: Tracer.Tracer): <R, E, A>(fx: Fx<R, E, A>) => Fx<R, E, A>;
1892
- <R, E, A>(fx: Fx<R, E, A>, tracer: Tracer.Tracer): Fx<R, E, A>;
1338
+ export declare const throttleLatest: {
1339
+ (delay: Duration.DurationInput): <R, E, A>(fx: Fx<R, E, A>) => Fx<R | Scope.Scope, E, A>;
1340
+ <R, E, A>(fx: Fx<R, E, A>, delay: Duration.DurationInput): Fx<R | Scope.Scope, E, A>;
1893
1341
  };
1894
1342
  /**
1895
- * Partition an Fx into two Fx's based on a either-returning function.
1896
- * @since 1.18.0
1897
- * @category combinators
1343
+ * @since 1.20.0
1898
1344
  */
1899
- export declare const partitionMap: {
1900
- <A, B, C>(f: (a: A) => Either.Either<B, C>): <R, E>(self: Fx<R, E, A>) => readonly [Fx<R, E, B>, Fx<R, E, C>];
1901
- <R, E, A, B, C>(self: Fx<R, E, A>, f: (a: A) => Either.Either<B, C>): readonly [Fx<R, E, B>, Fx<R, E, C>];
1902
- };
1345
+ export interface KeyedOptions<A, B, R2, E2, C> {
1346
+ readonly getKey: (a: A) => B;
1347
+ readonly onValue: (ref: RefSubject<never, never, A>, key: B) => Fx<R2, E2, C>;
1348
+ readonly debounce?: Duration.DurationInput;
1349
+ }
1903
1350
  /**
1904
- * Convert a list of keyed values into persistent workflows for given each key of the list
1905
- * even when the list has been re-ordered.
1906
- *
1907
- * @since 1.18.0
1908
- * @category combinators
1351
+ * @since 1.20.0
1909
1352
  */
1910
1353
  export declare const keyed: {
1911
- <A, B, R2, E2, C>(getKey: (a: A) => B, f: (ref: RefSubject<never, never, A>, key: B) => FxInput<R2, E2, C>): <R, E>(fx: Fx<R, E, ReadonlyArray<A>>) => Fx<R | R2, E | E2, ReadonlyArray<C>>;
1912
- <R, E, A, B, R2, E2, C>(fx: Fx<R, E, ReadonlyArray<A>>, getKey: (a: A) => B, f: (ref: RefSubject<never, never, A>, key: B) => FxInput<R2, E2, C>): Fx<R | R2, E | E2, ReadonlyArray<C>>;
1354
+ <A, B extends PropertyKey, R2, E2, C>(options: KeyedOptions<A, B, R2, E2, C>): <R, E>(fx: Fx<R, E, ReadonlyArray<A>>) => Fx<R | R2, E | E2, ReadonlyArray<C>>;
1355
+ <R, E, A, B extends PropertyKey, R2, E2, C>(fx: Fx<R, E, ReadonlyArray<A>>, options: KeyedOptions<A, B, R2, E2, C>): Fx<R | R2, E | E2, ReadonlyArray<C>>;
1913
1356
  };
1914
1357
  /**
1915
- * Map an Fx of values into workflows similar to Fx.switchMap, but
1916
- * instead of providing the value directly, it is exposed as a RefSubject to
1917
- * allow creating a persistent workflows similar to Fx.keyed but for a single value.
1918
- *
1919
- * @since 1.18.0
1920
- * @category combinators
1358
+ * @since 1.20.0
1359
+ */
1360
+ export interface WithKeyOptions<A, B, R2, E2, C> {
1361
+ readonly getKey: (a: A) => B;
1362
+ readonly onValue: (ref: RefSubject<never, never, A>, key: B) => Fx<R2, E2, C>;
1363
+ }
1364
+ /**
1365
+ * @since 1.20.0
1921
1366
  */
1922
1367
  export declare const withKey: {
1923
- <A, B, R2, E2, C>(getKey: (a: A) => B, f: (ref: RefSubject<never, never, A>, key: B) => FxInput<R2, E2, C>): <R, E>(fx: Fx<R, E, A>) => Fx<R | R2, E | E2, C>;
1924
- <R, E, A, B, R2, E2, C>(fx: Fx<R, E, A>, getKey: (a: A) => B, f: (ref: RefSubject<never, never, A>, key: B) => FxInput<R2, E2, C>): Fx<R | R2, E | E2, C>;
1368
+ <A, B extends PropertyKey, R2, E2, C>(options: WithKeyOptions<A, B, R2, E2, C>): <R, E>(fx: Fx<R, E, A>) => Fx<R | R2, E | E2, C>;
1369
+ <R, E, A, B extends PropertyKey, R2, E2, C>(fx: Fx<R, E, A>, options: WithKeyOptions<A, B, R2, E2, C>): Fx<R | R2, E | E2, C>;
1925
1370
  };
1926
1371
  /**
1927
1372
  * Match over a tagged union of values into a set of persistent workflows
1928
1373
  * that allow listening to changes of values with the same tag using the same
1929
1374
  * Fx.
1930
1375
  *
1931
- * @since 1.18.0
1376
+ * @since 1.20.0
1932
1377
  * @category combinators
1933
1378
  */
1934
1379
  export declare const matchTags: {
1935
1380
  <A extends {
1936
1381
  readonly _tag: string;
1937
- }, Matchers extends DefaultMatchersFrom<A>>(matchers: Matchers): <R, E>(fx: Fx<R, E, A>) => Fx<R | Fx.Context<Fx.FromInput<ReturnType<Matchers[keyof Matchers]>>>, E | Fx.Error<Fx.FromInput<ReturnType<Matchers[keyof Matchers]>>>, Fx.Success<Fx.FromInput<ReturnType<Matchers[keyof Matchers]>>>>;
1382
+ }, Matchers extends DefaultMatchersFrom<A>>(matchers: Matchers): <R, E>(fx: Fx<R, E, A>) => Fx<R | Fx.Context<ReturnType<Matchers[keyof Matchers]>>, E | Fx.Error<ReturnType<Matchers[keyof Matchers]>>, Fx.Success<ReturnType<Matchers[keyof Matchers]>>>;
1938
1383
  <R, E, A extends {
1939
1384
  readonly _tag: string;
1940
- }, Matchers extends DefaultMatchersFrom<A>>(fx: Fx<R, E, A>, matchers: Matchers): Fx<R | Fx.Context<Fx.FromInput<ReturnType<Matchers[keyof Matchers]>>>, E | Fx.Error<Fx.FromInput<ReturnType<Matchers[keyof Matchers]>>>, Fx.Success<Fx.FromInput<ReturnType<Matchers[keyof Matchers]>>>>;
1385
+ }, Matchers extends DefaultMatchersFrom<A>>(fx: Fx<R, E, A>, matchers: Matchers): Fx<R | Fx.Context<ReturnType<Matchers[keyof Matchers]>>, E | Fx.Error<ReturnType<Matchers[keyof Matchers]>>, Fx.Success<ReturnType<Matchers[keyof Matchers]>>>;
1941
1386
  };
1942
1387
  /**
1943
- * @since 1.18.0
1388
+ * @since 1.20.0
1944
1389
  */
1945
1390
  export type DefaultMatchersFrom<A extends {
1946
1391
  readonly _tag: string;
1947
1392
  }> = {
1948
1393
  readonly [Tag in A["_tag"]]: (value: RefSubject<never, never, Extract<A, {
1949
1394
  readonly _tag: Tag;
1950
- }>>) => FxInput<any, any, any>;
1395
+ }>>) => Fx<any, any, any>;
1951
1396
  };
1952
1397
  /**
1953
- * @since 1.18.0
1954
- */
1955
- export declare const drainLayer: <FXS extends ReadonlyArray<Fx<any, never, any>>>(...fxs: FXS) => Layer.Layer<Exclude<Fx.Context<FXS[number]>, Scope.Scope>, never, never>;
1956
- /**
1957
- * @since 1.18.0
1958
- */
1959
- export declare function isFx<R = unknown, E = unknown, A = unknown>(u: unknown): u is Fx<R, E, A>;
1960
- /**
1961
- * @since 1.18.0
1398
+ * @since 1.20.0
1962
1399
  */
1963
1400
  export declare const matchOption: {
1964
- <A, R2 = never, E2 = never, B = never, R3 = never, E3 = never, C = never>(onNone: () => FxInput<R2, E2, B>, onSome: (a: RefSubject<never, never, A>) => FxInput<R3, E3, C>): <R, E>(fx: Fx<R, E, Option.Option<A>>) => Fx<R | R2, E | E2, B | C>;
1965
- <R, E, A, R2 = never, E2 = never, B = never, R3 = never, E3 = never, C = never>(fx: Fx<R, E, Option.Option<A>>, onNone: () => FxInput<R2, E2, B>, onSome: (a: RefSubject<never, never, A>) => FxInput<R3, E3, C>): Fx<R | R2, E | E2, B | C>;
1401
+ <A, R2 = never, E2 = never, B = never, R3 = never, E3 = never, C = never>(onNone: () => Fx<R2, E2, B>, onSome: (a: RefSubject<never, never, A>) => Fx<R3, E3, C>): <R, E>(fx: Fx<R, E, Option.Option<A>>) => Fx<R | R2 | R3 | Scope.Scope, E | E2 | E3, B | C>;
1402
+ <R, E, A, R2 = never, E2 = never, B = never, R3 = never, E3 = never, C = never>(fx: Fx<R, E, Option.Option<A>>, onNone: () => Fx<R2, E2, B>, onSome: (a: RefSubject<never, never, A>) => Fx<R3, E3, C>): Fx<R | R2 | R3 | Scope.Scope, E | E2 | E3, B | C>;
1966
1403
  };
1967
1404
  /**
1968
- * @since 1.18.0
1405
+ * @since 1.20.0
1969
1406
  */
1970
1407
  export declare const getOrElse: {
1971
- <A, R2 = never, E2 = never, B = never>(orElse: () => FxInput<R2, E2, B>): <R, E>(fx: Fx<R, E, Option.Option<A>>) => Fx<R | R2, E | E2, A | B>;
1972
- <R, E, A, R2 = never, E2 = never, B = never>(fx: Fx<R, E, Option.Option<A>>, orElse: () => FxInput<R2, E2, B>): Fx<R | R2, E | E2, A | B>;
1408
+ <A, R2 = never, E2 = never, B = never>(orElse: () => Fx<R2, E2, B>): <R, E>(fx: Fx<R, E, Option.Option<A>>) => Fx<R | R2 | Scope.Scope, E | E2, A | B>;
1409
+ <R, E, A, R2 = never, E2 = never, B = never>(fx: Fx<R, E, Option.Option<A>>, orElse: () => Fx<R2, E2, B>): Fx<R | R2 | Scope.Scope, E | E2, A | B>;
1973
1410
  };
1974
1411
  /**
1975
- * @since 1.18.0
1412
+ * @since 1.20.0
1976
1413
  */
1977
1414
  export declare const matchEither: {
1978
- <E1, A, R2 = never, E2 = never, B = never, R3 = never, E3 = never, C = never>(onLeft: (e: RefSubject<never, never, E1>) => FxInput<R2, E2, B>, onRight: (a: RefSubject<never, never, A>) => FxInput<R3, E3, C>): <R, E>(fx: Fx<R, E, Either.Either<E1, A>>) => Fx<R | R2, E | E2, B | C>;
1979
- <R, E, E1, A, R2 = never, E2 = never, B = never, R3 = never, E3 = never, C = never>(fx: Fx<R, E, Either.Either<E1, A>>, onLeft: (e: RefSubject<never, never, E1>) => FxInput<R2, E2, B>, onRight: (a: RefSubject<never, never, A>) => FxInput<R3, E3, C>): Fx<R | R2, E | E2, B | C>;
1415
+ <E1, A, R2 = never, E2 = never, B = never, R3 = never, E3 = never, C = never>(onLeft: (e: RefSubject<never, never, E1>) => Fx<R2, E2, B>, onRight: (a: RefSubject<never, never, A>) => Fx<R3, E3, C>): <R, E>(fx: Fx<R, E, Either.Either<E1, A>>) => Fx<R | R2 | R3 | Scope.Scope, E | E2 | E3, B | C>;
1416
+ <R, E, E1, A, R2 = never, E2 = never, B = never, R3 = never, E3 = never, C = never>(fx: Fx<R, E, Either.Either<E1, A>>, onLeft: (e: RefSubject<never, never, E1>) => Fx<R2, E2, B>, onRight: (a: RefSubject<never, never, A>) => Fx<R3, E3, C>): Fx<R | R2 | R3 | Scope.Scope, E | E2 | E3, B | C>;
1980
1417
  };
1981
1418
  /**
1982
- * @since 1.18.0
1419
+ * @since 1.20.0
1420
+ */
1421
+ export declare const at: {
1422
+ (duration: Duration.DurationInput): <A>(value: A) => Fx<never, never, A>;
1423
+ <A>(value: A, duration: Duration.DurationInput): Fx<never, never, A>;
1424
+ };
1425
+ /**
1426
+ * @since 1.20.0
1427
+ */
1428
+ export declare function drainLayer<FXS extends ReadonlyArray<Fx<any, never, any>>>(...fxs: FXS): Layer.Layer<Exclude<Fx.Context<FXS[number]>, Scope.Scope>, never, never>;
1429
+ /**
1430
+ * @since 1.20.0
1983
1431
  */
1984
1432
  export declare const fork: <R, E, A>(fx: Fx<R, E, A>) => Effect.Effect<R, never, Fiber.RuntimeFiber<E, void>>;
1985
1433
  /**
1986
- * @since 1.18.0
1434
+ * @since 1.20.0
1987
1435
  */
1988
1436
  export declare const forkScoped: <R, E, A>(fx: Fx<R, E, A>) => Effect.Effect<Scope.Scope | R, never, Fiber.RuntimeFiber<E, void>>;
1989
1437
  /**
1990
- * @since 1.18.0
1438
+ * @since 1.20.0
1991
1439
  */
1992
1440
  export declare const forkDaemon: <R, E, A>(fx: Fx<R, E, A>) => Effect.Effect<R, never, Fiber.RuntimeFiber<E, void>>;
1993
1441
  /**
1994
- * @since 1.18.0
1442
+ * @since 1.20.0
1995
1443
  */
1996
1444
  export declare const forkIn: {
1997
1445
  (scope: Scope.Scope): <R, E, A>(fx: Fx<R, E, A>) => Effect.Effect<R, never, Fiber.RuntimeFiber<E, void>>;
1998
1446
  <R, E, A>(fx: Fx<R, E, A>, scope: Scope.Scope): Effect.Effect<R, never, Fiber.RuntimeFiber<E, void>>;
1999
1447
  };
2000
1448
  /**
2001
- * @since 1.18.0
1449
+ * @since 1.20.0
1450
+ */
1451
+ export declare const fromAsyncIterable: <A>(iterable: AsyncIterable<A>) => Fx<never, never, A>;
1452
+ /**
1453
+ * @since 1.20.0
1454
+ */
1455
+ export declare const partitionMap: {
1456
+ <A, B, C>(f: (a: A) => Either.Either<B, C>): <R, E>(fx: Fx<R, E, A>) => readonly [Fx<Scope.Scope | R, E, B>, Fx<Scope.Scope | R, E, C>];
1457
+ <R, E, A, B, C>(fx: Fx<R, E, A>, f: (a: A) => Either.Either<B, C>): readonly [Fx<Scope.Scope | R, E, B>, Fx<Scope.Scope | R, E, C>];
1458
+ };
1459
+ /**
1460
+ * @since 1.20.0
1461
+ */
1462
+ export declare const gen: <Y extends Effect.EffectGen<any, any, any>, FX extends Fx<any, any, any>>(f: (_: Effect.Adapter) => Generator<Y, FX, any>) => Fx<Effect.Effect.Context<Y["value"]> | Fx.Context<FX>, Effect.Effect.Error<Y["value"]> | Fx.Error<FX>, Fx.Success<FX>>;
1463
+ /**
1464
+ * @since 1.20.0
1465
+ */
1466
+ export declare const genScoped: <Y extends Effect.EffectGen<any, any, any>, FX extends Fx<any, any, any>>(f: (_: Effect.Adapter) => Generator<Y, FX, any>) => Fx<Exclude<Effect.Effect.Context<Y["value"]> | Fx.Context<FX>, Scope.Scope>, Effect.Effect.Error<Y["value"]> | Fx.Error<FX>, Fx.Success<FX>>;
1467
+ /**
1468
+ * @since 1.20.0
1469
+ */
1470
+ export declare const findFirst: {
1471
+ <A, B extends A>(refinement: Predicate.Refinement<A, B>): <R, E>(fx: Fx<R, E, A>) => Effect.Effect<R, E, B>;
1472
+ <A>(predicate: Predicate.Predicate<A>): <R, E>(fx: Fx<R, E, A>) => Effect.Effect<R, E, A>;
1473
+ <R, E, A, B extends A>(fx: Fx<R, E, A>, refinement: Predicate.Refinement<A, B>): Effect.Effect<R, E, B>;
1474
+ <R, E, A>(fx: Fx<R, E, A>, predicate: Predicate.Predicate<A>): Effect.Effect<R, E, A>;
1475
+ };
1476
+ /**
1477
+ * @since 1.20.0
1478
+ */
1479
+ export declare const first: <R, E, A>(fx: Fx<R, E, A>) => Effect.Effect<R, E, A>;
1480
+ /**
1481
+ * @since 1.20.0
1482
+ */
1483
+ export declare const mergeFirst: {
1484
+ <R2, E2, B>(that: Fx<R2, E2, B>): <R, E, A>(fx: Fx<R, E, A>) => Fx<R | R2, E | E2, A | B>;
1485
+ <R, E, A, R2, E2, B>(fx: Fx<R, E, A>, that: Fx<R2, E2, B>): Fx<R | R2, E | E2, A>;
1486
+ };
1487
+ /**
1488
+ * @since 1.20.0
2002
1489
  */
2003
1490
  export declare const mergeRace: {
2004
- <R2, E2, B>(other: Fx<R2, E2, B>): <R, E, A>(fx: Fx<R, E, A>) => Fx<R2 | R, E2 | E, B | A>;
2005
- <R, E, A, R2, E2, B>(fx: Fx<R, E, A>, other: Fx<R2, E2, B>): Fx<R | R2, E | E2, A | B>;
1491
+ <R2, E2, B>(that: Fx<R2, E2, B>): <R, E, A>(fx: Fx<R, E, A>) => Fx<R | R2, E | E2, A | B>;
1492
+ <R, E, A, R2, E2, B>(fx: Fx<R, E, A>, that: Fx<R2, E2, B>): Fx<R | R2, E | E2, A | B>;
1493
+ };
1494
+ /**
1495
+ * @since 1.20.0
1496
+ */
1497
+ export declare const raceAll: <const FX extends ReadonlyArray<Fx<any, any, any>>>(fx: FX) => Fx<Fx.Context<FX[number]>, Fx.Error<FX[number]>, Fx.Success<FX[number]>>;
1498
+ /**
1499
+ * @since 1.20.0
1500
+ */
1501
+ export declare const race: {
1502
+ <R2, E2, B>(that: Fx<R2, E2, B>): <R, E, A>(fx: Fx<R, E, A>) => Fx<R | R2, E | E2, A | B>;
1503
+ <R, E, A, R2, E2, B>(fx: Fx<R, E, A>, that: Fx<R2, E2, B>): Fx<R | R2, E | E2, A | B>;
1504
+ };
1505
+ /**
1506
+ * @since 1.20.0
1507
+ */
1508
+ export declare const snapshot: {
1509
+ <R, E, B, A, C>(sampled: Fx<R, E, B>, g: (a: A, b: B) => C): <R2, E2>(fx: Fx<R2, E2, A>) => Fx<R | R2, E | E2, C>;
1510
+ <R, E, A, R2, E2, B, C>(fx: Fx<R, E, A>, sampled: Fx<R2, E2, B>, f: (a: A, b: B) => C): Fx<R | R2, E | E2, C>;
1511
+ };
1512
+ /**
1513
+ * @since 1.20.0
1514
+ */
1515
+ export declare const sample: {
1516
+ <R, E, B>(sampled: Fx<R, E, B>): <R2, E2, A>(fx: Fx<R2, E2, A>) => Fx<R | R2, E | E2, B>;
1517
+ <R, E, A, R2, E2, B>(fx: Fx<R, E, A>, sampled: Fx<R2, E2, B>): Fx<R | R2, E | E2, B>;
1518
+ };
1519
+ /**
1520
+ * @since 1.20.0
1521
+ */
1522
+ export declare const snapshotEffect: {
1523
+ <R2, E2, B, A, R3, E3, C>(sampled: Fx<R2, E2, B>, g: (a: A, b: B) => Effect.Effect<R3, E3, C>): <R, E>(fx: Fx<R, E, A>) => Fx<R | R2 | R3, E | E2 | E3, C>;
1524
+ <R, E, A, R2, E2, B, R3, E3, C>(fx: Fx<R, E, A>, sampled: Fx<R2, E2, B>, f: (a: A, b: B) => Effect.Effect<R3, E3, C>): Fx<R | R2 | R3, E | E2 | E3, C>;
1525
+ };
1526
+ declare const if_: {
1527
+ <R2, E2, B, R3, E3, C>(options: {
1528
+ readonly onTrue: Fx<R2, E2, B>;
1529
+ readonly onFalse: Fx<R3, E3, C>;
1530
+ }): <R, E>(bool: Fx<R, E, boolean>) => Fx<R | R2 | R3 | Scope.Scope, E | E2 | E3, B | C>;
1531
+ <R, E, R2, E2, B, R3, E3, C>(bool: Fx<R, E, boolean>, options: {
1532
+ readonly onTrue: Fx<R2, E2, B>;
1533
+ readonly onFalse: Fx<R3, E3, C>;
1534
+ }): Fx<R | R2 | R3 | Scope.Scope, E | E2 | E3, B | C>;
1535
+ };
1536
+ export {
1537
+ /**
1538
+ * @since 1.20.0
1539
+ */
1540
+ if_ as if };
1541
+ /**
1542
+ * @since 1.20.0
1543
+ */
1544
+ export declare const when: {
1545
+ <B, C>(options: {
1546
+ readonly onTrue: B;
1547
+ readonly onFalse: C;
1548
+ }): <R, E>(bool: Fx<R, E, boolean>) => Fx<R | Scope.Scope, E, B | C>;
1549
+ <R, E, B, C>(bool: Fx<R, E, boolean>, options: {
1550
+ readonly onTrue: B;
1551
+ readonly onFalse: C;
1552
+ }): Fx<R | Scope.Scope, E, B | C>;
2006
1553
  };
2007
1554
  /**
1555
+ * @since 1.20.0
1556
+ */
1557
+ export declare const withEmitter: <E, A, R = never>(f: (emitter: Emitter.Emitter<E, A>) => Effect.Effect<R, E, unknown>) => Fx<Scope.Scope | R, E, A>;
1558
+ /**
1559
+ * Create an Fx which will wait a specified duration of time where no
1560
+ * events have occurred before emitting a value.
2008
1561
  * @since 1.18.0
2009
1562
  */
2010
- export declare abstract class FxEffectBase<R, E, A, R2, E2, B> extends internalProtos.FxEffectBase<R, E, A, R2, E2, B> implements Fx<R, E, A>, Effect.Effect<R2, E2, B> {
2011
- protected abstract toFx(): Fx<R, E, A>;
2012
- protected abstract toEffect(): Effect.Effect<R2, E2, B>;
1563
+ export declare const delay: {
1564
+ (delay: DurationInput): <R, E, A>(fx: Fx<R, E, A>) => Fx<R | Scope.Scope, E, A>;
1565
+ <R, E, A>(fx: Fx<R, E, A>, delay: DurationInput): Fx<R | Scope.Scope, E, A>;
1566
+ };
1567
+ /**
1568
+ * @since 1.20.0
1569
+ */
1570
+ export declare const ensuring: {
1571
+ <R2>(finalizer: Effect.Effect<R2, never, unknown>): <R, E, A>(self: Fx<R, E, A>) => Fx<R | R2, E, A>;
1572
+ <R, E, A, R2>(self: Fx<R, E, A>, finalizer: Effect.Effect<R2, never, unknown>): Fx<R | R2, E, A>;
1573
+ };
1574
+ /**
1575
+ * @since 1.20.0
1576
+ */
1577
+ export declare const flip: <R, E, A>(fx: Fx<R, E, A>) => Fx<R, A, E>;
1578
+ /**
1579
+ * @since 1.20.0
1580
+ */
1581
+ export declare const fromNullable: <A>(value: void | A | null | undefined) => Fx<never, never, NonNullable<A>>;
1582
+ /**
1583
+ * @since 1.20.0
1584
+ */
1585
+ export declare function fromDequeue<A>(dequeue: Queue.Dequeue<A>): Fx<never, never, A>;
1586
+ export declare function fromDequeue<I, A>(dequeue: Ctx.Dequeue<I, A>): Fx<I, never, A>;
1587
+ /**
1588
+ * @since 1.20.0
1589
+ */
1590
+ export declare function fromPubSub<A>(pubSub: PubSub.PubSub<A>): Fx<Scope.Scope, never, A>;
1591
+ export declare function fromPubSub<I, A>(pubSub: Ctx.PubSub<I, A>): Fx<I | Scope.Scope, never, A>;
1592
+ /**
1593
+ * @since 1.20.0
1594
+ */
1595
+ export declare abstract class FxEffectBase<R, E, A, R2, E2, B> extends protos.FxEffectBase<R, E, A, R2, E2, B> {
1596
+ private _fx;
1597
+ /**
1598
+ * @since 1.20.0
1599
+ */
1600
+ run<R3>(sink: Sink.Sink<R3, E, A>): Effect.Effect<R | R3, never, void>;
1601
+ /**
1602
+ * @since 1.20.0
1603
+ */
1604
+ abstract toFx(): Fx<R, E, A>;
1605
+ /**
1606
+ * @since 1.20.0
1607
+ */
1608
+ abstract toEffect(): Effect.Effect<R2, E2, B>;
2013
1609
  }
2014
1610
  //# sourceMappingURL=Fx.d.ts.map