effect 4.0.0-beta.65 → 4.0.0-beta.67

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 (1657) hide show
  1. package/dist/Array.d.ts +113 -67
  2. package/dist/Array.d.ts.map +1 -1
  3. package/dist/Array.js +28 -18
  4. package/dist/Array.js.map +1 -1
  5. package/dist/BigDecimal.d.ts +404 -337
  6. package/dist/BigDecimal.d.ts.map +1 -1
  7. package/dist/BigDecimal.js +190 -146
  8. package/dist/BigDecimal.js.map +1 -1
  9. package/dist/BigInt.d.ts +167 -97
  10. package/dist/BigInt.d.ts.map +1 -1
  11. package/dist/BigInt.js +87 -47
  12. package/dist/BigInt.js.map +1 -1
  13. package/dist/Boolean.d.ts +62 -31
  14. package/dist/Boolean.d.ts.map +1 -1
  15. package/dist/Boolean.js +30 -15
  16. package/dist/Boolean.js.map +1 -1
  17. package/dist/Brand.d.ts +20 -1
  18. package/dist/Brand.d.ts.map +1 -1
  19. package/dist/Brand.js +16 -0
  20. package/dist/Brand.js.map +1 -1
  21. package/dist/Cache.d.ts +236 -132
  22. package/dist/Cache.d.ts.map +1 -1
  23. package/dist/Cache.js +133 -57
  24. package/dist/Cache.js.map +1 -1
  25. package/dist/Cause.d.ts +77 -65
  26. package/dist/Cause.d.ts.map +1 -1
  27. package/dist/Cause.js +43 -36
  28. package/dist/Cause.js.map +1 -1
  29. package/dist/Channel.d.ts +1518 -575
  30. package/dist/Channel.d.ts.map +1 -1
  31. package/dist/Channel.js +661 -287
  32. package/dist/Channel.js.map +1 -1
  33. package/dist/ChannelSchema.d.ts +119 -10
  34. package/dist/ChannelSchema.d.ts.map +1 -1
  35. package/dist/ChannelSchema.js +45 -6
  36. package/dist/ChannelSchema.js.map +1 -1
  37. package/dist/Chunk.d.ts +548 -379
  38. package/dist/Chunk.d.ts.map +1 -1
  39. package/dist/Chunk.js +238 -170
  40. package/dist/Chunk.js.map +1 -1
  41. package/dist/Clock.d.ts +15 -8
  42. package/dist/Clock.d.ts.map +1 -1
  43. package/dist/Clock.js +8 -4
  44. package/dist/Clock.js.map +1 -1
  45. package/dist/Combiner.d.ts +2 -4
  46. package/dist/Combiner.d.ts.map +1 -1
  47. package/dist/Combiner.js +2 -4
  48. package/dist/Combiner.js.map +1 -1
  49. package/dist/Config.d.ts +5 -4
  50. package/dist/Config.d.ts.map +1 -1
  51. package/dist/Config.js +9 -8
  52. package/dist/Config.js.map +1 -1
  53. package/dist/ConfigProvider.d.ts +1 -1
  54. package/dist/ConfigProvider.js +1 -1
  55. package/dist/Console.d.ts +76 -50
  56. package/dist/Console.d.ts.map +1 -1
  57. package/dist/Console.js +69 -46
  58. package/dist/Console.js.map +1 -1
  59. package/dist/Context.d.ts +386 -138
  60. package/dist/Context.d.ts.map +1 -1
  61. package/dist/Context.js +144 -62
  62. package/dist/Context.js.map +1 -1
  63. package/dist/Cron.d.ts +69 -48
  64. package/dist/Cron.d.ts.map +1 -1
  65. package/dist/Cron.js +96 -36
  66. package/dist/Cron.js.map +1 -1
  67. package/dist/Data.d.ts +3 -2
  68. package/dist/Data.d.ts.map +1 -1
  69. package/dist/Data.js.map +1 -1
  70. package/dist/DateTime.d.ts +875 -444
  71. package/dist/DateTime.d.ts.map +1 -1
  72. package/dist/DateTime.js +376 -217
  73. package/dist/DateTime.js.map +1 -1
  74. package/dist/Deferred.d.ts +367 -174
  75. package/dist/Deferred.d.ts.map +1 -1
  76. package/dist/Deferred.js +145 -71
  77. package/dist/Deferred.js.map +1 -1
  78. package/dist/Differ.d.ts +42 -0
  79. package/dist/Differ.d.ts.map +1 -1
  80. package/dist/Differ.js +36 -0
  81. package/dist/Duration.d.ts +329 -185
  82. package/dist/Duration.d.ts.map +1 -1
  83. package/dist/Duration.js +174 -106
  84. package/dist/Duration.js.map +1 -1
  85. package/dist/Effect.d.ts +2445 -2356
  86. package/dist/Effect.d.ts.map +1 -1
  87. package/dist/Effect.js +906 -758
  88. package/dist/Effect.js.map +1 -1
  89. package/dist/Effectable.d.ts +38 -3
  90. package/dist/Effectable.d.ts.map +1 -1
  91. package/dist/Effectable.js +3 -3
  92. package/dist/Effectable.js.map +1 -1
  93. package/dist/Encoding.d.ts +78 -28
  94. package/dist/Encoding.d.ts.map +1 -1
  95. package/dist/Encoding.js +75 -27
  96. package/dist/Encoding.js.map +1 -1
  97. package/dist/Equivalence.d.ts +14 -19
  98. package/dist/Equivalence.d.ts.map +1 -1
  99. package/dist/Equivalence.js +14 -19
  100. package/dist/Equivalence.js.map +1 -1
  101. package/dist/ErrorReporter.d.ts +66 -82
  102. package/dist/ErrorReporter.d.ts.map +1 -1
  103. package/dist/ErrorReporter.js +38 -29
  104. package/dist/ErrorReporter.js.map +1 -1
  105. package/dist/ExecutionPlan.d.ts +96 -12
  106. package/dist/ExecutionPlan.d.ts.map +1 -1
  107. package/dist/ExecutionPlan.js +21 -6
  108. package/dist/ExecutionPlan.js.map +1 -1
  109. package/dist/Exit.d.ts +7 -5
  110. package/dist/Exit.d.ts.map +1 -1
  111. package/dist/Exit.js.map +1 -1
  112. package/dist/Fiber.d.ts +72 -40
  113. package/dist/Fiber.d.ts.map +1 -1
  114. package/dist/Fiber.js +39 -21
  115. package/dist/Fiber.js.map +1 -1
  116. package/dist/FiberHandle.d.ts +119 -58
  117. package/dist/FiberHandle.d.ts.map +1 -1
  118. package/dist/FiberHandle.js +122 -40
  119. package/dist/FiberHandle.js.map +1 -1
  120. package/dist/FiberMap.d.ts +288 -160
  121. package/dist/FiberMap.d.ts.map +1 -1
  122. package/dist/FiberMap.js +176 -74
  123. package/dist/FiberMap.js.map +1 -1
  124. package/dist/FiberSet.d.ts +93 -52
  125. package/dist/FiberSet.d.ts.map +1 -1
  126. package/dist/FiberSet.js +97 -34
  127. package/dist/FiberSet.js.map +1 -1
  128. package/dist/FileSystem.d.ts +104 -73
  129. package/dist/FileSystem.d.ts.map +1 -1
  130. package/dist/FileSystem.js +53 -39
  131. package/dist/FileSystem.js.map +1 -1
  132. package/dist/Filter.d.ts +166 -88
  133. package/dist/Filter.d.ts.map +1 -1
  134. package/dist/Filter.js +68 -42
  135. package/dist/Filter.js.map +1 -1
  136. package/dist/Function.d.ts +154 -86
  137. package/dist/Function.d.ts.map +1 -1
  138. package/dist/Function.js +53 -37
  139. package/dist/Function.js.map +1 -1
  140. package/dist/Graph.d.ts +682 -365
  141. package/dist/Graph.d.ts.map +1 -1
  142. package/dist/Graph.js +308 -157
  143. package/dist/Graph.js.map +1 -1
  144. package/dist/HKT.d.ts +29 -13
  145. package/dist/HKT.d.ts.map +1 -1
  146. package/dist/Hash.d.ts +31 -18
  147. package/dist/Hash.d.ts.map +1 -1
  148. package/dist/Hash.js +25 -15
  149. package/dist/Hash.js.map +1 -1
  150. package/dist/HashMap.d.ts +444 -256
  151. package/dist/HashMap.d.ts.map +1 -1
  152. package/dist/HashMap.js +223 -105
  153. package/dist/HashMap.js.map +1 -1
  154. package/dist/HashRing.d.ts +36 -17
  155. package/dist/HashRing.d.ts.map +1 -1
  156. package/dist/HashRing.js +75 -8
  157. package/dist/HashRing.js.map +1 -1
  158. package/dist/HashSet.d.ts +194 -104
  159. package/dist/HashSet.d.ts.map +1 -1
  160. package/dist/HashSet.js +93 -38
  161. package/dist/HashSet.js.map +1 -1
  162. package/dist/Inspectable.d.ts +20 -9
  163. package/dist/Inspectable.d.ts.map +1 -1
  164. package/dist/Inspectable.js +16 -6
  165. package/dist/Inspectable.js.map +1 -1
  166. package/dist/Iterable.d.ts +309 -149
  167. package/dist/Iterable.d.ts.map +1 -1
  168. package/dist/Iterable.js +129 -65
  169. package/dist/Iterable.js.map +1 -1
  170. package/dist/JsonPatch.d.ts +4 -3
  171. package/dist/JsonPatch.d.ts.map +1 -1
  172. package/dist/JsonPatch.js +4 -3
  173. package/dist/JsonPatch.js.map +1 -1
  174. package/dist/Latch.d.ts +98 -15
  175. package/dist/Latch.d.ts.map +1 -1
  176. package/dist/Latch.js +41 -10
  177. package/dist/Latch.js.map +1 -1
  178. package/dist/Layer.d.ts +412 -309
  179. package/dist/Layer.d.ts.map +1 -1
  180. package/dist/Layer.js +262 -181
  181. package/dist/Layer.js.map +1 -1
  182. package/dist/LayerMap.d.ts +95 -21
  183. package/dist/LayerMap.d.ts.map +1 -1
  184. package/dist/LayerMap.js +58 -14
  185. package/dist/LayerMap.js.map +1 -1
  186. package/dist/LogLevel.d.ts +92 -131
  187. package/dist/LogLevel.d.ts.map +1 -1
  188. package/dist/LogLevel.js +25 -15
  189. package/dist/LogLevel.js.map +1 -1
  190. package/dist/Logger.d.ts +155 -99
  191. package/dist/Logger.d.ts.map +1 -1
  192. package/dist/Logger.js +211 -184
  193. package/dist/Logger.js.map +1 -1
  194. package/dist/ManagedRuntime.d.ts +75 -17
  195. package/dist/ManagedRuntime.d.ts.map +1 -1
  196. package/dist/ManagedRuntime.js +22 -16
  197. package/dist/ManagedRuntime.js.map +1 -1
  198. package/dist/Match.d.ts +133 -157
  199. package/dist/Match.d.ts.map +1 -1
  200. package/dist/Match.js +85 -76
  201. package/dist/Match.js.map +1 -1
  202. package/dist/Metric.d.ts +325 -284
  203. package/dist/Metric.d.ts.map +1 -1
  204. package/dist/Metric.js +217 -212
  205. package/dist/Metric.js.map +1 -1
  206. package/dist/MutableHashMap.d.ts +117 -58
  207. package/dist/MutableHashMap.d.ts.map +1 -1
  208. package/dist/MutableHashMap.js +52 -29
  209. package/dist/MutableHashMap.js.map +1 -1
  210. package/dist/MutableHashSet.d.ts +52 -30
  211. package/dist/MutableHashSet.d.ts.map +1 -1
  212. package/dist/MutableHashSet.js +94 -38
  213. package/dist/MutableHashSet.js.map +1 -1
  214. package/dist/MutableList.d.ts +92 -49
  215. package/dist/MutableList.d.ts.map +1 -1
  216. package/dist/MutableList.js +123 -71
  217. package/dist/MutableList.js.map +1 -1
  218. package/dist/MutableRef.d.ts +99 -62
  219. package/dist/MutableRef.d.ts.map +1 -1
  220. package/dist/MutableRef.js +79 -60
  221. package/dist/MutableRef.js.map +1 -1
  222. package/dist/Newtype.d.ts +3 -0
  223. package/dist/Newtype.d.ts.map +1 -1
  224. package/dist/Newtype.js.map +1 -1
  225. package/dist/NonEmptyIterable.d.ts +36 -39
  226. package/dist/NonEmptyIterable.d.ts.map +1 -1
  227. package/dist/NonEmptyIterable.js +34 -20
  228. package/dist/NonEmptyIterable.js.map +1 -1
  229. package/dist/Number.d.ts +116 -64
  230. package/dist/Number.d.ts.map +1 -1
  231. package/dist/Number.js +54 -30
  232. package/dist/Number.js.map +1 -1
  233. package/dist/Optic.d.ts +1 -2
  234. package/dist/Optic.d.ts.map +1 -1
  235. package/dist/Optic.js +0 -1
  236. package/dist/Optic.js.map +1 -1
  237. package/dist/Option.d.ts +38 -53
  238. package/dist/Option.d.ts.map +1 -1
  239. package/dist/Option.js +87 -11
  240. package/dist/Option.js.map +1 -1
  241. package/dist/Ordering.d.ts +43 -28
  242. package/dist/Ordering.d.ts.map +1 -1
  243. package/dist/Ordering.js +4 -2
  244. package/dist/Ordering.js.map +1 -1
  245. package/dist/PartitionedSemaphore.d.ts +225 -40
  246. package/dist/PartitionedSemaphore.d.ts.map +1 -1
  247. package/dist/PartitionedSemaphore.js +113 -17
  248. package/dist/PartitionedSemaphore.js.map +1 -1
  249. package/dist/Path.d.ts +77 -13
  250. package/dist/Path.d.ts.map +1 -1
  251. package/dist/Path.js +48 -4
  252. package/dist/Path.js.map +1 -1
  253. package/dist/Pipeable.d.ts +71 -15
  254. package/dist/Pipeable.d.ts.map +1 -1
  255. package/dist/Pipeable.js +59 -12
  256. package/dist/Pipeable.js.map +1 -1
  257. package/dist/PlatformError.d.ts +74 -6
  258. package/dist/PlatformError.d.ts.map +1 -1
  259. package/dist/PlatformError.js +68 -5
  260. package/dist/PlatformError.js.map +1 -1
  261. package/dist/Pool.d.ts +66 -31
  262. package/dist/Pool.d.ts.map +1 -1
  263. package/dist/Pool.js +26 -24
  264. package/dist/Pool.js.map +1 -1
  265. package/dist/Predicate.d.ts +16 -21
  266. package/dist/Predicate.d.ts.map +1 -1
  267. package/dist/Predicate.js +9 -14
  268. package/dist/Predicate.js.map +1 -1
  269. package/dist/PrimaryKey.d.ts +9 -2
  270. package/dist/PrimaryKey.d.ts.map +1 -1
  271. package/dist/PrimaryKey.js +7 -1
  272. package/dist/PrimaryKey.js.map +1 -1
  273. package/dist/PubSub.d.ts +364 -262
  274. package/dist/PubSub.d.ts.map +1 -1
  275. package/dist/PubSub.js +245 -174
  276. package/dist/PubSub.js.map +1 -1
  277. package/dist/Pull.d.ts +94 -25
  278. package/dist/Pull.d.ts.map +1 -1
  279. package/dist/Pull.js +61 -13
  280. package/dist/Pull.js.map +1 -1
  281. package/dist/Queue.d.ts +284 -150
  282. package/dist/Queue.d.ts.map +1 -1
  283. package/dist/Queue.js +216 -113
  284. package/dist/Queue.js.map +1 -1
  285. package/dist/Random.d.ts +54 -35
  286. package/dist/Random.d.ts.map +1 -1
  287. package/dist/Random.js +36 -24
  288. package/dist/Random.js.map +1 -1
  289. package/dist/RcMap.d.ts +151 -141
  290. package/dist/RcMap.d.ts.map +1 -1
  291. package/dist/RcMap.js +66 -20
  292. package/dist/RcMap.js.map +1 -1
  293. package/dist/RcRef.d.ts +69 -32
  294. package/dist/RcRef.d.ts.map +1 -1
  295. package/dist/RcRef.js +33 -16
  296. package/dist/RcRef.js.map +1 -1
  297. package/dist/Record.d.ts +273 -129
  298. package/dist/Record.d.ts.map +1 -1
  299. package/dist/Record.js +117 -57
  300. package/dist/Record.js.map +1 -1
  301. package/dist/Redactable.d.ts +3 -3
  302. package/dist/Redactable.js +2 -2
  303. package/dist/Redacted.d.ts +63 -33
  304. package/dist/Redacted.d.ts.map +1 -1
  305. package/dist/Redacted.js +30 -14
  306. package/dist/Redacted.js.map +1 -1
  307. package/dist/Ref.d.ts +81 -52
  308. package/dist/Ref.d.ts.map +1 -1
  309. package/dist/Ref.js +54 -35
  310. package/dist/Ref.js.map +1 -1
  311. package/dist/References.d.ts +73 -31
  312. package/dist/References.d.ts.map +1 -1
  313. package/dist/References.js +66 -30
  314. package/dist/References.js.map +1 -1
  315. package/dist/RegExp.d.ts +11 -5
  316. package/dist/RegExp.d.ts.map +1 -1
  317. package/dist/RegExp.js +11 -5
  318. package/dist/RegExp.js.map +1 -1
  319. package/dist/Request.d.ts +158 -34
  320. package/dist/Request.d.ts.map +1 -1
  321. package/dist/Request.js +67 -12
  322. package/dist/Request.js.map +1 -1
  323. package/dist/RequestResolver.d.ts +261 -116
  324. package/dist/RequestResolver.d.ts.map +1 -1
  325. package/dist/RequestResolver.js +77 -41
  326. package/dist/RequestResolver.js.map +1 -1
  327. package/dist/Resource.d.ts +13 -7
  328. package/dist/Resource.d.ts.map +1 -1
  329. package/dist/Resource.js +44 -6
  330. package/dist/Resource.js.map +1 -1
  331. package/dist/Result.d.ts +26 -16
  332. package/dist/Result.d.ts.map +1 -1
  333. package/dist/Result.js +6 -6
  334. package/dist/Result.js.map +1 -1
  335. package/dist/Runtime.d.ts +43 -18
  336. package/dist/Runtime.d.ts.map +1 -1
  337. package/dist/Runtime.js +35 -16
  338. package/dist/Runtime.js.map +1 -1
  339. package/dist/Schedule.d.ts +545 -576
  340. package/dist/Schedule.d.ts.map +1 -1
  341. package/dist/Schedule.js +261 -247
  342. package/dist/Schedule.js.map +1 -1
  343. package/dist/Scheduler.d.ts +43 -6
  344. package/dist/Scheduler.d.ts.map +1 -1
  345. package/dist/Scheduler.js +33 -4
  346. package/dist/Scheduler.js.map +1 -1
  347. package/dist/Schema.d.ts +815 -294
  348. package/dist/Schema.d.ts.map +1 -1
  349. package/dist/Schema.js +287 -193
  350. package/dist/Schema.js.map +1 -1
  351. package/dist/SchemaAST.d.ts +24 -15
  352. package/dist/SchemaAST.d.ts.map +1 -1
  353. package/dist/SchemaAST.js +13 -9
  354. package/dist/SchemaAST.js.map +1 -1
  355. package/dist/SchemaGetter.d.ts +26 -13
  356. package/dist/SchemaGetter.d.ts.map +1 -1
  357. package/dist/SchemaGetter.js +24 -11
  358. package/dist/SchemaGetter.js.map +1 -1
  359. package/dist/SchemaIssue.d.ts +1 -8
  360. package/dist/SchemaIssue.d.ts.map +1 -1
  361. package/dist/SchemaIssue.js.map +1 -1
  362. package/dist/SchemaParser.d.ts +194 -25
  363. package/dist/SchemaParser.d.ts.map +1 -1
  364. package/dist/SchemaParser.js +220 -26
  365. package/dist/SchemaParser.js.map +1 -1
  366. package/dist/SchemaRepresentation.d.ts +2 -2
  367. package/dist/SchemaTransformation.d.ts +61 -41
  368. package/dist/SchemaTransformation.d.ts.map +1 -1
  369. package/dist/SchemaTransformation.js +56 -33
  370. package/dist/SchemaTransformation.js.map +1 -1
  371. package/dist/SchemaUtils.d.ts +7 -0
  372. package/dist/SchemaUtils.d.ts.map +1 -1
  373. package/dist/SchemaUtils.js +23 -0
  374. package/dist/SchemaUtils.js.map +1 -1
  375. package/dist/Scope.d.ts +102 -43
  376. package/dist/Scope.d.ts.map +1 -1
  377. package/dist/Scope.js +57 -23
  378. package/dist/Scope.js.map +1 -1
  379. package/dist/ScopedCache.d.ts +138 -46
  380. package/dist/ScopedCache.d.ts.map +1 -1
  381. package/dist/ScopedCache.js +80 -19
  382. package/dist/ScopedCache.js.map +1 -1
  383. package/dist/ScopedRef.d.ts +28 -8
  384. package/dist/ScopedRef.d.ts.map +1 -1
  385. package/dist/ScopedRef.js +25 -5
  386. package/dist/ScopedRef.js.map +1 -1
  387. package/dist/Semaphore.d.ts +64 -28
  388. package/dist/Semaphore.d.ts.map +1 -1
  389. package/dist/Semaphore.js +22 -13
  390. package/dist/Semaphore.js.map +1 -1
  391. package/dist/Sink.d.ts +458 -200
  392. package/dist/Sink.d.ts.map +1 -1
  393. package/dist/Sink.js +240 -89
  394. package/dist/Sink.js.map +1 -1
  395. package/dist/Stdio.d.ts +43 -6
  396. package/dist/Stdio.d.ts.map +1 -1
  397. package/dist/Stdio.js +33 -4
  398. package/dist/Stdio.js.map +1 -1
  399. package/dist/Stream.d.ts +1899 -1186
  400. package/dist/Stream.d.ts.map +1 -1
  401. package/dist/Stream.js +868 -525
  402. package/dist/Stream.js.map +1 -1
  403. package/dist/String.d.ts +171 -95
  404. package/dist/String.d.ts.map +1 -1
  405. package/dist/String.js +125 -67
  406. package/dist/String.js.map +1 -1
  407. package/dist/SubscriptionRef.d.ts +308 -203
  408. package/dist/SubscriptionRef.d.ts.map +1 -1
  409. package/dist/SubscriptionRef.js +125 -76
  410. package/dist/SubscriptionRef.js.map +1 -1
  411. package/dist/Symbol.d.ts +13 -5
  412. package/dist/Symbol.d.ts.map +1 -1
  413. package/dist/Symbol.js +13 -5
  414. package/dist/Symbol.js.map +1 -1
  415. package/dist/SynchronizedRef.d.ts +278 -62
  416. package/dist/SynchronizedRef.d.ts.map +1 -1
  417. package/dist/SynchronizedRef.js +116 -23
  418. package/dist/SynchronizedRef.js.map +1 -1
  419. package/dist/Take.d.ts +26 -2
  420. package/dist/Take.d.ts.map +1 -1
  421. package/dist/Take.js +4 -1
  422. package/dist/Take.js.map +1 -1
  423. package/dist/Terminal.d.ts +39 -7
  424. package/dist/Terminal.d.ts.map +1 -1
  425. package/dist/Terminal.js +10 -4
  426. package/dist/Terminal.js.map +1 -1
  427. package/dist/Tracer.d.ts +229 -55
  428. package/dist/Tracer.d.ts.map +1 -1
  429. package/dist/Tracer.js +94 -18
  430. package/dist/Tracer.js.map +1 -1
  431. package/dist/Trie.d.ts +213 -142
  432. package/dist/Trie.d.ts.map +1 -1
  433. package/dist/Trie.js +88 -60
  434. package/dist/Trie.js.map +1 -1
  435. package/dist/TxChunk.d.ts +182 -146
  436. package/dist/TxChunk.d.ts.map +1 -1
  437. package/dist/TxChunk.js +73 -56
  438. package/dist/TxChunk.js.map +1 -1
  439. package/dist/TxDeferred.d.ts +43 -29
  440. package/dist/TxDeferred.d.ts.map +1 -1
  441. package/dist/TxDeferred.js +22 -15
  442. package/dist/TxDeferred.js.map +1 -1
  443. package/dist/TxHashMap.d.ts +362 -222
  444. package/dist/TxHashMap.d.ts.map +1 -1
  445. package/dist/TxHashMap.js +171 -98
  446. package/dist/TxHashMap.js.map +1 -1
  447. package/dist/TxHashSet.d.ts +178 -104
  448. package/dist/TxHashSet.d.ts.map +1 -1
  449. package/dist/TxHashSet.js +84 -43
  450. package/dist/TxHashSet.js.map +1 -1
  451. package/dist/TxPriorityQueue.d.ts +93 -62
  452. package/dist/TxPriorityQueue.d.ts.map +1 -1
  453. package/dist/TxPriorityQueue.js +54 -36
  454. package/dist/TxPriorityQueue.js.map +1 -1
  455. package/dist/TxPubSub.d.ts +77 -49
  456. package/dist/TxPubSub.d.ts.map +1 -1
  457. package/dist/TxPubSub.js +60 -37
  458. package/dist/TxPubSub.js.map +1 -1
  459. package/dist/TxQueue.d.ts +279 -241
  460. package/dist/TxQueue.d.ts.map +1 -1
  461. package/dist/TxQueue.js +147 -101
  462. package/dist/TxQueue.js.map +1 -1
  463. package/dist/TxReentrantLock.d.ts +69 -46
  464. package/dist/TxReentrantLock.d.ts.map +1 -1
  465. package/dist/TxReentrantLock.js +48 -32
  466. package/dist/TxReentrantLock.js.map +1 -1
  467. package/dist/TxRef.d.ts +69 -40
  468. package/dist/TxRef.d.ts.map +1 -1
  469. package/dist/TxRef.js +35 -20
  470. package/dist/TxRef.js.map +1 -1
  471. package/dist/TxSemaphore.d.ts +101 -54
  472. package/dist/TxSemaphore.d.ts.map +1 -1
  473. package/dist/TxSemaphore.js +76 -34
  474. package/dist/TxSemaphore.js.map +1 -1
  475. package/dist/TxSubscriptionRef.d.ts +72 -48
  476. package/dist/TxSubscriptionRef.d.ts.map +1 -1
  477. package/dist/TxSubscriptionRef.js +33 -22
  478. package/dist/TxSubscriptionRef.js.map +1 -1
  479. package/dist/Types.d.ts +34 -34
  480. package/dist/UndefinedOr.d.ts +48 -25
  481. package/dist/UndefinedOr.d.ts.map +1 -1
  482. package/dist/UndefinedOr.js +28 -25
  483. package/dist/UndefinedOr.js.map +1 -1
  484. package/dist/Unify.d.ts +71 -116
  485. package/dist/Unify.d.ts.map +1 -1
  486. package/dist/Unify.js +20 -6
  487. package/dist/Unify.js.map +1 -1
  488. package/dist/Utils.d.ts +4 -0
  489. package/dist/Utils.d.ts.map +1 -1
  490. package/dist/Utils.js +4 -0
  491. package/dist/Utils.js.map +1 -1
  492. package/dist/index.d.ts +81 -32
  493. package/dist/index.d.ts.map +1 -1
  494. package/dist/index.js +81 -32
  495. package/dist/index.js.map +1 -1
  496. package/dist/internal/concurrency.js +2 -2
  497. package/dist/internal/concurrency.js.map +1 -1
  498. package/dist/internal/core.js +8 -20
  499. package/dist/internal/core.js.map +1 -1
  500. package/dist/internal/effect.js +20 -19
  501. package/dist/internal/effect.js.map +1 -1
  502. package/dist/internal/executionPlan.js +2 -2
  503. package/dist/internal/executionPlan.js.map +1 -1
  504. package/dist/internal/option.js +5 -8
  505. package/dist/internal/option.js.map +1 -1
  506. package/dist/internal/result.js +5 -8
  507. package/dist/internal/result.js.map +1 -1
  508. package/dist/internal/schema/schema.js +1 -1
  509. package/dist/internal/schema/schema.js.map +1 -1
  510. package/dist/testing/FastCheck.d.ts +6 -3
  511. package/dist/testing/FastCheck.d.ts.map +1 -1
  512. package/dist/testing/FastCheck.js +6 -3
  513. package/dist/testing/FastCheck.js.map +1 -1
  514. package/dist/testing/TestClock.d.ts +39 -34
  515. package/dist/testing/TestClock.d.ts.map +1 -1
  516. package/dist/testing/TestClock.js +42 -12
  517. package/dist/testing/TestClock.js.map +1 -1
  518. package/dist/testing/TestConsole.d.ts +39 -30
  519. package/dist/testing/TestConsole.d.ts.map +1 -1
  520. package/dist/testing/TestConsole.js +25 -10
  521. package/dist/testing/TestConsole.js.map +1 -1
  522. package/dist/testing/TestSchema.js +7 -7
  523. package/dist/testing/TestSchema.js.map +1 -1
  524. package/dist/unstable/ai/AiError.d.ts +197 -130
  525. package/dist/unstable/ai/AiError.d.ts.map +1 -1
  526. package/dist/unstable/ai/AiError.js +166 -102
  527. package/dist/unstable/ai/AiError.js.map +1 -1
  528. package/dist/unstable/ai/AnthropicStructuredOutput.d.ts +1 -1
  529. package/dist/unstable/ai/AnthropicStructuredOutput.js +2 -2
  530. package/dist/unstable/ai/Chat.d.ts +65 -41
  531. package/dist/unstable/ai/Chat.d.ts.map +1 -1
  532. package/dist/unstable/ai/Chat.js +51 -33
  533. package/dist/unstable/ai/Chat.js.map +1 -1
  534. package/dist/unstable/ai/EmbeddingModel.d.ts +12 -11
  535. package/dist/unstable/ai/EmbeddingModel.d.ts.map +1 -1
  536. package/dist/unstable/ai/EmbeddingModel.js +9 -8
  537. package/dist/unstable/ai/EmbeddingModel.js.map +1 -1
  538. package/dist/unstable/ai/IdGenerator.d.ts +28 -18
  539. package/dist/unstable/ai/IdGenerator.d.ts.map +1 -1
  540. package/dist/unstable/ai/IdGenerator.js +18 -11
  541. package/dist/unstable/ai/IdGenerator.js.map +1 -1
  542. package/dist/unstable/ai/LanguageModel.d.ts +36 -30
  543. package/dist/unstable/ai/LanguageModel.d.ts.map +1 -1
  544. package/dist/unstable/ai/LanguageModel.js +21 -15
  545. package/dist/unstable/ai/LanguageModel.js.map +1 -1
  546. package/dist/unstable/ai/McpSchema.d.ts +339 -119
  547. package/dist/unstable/ai/McpSchema.d.ts.map +1 -1
  548. package/dist/unstable/ai/McpSchema.js +264 -98
  549. package/dist/unstable/ai/McpSchema.js.map +1 -1
  550. package/dist/unstable/ai/McpServer.d.ts +53 -19
  551. package/dist/unstable/ai/McpServer.d.ts.map +1 -1
  552. package/dist/unstable/ai/McpServer.js +65 -17
  553. package/dist/unstable/ai/McpServer.js.map +1 -1
  554. package/dist/unstable/ai/Model.d.ts +13 -7
  555. package/dist/unstable/ai/Model.d.ts.map +1 -1
  556. package/dist/unstable/ai/Model.js +11 -9
  557. package/dist/unstable/ai/Model.js.map +1 -1
  558. package/dist/unstable/ai/OpenAiStructuredOutput.d.ts +1 -1
  559. package/dist/unstable/ai/OpenAiStructuredOutput.js +2 -2
  560. package/dist/unstable/ai/Prompt.d.ts +194 -168
  561. package/dist/unstable/ai/Prompt.d.ts.map +1 -1
  562. package/dist/unstable/ai/Prompt.js +75 -66
  563. package/dist/unstable/ai/Prompt.js.map +1 -1
  564. package/dist/unstable/ai/Response.d.ts +153 -140
  565. package/dist/unstable/ai/Response.d.ts.map +1 -1
  566. package/dist/unstable/ai/Response.js +43 -48
  567. package/dist/unstable/ai/Response.js.map +1 -1
  568. package/dist/unstable/ai/ResponseIdTracker.d.ts +43 -4
  569. package/dist/unstable/ai/ResponseIdTracker.d.ts.map +1 -1
  570. package/dist/unstable/ai/ResponseIdTracker.js +27 -2
  571. package/dist/unstable/ai/ResponseIdTracker.js.map +1 -1
  572. package/dist/unstable/ai/Telemetry.d.ts +42 -32
  573. package/dist/unstable/ai/Telemetry.d.ts.map +1 -1
  574. package/dist/unstable/ai/Telemetry.js +14 -10
  575. package/dist/unstable/ai/Telemetry.js.map +1 -1
  576. package/dist/unstable/ai/Tokenizer.d.ts +13 -8
  577. package/dist/unstable/ai/Tokenizer.d.ts.map +1 -1
  578. package/dist/unstable/ai/Tokenizer.js +10 -6
  579. package/dist/unstable/ai/Tokenizer.js.map +1 -1
  580. package/dist/unstable/ai/Tool.d.ts +153 -84
  581. package/dist/unstable/ai/Tool.d.ts.map +1 -1
  582. package/dist/unstable/ai/Tool.js +97 -44
  583. package/dist/unstable/ai/Tool.js.map +1 -1
  584. package/dist/unstable/ai/Toolkit.d.ts +33 -42
  585. package/dist/unstable/ai/Toolkit.d.ts.map +1 -1
  586. package/dist/unstable/ai/Toolkit.js +35 -36
  587. package/dist/unstable/ai/Toolkit.js.map +1 -1
  588. package/dist/unstable/ai/index.d.ts +42 -24
  589. package/dist/unstable/ai/index.d.ts.map +1 -1
  590. package/dist/unstable/ai/index.js +42 -24
  591. package/dist/unstable/ai/index.js.map +1 -1
  592. package/dist/unstable/cli/Argument.d.ts +226 -134
  593. package/dist/unstable/cli/Argument.d.ts.map +1 -1
  594. package/dist/unstable/cli/Argument.js +101 -65
  595. package/dist/unstable/cli/Argument.js.map +1 -1
  596. package/dist/unstable/cli/CliError.d.ts +72 -26
  597. package/dist/unstable/cli/CliError.d.ts.map +1 -1
  598. package/dist/unstable/cli/CliError.js +86 -23
  599. package/dist/unstable/cli/CliError.js.map +1 -1
  600. package/dist/unstable/cli/CliOutput.d.ts +43 -13
  601. package/dist/unstable/cli/CliOutput.d.ts.map +1 -1
  602. package/dist/unstable/cli/CliOutput.js +30 -6
  603. package/dist/unstable/cli/CliOutput.js.map +1 -1
  604. package/dist/unstable/cli/Command.d.ts +218 -117
  605. package/dist/unstable/cli/Command.d.ts.map +1 -1
  606. package/dist/unstable/cli/Command.js +45 -31
  607. package/dist/unstable/cli/Command.js.map +1 -1
  608. package/dist/unstable/cli/Completions.d.ts +7 -7
  609. package/dist/unstable/cli/Completions.js +1 -1
  610. package/dist/unstable/cli/Flag.d.ts +235 -142
  611. package/dist/unstable/cli/Flag.d.ts.map +1 -1
  612. package/dist/unstable/cli/Flag.js +111 -71
  613. package/dist/unstable/cli/Flag.js.map +1 -1
  614. package/dist/unstable/cli/GlobalFlag.d.ts +42 -14
  615. package/dist/unstable/cli/GlobalFlag.d.ts.map +1 -1
  616. package/dist/unstable/cli/GlobalFlag.js +30 -7
  617. package/dist/unstable/cli/GlobalFlag.js.map +1 -1
  618. package/dist/unstable/cli/HelpDoc.d.ts +35 -10
  619. package/dist/unstable/cli/HelpDoc.d.ts.map +1 -1
  620. package/dist/unstable/cli/HelpDoc.js +21 -0
  621. package/dist/unstable/cli/Param.d.ts +79 -31
  622. package/dist/unstable/cli/Param.d.ts.map +1 -1
  623. package/dist/unstable/cli/Param.js +161 -99
  624. package/dist/unstable/cli/Param.js.map +1 -1
  625. package/dist/unstable/cli/Primitive.d.ts +79 -42
  626. package/dist/unstable/cli/Primitive.d.ts.map +1 -1
  627. package/dist/unstable/cli/Primitive.js +66 -35
  628. package/dist/unstable/cli/Primitive.js.map +1 -1
  629. package/dist/unstable/cli/Prompt.d.ts +178 -47
  630. package/dist/unstable/cli/Prompt.d.ts.map +1 -1
  631. package/dist/unstable/cli/Prompt.js +111 -31
  632. package/dist/unstable/cli/Prompt.js.map +1 -1
  633. package/dist/unstable/cli/internal/ansi.d.ts.map +1 -1
  634. package/dist/unstable/cli/internal/ansi.js +13 -0
  635. package/dist/unstable/cli/internal/ansi.js.map +1 -1
  636. package/dist/unstable/cli/internal/command.d.ts +7 -7
  637. package/dist/unstable/cli/internal/command.d.ts.map +1 -1
  638. package/dist/unstable/cli/internal/command.js +12 -10
  639. package/dist/unstable/cli/internal/command.js.map +1 -1
  640. package/dist/unstable/cli/internal/config.d.ts +3 -0
  641. package/dist/unstable/cli/internal/config.d.ts.map +1 -1
  642. package/dist/unstable/cli/internal/config.js.map +1 -1
  643. package/dist/unstable/cli/internal/lexer.js.map +1 -1
  644. package/dist/unstable/cluster/ClusterCron.d.ts +35 -1
  645. package/dist/unstable/cluster/ClusterCron.d.ts.map +1 -1
  646. package/dist/unstable/cluster/ClusterCron.js +35 -1
  647. package/dist/unstable/cluster/ClusterCron.js.map +1 -1
  648. package/dist/unstable/cluster/ClusterError.d.ts +56 -7
  649. package/dist/unstable/cluster/ClusterError.d.ts.map +1 -1
  650. package/dist/unstable/cluster/ClusterError.js +56 -7
  651. package/dist/unstable/cluster/ClusterError.js.map +1 -1
  652. package/dist/unstable/cluster/ClusterMetrics.d.ts +39 -5
  653. package/dist/unstable/cluster/ClusterMetrics.d.ts.map +1 -1
  654. package/dist/unstable/cluster/ClusterMetrics.js +39 -5
  655. package/dist/unstable/cluster/ClusterMetrics.js.map +1 -1
  656. package/dist/unstable/cluster/ClusterSchema.d.ts +61 -8
  657. package/dist/unstable/cluster/ClusterSchema.d.ts.map +1 -1
  658. package/dist/unstable/cluster/ClusterSchema.js +61 -8
  659. package/dist/unstable/cluster/ClusterSchema.js.map +1 -1
  660. package/dist/unstable/cluster/ClusterWorkflowEngine.d.ts +14 -2
  661. package/dist/unstable/cluster/ClusterWorkflowEngine.d.ts.map +1 -1
  662. package/dist/unstable/cluster/ClusterWorkflowEngine.js +36 -3
  663. package/dist/unstable/cluster/ClusterWorkflowEngine.js.map +1 -1
  664. package/dist/unstable/cluster/DeliverAt.d.ts +39 -4
  665. package/dist/unstable/cluster/DeliverAt.d.ts.map +1 -1
  666. package/dist/unstable/cluster/DeliverAt.js +11 -3
  667. package/dist/unstable/cluster/DeliverAt.js.map +1 -1
  668. package/dist/unstable/cluster/Entity.d.ts +75 -16
  669. package/dist/unstable/cluster/Entity.d.ts.map +1 -1
  670. package/dist/unstable/cluster/Entity.js +78 -13
  671. package/dist/unstable/cluster/Entity.js.map +1 -1
  672. package/dist/unstable/cluster/EntityAddress.d.ts +30 -2
  673. package/dist/unstable/cluster/EntityAddress.d.ts.map +1 -1
  674. package/dist/unstable/cluster/EntityAddress.js +30 -2
  675. package/dist/unstable/cluster/EntityAddress.js.map +1 -1
  676. package/dist/unstable/cluster/EntityId.d.ts +18 -3
  677. package/dist/unstable/cluster/EntityId.d.ts.map +1 -1
  678. package/dist/unstable/cluster/EntityId.js +15 -2
  679. package/dist/unstable/cluster/EntityId.js.map +1 -1
  680. package/dist/unstable/cluster/EntityProxy.d.ts +34 -2
  681. package/dist/unstable/cluster/EntityProxy.d.ts.map +1 -1
  682. package/dist/unstable/cluster/EntityProxy.js +24 -2
  683. package/dist/unstable/cluster/EntityProxy.js.map +1 -1
  684. package/dist/unstable/cluster/EntityProxyServer.d.ts +17 -2
  685. package/dist/unstable/cluster/EntityProxyServer.d.ts.map +1 -1
  686. package/dist/unstable/cluster/EntityProxyServer.js +40 -8
  687. package/dist/unstable/cluster/EntityProxyServer.js.map +1 -1
  688. package/dist/unstable/cluster/EntityResource.d.ts +43 -6
  689. package/dist/unstable/cluster/EntityResource.d.ts.map +1 -1
  690. package/dist/unstable/cluster/EntityResource.js +11 -4
  691. package/dist/unstable/cluster/EntityResource.js.map +1 -1
  692. package/dist/unstable/cluster/EntityType.d.ts +27 -3
  693. package/dist/unstable/cluster/EntityType.d.ts.map +1 -1
  694. package/dist/unstable/cluster/EntityType.js +24 -2
  695. package/dist/unstable/cluster/EntityType.js.map +1 -1
  696. package/dist/unstable/cluster/Envelope.d.ts +105 -23
  697. package/dist/unstable/cluster/Envelope.d.ts.map +1 -1
  698. package/dist/unstable/cluster/Envelope.js +88 -14
  699. package/dist/unstable/cluster/Envelope.js.map +1 -1
  700. package/dist/unstable/cluster/HttpRunner.d.ts +88 -13
  701. package/dist/unstable/cluster/HttpRunner.d.ts.map +1 -1
  702. package/dist/unstable/cluster/HttpRunner.js +88 -13
  703. package/dist/unstable/cluster/HttpRunner.js.map +1 -1
  704. package/dist/unstable/cluster/K8sHttpClient.d.ts +49 -6
  705. package/dist/unstable/cluster/K8sHttpClient.d.ts.map +1 -1
  706. package/dist/unstable/cluster/K8sHttpClient.js +31 -6
  707. package/dist/unstable/cluster/K8sHttpClient.js.map +1 -1
  708. package/dist/unstable/cluster/MachineId.d.ts +24 -3
  709. package/dist/unstable/cluster/MachineId.d.ts.map +1 -1
  710. package/dist/unstable/cluster/MachineId.js +21 -2
  711. package/dist/unstable/cluster/MachineId.js.map +1 -1
  712. package/dist/unstable/cluster/Message.d.ts +102 -13
  713. package/dist/unstable/cluster/Message.d.ts.map +1 -1
  714. package/dist/unstable/cluster/Message.js +86 -10
  715. package/dist/unstable/cluster/Message.js.map +1 -1
  716. package/dist/unstable/cluster/MessageStorage.d.ts +127 -21
  717. package/dist/unstable/cluster/MessageStorage.d.ts.map +1 -1
  718. package/dist/unstable/cluster/MessageStorage.js +71 -11
  719. package/dist/unstable/cluster/MessageStorage.js.map +1 -1
  720. package/dist/unstable/cluster/Reply.d.ts +101 -12
  721. package/dist/unstable/cluster/Reply.d.ts.map +1 -1
  722. package/dist/unstable/cluster/Reply.js +64 -8
  723. package/dist/unstable/cluster/Reply.js.map +1 -1
  724. package/dist/unstable/cluster/Runner.d.ts +47 -17
  725. package/dist/unstable/cluster/Runner.d.ts.map +1 -1
  726. package/dist/unstable/cluster/Runner.js +47 -17
  727. package/dist/unstable/cluster/Runner.js.map +1 -1
  728. package/dist/unstable/cluster/RunnerAddress.d.ts +34 -2
  729. package/dist/unstable/cluster/RunnerAddress.d.ts.map +1 -1
  730. package/dist/unstable/cluster/RunnerAddress.js +34 -2
  731. package/dist/unstable/cluster/RunnerAddress.js.map +1 -1
  732. package/dist/unstable/cluster/RunnerHealth.d.ts +40 -12
  733. package/dist/unstable/cluster/RunnerHealth.d.ts.map +1 -1
  734. package/dist/unstable/cluster/RunnerHealth.js +40 -12
  735. package/dist/unstable/cluster/RunnerHealth.js.map +1 -1
  736. package/dist/unstable/cluster/RunnerServer.d.ts +7 -4
  737. package/dist/unstable/cluster/RunnerServer.d.ts.map +1 -1
  738. package/dist/unstable/cluster/RunnerServer.js +31 -4
  739. package/dist/unstable/cluster/RunnerServer.js.map +1 -1
  740. package/dist/unstable/cluster/RunnerStorage.d.ts +42 -5
  741. package/dist/unstable/cluster/RunnerStorage.d.ts.map +1 -1
  742. package/dist/unstable/cluster/RunnerStorage.js +38 -4
  743. package/dist/unstable/cluster/RunnerStorage.js.map +1 -1
  744. package/dist/unstable/cluster/Runners.d.ts +73 -10
  745. package/dist/unstable/cluster/Runners.d.ts.map +1 -1
  746. package/dist/unstable/cluster/Runners.js +70 -9
  747. package/dist/unstable/cluster/Runners.js.map +1 -1
  748. package/dist/unstable/cluster/ShardId.d.ts +51 -5
  749. package/dist/unstable/cluster/ShardId.d.ts.map +1 -1
  750. package/dist/unstable/cluster/ShardId.js +47 -4
  751. package/dist/unstable/cluster/ShardId.js.map +1 -1
  752. package/dist/unstable/cluster/Sharding.d.ts +10 -2
  753. package/dist/unstable/cluster/Sharding.d.ts.map +1 -1
  754. package/dist/unstable/cluster/Sharding.js +35 -4
  755. package/dist/unstable/cluster/Sharding.js.map +1 -1
  756. package/dist/unstable/cluster/ShardingConfig.d.ts +65 -9
  757. package/dist/unstable/cluster/ShardingConfig.d.ts.map +1 -1
  758. package/dist/unstable/cluster/ShardingConfig.js +67 -10
  759. package/dist/unstable/cluster/ShardingConfig.js.map +1 -1
  760. package/dist/unstable/cluster/ShardingRegistrationEvent.d.ts +27 -6
  761. package/dist/unstable/cluster/ShardingRegistrationEvent.d.ts.map +1 -1
  762. package/dist/unstable/cluster/ShardingRegistrationEvent.js +28 -4
  763. package/dist/unstable/cluster/ShardingRegistrationEvent.js.map +1 -1
  764. package/dist/unstable/cluster/SingleRunner.d.ts +23 -1
  765. package/dist/unstable/cluster/SingleRunner.d.ts.map +1 -1
  766. package/dist/unstable/cluster/SingleRunner.js +23 -1
  767. package/dist/unstable/cluster/SingleRunner.js.map +1 -1
  768. package/dist/unstable/cluster/Singleton.d.ts +15 -1
  769. package/dist/unstable/cluster/Singleton.d.ts.map +1 -1
  770. package/dist/unstable/cluster/Singleton.js +15 -1
  771. package/dist/unstable/cluster/Singleton.js.map +1 -1
  772. package/dist/unstable/cluster/SingletonAddress.d.ts +21 -1
  773. package/dist/unstable/cluster/SingletonAddress.d.ts.map +1 -1
  774. package/dist/unstable/cluster/SingletonAddress.js +21 -1
  775. package/dist/unstable/cluster/SingletonAddress.js.map +1 -1
  776. package/dist/unstable/cluster/Snowflake.d.ts +89 -19
  777. package/dist/unstable/cluster/Snowflake.d.ts.map +1 -1
  778. package/dist/unstable/cluster/Snowflake.js +48 -13
  779. package/dist/unstable/cluster/Snowflake.js.map +1 -1
  780. package/dist/unstable/cluster/SocketRunner.d.ts +8 -2
  781. package/dist/unstable/cluster/SocketRunner.d.ts.map +1 -1
  782. package/dist/unstable/cluster/SocketRunner.js +29 -2
  783. package/dist/unstable/cluster/SocketRunner.js.map +1 -1
  784. package/dist/unstable/cluster/SqlMessageStorage.d.ts +11 -3
  785. package/dist/unstable/cluster/SqlMessageStorage.d.ts.map +1 -1
  786. package/dist/unstable/cluster/SqlMessageStorage.js +27 -3
  787. package/dist/unstable/cluster/SqlMessageStorage.js.map +1 -1
  788. package/dist/unstable/cluster/SqlRunnerStorage.d.ts +11 -3
  789. package/dist/unstable/cluster/SqlRunnerStorage.d.ts.map +1 -1
  790. package/dist/unstable/cluster/SqlRunnerStorage.js +46 -7
  791. package/dist/unstable/cluster/SqlRunnerStorage.js.map +1 -1
  792. package/dist/unstable/cluster/TestRunner.d.ts +18 -1
  793. package/dist/unstable/cluster/TestRunner.d.ts.map +1 -1
  794. package/dist/unstable/cluster/TestRunner.js +18 -1
  795. package/dist/unstable/cluster/TestRunner.js.map +1 -1
  796. package/dist/unstable/cluster/internal/hash.js +12 -0
  797. package/dist/unstable/cluster/internal/hash.js.map +1 -1
  798. package/dist/unstable/devtools/DevTools.d.ts +26 -3
  799. package/dist/unstable/devtools/DevTools.d.ts.map +1 -1
  800. package/dist/unstable/devtools/DevTools.js +26 -3
  801. package/dist/unstable/devtools/DevTools.js.map +1 -1
  802. package/dist/unstable/devtools/DevToolsClient.d.ts +20 -5
  803. package/dist/unstable/devtools/DevToolsClient.d.ts.map +1 -1
  804. package/dist/unstable/devtools/DevToolsClient.js +32 -5
  805. package/dist/unstable/devtools/DevToolsClient.js.map +1 -1
  806. package/dist/unstable/devtools/DevToolsSchema.d.ts +184 -44
  807. package/dist/unstable/devtools/DevToolsSchema.d.ts.map +1 -1
  808. package/dist/unstable/devtools/DevToolsSchema.js +102 -20
  809. package/dist/unstable/devtools/DevToolsSchema.js.map +1 -1
  810. package/dist/unstable/devtools/DevToolsServer.d.ts +27 -2
  811. package/dist/unstable/devtools/DevToolsServer.d.ts.map +1 -1
  812. package/dist/unstable/devtools/DevToolsServer.js +21 -1
  813. package/dist/unstable/devtools/DevToolsServer.js.map +1 -1
  814. package/dist/unstable/encoding/Msgpack.d.ts +81 -12
  815. package/dist/unstable/encoding/Msgpack.d.ts.map +1 -1
  816. package/dist/unstable/encoding/Msgpack.js +75 -9
  817. package/dist/unstable/encoding/Msgpack.js.map +1 -1
  818. package/dist/unstable/encoding/Ndjson.d.ts +149 -21
  819. package/dist/unstable/encoding/Ndjson.d.ts.map +1 -1
  820. package/dist/unstable/encoding/Ndjson.js +97 -13
  821. package/dist/unstable/encoding/Ndjson.js.map +1 -1
  822. package/dist/unstable/encoding/Sse.d.ts +109 -18
  823. package/dist/unstable/encoding/Sse.d.ts.map +1 -1
  824. package/dist/unstable/encoding/Sse.js +69 -13
  825. package/dist/unstable/encoding/Sse.js.map +1 -1
  826. package/dist/unstable/eventlog/Event.d.ts +115 -30
  827. package/dist/unstable/eventlog/Event.d.ts.map +1 -1
  828. package/dist/unstable/eventlog/Event.js +22 -2
  829. package/dist/unstable/eventlog/Event.js.map +1 -1
  830. package/dist/unstable/eventlog/EventGroup.d.ts +50 -17
  831. package/dist/unstable/eventlog/EventGroup.d.ts.map +1 -1
  832. package/dist/unstable/eventlog/EventGroup.js +24 -6
  833. package/dist/unstable/eventlog/EventGroup.js.map +1 -1
  834. package/dist/unstable/eventlog/EventJournal.d.ts +104 -20
  835. package/dist/unstable/eventlog/EventJournal.d.ts.map +1 -1
  836. package/dist/unstable/eventlog/EventJournal.js +108 -16
  837. package/dist/unstable/eventlog/EventJournal.js.map +1 -1
  838. package/dist/unstable/eventlog/EventLog.d.ts +151 -31
  839. package/dist/unstable/eventlog/EventLog.d.ts.map +1 -1
  840. package/dist/unstable/eventlog/EventLog.js +111 -20
  841. package/dist/unstable/eventlog/EventLog.js.map +1 -1
  842. package/dist/unstable/eventlog/EventLogEncryption.d.ts +42 -6
  843. package/dist/unstable/eventlog/EventLogEncryption.d.ts.map +1 -1
  844. package/dist/unstable/eventlog/EventLogEncryption.js +38 -5
  845. package/dist/unstable/eventlog/EventLogEncryption.js.map +1 -1
  846. package/dist/unstable/eventlog/EventLogMessage.d.ts +96 -22
  847. package/dist/unstable/eventlog/EventLogMessage.d.ts.map +1 -1
  848. package/dist/unstable/eventlog/EventLogMessage.js +72 -16
  849. package/dist/unstable/eventlog/EventLogMessage.js.map +1 -1
  850. package/dist/unstable/eventlog/EventLogRemote.d.ts +35 -8
  851. package/dist/unstable/eventlog/EventLogRemote.d.ts.map +1 -1
  852. package/dist/unstable/eventlog/EventLogRemote.js +54 -8
  853. package/dist/unstable/eventlog/EventLogRemote.js.map +1 -1
  854. package/dist/unstable/eventlog/EventLogServer.d.ts +17 -3
  855. package/dist/unstable/eventlog/EventLogServer.d.ts.map +1 -1
  856. package/dist/unstable/eventlog/EventLogServer.js +17 -3
  857. package/dist/unstable/eventlog/EventLogServer.js.map +1 -1
  858. package/dist/unstable/eventlog/EventLogServerEncrypted.d.ts +32 -6
  859. package/dist/unstable/eventlog/EventLogServerEncrypted.d.ts.map +1 -1
  860. package/dist/unstable/eventlog/EventLogServerEncrypted.js +52 -6
  861. package/dist/unstable/eventlog/EventLogServerEncrypted.js.map +1 -1
  862. package/dist/unstable/eventlog/EventLogServerUnencrypted.d.ts +74 -16
  863. package/dist/unstable/eventlog/EventLogServerUnencrypted.d.ts.map +1 -1
  864. package/dist/unstable/eventlog/EventLogServerUnencrypted.js +90 -16
  865. package/dist/unstable/eventlog/EventLogServerUnencrypted.js.map +1 -1
  866. package/dist/unstable/eventlog/EventLogSessionAuth.d.ts +59 -15
  867. package/dist/unstable/eventlog/EventLogSessionAuth.d.ts.map +1 -1
  868. package/dist/unstable/eventlog/EventLogSessionAuth.js +73 -14
  869. package/dist/unstable/eventlog/EventLogSessionAuth.js.map +1 -1
  870. package/dist/unstable/eventlog/SqlEventJournal.d.ts +10 -2
  871. package/dist/unstable/eventlog/SqlEventJournal.d.ts.map +1 -1
  872. package/dist/unstable/eventlog/SqlEventJournal.js +28 -2
  873. package/dist/unstable/eventlog/SqlEventJournal.js.map +1 -1
  874. package/dist/unstable/eventlog/SqlEventLogServerEncrypted.d.ts +32 -3
  875. package/dist/unstable/eventlog/SqlEventLogServerEncrypted.d.ts.map +1 -1
  876. package/dist/unstable/eventlog/SqlEventLogServerEncrypted.js +32 -3
  877. package/dist/unstable/eventlog/SqlEventLogServerEncrypted.js.map +1 -1
  878. package/dist/unstable/eventlog/SqlEventLogServerUnencrypted.d.ts +10 -2
  879. package/dist/unstable/eventlog/SqlEventLogServerUnencrypted.d.ts.map +1 -1
  880. package/dist/unstable/eventlog/SqlEventLogServerUnencrypted.js +28 -2
  881. package/dist/unstable/eventlog/SqlEventLogServerUnencrypted.js.map +1 -1
  882. package/dist/unstable/http/Cookies.d.ts +156 -77
  883. package/dist/unstable/http/Cookies.d.ts.map +1 -1
  884. package/dist/unstable/http/Cookies.js +93 -39
  885. package/dist/unstable/http/Cookies.js.map +1 -1
  886. package/dist/unstable/http/Etag.d.ts +40 -7
  887. package/dist/unstable/http/Etag.d.ts.map +1 -1
  888. package/dist/unstable/http/Etag.js +27 -4
  889. package/dist/unstable/http/Etag.js.map +1 -1
  890. package/dist/unstable/http/FetchHttpClient.d.ts +29 -3
  891. package/dist/unstable/http/FetchHttpClient.d.ts.map +1 -1
  892. package/dist/unstable/http/FetchHttpClient.js +33 -4
  893. package/dist/unstable/http/FetchHttpClient.js.map +1 -1
  894. package/dist/unstable/http/FindMyWay.d.ts +1 -1
  895. package/dist/unstable/http/FindMyWay.js +1 -1
  896. package/dist/unstable/http/Headers.d.ts +182 -36
  897. package/dist/unstable/http/Headers.d.ts.map +1 -1
  898. package/dist/unstable/http/Headers.js +86 -16
  899. package/dist/unstable/http/Headers.js.map +1 -1
  900. package/dist/unstable/http/HttpBody.d.ts +114 -26
  901. package/dist/unstable/http/HttpBody.d.ts.map +1 -1
  902. package/dist/unstable/http/HttpBody.js +100 -22
  903. package/dist/unstable/http/HttpBody.js.map +1 -1
  904. package/dist/unstable/http/HttpClient.d.ts +205 -96
  905. package/dist/unstable/http/HttpClient.d.ts.map +1 -1
  906. package/dist/unstable/http/HttpClient.js +85 -39
  907. package/dist/unstable/http/HttpClient.js.map +1 -1
  908. package/dist/unstable/http/HttpClientError.d.ts +68 -12
  909. package/dist/unstable/http/HttpClientError.d.ts.map +1 -1
  910. package/dist/unstable/http/HttpClientError.js +71 -9
  911. package/dist/unstable/http/HttpClientError.js.map +1 -1
  912. package/dist/unstable/http/HttpClientRequest.d.ts +318 -100
  913. package/dist/unstable/http/HttpClientRequest.d.ts.map +1 -1
  914. package/dist/unstable/http/HttpClientRequest.js +153 -47
  915. package/dist/unstable/http/HttpClientRequest.js.map +1 -1
  916. package/dist/unstable/http/HttpClientResponse.d.ts +59 -16
  917. package/dist/unstable/http/HttpClientResponse.d.ts.map +1 -1
  918. package/dist/unstable/http/HttpClientResponse.js +44 -11
  919. package/dist/unstable/http/HttpClientResponse.js.map +1 -1
  920. package/dist/unstable/http/HttpEffect.d.ts +42 -16
  921. package/dist/unstable/http/HttpEffect.d.ts.map +1 -1
  922. package/dist/unstable/http/HttpEffect.js +33 -13
  923. package/dist/unstable/http/HttpEffect.js.map +1 -1
  924. package/dist/unstable/http/HttpIncomingMessage.d.ts +47 -7
  925. package/dist/unstable/http/HttpIncomingMessage.d.ts.map +1 -1
  926. package/dist/unstable/http/HttpIncomingMessage.js +44 -6
  927. package/dist/unstable/http/HttpIncomingMessage.js.map +1 -1
  928. package/dist/unstable/http/HttpMethod.d.ts +35 -5
  929. package/dist/unstable/http/HttpMethod.d.ts.map +1 -1
  930. package/dist/unstable/http/HttpMethod.js +23 -1
  931. package/dist/unstable/http/HttpMethod.js.map +1 -1
  932. package/dist/unstable/http/HttpMiddleware.d.ts +37 -11
  933. package/dist/unstable/http/HttpMiddleware.d.ts.map +1 -1
  934. package/dist/unstable/http/HttpMiddleware.js +70 -31
  935. package/dist/unstable/http/HttpMiddleware.js.map +1 -1
  936. package/dist/unstable/http/HttpPlatform.d.ts +34 -3
  937. package/dist/unstable/http/HttpPlatform.d.ts.map +1 -1
  938. package/dist/unstable/http/HttpPlatform.js +35 -4
  939. package/dist/unstable/http/HttpPlatform.js.map +1 -1
  940. package/dist/unstable/http/HttpRouter.d.ts +194 -45
  941. package/dist/unstable/http/HttpRouter.d.ts.map +1 -1
  942. package/dist/unstable/http/HttpRouter.js +122 -28
  943. package/dist/unstable/http/HttpRouter.js.map +1 -1
  944. package/dist/unstable/http/HttpServer.d.ts +151 -22
  945. package/dist/unstable/http/HttpServer.d.ts.map +1 -1
  946. package/dist/unstable/http/HttpServer.js +77 -12
  947. package/dist/unstable/http/HttpServer.js.map +1 -1
  948. package/dist/unstable/http/HttpServerError.d.ts +90 -10
  949. package/dist/unstable/http/HttpServerError.d.ts.map +1 -1
  950. package/dist/unstable/http/HttpServerError.js +82 -8
  951. package/dist/unstable/http/HttpServerError.js.map +1 -1
  952. package/dist/unstable/http/HttpServerRequest.d.ts +125 -21
  953. package/dist/unstable/http/HttpServerRequest.d.ts.map +1 -1
  954. package/dist/unstable/http/HttpServerRequest.js +112 -31
  955. package/dist/unstable/http/HttpServerRequest.js.map +1 -1
  956. package/dist/unstable/http/HttpServerRespondable.d.ts +32 -6
  957. package/dist/unstable/http/HttpServerRespondable.d.ts.map +1 -1
  958. package/dist/unstable/http/HttpServerRespondable.js +43 -5
  959. package/dist/unstable/http/HttpServerRespondable.js.map +1 -1
  960. package/dist/unstable/http/HttpServerResponse.d.ts +390 -67
  961. package/dist/unstable/http/HttpServerResponse.d.ts.map +1 -1
  962. package/dist/unstable/http/HttpServerResponse.js +209 -38
  963. package/dist/unstable/http/HttpServerResponse.js.map +1 -1
  964. package/dist/unstable/http/HttpStaticServer.d.ts +22 -4
  965. package/dist/unstable/http/HttpStaticServer.d.ts.map +1 -1
  966. package/dist/unstable/http/HttpStaticServer.js +22 -4
  967. package/dist/unstable/http/HttpStaticServer.js.map +1 -1
  968. package/dist/unstable/http/HttpTraceContext.d.ts +53 -6
  969. package/dist/unstable/http/HttpTraceContext.d.ts.map +1 -1
  970. package/dist/unstable/http/HttpTraceContext.js +47 -5
  971. package/dist/unstable/http/HttpTraceContext.js.map +1 -1
  972. package/dist/unstable/http/Multipart.d.ts +178 -28
  973. package/dist/unstable/http/Multipart.d.ts.map +1 -1
  974. package/dist/unstable/http/Multipart.js +130 -20
  975. package/dist/unstable/http/Multipart.js.map +1 -1
  976. package/dist/unstable/http/Multipasta/HeadersParser.d.ts +1 -1
  977. package/dist/unstable/http/Multipasta/HeadersParser.js +1 -1
  978. package/dist/unstable/http/Multipasta/Node.d.ts +1 -1
  979. package/dist/unstable/http/Multipasta/Node.js +1 -1
  980. package/dist/unstable/http/Multipasta/Search.d.ts +1 -1
  981. package/dist/unstable/http/Multipasta/Search.js +1 -1
  982. package/dist/unstable/http/Multipasta/Web.d.ts +1 -1
  983. package/dist/unstable/http/Multipasta/Web.js +1 -1
  984. package/dist/unstable/http/Multipasta.d.ts +1 -1
  985. package/dist/unstable/http/Multipasta.js +1 -1
  986. package/dist/unstable/http/Template.d.ts +53 -0
  987. package/dist/unstable/http/Template.d.ts.map +1 -1
  988. package/dist/unstable/http/Template.js +26 -0
  989. package/dist/unstable/http/Template.js.map +1 -1
  990. package/dist/unstable/http/Url.d.ts +56 -42
  991. package/dist/unstable/http/Url.d.ts.map +1 -1
  992. package/dist/unstable/http/Url.js +29 -15
  993. package/dist/unstable/http/Url.js.map +1 -1
  994. package/dist/unstable/http/UrlParams.d.ts +233 -49
  995. package/dist/unstable/http/UrlParams.d.ts.map +1 -1
  996. package/dist/unstable/http/UrlParams.js +116 -23
  997. package/dist/unstable/http/UrlParams.js.map +1 -1
  998. package/dist/unstable/httpapi/HttpApi.d.ts +49 -14
  999. package/dist/unstable/httpapi/HttpApi.d.ts.map +1 -1
  1000. package/dist/unstable/httpapi/HttpApi.js +14 -8
  1001. package/dist/unstable/httpapi/HttpApi.js.map +1 -1
  1002. package/dist/unstable/httpapi/HttpApiBuilder.d.ts +55 -16
  1003. package/dist/unstable/httpapi/HttpApiBuilder.d.ts.map +1 -1
  1004. package/dist/unstable/httpapi/HttpApiBuilder.js +47 -9
  1005. package/dist/unstable/httpapi/HttpApiBuilder.js.map +1 -1
  1006. package/dist/unstable/httpapi/HttpApiClient.d.ts +58 -15
  1007. package/dist/unstable/httpapi/HttpApiClient.d.ts.map +1 -1
  1008. package/dist/unstable/httpapi/HttpApiClient.js +43 -7
  1009. package/dist/unstable/httpapi/HttpApiClient.js.map +1 -1
  1010. package/dist/unstable/httpapi/HttpApiEndpoint.d.ts +214 -59
  1011. package/dist/unstable/httpapi/HttpApiEndpoint.d.ts.map +1 -1
  1012. package/dist/unstable/httpapi/HttpApiEndpoint.js +53 -9
  1013. package/dist/unstable/httpapi/HttpApiEndpoint.js.map +1 -1
  1014. package/dist/unstable/httpapi/HttpApiError.d.ts +81 -1
  1015. package/dist/unstable/httpapi/HttpApiError.d.ts.map +1 -1
  1016. package/dist/unstable/httpapi/HttpApiError.js +98 -1
  1017. package/dist/unstable/httpapi/HttpApiError.js.map +1 -1
  1018. package/dist/unstable/httpapi/HttpApiGroup.d.ts +87 -20
  1019. package/dist/unstable/httpapi/HttpApiGroup.d.ts.map +1 -1
  1020. package/dist/unstable/httpapi/HttpApiGroup.js +5 -2
  1021. package/dist/unstable/httpapi/HttpApiGroup.js.map +1 -1
  1022. package/dist/unstable/httpapi/HttpApiMiddleware.d.ts +113 -22
  1023. package/dist/unstable/httpapi/HttpApiMiddleware.d.ts.map +1 -1
  1024. package/dist/unstable/httpapi/HttpApiMiddleware.js +49 -6
  1025. package/dist/unstable/httpapi/HttpApiMiddleware.js.map +1 -1
  1026. package/dist/unstable/httpapi/HttpApiScalar.d.ts +19 -4
  1027. package/dist/unstable/httpapi/HttpApiScalar.d.ts.map +1 -1
  1028. package/dist/unstable/httpapi/HttpApiScalar.js +32 -2
  1029. package/dist/unstable/httpapi/HttpApiScalar.js.map +1 -1
  1030. package/dist/unstable/httpapi/HttpApiSchema.d.ts +67 -30
  1031. package/dist/unstable/httpapi/HttpApiSchema.d.ts.map +1 -1
  1032. package/dist/unstable/httpapi/HttpApiSchema.js +48 -27
  1033. package/dist/unstable/httpapi/HttpApiSchema.js.map +1 -1
  1034. package/dist/unstable/httpapi/HttpApiSecurity.d.ts +74 -17
  1035. package/dist/unstable/httpapi/HttpApiSecurity.d.ts.map +1 -1
  1036. package/dist/unstable/httpapi/HttpApiSecurity.js +38 -5
  1037. package/dist/unstable/httpapi/HttpApiSecurity.js.map +1 -1
  1038. package/dist/unstable/httpapi/HttpApiSwagger.d.ts +5 -2
  1039. package/dist/unstable/httpapi/HttpApiSwagger.d.ts.map +1 -1
  1040. package/dist/unstable/httpapi/HttpApiSwagger.js +24 -2
  1041. package/dist/unstable/httpapi/HttpApiSwagger.js.map +1 -1
  1042. package/dist/unstable/httpapi/HttpApiTest.d.ts +9 -2
  1043. package/dist/unstable/httpapi/HttpApiTest.d.ts.map +1 -1
  1044. package/dist/unstable/httpapi/HttpApiTest.js +28 -3
  1045. package/dist/unstable/httpapi/HttpApiTest.js.map +1 -1
  1046. package/dist/unstable/httpapi/OpenApi.d.ts +86 -15
  1047. package/dist/unstable/httpapi/OpenApi.d.ts.map +1 -1
  1048. package/dist/unstable/httpapi/OpenApi.js +73 -15
  1049. package/dist/unstable/httpapi/OpenApi.js.map +1 -1
  1050. package/dist/unstable/observability/Otlp.d.ts +33 -3
  1051. package/dist/unstable/observability/Otlp.d.ts.map +1 -1
  1052. package/dist/unstable/observability/Otlp.js +14 -3
  1053. package/dist/unstable/observability/Otlp.js.map +1 -1
  1054. package/dist/unstable/observability/OtlpExporter.d.ts +8 -1
  1055. package/dist/unstable/observability/OtlpExporter.d.ts.map +1 -1
  1056. package/dist/unstable/observability/OtlpExporter.js +32 -1
  1057. package/dist/unstable/observability/OtlpExporter.js.map +1 -1
  1058. package/dist/unstable/observability/OtlpLogger.d.ts +14 -2
  1059. package/dist/unstable/observability/OtlpLogger.d.ts.map +1 -1
  1060. package/dist/unstable/observability/OtlpLogger.js +29 -2
  1061. package/dist/unstable/observability/OtlpLogger.js.map +1 -1
  1062. package/dist/unstable/observability/OtlpMetrics.d.ts +15 -4
  1063. package/dist/unstable/observability/OtlpMetrics.d.ts.map +1 -1
  1064. package/dist/unstable/observability/OtlpMetrics.js +32 -2
  1065. package/dist/unstable/observability/OtlpMetrics.js.map +1 -1
  1066. package/dist/unstable/observability/OtlpResource.d.ts +49 -12
  1067. package/dist/unstable/observability/OtlpResource.d.ts.map +1 -1
  1068. package/dist/unstable/observability/OtlpResource.js +47 -5
  1069. package/dist/unstable/observability/OtlpResource.js.map +1 -1
  1070. package/dist/unstable/observability/OtlpSerialization.d.ts +28 -3
  1071. package/dist/unstable/observability/OtlpSerialization.d.ts.map +1 -1
  1072. package/dist/unstable/observability/OtlpSerialization.js +28 -3
  1073. package/dist/unstable/observability/OtlpSerialization.js.map +1 -1
  1074. package/dist/unstable/observability/OtlpTracer.d.ts +16 -2
  1075. package/dist/unstable/observability/OtlpTracer.d.ts.map +1 -1
  1076. package/dist/unstable/observability/OtlpTracer.js +32 -2
  1077. package/dist/unstable/observability/OtlpTracer.js.map +1 -1
  1078. package/dist/unstable/observability/PrometheusMetrics.d.ts +32 -12
  1079. package/dist/unstable/observability/PrometheusMetrics.d.ts.map +1 -1
  1080. package/dist/unstable/observability/PrometheusMetrics.js +7 -5
  1081. package/dist/unstable/observability/PrometheusMetrics.js.map +1 -1
  1082. package/dist/unstable/observability/index.d.ts +2 -1
  1083. package/dist/unstable/observability/index.d.ts.map +1 -1
  1084. package/dist/unstable/observability/index.js +2 -1
  1085. package/dist/unstable/observability/index.js.map +1 -1
  1086. package/dist/unstable/persistence/KeyValueStore.d.ts +93 -18
  1087. package/dist/unstable/persistence/KeyValueStore.d.ts.map +1 -1
  1088. package/dist/unstable/persistence/KeyValueStore.js +81 -21
  1089. package/dist/unstable/persistence/KeyValueStore.js.map +1 -1
  1090. package/dist/unstable/persistence/Persistable.d.ts +76 -15
  1091. package/dist/unstable/persistence/Persistable.d.ts.map +1 -1
  1092. package/dist/unstable/persistence/Persistable.js +22 -5
  1093. package/dist/unstable/persistence/Persistable.js.map +1 -1
  1094. package/dist/unstable/persistence/PersistedCache.d.ts +27 -2
  1095. package/dist/unstable/persistence/PersistedCache.d.ts.map +1 -1
  1096. package/dist/unstable/persistence/PersistedCache.js +24 -1
  1097. package/dist/unstable/persistence/PersistedCache.js.map +1 -1
  1098. package/dist/unstable/persistence/PersistedQueue.d.ts +73 -16
  1099. package/dist/unstable/persistence/PersistedQueue.d.ts.map +1 -1
  1100. package/dist/unstable/persistence/PersistedQueue.js +60 -13
  1101. package/dist/unstable/persistence/PersistedQueue.js.map +1 -1
  1102. package/dist/unstable/persistence/Persistence.d.ts +97 -16
  1103. package/dist/unstable/persistence/Persistence.d.ts.map +1 -1
  1104. package/dist/unstable/persistence/Persistence.js +90 -14
  1105. package/dist/unstable/persistence/Persistence.js.map +1 -1
  1106. package/dist/unstable/persistence/RateLimiter.d.ts +97 -21
  1107. package/dist/unstable/persistence/RateLimiter.d.ts.map +1 -1
  1108. package/dist/unstable/persistence/RateLimiter.js +82 -17
  1109. package/dist/unstable/persistence/RateLimiter.js.map +1 -1
  1110. package/dist/unstable/persistence/Redis.d.ts +26 -5
  1111. package/dist/unstable/persistence/Redis.d.ts.map +1 -1
  1112. package/dist/unstable/persistence/Redis.js +36 -4
  1113. package/dist/unstable/persistence/Redis.js.map +1 -1
  1114. package/dist/unstable/process/ChildProcess.d.ts +89 -109
  1115. package/dist/unstable/process/ChildProcess.d.ts.map +1 -1
  1116. package/dist/unstable/process/ChildProcess.js +74 -23
  1117. package/dist/unstable/process/ChildProcess.js.map +1 -1
  1118. package/dist/unstable/process/ChildProcessSpawner.d.ts +22 -11
  1119. package/dist/unstable/process/ChildProcessSpawner.d.ts.map +1 -1
  1120. package/dist/unstable/process/ChildProcessSpawner.js +11 -6
  1121. package/dist/unstable/process/ChildProcessSpawner.js.map +1 -1
  1122. package/dist/unstable/process/index.d.ts +2 -1
  1123. package/dist/unstable/process/index.d.ts.map +1 -1
  1124. package/dist/unstable/process/index.js +2 -1
  1125. package/dist/unstable/process/index.js.map +1 -1
  1126. package/dist/unstable/reactivity/AsyncResult.d.ts +196 -59
  1127. package/dist/unstable/reactivity/AsyncResult.d.ts.map +1 -1
  1128. package/dist/unstable/reactivity/AsyncResult.js +121 -36
  1129. package/dist/unstable/reactivity/AsyncResult.js.map +1 -1
  1130. package/dist/unstable/reactivity/Atom.d.ts +539 -130
  1131. package/dist/unstable/reactivity/Atom.d.ts.map +1 -1
  1132. package/dist/unstable/reactivity/Atom.js +256 -62
  1133. package/dist/unstable/reactivity/Atom.js.map +1 -1
  1134. package/dist/unstable/reactivity/AtomHttpApi.d.ts +41 -2
  1135. package/dist/unstable/reactivity/AtomHttpApi.d.ts.map +1 -1
  1136. package/dist/unstable/reactivity/AtomHttpApi.js +35 -1
  1137. package/dist/unstable/reactivity/AtomHttpApi.js.map +1 -1
  1138. package/dist/unstable/reactivity/AtomRef.d.ts +51 -7
  1139. package/dist/unstable/reactivity/AtomRef.d.ts.map +1 -1
  1140. package/dist/unstable/reactivity/AtomRef.js +29 -3
  1141. package/dist/unstable/reactivity/AtomRef.js.map +1 -1
  1142. package/dist/unstable/reactivity/AtomRegistry.d.ts +135 -21
  1143. package/dist/unstable/reactivity/AtomRegistry.d.ts.map +1 -1
  1144. package/dist/unstable/reactivity/AtomRegistry.js +69 -10
  1145. package/dist/unstable/reactivity/AtomRegistry.js.map +1 -1
  1146. package/dist/unstable/reactivity/AtomRpc.d.ts +36 -2
  1147. package/dist/unstable/reactivity/AtomRpc.d.ts.map +1 -1
  1148. package/dist/unstable/reactivity/AtomRpc.js +29 -1
  1149. package/dist/unstable/reactivity/AtomRpc.js.map +1 -1
  1150. package/dist/unstable/reactivity/Hydration.d.ts +28 -5
  1151. package/dist/unstable/reactivity/Hydration.d.ts.map +1 -1
  1152. package/dist/unstable/reactivity/Hydration.js +35 -3
  1153. package/dist/unstable/reactivity/Hydration.js.map +1 -1
  1154. package/dist/unstable/reactivity/Reactivity.d.ts +95 -13
  1155. package/dist/unstable/reactivity/Reactivity.d.ts.map +1 -1
  1156. package/dist/unstable/reactivity/Reactivity.js +61 -7
  1157. package/dist/unstable/reactivity/Reactivity.js.map +1 -1
  1158. package/dist/unstable/rpc/Rpc.d.ts +255 -56
  1159. package/dist/unstable/rpc/Rpc.d.ts.map +1 -1
  1160. package/dist/unstable/rpc/Rpc.js +44 -11
  1161. package/dist/unstable/rpc/Rpc.js.map +1 -1
  1162. package/dist/unstable/rpc/RpcClient.d.ts +81 -19
  1163. package/dist/unstable/rpc/RpcClient.d.ts.map +1 -1
  1164. package/dist/unstable/rpc/RpcClient.js +53 -13
  1165. package/dist/unstable/rpc/RpcClient.js.map +1 -1
  1166. package/dist/unstable/rpc/RpcClientError.d.ts +26 -2
  1167. package/dist/unstable/rpc/RpcClientError.d.ts.map +1 -1
  1168. package/dist/unstable/rpc/RpcClientError.js +26 -2
  1169. package/dist/unstable/rpc/RpcClientError.js.map +1 -1
  1170. package/dist/unstable/rpc/RpcGroup.d.ts +51 -8
  1171. package/dist/unstable/rpc/RpcGroup.d.ts.map +1 -1
  1172. package/dist/unstable/rpc/RpcGroup.js +3 -1
  1173. package/dist/unstable/rpc/RpcGroup.js.map +1 -1
  1174. package/dist/unstable/rpc/RpcMessage.d.ts +128 -32
  1175. package/dist/unstable/rpc/RpcMessage.d.ts.map +1 -1
  1176. package/dist/unstable/rpc/RpcMessage.js +23 -7
  1177. package/dist/unstable/rpc/RpcMessage.js.map +1 -1
  1178. package/dist/unstable/rpc/RpcMiddleware.d.ts +100 -20
  1179. package/dist/unstable/rpc/RpcMiddleware.d.ts.map +1 -1
  1180. package/dist/unstable/rpc/RpcMiddleware.js +39 -3
  1181. package/dist/unstable/rpc/RpcMiddleware.js.map +1 -1
  1182. package/dist/unstable/rpc/RpcSchema.d.ts +38 -4
  1183. package/dist/unstable/rpc/RpcSchema.d.ts.map +1 -1
  1184. package/dist/unstable/rpc/RpcSchema.js +34 -3
  1185. package/dist/unstable/rpc/RpcSchema.js.map +1 -1
  1186. package/dist/unstable/rpc/RpcSerialization.d.ts +60 -13
  1187. package/dist/unstable/rpc/RpcSerialization.d.ts.map +1 -1
  1188. package/dist/unstable/rpc/RpcSerialization.js +56 -12
  1189. package/dist/unstable/rpc/RpcSerialization.js.map +1 -1
  1190. package/dist/unstable/rpc/RpcServer.d.ts +73 -23
  1191. package/dist/unstable/rpc/RpcServer.d.ts.map +1 -1
  1192. package/dist/unstable/rpc/RpcServer.js +70 -23
  1193. package/dist/unstable/rpc/RpcServer.js.map +1 -1
  1194. package/dist/unstable/rpc/RpcTest.d.ts +20 -1
  1195. package/dist/unstable/rpc/RpcTest.d.ts.map +1 -1
  1196. package/dist/unstable/rpc/RpcTest.js +20 -1
  1197. package/dist/unstable/rpc/RpcTest.js.map +1 -1
  1198. package/dist/unstable/rpc/RpcWorker.d.ts +40 -6
  1199. package/dist/unstable/rpc/RpcWorker.d.ts.map +1 -1
  1200. package/dist/unstable/rpc/RpcWorker.js +17 -5
  1201. package/dist/unstable/rpc/RpcWorker.js.map +1 -1
  1202. package/dist/unstable/rpc/Utils.d.ts +8 -0
  1203. package/dist/unstable/rpc/Utils.d.ts.map +1 -1
  1204. package/dist/unstable/rpc/Utils.js +8 -0
  1205. package/dist/unstable/rpc/Utils.js.map +1 -1
  1206. package/dist/unstable/schema/Model.d.ts +130 -52
  1207. package/dist/unstable/schema/Model.d.ts.map +1 -1
  1208. package/dist/unstable/schema/Model.js +79 -34
  1209. package/dist/unstable/schema/Model.js.map +1 -1
  1210. package/dist/unstable/schema/VariantSchema.d.ts +104 -24
  1211. package/dist/unstable/schema/VariantSchema.d.ts.map +1 -1
  1212. package/dist/unstable/schema/VariantSchema.js +22 -6
  1213. package/dist/unstable/schema/VariantSchema.js.map +1 -1
  1214. package/dist/unstable/socket/Socket.d.ts +167 -34
  1215. package/dist/unstable/socket/Socket.d.ts.map +1 -1
  1216. package/dist/unstable/socket/Socket.js +124 -29
  1217. package/dist/unstable/socket/Socket.js.map +1 -1
  1218. package/dist/unstable/socket/SocketServer.d.ts +58 -10
  1219. package/dist/unstable/socket/SocketServer.d.ts.map +1 -1
  1220. package/dist/unstable/socket/SocketServer.js +43 -5
  1221. package/dist/unstable/socket/SocketServer.js.map +1 -1
  1222. package/dist/unstable/sql/Migrator.d.ts +35 -4
  1223. package/dist/unstable/sql/Migrator.d.ts.map +1 -1
  1224. package/dist/unstable/sql/Migrator.js +45 -5
  1225. package/dist/unstable/sql/Migrator.js.map +1 -1
  1226. package/dist/unstable/sql/SqlClient.d.ts +34 -2
  1227. package/dist/unstable/sql/SqlClient.d.ts.map +1 -1
  1228. package/dist/unstable/sql/SqlClient.js +38 -1
  1229. package/dist/unstable/sql/SqlClient.js.map +1 -1
  1230. package/dist/unstable/sql/SqlConnection.d.ts +31 -0
  1231. package/dist/unstable/sql/SqlConnection.d.ts.map +1 -1
  1232. package/dist/unstable/sql/SqlConnection.js +22 -0
  1233. package/dist/unstable/sql/SqlConnection.js.map +1 -1
  1234. package/dist/unstable/sql/SqlError.d.ts +99 -0
  1235. package/dist/unstable/sql/SqlError.d.ts.map +1 -1
  1236. package/dist/unstable/sql/SqlError.js +114 -0
  1237. package/dist/unstable/sql/SqlError.js.map +1 -1
  1238. package/dist/unstable/sql/SqlModel.d.ts +26 -5
  1239. package/dist/unstable/sql/SqlModel.d.ts.map +1 -1
  1240. package/dist/unstable/sql/SqlModel.js +8 -4
  1241. package/dist/unstable/sql/SqlModel.js.map +1 -1
  1242. package/dist/unstable/sql/SqlResolver.d.ts +56 -13
  1243. package/dist/unstable/sql/SqlResolver.d.ts.map +1 -1
  1244. package/dist/unstable/sql/SqlResolver.js +44 -10
  1245. package/dist/unstable/sql/SqlResolver.js.map +1 -1
  1246. package/dist/unstable/sql/SqlSchema.d.ts +29 -8
  1247. package/dist/unstable/sql/SqlSchema.d.ts.map +1 -1
  1248. package/dist/unstable/sql/SqlSchema.js +29 -8
  1249. package/dist/unstable/sql/SqlSchema.js.map +1 -1
  1250. package/dist/unstable/sql/SqlStream.d.ts +3 -0
  1251. package/dist/unstable/sql/SqlStream.d.ts.map +1 -1
  1252. package/dist/unstable/sql/SqlStream.js +23 -0
  1253. package/dist/unstable/sql/SqlStream.js.map +1 -1
  1254. package/dist/unstable/sql/Statement.d.ts +124 -0
  1255. package/dist/unstable/sql/Statement.d.ts.map +1 -1
  1256. package/dist/unstable/sql/Statement.js +82 -0
  1257. package/dist/unstable/sql/Statement.js.map +1 -1
  1258. package/dist/unstable/sql/index.d.ts +1 -1
  1259. package/dist/unstable/sql/index.js +1 -1
  1260. package/dist/unstable/workers/Transferable.d.ts +65 -13
  1261. package/dist/unstable/workers/Transferable.d.ts.map +1 -1
  1262. package/dist/unstable/workers/Transferable.js +53 -10
  1263. package/dist/unstable/workers/Transferable.js.map +1 -1
  1264. package/dist/unstable/workers/Worker.d.ts +60 -8
  1265. package/dist/unstable/workers/Worker.d.ts.map +1 -1
  1266. package/dist/unstable/workers/Worker.js +43 -4
  1267. package/dist/unstable/workers/Worker.js.map +1 -1
  1268. package/dist/unstable/workers/WorkerError.d.ts +31 -9
  1269. package/dist/unstable/workers/WorkerError.d.ts.map +1 -1
  1270. package/dist/unstable/workers/WorkerError.js +44 -7
  1271. package/dist/unstable/workers/WorkerError.js.map +1 -1
  1272. package/dist/unstable/workers/WorkerRunner.d.ts +32 -3
  1273. package/dist/unstable/workers/WorkerRunner.d.ts.map +1 -1
  1274. package/dist/unstable/workers/WorkerRunner.js +24 -1
  1275. package/dist/unstable/workers/WorkerRunner.js.map +1 -1
  1276. package/dist/unstable/workers/index.d.ts +1 -1
  1277. package/dist/unstable/workers/index.js +1 -1
  1278. package/dist/unstable/workflow/Activity.d.ts +61 -10
  1279. package/dist/unstable/workflow/Activity.d.ts.map +1 -1
  1280. package/dist/unstable/workflow/Activity.js +21 -6
  1281. package/dist/unstable/workflow/Activity.js.map +1 -1
  1282. package/dist/unstable/workflow/DurableClock.d.ts +12 -3
  1283. package/dist/unstable/workflow/DurableClock.d.ts.map +1 -1
  1284. package/dist/unstable/workflow/DurableClock.js +22 -2
  1285. package/dist/unstable/workflow/DurableClock.js.map +1 -1
  1286. package/dist/unstable/workflow/DurableDeferred.d.ts +126 -31
  1287. package/dist/unstable/workflow/DurableDeferred.d.ts.map +1 -1
  1288. package/dist/unstable/workflow/DurableDeferred.js +76 -13
  1289. package/dist/unstable/workflow/DurableDeferred.js.map +1 -1
  1290. package/dist/unstable/workflow/DurableQueue.d.ts +145 -0
  1291. package/dist/unstable/workflow/DurableQueue.d.ts.map +1 -0
  1292. package/dist/unstable/workflow/DurableQueue.js +200 -0
  1293. package/dist/unstable/workflow/DurableQueue.js.map +1 -0
  1294. package/dist/unstable/workflow/Workflow.d.ts +100 -31
  1295. package/dist/unstable/workflow/Workflow.d.ts.map +1 -1
  1296. package/dist/unstable/workflow/Workflow.js +76 -20
  1297. package/dist/unstable/workflow/Workflow.js.map +1 -1
  1298. package/dist/unstable/workflow/WorkflowEngine.d.ts +40 -5
  1299. package/dist/unstable/workflow/WorkflowEngine.d.ts.map +1 -1
  1300. package/dist/unstable/workflow/WorkflowEngine.js +16 -4
  1301. package/dist/unstable/workflow/WorkflowEngine.js.map +1 -1
  1302. package/dist/unstable/workflow/WorkflowProxy.d.ts +32 -2
  1303. package/dist/unstable/workflow/WorkflowProxy.d.ts.map +1 -1
  1304. package/dist/unstable/workflow/WorkflowProxy.js +2 -2
  1305. package/dist/unstable/workflow/WorkflowProxy.js.map +1 -1
  1306. package/dist/unstable/workflow/WorkflowProxyServer.d.ts +36 -2
  1307. package/dist/unstable/workflow/WorkflowProxyServer.d.ts.map +1 -1
  1308. package/dist/unstable/workflow/WorkflowProxyServer.js +12 -6
  1309. package/dist/unstable/workflow/WorkflowProxyServer.js.map +1 -1
  1310. package/dist/unstable/workflow/index.d.ts +4 -0
  1311. package/dist/unstable/workflow/index.d.ts.map +1 -1
  1312. package/dist/unstable/workflow/index.js +4 -0
  1313. package/dist/unstable/workflow/index.js.map +1 -1
  1314. package/package.json +11 -11
  1315. package/src/Array.ts +113 -67
  1316. package/src/BigDecimal.ts +404 -337
  1317. package/src/BigInt.ts +167 -97
  1318. package/src/Boolean.ts +62 -31
  1319. package/src/Brand.ts +20 -1
  1320. package/src/Cache.ts +331 -164
  1321. package/src/Cause.ts +77 -65
  1322. package/src/Channel.ts +1585 -607
  1323. package/src/ChannelSchema.ts +137 -12
  1324. package/src/Chunk.ts +549 -380
  1325. package/src/Clock.ts +15 -8
  1326. package/src/Combiner.ts +2 -4
  1327. package/src/Config.ts +12 -10
  1328. package/src/ConfigProvider.ts +1 -1
  1329. package/src/Console.ts +88 -58
  1330. package/src/Context.ts +397 -149
  1331. package/src/Cron.ts +111 -48
  1332. package/src/Data.ts +3 -2
  1333. package/src/DateTime.ts +876 -445
  1334. package/src/Deferred.ts +367 -174
  1335. package/src/Differ.ts +42 -0
  1336. package/src/Duration.ts +329 -185
  1337. package/src/Effect.ts +2474 -2395
  1338. package/src/Effectable.ts +39 -4
  1339. package/src/Encoding.ts +78 -28
  1340. package/src/Equivalence.ts +14 -19
  1341. package/src/ErrorReporter.ts +66 -82
  1342. package/src/ExecutionPlan.ts +97 -13
  1343. package/src/Exit.ts +7 -5
  1344. package/src/Fiber.ts +72 -40
  1345. package/src/FiberHandle.ts +158 -58
  1346. package/src/FiberMap.ts +329 -164
  1347. package/src/FiberSet.ts +130 -52
  1348. package/src/FileSystem.ts +106 -74
  1349. package/src/Filter.ts +166 -88
  1350. package/src/Function.ts +154 -86
  1351. package/src/Graph.ts +682 -365
  1352. package/src/HKT.ts +29 -13
  1353. package/src/Hash.ts +31 -18
  1354. package/src/HashMap.ts +444 -256
  1355. package/src/HashRing.ts +94 -17
  1356. package/src/HashSet.ts +194 -104
  1357. package/src/Inspectable.ts +22 -10
  1358. package/src/Iterable.ts +309 -149
  1359. package/src/JsonPatch.ts +4 -3
  1360. package/src/Latch.ts +98 -15
  1361. package/src/Layer.ts +488 -345
  1362. package/src/LayerMap.ts +98 -25
  1363. package/src/LogLevel.ts +92 -131
  1364. package/src/Logger.ts +357 -288
  1365. package/src/ManagedRuntime.ts +75 -17
  1366. package/src/Match.ts +133 -157
  1367. package/src/Metric.ts +355 -304
  1368. package/src/MutableHashMap.ts +161 -84
  1369. package/src/MutableHashSet.ts +122 -52
  1370. package/src/MutableList.ts +141 -81
  1371. package/src/MutableRef.ts +130 -90
  1372. package/src/Newtype.ts +3 -0
  1373. package/src/NonEmptyIterable.ts +36 -39
  1374. package/src/Number.ts +116 -64
  1375. package/src/Optic.ts +1 -2
  1376. package/src/Option.ts +41 -53
  1377. package/src/Ordering.ts +43 -28
  1378. package/src/PartitionedSemaphore.ts +225 -40
  1379. package/src/Path.ts +77 -13
  1380. package/src/Pipeable.ts +76 -21
  1381. package/src/PlatformError.ts +74 -6
  1382. package/src/Pool.ts +94 -31
  1383. package/src/Predicate.ts +16 -21
  1384. package/src/PrimaryKey.ts +9 -2
  1385. package/src/PubSub.ts +364 -262
  1386. package/src/Pull.ts +94 -25
  1387. package/src/Queue.ts +284 -150
  1388. package/src/Random.ts +54 -35
  1389. package/src/RcMap.ts +151 -141
  1390. package/src/RcRef.ts +69 -32
  1391. package/src/Record.ts +273 -129
  1392. package/src/Redactable.ts +3 -3
  1393. package/src/Redacted.ts +63 -33
  1394. package/src/Ref.ts +161 -104
  1395. package/src/References.ts +73 -31
  1396. package/src/RegExp.ts +11 -5
  1397. package/src/Request.ts +158 -34
  1398. package/src/RequestResolver.ts +277 -119
  1399. package/src/Resource.ts +45 -7
  1400. package/src/Result.ts +31 -18
  1401. package/src/Runtime.ts +45 -19
  1402. package/src/Schedule.ts +575 -600
  1403. package/src/Scheduler.ts +43 -6
  1404. package/src/Schema.ts +845 -319
  1405. package/src/SchemaAST.ts +25 -16
  1406. package/src/SchemaGetter.ts +32 -17
  1407. package/src/SchemaIssue.ts +1 -8
  1408. package/src/SchemaParser.ts +262 -38
  1409. package/src/SchemaTransformation.ts +61 -41
  1410. package/src/SchemaUtils.ts +23 -0
  1411. package/src/Scope.ts +102 -43
  1412. package/src/ScopedCache.ts +192 -56
  1413. package/src/ScopedRef.ts +28 -8
  1414. package/src/Semaphore.ts +64 -28
  1415. package/src/Sink.ts +458 -200
  1416. package/src/Stdio.ts +43 -6
  1417. package/src/Stream.ts +2043 -1256
  1418. package/src/String.ts +171 -95
  1419. package/src/SubscriptionRef.ts +308 -203
  1420. package/src/Symbol.ts +13 -5
  1421. package/src/SynchronizedRef.ts +278 -62
  1422. package/src/Take.ts +26 -2
  1423. package/src/Terminal.ts +40 -7
  1424. package/src/Tracer.ts +229 -55
  1425. package/src/Trie.ts +213 -142
  1426. package/src/TxChunk.ts +182 -146
  1427. package/src/TxDeferred.ts +43 -29
  1428. package/src/TxHashMap.ts +370 -230
  1429. package/src/TxHashSet.ts +250 -152
  1430. package/src/TxPriorityQueue.ts +96 -64
  1431. package/src/TxPubSub.ts +77 -49
  1432. package/src/TxQueue.ts +279 -241
  1433. package/src/TxReentrantLock.ts +70 -47
  1434. package/src/TxRef.ts +70 -41
  1435. package/src/TxSemaphore.ts +101 -54
  1436. package/src/TxSubscriptionRef.ts +72 -48
  1437. package/src/Types.ts +34 -34
  1438. package/src/UndefinedOr.ts +48 -25
  1439. package/src/Unify.ts +71 -116
  1440. package/src/Utils.ts +4 -0
  1441. package/src/index.ts +81 -32
  1442. package/src/internal/concurrency.ts +2 -2
  1443. package/src/internal/core.ts +12 -23
  1444. package/src/internal/effect.ts +25 -29
  1445. package/src/internal/executionPlan.ts +2 -2
  1446. package/src/internal/option.ts +5 -8
  1447. package/src/internal/result.ts +5 -8
  1448. package/src/internal/schema/schema.ts +1 -1
  1449. package/src/testing/FastCheck.ts +6 -3
  1450. package/src/testing/TestClock.ts +63 -34
  1451. package/src/testing/TestConsole.ts +49 -30
  1452. package/src/testing/TestSchema.ts +8 -8
  1453. package/src/unstable/ai/AiError.ts +187 -120
  1454. package/src/unstable/ai/AnthropicStructuredOutput.ts +2 -2
  1455. package/src/unstable/ai/Chat.ts +69 -43
  1456. package/src/unstable/ai/EmbeddingModel.ts +12 -11
  1457. package/src/unstable/ai/IdGenerator.ts +28 -18
  1458. package/src/unstable/ai/LanguageModel.ts +47 -46
  1459. package/src/unstable/ai/McpSchema.ts +339 -119
  1460. package/src/unstable/ai/McpServer.ts +78 -21
  1461. package/src/unstable/ai/Model.ts +23 -18
  1462. package/src/unstable/ai/OpenAiStructuredOutput.ts +2 -2
  1463. package/src/unstable/ai/Prompt.ts +210 -184
  1464. package/src/unstable/ai/Response.ts +159 -147
  1465. package/src/unstable/ai/ResponseIdTracker.ts +43 -4
  1466. package/src/unstable/ai/Telemetry.ts +42 -32
  1467. package/src/unstable/ai/Tokenizer.ts +13 -8
  1468. package/src/unstable/ai/Tool.ts +154 -85
  1469. package/src/unstable/ai/Toolkit.ts +81 -84
  1470. package/src/unstable/ai/index.ts +42 -24
  1471. package/src/unstable/cli/Argument.ts +226 -134
  1472. package/src/unstable/cli/CliError.ts +96 -26
  1473. package/src/unstable/cli/CliOutput.ts +43 -13
  1474. package/src/unstable/cli/Command.ts +225 -125
  1475. package/src/unstable/cli/Completions.ts +7 -7
  1476. package/src/unstable/cli/Flag.ts +235 -142
  1477. package/src/unstable/cli/GlobalFlag.ts +42 -14
  1478. package/src/unstable/cli/HelpDoc.ts +35 -10
  1479. package/src/unstable/cli/Param.ts +328 -190
  1480. package/src/unstable/cli/Primitive.ts +79 -42
  1481. package/src/unstable/cli/Prompt.ts +210 -58
  1482. package/src/unstable/cli/internal/ansi.ts +13 -0
  1483. package/src/unstable/cli/internal/command.ts +17 -15
  1484. package/src/unstable/cli/internal/config.ts +3 -0
  1485. package/src/unstable/cli/internal/lexer.ts +11 -0
  1486. package/src/unstable/cluster/ClusterCron.ts +35 -1
  1487. package/src/unstable/cluster/ClusterError.ts +56 -7
  1488. package/src/unstable/cluster/ClusterMetrics.ts +39 -5
  1489. package/src/unstable/cluster/ClusterSchema.ts +61 -8
  1490. package/src/unstable/cluster/ClusterWorkflowEngine.ts +36 -3
  1491. package/src/unstable/cluster/DeliverAt.ts +39 -4
  1492. package/src/unstable/cluster/Entity.ts +110 -19
  1493. package/src/unstable/cluster/EntityAddress.ts +30 -2
  1494. package/src/unstable/cluster/EntityId.ts +18 -3
  1495. package/src/unstable/cluster/EntityProxy.ts +34 -2
  1496. package/src/unstable/cluster/EntityProxyServer.ts +44 -8
  1497. package/src/unstable/cluster/EntityResource.ts +43 -6
  1498. package/src/unstable/cluster/EntityType.ts +27 -3
  1499. package/src/unstable/cluster/Envelope.ts +128 -23
  1500. package/src/unstable/cluster/HttpRunner.ts +88 -13
  1501. package/src/unstable/cluster/K8sHttpClient.ts +49 -6
  1502. package/src/unstable/cluster/MachineId.ts +24 -3
  1503. package/src/unstable/cluster/Message.ts +102 -13
  1504. package/src/unstable/cluster/MessageStorage.ts +128 -22
  1505. package/src/unstable/cluster/Reply.ts +101 -12
  1506. package/src/unstable/cluster/Runner.ts +47 -17
  1507. package/src/unstable/cluster/RunnerAddress.ts +34 -2
  1508. package/src/unstable/cluster/RunnerHealth.ts +40 -12
  1509. package/src/unstable/cluster/RunnerServer.ts +31 -4
  1510. package/src/unstable/cluster/RunnerStorage.ts +42 -5
  1511. package/src/unstable/cluster/Runners.ts +73 -10
  1512. package/src/unstable/cluster/ShardId.ts +51 -5
  1513. package/src/unstable/cluster/Sharding.ts +35 -4
  1514. package/src/unstable/cluster/ShardingConfig.ts +76 -11
  1515. package/src/unstable/cluster/ShardingRegistrationEvent.ts +31 -7
  1516. package/src/unstable/cluster/SingleRunner.ts +23 -1
  1517. package/src/unstable/cluster/Singleton.ts +15 -1
  1518. package/src/unstable/cluster/SingletonAddress.ts +21 -1
  1519. package/src/unstable/cluster/Snowflake.ts +89 -19
  1520. package/src/unstable/cluster/SocketRunner.ts +29 -2
  1521. package/src/unstable/cluster/SqlMessageStorage.ts +27 -3
  1522. package/src/unstable/cluster/SqlRunnerStorage.ts +46 -7
  1523. package/src/unstable/cluster/TestRunner.ts +18 -1
  1524. package/src/unstable/cluster/internal/hash.ts +12 -0
  1525. package/src/unstable/devtools/DevTools.ts +26 -3
  1526. package/src/unstable/devtools/DevToolsClient.ts +32 -5
  1527. package/src/unstable/devtools/DevToolsSchema.ts +201 -44
  1528. package/src/unstable/devtools/DevToolsServer.ts +27 -2
  1529. package/src/unstable/encoding/Msgpack.ts +97 -12
  1530. package/src/unstable/encoding/Ndjson.ts +149 -21
  1531. package/src/unstable/encoding/Sse.ts +109 -18
  1532. package/src/unstable/eventlog/Event.ts +131 -30
  1533. package/src/unstable/eventlog/EventGroup.ts +50 -17
  1534. package/src/unstable/eventlog/EventJournal.ts +120 -20
  1535. package/src/unstable/eventlog/EventLog.ts +151 -31
  1536. package/src/unstable/eventlog/EventLogEncryption.ts +42 -6
  1537. package/src/unstable/eventlog/EventLogMessage.ts +92 -18
  1538. package/src/unstable/eventlog/EventLogRemote.ts +54 -8
  1539. package/src/unstable/eventlog/EventLogServer.ts +33 -3
  1540. package/src/unstable/eventlog/EventLogServerEncrypted.ts +52 -6
  1541. package/src/unstable/eventlog/EventLogServerUnencrypted.ts +90 -16
  1542. package/src/unstable/eventlog/EventLogSessionAuth.ts +77 -15
  1543. package/src/unstable/eventlog/SqlEventJournal.ts +28 -2
  1544. package/src/unstable/eventlog/SqlEventLogServerEncrypted.ts +32 -3
  1545. package/src/unstable/eventlog/SqlEventLogServerUnencrypted.ts +28 -2
  1546. package/src/unstable/http/Cookies.ts +156 -77
  1547. package/src/unstable/http/Etag.ts +40 -7
  1548. package/src/unstable/http/FetchHttpClient.ts +33 -4
  1549. package/src/unstable/http/FindMyWay.ts +1 -1
  1550. package/src/unstable/http/Headers.ts +252 -50
  1551. package/src/unstable/http/HttpBody.ts +130 -28
  1552. package/src/unstable/http/HttpClient.ts +206 -97
  1553. package/src/unstable/http/HttpClientError.ts +80 -12
  1554. package/src/unstable/http/HttpClientRequest.ts +320 -102
  1555. package/src/unstable/http/HttpClientResponse.ts +59 -16
  1556. package/src/unstable/http/HttpEffect.ts +66 -18
  1557. package/src/unstable/http/HttpIncomingMessage.ts +47 -7
  1558. package/src/unstable/http/HttpMethod.ts +35 -5
  1559. package/src/unstable/http/HttpMiddleware.ts +63 -16
  1560. package/src/unstable/http/HttpPlatform.ts +35 -4
  1561. package/src/unstable/http/HttpRouter.ts +221 -57
  1562. package/src/unstable/http/HttpServer.ts +152 -23
  1563. package/src/unstable/http/HttpServerError.ts +90 -10
  1564. package/src/unstable/http/HttpServerRequest.ts +136 -32
  1565. package/src/unstable/http/HttpServerRespondable.ts +49 -6
  1566. package/src/unstable/http/HttpServerResponse.ts +395 -72
  1567. package/src/unstable/http/HttpStaticServer.ts +22 -4
  1568. package/src/unstable/http/HttpTraceContext.ts +53 -6
  1569. package/src/unstable/http/Multipart.ts +179 -29
  1570. package/src/unstable/http/Multipasta/HeadersParser.ts +1 -1
  1571. package/src/unstable/http/Multipasta/Node.ts +1 -1
  1572. package/src/unstable/http/Multipasta/Search.ts +1 -1
  1573. package/src/unstable/http/Multipasta/Web.ts +1 -1
  1574. package/src/unstable/http/Multipasta.ts +1 -1
  1575. package/src/unstable/http/Template.ts +53 -0
  1576. package/src/unstable/http/Url.ts +56 -42
  1577. package/src/unstable/http/UrlParams.ts +233 -49
  1578. package/src/unstable/httpapi/HttpApi.ts +49 -14
  1579. package/src/unstable/httpapi/HttpApiBuilder.ts +86 -20
  1580. package/src/unstable/httpapi/HttpApiClient.ts +80 -16
  1581. package/src/unstable/httpapi/HttpApiEndpoint.ts +238 -59
  1582. package/src/unstable/httpapi/HttpApiError.ts +100 -1
  1583. package/src/unstable/httpapi/HttpApiGroup.ts +87 -20
  1584. package/src/unstable/httpapi/HttpApiMiddleware.ts +113 -23
  1585. package/src/unstable/httpapi/HttpApiScalar.ts +38 -4
  1586. package/src/unstable/httpapi/HttpApiSchema.ts +67 -30
  1587. package/src/unstable/httpapi/HttpApiSecurity.ts +74 -17
  1588. package/src/unstable/httpapi/HttpApiSwagger.ts +24 -2
  1589. package/src/unstable/httpapi/HttpApiTest.ts +31 -3
  1590. package/src/unstable/httpapi/OpenApi.ts +115 -15
  1591. package/src/unstable/observability/Otlp.ts +33 -3
  1592. package/src/unstable/observability/OtlpExporter.ts +32 -1
  1593. package/src/unstable/observability/OtlpLogger.ts +31 -2
  1594. package/src/unstable/observability/OtlpMetrics.ts +37 -4
  1595. package/src/unstable/observability/OtlpResource.ts +68 -12
  1596. package/src/unstable/observability/OtlpSerialization.ts +28 -3
  1597. package/src/unstable/observability/OtlpTracer.ts +38 -2
  1598. package/src/unstable/observability/PrometheusMetrics.ts +32 -12
  1599. package/src/unstable/observability/index.ts +2 -1
  1600. package/src/unstable/persistence/KeyValueStore.ts +108 -28
  1601. package/src/unstable/persistence/Persistable.ts +76 -15
  1602. package/src/unstable/persistence/PersistedCache.ts +27 -2
  1603. package/src/unstable/persistence/PersistedQueue.ts +98 -16
  1604. package/src/unstable/persistence/Persistence.ts +97 -16
  1605. package/src/unstable/persistence/RateLimiter.ts +98 -22
  1606. package/src/unstable/persistence/Redis.ts +42 -5
  1607. package/src/unstable/process/ChildProcess.ts +100 -79
  1608. package/src/unstable/process/ChildProcessSpawner.ts +22 -11
  1609. package/src/unstable/process/index.ts +2 -1
  1610. package/src/unstable/reactivity/AsyncResult.ts +202 -61
  1611. package/src/unstable/reactivity/Atom.ts +597 -143
  1612. package/src/unstable/reactivity/AtomHttpApi.ts +41 -2
  1613. package/src/unstable/reactivity/AtomRef.ts +51 -7
  1614. package/src/unstable/reactivity/AtomRegistry.ts +141 -22
  1615. package/src/unstable/reactivity/AtomRpc.ts +36 -2
  1616. package/src/unstable/reactivity/Hydration.ts +45 -5
  1617. package/src/unstable/reactivity/Reactivity.ts +95 -13
  1618. package/src/unstable/rpc/Rpc.ts +255 -56
  1619. package/src/unstable/rpc/RpcClient.ts +108 -20
  1620. package/src/unstable/rpc/RpcClientError.ts +26 -2
  1621. package/src/unstable/rpc/RpcGroup.ts +51 -8
  1622. package/src/unstable/rpc/RpcMessage.ts +128 -32
  1623. package/src/unstable/rpc/RpcMiddleware.ts +100 -20
  1624. package/src/unstable/rpc/RpcSchema.ts +38 -4
  1625. package/src/unstable/rpc/RpcSerialization.ts +60 -13
  1626. package/src/unstable/rpc/RpcServer.ts +108 -25
  1627. package/src/unstable/rpc/RpcTest.ts +20 -1
  1628. package/src/unstable/rpc/RpcWorker.ts +42 -8
  1629. package/src/unstable/rpc/Utils.ts +31 -0
  1630. package/src/unstable/schema/Model.ts +148 -52
  1631. package/src/unstable/schema/VariantSchema.ts +104 -24
  1632. package/src/unstable/socket/Socket.ts +168 -35
  1633. package/src/unstable/socket/SocketServer.ts +58 -10
  1634. package/src/unstable/sql/Migrator.ts +57 -5
  1635. package/src/unstable/sql/SqlClient.ts +55 -2
  1636. package/src/unstable/sql/SqlConnection.ts +31 -0
  1637. package/src/unstable/sql/SqlError.ts +117 -0
  1638. package/src/unstable/sql/SqlModel.ts +26 -5
  1639. package/src/unstable/sql/SqlResolver.ts +56 -13
  1640. package/src/unstable/sql/SqlSchema.ts +29 -8
  1641. package/src/unstable/sql/SqlStream.ts +23 -0
  1642. package/src/unstable/sql/Statement.ts +141 -0
  1643. package/src/unstable/sql/index.ts +1 -1
  1644. package/src/unstable/workers/Transferable.ts +65 -13
  1645. package/src/unstable/workers/Worker.ts +60 -8
  1646. package/src/unstable/workers/WorkerError.ts +50 -9
  1647. package/src/unstable/workers/WorkerRunner.ts +32 -3
  1648. package/src/unstable/workers/index.ts +1 -1
  1649. package/src/unstable/workflow/Activity.ts +62 -11
  1650. package/src/unstable/workflow/DurableClock.ts +26 -3
  1651. package/src/unstable/workflow/DurableDeferred.ts +146 -31
  1652. package/src/unstable/workflow/DurableQueue.ts +366 -0
  1653. package/src/unstable/workflow/Workflow.ts +122 -32
  1654. package/src/unstable/workflow/WorkflowEngine.ts +40 -5
  1655. package/src/unstable/workflow/WorkflowProxy.ts +32 -2
  1656. package/src/unstable/workflow/WorkflowProxyServer.ts +40 -6
  1657. package/src/unstable/workflow/index.ts +5 -0
package/dist/Channel.d.ts CHANGED
@@ -28,7 +28,8 @@
28
28
  * 2. **Sequencing**: Use the result of one channel to create another
29
29
  * 3. **Concatenating**: Combine multiple channels into a single channel
30
30
  *
31
- * @example
31
+ * **Example** (Creating a simple channel)
32
+ *
32
33
  * ```ts
33
34
  * import { Channel } from "effect"
34
35
  *
@@ -41,7 +42,8 @@
41
42
  * // Running the channel would output: 84
42
43
  * ```
43
44
  *
44
- * @example
45
+ * **Example** (Transforming array-backed channels)
46
+ *
45
47
  * ```ts
46
48
  * import { Channel } from "effect"
47
49
  *
@@ -79,19 +81,25 @@ import { ParentSpan, type SpanOptions } from "./Tracer.ts";
79
81
  import type * as Types from "./Types.ts";
80
82
  import type * as Unify from "./Unify.ts";
81
83
  /**
82
- * @since 4.0.0
84
+ * String literal type used as the unique brand for `Channel` values.
85
+ *
83
86
  * @category Type Identifiers
87
+ * @since 4.0.0
84
88
  */
85
89
  export type TypeId = "~effect/Channel";
86
90
  /**
87
- * @since 4.0.0
91
+ * Runtime identifier stored on `Channel` values and used by `isChannel` to
92
+ * recognize them.
93
+ *
88
94
  * @category Type Identifiers
95
+ * @since 4.0.0
89
96
  */
90
97
  export declare const TypeId: TypeId;
91
98
  /**
92
99
  * Tests if a value is a `Channel`.
93
100
  *
94
- * @example
101
+ * **Example** (Checking for channels)
102
+ *
95
103
  * ```ts
96
104
  * import { Channel } from "effect"
97
105
  *
@@ -127,7 +135,8 @@ export declare const isChannel: (u: unknown) => u is Channel<unknown, unknown, u
127
135
  * channels, which are all concatenated together. The first channel and the
128
136
  * function that makes the other channels can be composed into a channel.
129
137
  *
130
- * @example
138
+ * **Example** (Typing channels)
139
+ *
131
140
  * ```ts
132
141
  * import type { Channel } from "effect"
133
142
  *
@@ -149,8 +158,8 @@ export declare const isChannel: (u: unknown) => u is Channel<unknown, unknown, u
149
158
  * >
150
159
  * ```
151
160
  *
152
- * @since 2.0.0
153
161
  * @category models
162
+ * @since 2.0.0
154
163
  */
155
164
  export interface Channel<out OutElem, out OutErr = never, out OutDone = void, in InElem = unknown, in InErr = unknown, in InDone = unknown, out Env = never> extends Variance<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>, Pipeable {
156
165
  [Unify.typeSymbol]?: unknown;
@@ -158,8 +167,14 @@ export interface Channel<out OutElem, out OutErr = never, out OutDone = void, in
158
167
  [Unify.ignoreSymbol]?: ChannelUnifyIgnore;
159
168
  }
160
169
  /**
161
- * @since 2.0.0
170
+ * Type-level unification support for `Channel` values.
171
+ *
172
+ * This preserves all `Channel` type parameters when `Unify` normalizes unions
173
+ * or generic return types that include channels. Users normally do not need to
174
+ * reference this interface directly.
175
+ *
162
176
  * @category models
177
+ * @since 2.0.0
163
178
  */
164
179
  export interface ChannelUnify<A extends {
165
180
  [Unify.typeSymbol]?: any;
@@ -167,6 +182,13 @@ export interface ChannelUnify<A extends {
167
182
  Channel?: () => A[Unify.typeSymbol] extends Channel<infer OutElem, infer OutErr, infer OutDone, infer InElem, infer InErr, infer InDone, infer Env> | infer _ ? Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env> : never;
168
183
  }
169
184
  /**
185
+ * Marker used by `Unify` while resolving `Channel` values.
186
+ *
187
+ * It prevents the inherited `Effect` unifier from being selected when the
188
+ * channel-specific unifier should preserve `Channel` input, output, and
189
+ * environment type parameters. Users normally do not need to reference this
190
+ * interface directly.
191
+ *
170
192
  * @category models
171
193
  * @since 2.0.0
172
194
  */
@@ -177,15 +199,29 @@ type TagsWithReason<E> = {
177
199
  [T in Types.Tags<E>]: Types.ReasonTags<Types.ExtractTag<E, T>> extends never ? never : T;
178
200
  }[Types.Tags<E>];
179
201
  /**
180
- * @since 2.0.0
202
+ * Phantom variance marker for the type parameters of `Channel`.
203
+ *
204
+ * Output element, output error, output done, and environment types are
205
+ * covariant. Input element, input error, and input done types are
206
+ * contravariant. This is type-level machinery and is not used directly at
207
+ * runtime.
208
+ *
181
209
  * @category models
210
+ * @since 2.0.0
182
211
  */
183
212
  export interface Variance<out OutElem, out OutErr, out OutDone, in InElem, in InErr, in InDone, out Env> {
184
213
  readonly [TypeId]: VarianceStruct<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>;
185
214
  }
186
215
  /**
187
- * @since 2.0.0
216
+ * Structural encoding used by `Variance` to record each `Channel` type
217
+ * parameter's variance.
218
+ *
219
+ * The `_OutElem`, `_OutErr`, `_OutDone`, and `_Env` fields are covariant; the
220
+ * `_InElem`, `_InErr`, and `_InDone` fields are contravariant. Users normally
221
+ * do not need to reference this interface directly.
222
+ *
188
223
  * @category models
224
+ * @since 2.0.0
189
225
  */
190
226
  export interface VarianceStruct<out OutElem, out OutErr, out OutDone, in InElem, in InErr, in InDone, out Env> {
191
227
  _Env: Types.Covariant<Env>;
@@ -199,7 +235,8 @@ export interface VarianceStruct<out OutElem, out OutErr, out OutDone, in InElem,
199
235
  /**
200
236
  * Creates a `Channel` from a transformation function that operates on upstream pulls.
201
237
  *
202
- * @example
238
+ * **Example** (Creating channels from transforms)
239
+ *
203
240
  * ```ts
204
241
  * import { Channel, Effect } from "effect"
205
242
  *
@@ -215,7 +252,8 @@ export declare const fromTransform: <OutElem, OutErr, OutDone, InElem, InErr, In
215
252
  /**
216
253
  * Transforms a Channel by applying a function to its Pull implementation.
217
254
  *
218
- * @example
255
+ * **Example** (Transforming pull behavior)
256
+ *
219
257
  * ```ts
220
258
  * import { Channel, Effect } from "effect"
221
259
  *
@@ -239,7 +277,8 @@ export declare const transformPull: <OutElem, OutErr, OutDone, InElem, InErr, In
239
277
  /**
240
278
  * Creates a `Channel` from an `Effect` that produces a `Pull`.
241
279
  *
242
- * @example
280
+ * **Example** (Creating channels from pulls)
281
+ *
243
282
  * ```ts
244
283
  * import { Channel, Effect } from "effect"
245
284
  *
@@ -257,14 +296,15 @@ export declare const fromPull: <OutElem, OutErr, OutDone, EX, EnvX, Env>(effect:
257
296
  * pulls, but also provides a forked scope that closes when the resulting
258
297
  * Channel completes.
259
298
  *
260
- * @since 4.0.0
261
299
  * @category constructors
300
+ * @since 4.0.0
262
301
  */
263
302
  export declare const fromTransformBracket: <OutElem, OutErr, OutDone, InElem, InErr, InDone, EX, EnvX, Env>(f: (upstream: Pull.Pull<InElem, InErr, InDone>, scope: Scope.Scope, forkedScope: Scope.Scope) => Effect.Effect<Pull.Pull<OutElem, OutErr, OutDone, EnvX>, EX, Env>) => Channel<OutElem, Pull.ExcludeDone<OutErr> | EX, OutDone, InElem, InErr, InDone, Env | EnvX>;
264
303
  /**
265
304
  * Converts a `Channel` back to its underlying transformation function.
266
305
  *
267
- * @example
306
+ * **Example** (Extracting channel transforms)
307
+ *
268
308
  * ```ts
269
309
  * import { Channel } from "effect"
270
310
  *
@@ -280,7 +320,8 @@ export declare const toTransform: <OutElem, OutErr, OutDone, InElem, InErr, InDo
280
320
  /**
281
321
  * The default chunk size used by channels for batching operations.
282
322
  *
283
- * @example
323
+ * **Example** (Reading the default chunk size)
324
+ *
284
325
  * ```ts
285
326
  * import { Channel } from "effect"
286
327
  *
@@ -294,7 +335,8 @@ export declare const DefaultChunkSize: number;
294
335
  /**
295
336
  * Creates a `Channel` that interacts with a callback function using a queue.
296
337
  *
297
- * @example
338
+ * **Example** (Creating channels from callbacks)
339
+ *
298
340
  * ```ts
299
341
  * import { Channel, Effect, Queue } from "effect"
300
342
  *
@@ -317,7 +359,8 @@ export declare const callback: <A, E = never, R = never>(f: (queue: Queue.Queue<
317
359
  /**
318
360
  * Creates a `Channel` that interacts with a callback function using a queue, emitting arrays.
319
361
  *
320
- * @example
362
+ * **Example** (Creating array channels from callbacks)
363
+ *
321
364
  * ```ts
322
365
  * import { Channel, Effect, Queue } from "effect"
323
366
  *
@@ -338,7 +381,8 @@ export declare const callbackArray: <A, E = never, R = never>(f: (queue: Queue.Q
338
381
  /**
339
382
  * Creates a `Channel` that lazily evaluates to another channel.
340
383
  *
341
- * @example
384
+ * **Example** (Suspending channel creation)
385
+ *
342
386
  * ```ts
343
387
  * import { Channel } from "effect"
344
388
  *
@@ -351,9 +395,15 @@ export declare const callbackArray: <A, E = never, R = never>(f: (queue: Queue.Q
351
395
  */
352
396
  export declare const suspend: <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>(evaluate: LazyArg<Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>>) => Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>;
353
397
  /**
354
- * Creates a `Channel` with resource management using acquire-use-release pattern.
398
+ * Acquires a resource, uses it to build a `Channel`, and guarantees that
399
+ * `release` runs with the channel's `Exit` when the channel completes, fails,
400
+ * or is interrupted.
401
+ *
402
+ * Acquisition is uninterruptible. If acquisition fails, `use` is not run and
403
+ * `release` is not registered.
404
+ *
405
+ * **Example** (Managing resources with acquire-use-release)
355
406
  *
356
- * @example
357
407
  * ```ts
358
408
  * import { Channel, Effect } from "effect"
359
409
  *
@@ -369,9 +419,15 @@ export declare const suspend: <OutElem, OutErr, OutDone, InElem, InErr, InDone,
369
419
  */
370
420
  export declare const acquireUseRelease: <A, E, R, OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>(acquire: Effect.Effect<A, E, R>, use: (a: A) => Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>, release: (a: A, exit: Exit.Exit<OutDone, OutErr>) => Effect.Effect<unknown>) => Channel<OutElem, OutErr | E, OutDone, InElem, InErr, InDone, Env | R>;
371
421
  /**
372
- * Creates a `Channel` with resource management using acquire-release pattern.
422
+ * Acquires a resource, emits the acquired value as a single channel element,
423
+ * and registers `release` in the channel scope.
424
+ *
425
+ * The release action runs when the channel scope closes and receives the scope
426
+ * exit. If acquisition fails, no element is emitted and `release` is not
427
+ * registered.
428
+ *
429
+ * **Example** (Managing resources with acquire-release)
373
430
  *
374
- * @example
375
431
  * ```ts
376
432
  * import { Channel, Effect } from "effect"
377
433
  *
@@ -386,9 +442,15 @@ export declare const acquireUseRelease: <A, E, R, OutElem, OutErr, OutDone, InEl
386
442
  */
387
443
  export declare const acquireRelease: {
388
444
  /**
389
- * Creates a `Channel` with resource management using acquire-release pattern.
445
+ * Acquires a resource, emits the acquired value as a single channel element,
446
+ * and registers `release` in the channel scope.
447
+ *
448
+ * The release action runs when the channel scope closes and receives the scope
449
+ * exit. If acquisition fails, no element is emitted and `release` is not
450
+ * registered.
451
+ *
452
+ * **Example** (Managing resources with acquire-release)
390
453
  *
391
- * @example
392
454
  * ```ts
393
455
  * import { Channel, Effect } from "effect"
394
456
  *
@@ -403,9 +465,15 @@ export declare const acquireRelease: {
403
465
  */
404
466
  <Z>(release: (z: Z, e: Exit.Exit<unknown, unknown>) => Effect.Effect<unknown>): <E, R>(self: Effect.Effect<Z, E, R>) => Channel<Z, E, void, unknown, unknown, unknown, R>;
405
467
  /**
406
- * Creates a `Channel` with resource management using acquire-release pattern.
468
+ * Acquires a resource, emits the acquired value as a single channel element,
469
+ * and registers `release` in the channel scope.
470
+ *
471
+ * The release action runs when the channel scope closes and receives the scope
472
+ * exit. If acquisition fails, no element is emitted and `release` is not
473
+ * registered.
474
+ *
475
+ * **Example** (Managing resources with acquire-release)
407
476
  *
408
- * @example
409
477
  * ```ts
410
478
  * import { Channel, Effect } from "effect"
411
479
  *
@@ -423,7 +491,8 @@ export declare const acquireRelease: {
423
491
  /**
424
492
  * Creates a `Channel` from an iterator.
425
493
  *
426
- * @example
494
+ * **Example** (Creating channels from iterators)
495
+ *
427
496
  * ```ts
428
497
  * import { Channel } from "effect"
429
498
  *
@@ -439,7 +508,8 @@ export declare const fromIterator: <A, L>(iterator: LazyArg<Iterator<A, L>>) =>
439
508
  /**
440
509
  * Creates a `Channel` that emits all elements from an array.
441
510
  *
442
- * @example
511
+ * **Example** (Creating channels from arrays)
512
+ *
443
513
  * ```ts
444
514
  * import { Channel } from "effect"
445
515
  *
@@ -454,7 +524,8 @@ export declare const fromArray: <A>(array: ReadonlyArray<A>) => Channel<A>;
454
524
  /**
455
525
  * Creates a `Channel` that emits all elements from a chunk.
456
526
  *
457
- * @example
527
+ * **Example** (Creating channels from chunks)
528
+ *
458
529
  * ```ts
459
530
  * import { Channel, Chunk } from "effect"
460
531
  *
@@ -470,7 +541,8 @@ export declare const fromChunk: <A>(chunk: Chunk.Chunk<A>) => Channel<A>;
470
541
  /**
471
542
  * Creates a `Channel` from an iterator that emits arrays of elements.
472
543
  *
473
- * @example
544
+ * **Example** (Batching iterator output)
545
+ *
474
546
  * ```ts
475
547
  * import { Channel } from "effect"
476
548
  *
@@ -491,7 +563,8 @@ export declare const fromChunk: <A>(chunk: Chunk.Chunk<A>) => Channel<A>;
491
563
  * // This will emit arrays: [0, 1], [2], then complete with "finished"
492
564
  * ```
493
565
  *
494
- * @example
566
+ * **Example** (Batching generator output)
567
+ *
495
568
  * ```ts
496
569
  * import { Channel } from "effect"
497
570
  *
@@ -508,14 +581,15 @@ export declare const fromChunk: <A>(chunk: Chunk.Chunk<A>) => Channel<A>;
508
581
  * // Emits: [0, 1, 1], [2, 3], then completes
509
582
  * ```
510
583
  *
511
- * @since 2.0.0
512
584
  * @category constructors
585
+ * @since 2.0.0
513
586
  */
514
587
  export declare const fromIteratorArray: <A, L>(iterator: LazyArg<Iterator<A, L>>, chunkSize?: number) => Channel<Arr.NonEmptyReadonlyArray<A>, never, L>;
515
588
  /**
516
589
  * Creates a `Channel` that emits all elements from an iterable.
517
590
  *
518
- * @example
591
+ * **Example** (Creating channels from iterables)
592
+ *
519
593
  * ```ts
520
594
  * import { Channel } from "effect"
521
595
  *
@@ -531,7 +605,8 @@ export declare const fromIterable: <A, L>(iterable: Iterable<A, L>) => Channel<A
531
605
  /**
532
606
  * Creates a `Channel` that emits arrays of elements from an iterable.
533
607
  *
534
- * @example
608
+ * **Example** (Batching iterable output)
609
+ *
535
610
  * ```ts
536
611
  * import { Channel } from "effect"
537
612
  *
@@ -547,7 +622,8 @@ export declare const fromIterableArray: <A, L>(iterable: Iterable<A, L>, chunkSi
547
622
  /**
548
623
  * Creates a `Channel` that emits a single value and then ends.
549
624
  *
550
- * @example
625
+ * **Example** (Creating channels that succeed)
626
+ *
551
627
  * ```ts
552
628
  * import { Channel } from "effect"
553
629
  *
@@ -562,7 +638,8 @@ export declare const succeed: <A>(value: A) => Channel<A>;
562
638
  /**
563
639
  * Creates a `Channel` that immediately ends with the specified value.
564
640
  *
565
- * @example
641
+ * **Example** (Ending with a value)
642
+ *
566
643
  * ```ts
567
644
  * import { Channel } from "effect"
568
645
  *
@@ -584,12 +661,18 @@ export declare const endSync: <A>(evaluate: LazyArg<A>) => Channel<never, never,
584
661
  /**
585
662
  * Creates a `Channel` that emits a single value computed by a lazy evaluation.
586
663
  *
587
- * @example
664
+ * **Example** (Computing values lazily)
665
+ *
588
666
  * ```ts
589
667
  * import { Channel } from "effect"
590
668
  *
591
- * const channel = Channel.sync(() => Math.random())
592
- * // Emits a random number computed when the channel runs
669
+ * let requests = 0
670
+ *
671
+ * const channel = Channel.sync(() => {
672
+ * requests += 1
673
+ * return `request-${requests}`
674
+ * })
675
+ * // Emits "request-1" when the channel runs for the first time
593
676
  * ```
594
677
  *
595
678
  * @category constructors
@@ -599,7 +682,8 @@ export declare const sync: <A>(evaluate: LazyArg<A>) => Channel<A>;
599
682
  /**
600
683
  * Represents an Channel that emits no elements
601
684
  *
602
- * @example
685
+ * **Example** (Using empty channels)
686
+ *
603
687
  * ```ts
604
688
  * import { Channel } from "effect"
605
689
  *
@@ -615,14 +699,15 @@ export declare const sync: <A>(evaluate: LazyArg<A>) => Channel<A>;
615
699
  * shouldEmit ? Channel.succeed("data") : Channel.empty
616
700
  * ```
617
701
  *
618
- * @since 2.0.0
619
702
  * @category constructors
703
+ * @since 2.0.0
620
704
  */
621
705
  export declare const empty: Channel<never>;
622
706
  /**
623
707
  * Represents an Channel that never completes
624
708
  *
625
- * @example
709
+ * **Example** (Using non-terminating channels)
710
+ *
626
711
  * ```ts
627
712
  * import { Channel } from "effect"
628
713
  *
@@ -640,14 +725,15 @@ export declare const empty: Channel<never>;
640
725
  * shouldComplete ? Channel.succeed("done") : Channel.never
641
726
  * ```
642
727
  *
643
- * @since 2.0.0
644
728
  * @category constructors
729
+ * @since 2.0.0
645
730
  */
646
731
  export declare const never: Channel<never, never, never>;
647
732
  /**
648
733
  * Constructs a channel that fails immediately with the specified error.
649
734
  *
650
- * @example
735
+ * **Example** (Failing with an error)
736
+ *
651
737
  * ```ts
652
738
  * import { Channel } from "effect"
653
739
  *
@@ -670,15 +756,16 @@ export declare const never: Channel<never, never, never>;
670
756
  * )
671
757
  * ```
672
758
  *
673
- * @since 2.0.0
674
759
  * @category constructors
760
+ * @since 2.0.0
675
761
  */
676
762
  export declare const fail: <E>(error: E) => Channel<never, E, never>;
677
763
  /**
678
764
  * Constructs a channel that fails immediately with the specified lazily
679
765
  * evaluated error.
680
766
  *
681
- * @example
767
+ * **Example** (Failing with a lazy error)
768
+ *
682
769
  * ```ts
683
770
  * import { Channel } from "effect"
684
771
  *
@@ -689,25 +776,28 @@ export declare const fail: <E>(error: E) => Channel<never, E, never>;
689
776
  * })
690
777
  *
691
778
  * // The error computation is deferred until the channel runs
692
- * const conditionalError = Channel.failSync(() =>
693
- * Math.random() > 0.5 ? "Error A" : "Error B"
694
- * )
779
+ * let attempts = 0
780
+ * const conditionalError = Channel.failSync(() => {
781
+ * attempts += 1
782
+ * return `Error after attempt ${attempts}`
783
+ * })
695
784
  *
696
785
  * // Use with expensive error construction
697
786
  * const expensiveError = Channel.failSync(() => {
698
- * const timestamp = Date.now()
699
- * return new Error(`Failed at: ${timestamp}`)
787
+ * const requestId = "request-123"
788
+ * return new Error(`Failed while processing ${requestId}`)
700
789
  * })
701
790
  * ```
702
791
  *
703
- * @since 2.0.0
704
792
  * @category constructors
793
+ * @since 2.0.0
705
794
  */
706
795
  export declare const failSync: <E>(evaluate: LazyArg<E>) => Channel<never, E, never>;
707
796
  /**
708
797
  * Constructs a channel that fails immediately with the specified `Cause`.
709
798
  *
710
- * @example
799
+ * **Example** (Failing with causes)
800
+ *
711
801
  * ```ts
712
802
  * import { Cause, Channel } from "effect"
713
803
  *
@@ -724,39 +814,42 @@ export declare const failSync: <E>(evaluate: LazyArg<E>) => Channel<never, E, ne
724
814
  * const simpleFail = Channel.failCause(failCause)
725
815
  * ```
726
816
  *
727
- * @since 2.0.0
728
817
  * @category constructors
818
+ * @since 2.0.0
729
819
  */
730
820
  export declare const failCause: <E>(cause: Cause.Cause<E>) => Channel<never, E, never>;
731
821
  /**
732
822
  * Constructs a channel that fails immediately with the specified lazily
733
823
  * evaluated `Cause`.
734
824
  *
735
- * @example
825
+ * **Example** (Failing with lazy causes)
826
+ *
736
827
  * ```ts
737
828
  * import { Cause, Channel } from "effect"
738
829
  *
739
830
  * // Create a channel that fails with a lazily computed cause
831
+ * let attempts = 0
740
832
  * const failedChannel = Channel.failCauseSync(() => {
741
- * const errorType = Math.random() > 0.5 ? "A" : "B"
742
- * return Cause.fail(`Runtime error ${errorType}`)
833
+ * attempts += 1
834
+ * return Cause.fail(`Runtime error after attempt ${attempts}`)
743
835
  * })
744
836
  *
745
837
  * // Create a channel with die cause computation
746
838
  * const dieCauseChannel = Channel.failCauseSync(() => {
747
- * const timestamp = Date.now()
748
- * return Cause.die(`Error at ${timestamp}`)
839
+ * const operation = "load-profile"
840
+ * return Cause.die(`Unexpected defect during ${operation}`)
749
841
  * })
750
842
  * ```
751
843
  *
752
- * @since 2.0.0
753
844
  * @category constructors
845
+ * @since 2.0.0
754
846
  */
755
847
  export declare const failCauseSync: <E>(evaluate: LazyArg<Cause.Cause<E>>) => Channel<never, E, never>;
756
848
  /**
757
849
  * Constructs a channel that fails immediately with the specified defect.
758
850
  *
759
- * @example
851
+ * **Example** (Dying with defects)
852
+ *
760
853
  * ```ts
761
854
  * import { Channel } from "effect"
762
855
  *
@@ -773,14 +866,15 @@ export declare const failCauseSync: <E>(evaluate: LazyArg<Cause.Cause<E>>) => Ch
773
866
  * })
774
867
  * ```
775
868
  *
776
- * @since 2.0.0
777
869
  * @category constructors
870
+ * @since 2.0.0
778
871
  */
779
872
  export declare const die: (defect: unknown) => Channel<never, never, never>;
780
873
  /**
781
874
  * Use an effect to write a single value to the channel.
782
875
  *
783
- * @example
876
+ * **Example** (Creating channels from effects)
877
+ *
784
878
  * ```ts
785
879
  * import { Channel, Data, Effect } from "effect"
786
880
  *
@@ -810,31 +904,43 @@ export declare const die: (defect: unknown) => Channel<never, never, never>;
810
904
  * )
811
905
  * ```
812
906
  *
813
- * @since 2.0.0
814
907
  * @category constructors
908
+ * @since 2.0.0
815
909
  */
816
910
  export declare const fromEffect: <A, E, R>(effect: Effect.Effect<A, E, R>) => Channel<A, Pull.ExcludeDone<E>, void, unknown, unknown, unknown, R>;
817
911
  /**
818
- * @since 4.0.0
912
+ * Creates a channel that evaluates an effect and uses its successful value as
913
+ * the channel's done value without emitting any output elements.
914
+ *
915
+ * If the effect fails, the channel fails with the effect's error.
916
+ *
819
917
  * @category constructors
918
+ * @since 4.0.0
820
919
  */
821
920
  export declare const fromEffectDone: <A, E, R>(effect: Effect.Effect<A, E, R>) => Channel<never, Pull.ExcludeDone<E>, A, unknown, unknown, unknown, R>;
822
921
  /**
823
922
  * Use an effect and discard its result.
824
923
  *
825
- * @since 4.0.0
826
924
  * @category constructors
925
+ * @since 4.0.0
827
926
  */
828
927
  export declare const fromEffectDrain: <A, E, R>(effect: Effect.Effect<A, E, R>) => Channel<never, E, void, unknown, unknown, unknown, R>;
829
928
  /**
830
- * @since 4.0.0
929
+ * Creates a channel from an effect that produces a `Take`.
930
+ *
931
+ * A successful `Take` emits a non-empty array of output elements. A failed
932
+ * `Take` fails the channel. A done `Take` completes the channel with its done
933
+ * value.
934
+ *
831
935
  * @category constructors
936
+ * @since 4.0.0
832
937
  */
833
938
  export declare const fromEffectTake: <A, E, Done, E2, R>(effect: Effect.Effect<Take.Take<A, E, Done>, E2, R>) => Channel<Arr.NonEmptyReadonlyArray<A>, E | E2, Done, unknown, unknown, unknown, R>;
834
939
  /**
835
940
  * Create a channel from a queue
836
941
  *
837
- * @example
942
+ * **Example** (Creating channels from queues)
943
+ *
838
944
  * ```ts
839
945
  * import { Channel, Data, Effect, Queue } from "effect"
840
946
  *
@@ -866,14 +972,15 @@ export declare const fromEffectTake: <A, E, Done, E2, R>(effect: Effect.Effect<T
866
972
  * })
867
973
  * ```
868
974
  *
869
- * @since 4.0.0
870
975
  * @category constructors
976
+ * @since 4.0.0
871
977
  */
872
978
  export declare const fromQueue: <A, E>(queue: Queue.Dequeue<A, E>) => Channel<A, Exclude<E, Cause.Done>>;
873
979
  /**
874
980
  * Create a channel from a queue that emits arrays of elements
875
981
  *
876
- * @example
982
+ * **Example** (Creating batched channels from queues)
983
+ *
877
984
  * ```ts
878
985
  * import { Channel, Data, Effect, Queue } from "effect"
879
986
  *
@@ -909,19 +1016,23 @@ export declare const fromQueue: <A, E>(queue: Queue.Dequeue<A, E>) => Channel<A,
909
1016
  * })
910
1017
  * ```
911
1018
  *
912
- * @since 4.0.0
913
1019
  * @category constructors
1020
+ * @since 4.0.0
914
1021
  */
915
1022
  export declare const fromQueueArray: <A, E>(queue: Queue.Dequeue<A, E>) => Channel<Arr.NonEmptyReadonlyArray<A>, Exclude<E, Cause.Done>>;
916
1023
  /**
917
- * @since 2.0.0
1024
+ * Creates a channel that forwards upstream input elements, input errors, and
1025
+ * the upstream done value unchanged.
1026
+ *
918
1027
  * @category Constructors
1028
+ * @since 2.0.0
919
1029
  */
920
1030
  export declare const identity: <Elem, Err, Done>() => Channel<Elem, Err, Done, Elem, Err, Done>;
921
1031
  /**
922
1032
  * Create a channel from a PubSub subscription
923
1033
  *
924
- * @example
1034
+ * **Example** (Creating channels from subscriptions)
1035
+ *
925
1036
  * ```ts
926
1037
  * import { Channel, Data, Effect, PubSub } from "effect"
927
1038
  *
@@ -958,8 +1069,8 @@ export declare const identity: <Elem, Err, Done>() => Channel<Elem, Err, Done, E
958
1069
  * })
959
1070
  * ```
960
1071
  *
961
- * @since 4.0.0
962
1072
  * @category constructors
1073
+ * @since 4.0.0
963
1074
  */
964
1075
  export declare const fromSubscription: <A>(subscription: PubSub.Subscription<A>) => Channel<A>;
965
1076
  /**
@@ -972,7 +1083,8 @@ export declare const fromSubscription: <A>(subscription: PubSub.Subscription<A>)
972
1083
  * @param subscription - The PubSub subscription to read from
973
1084
  * @param chunkSize - The maximum number of elements to read in each chunk (default: 4096)
974
1085
  *
975
- * @example
1086
+ * **Example** (Batching subscription values)
1087
+ *
976
1088
  * ```ts
977
1089
  * import { Channel, Data, Effect, PubSub } from "effect"
978
1090
  *
@@ -998,7 +1110,8 @@ export declare const fromSubscription: <A>(subscription: PubSub.Subscription<A>)
998
1110
  * })
999
1111
  * ```
1000
1112
  *
1001
- * @example
1113
+ * **Example** (Processing subscription values in batches)
1114
+ *
1002
1115
  * ```ts
1003
1116
  * import { Channel, Data, Effect, PubSub } from "effect"
1004
1117
  *
@@ -1023,13 +1136,10 @@ export declare const fromSubscription: <A>(subscription: PubSub.Subscription<A>)
1023
1136
  * })
1024
1137
  * ```
1025
1138
  *
1026
- * @example
1027
- * ```ts
1028
- * import { Channel, Data, Effect, PubSub } from "effect"
1139
+ * **Example** (Aggregating subscription metrics)
1029
1140
  *
1030
- * class MetricsError extends Data.TaggedError("MetricsError")<{
1031
- * readonly cause: string
1032
- * }> {}
1141
+ * ```ts
1142
+ * import { Channel, Effect, PubSub } from "effect"
1033
1143
  *
1034
1144
  * const metricsAggregator = Effect.gen(function*() {
1035
1145
  * const metricsPubSub = yield* PubSub.bounded<
@@ -1054,7 +1164,8 @@ export declare const fromSubscription: <A>(subscription: PubSub.Subscription<A>)
1054
1164
  * average: avg,
1055
1165
  * min,
1056
1166
  * max,
1057
- * timestamp: Date.now()
1167
+ * firstTimestamp: Math.min(...metrics.map((m) => m.timestamp)),
1168
+ * lastTimestamp: Math.max(...metrics.map((m) => m.timestamp))
1058
1169
  * }
1059
1170
  * })
1060
1171
  *
@@ -1062,8 +1173,8 @@ export declare const fromSubscription: <A>(subscription: PubSub.Subscription<A>)
1062
1173
  * })
1063
1174
  * ```
1064
1175
  *
1065
- * @since 4.0.0
1066
1176
  * @category constructors
1177
+ * @since 4.0.0
1067
1178
  */
1068
1179
  export declare const fromSubscriptionArray: <A>(subscription: PubSub.Subscription<A>) => Channel<Arr.NonEmptyReadonlyArray<A>>;
1069
1180
  /**
@@ -1075,7 +1186,8 @@ export declare const fromSubscriptionArray: <A>(subscription: PubSub.Subscriptio
1075
1186
  *
1076
1187
  * @param pubsub - The PubSub to read from
1077
1188
  *
1078
- * @example
1189
+ * **Example** (Creating channels from PubSubs)
1190
+ *
1079
1191
  * ```ts
1080
1192
  * import { Channel, Data, Effect, PubSub } from "effect"
1081
1193
  *
@@ -1099,13 +1211,10 @@ export declare const fromSubscriptionArray: <A>(subscription: PubSub.Subscriptio
1099
1211
  * })
1100
1212
  * ```
1101
1213
  *
1102
- * @example
1103
- * ```ts
1104
- * import { Channel, Data, Effect, PubSub } from "effect"
1214
+ * **Example** (Streaming PubSub notifications)
1105
1215
  *
1106
- * class NotificationError extends Data.TaggedError("NotificationError")<{
1107
- * readonly reason: string
1108
- * }> {}
1216
+ * ```ts
1217
+ * import { Channel, Effect, PubSub } from "effect"
1109
1218
  *
1110
1219
  * const notificationService = Effect.gen(function*() {
1111
1220
  * const notificationPubSub = yield* PubSub.bounded<string>(50)
@@ -1114,24 +1223,21 @@ export declare const fromSubscriptionArray: <A>(subscription: PubSub.Subscriptio
1114
1223
  * const notificationChannel = Channel.fromPubSub(notificationPubSub)
1115
1224
  *
1116
1225
  * // Transform notifications to add timestamps
1226
+ * const receivedAt = "2024-01-01T00:00:00.000Z"
1117
1227
  * const timestampedChannel = Channel.map(notificationChannel, (message) => ({
1118
1228
  * message,
1119
- * timestamp: new Date().toISOString(),
1120
- * id: Math.random().toString(36).substr(2, 9)
1229
+ * receivedAt,
1230
+ * id: `notification:${message}`
1121
1231
  * }))
1122
1232
  *
1123
1233
  * return timestampedChannel
1124
1234
  * })
1125
1235
  * ```
1126
1236
  *
1127
- * @example
1128
- * ```ts
1129
- * import { Channel, Data, Effect, PubSub } from "effect"
1237
+ * **Example** (Processing PubSub events)
1130
1238
  *
1131
- * class EventProcessingError extends Data.TaggedError("EventProcessingError")<{
1132
- * readonly eventType: string
1133
- * readonly cause: string
1134
- * }> {}
1239
+ * ```ts
1240
+ * import { Channel, Effect, PubSub } from "effect"
1135
1241
  *
1136
1242
  * interface DomainEvent {
1137
1243
  * readonly type: string
@@ -1151,7 +1257,7 @@ export declare const fromSubscriptionArray: <A>(subscription: PubSub.Subscriptio
1151
1257
  * return {
1152
1258
  * ...event,
1153
1259
  * processed: true,
1154
- * processedAt: Date.now()
1260
+ * processedAt: event.timestamp + 1
1155
1261
  * }
1156
1262
  * }
1157
1263
  * return event
@@ -1161,8 +1267,8 @@ export declare const fromSubscriptionArray: <A>(subscription: PubSub.Subscriptio
1161
1267
  * })
1162
1268
  * ```
1163
1269
  *
1164
- * @since 4.0.0
1165
1270
  * @category constructors
1271
+ * @since 4.0.0
1166
1272
  */
1167
1273
  export declare const fromPubSub: <A>(pubsub: PubSub.PubSub<A>) => Channel<A>;
1168
1274
  /**
@@ -1175,7 +1281,8 @@ export declare const fromPubSub: <A>(pubsub: PubSub.PubSub<A>) => Channel<A>;
1175
1281
  * @param pubsub - The PubSub to read from
1176
1282
  * @param chunkSize - The maximum number of elements to collect in each array (default: 4096)
1177
1283
  *
1178
- * @example
1284
+ * **Example** (Batching PubSub values)
1285
+ *
1179
1286
  * ```ts
1180
1287
  * import { Channel, Data, Effect, PubSub } from "effect"
1181
1288
  *
@@ -1200,20 +1307,17 @@ export declare const fromPubSub: <A>(pubsub: PubSub.PubSub<A>) => Channel<A>;
1200
1307
  * })
1201
1308
  * ```
1202
1309
  *
1203
- * @example
1204
- * ```ts
1205
- * import { Channel, Data, Effect, PubSub } from "effect"
1310
+ * **Example** (Processing PubSub orders in batches)
1206
1311
  *
1207
- * class OrderProcessingError extends Data.TaggedError("OrderProcessingError")<{
1208
- * readonly orderId: string
1209
- * readonly reason: string
1210
- * }> {}
1312
+ * ```ts
1313
+ * import { Channel, Effect, PubSub } from "effect"
1211
1314
  *
1212
1315
  * interface Order {
1213
1316
  * readonly id: string
1214
1317
  * readonly customerId: string
1215
1318
  * readonly items: ReadonlyArray<string>
1216
1319
  * readonly total: number
1320
+ * readonly submittedAt: number
1217
1321
  * }
1218
1322
  *
1219
1323
  * const orderBatchProcessor = Effect.gen(function*() {
@@ -1233,7 +1337,7 @@ export declare const fromPubSub: <A>(pubsub: PubSub.PubSub<A>) => Channel<A>;
1233
1337
  * batchSize: orderBatch.length,
1234
1338
  * totalRevenue,
1235
1339
  * uniqueCustomers: customerCount,
1236
- * processedAt: Date.now(),
1340
+ * firstSubmittedAt: Math.min(...orderBatch.map((order) => order.submittedAt)),
1237
1341
  * orders: orderBatch
1238
1342
  * }
1239
1343
  * })
@@ -1242,14 +1346,10 @@ export declare const fromPubSub: <A>(pubsub: PubSub.PubSub<A>) => Channel<A>;
1242
1346
  * })
1243
1347
  * ```
1244
1348
  *
1245
- * @example
1246
- * ```ts
1247
- * import { Channel, Data, Effect, PubSub } from "effect"
1349
+ * **Example** (Processing PubSub logs in batches)
1248
1350
  *
1249
- * class LogProcessingError extends Data.TaggedError("LogProcessingError")<{
1250
- * readonly batchId: string
1251
- * readonly cause: string
1252
- * }> {}
1351
+ * ```ts
1352
+ * import { Channel, Effect, PubSub } from "effect"
1253
1353
  *
1254
1354
  * interface LogEntry {
1255
1355
  * readonly timestamp: number
@@ -1276,7 +1376,7 @@ export declare const fromPubSub: <A>(pubsub: PubSub.PubSub<A>) => Channel<A>;
1276
1376
  * }
1277
1377
  *
1278
1378
  * return {
1279
- * batchId: Math.random().toString(36).substr(2, 9),
1379
+ * batchId: `${timeRange.start}-${timeRange.end}`,
1280
1380
  * totalEntries: logBatch.length,
1281
1381
  * errorCount,
1282
1382
  * warnCount,
@@ -1290,40 +1390,56 @@ export declare const fromPubSub: <A>(pubsub: PubSub.PubSub<A>) => Channel<A>;
1290
1390
  * })
1291
1391
  * ```
1292
1392
  *
1293
- * @since 4.0.0
1294
1393
  * @category constructors
1394
+ * @since 4.0.0
1295
1395
  */
1296
1396
  export declare const fromPubSubArray: <A>(pubsub: PubSub.PubSub<A>) => Channel<Arr.NonEmptyReadonlyArray<A>>;
1297
1397
  /**
1298
- * @since 4.0.0
1398
+ * Subscribes to a `PubSub` of `Take` values and exposes them as a channel.
1399
+ *
1400
+ * Output `Take` values are emitted as non-empty arrays. Failed `Take` values
1401
+ * fail the channel. Done `Take` values complete the channel.
1402
+ *
1299
1403
  * @category constructors
1404
+ * @since 4.0.0
1300
1405
  */
1301
1406
  export declare const fromPubSubTake: <A, E, Done>(pubsub: PubSub.PubSub<Take.Take<A, E, Done>>) => Channel<Arr.NonEmptyReadonlyArray<A>, E, Done>;
1302
1407
  /**
1303
1408
  * Creates a Channel from a Schedule.
1304
1409
  *
1305
- * @since 4.0.0
1306
1410
  * @category constructors
1411
+ * @since 4.0.0
1307
1412
  */
1308
1413
  export declare const fromSchedule: <O, E, R>(schedule: Schedule.Schedule<O, unknown, E, R>) => Channel<O, E, O, unknown, unknown, unknown, R>;
1309
1414
  /**
1310
- * Creates a Channel from a AsyncIterable.
1415
+ * Creates a channel that pulls values from an `AsyncIterable`.
1416
+ *
1417
+ * Each yielded value is emitted as an output element. The iterator's return
1418
+ * value becomes the channel's done value. Thrown or rejected iterator errors
1419
+ * are converted with `onError`. If the channel scope closes early and the
1420
+ * iterator has a `return` method, that method is called.
1311
1421
  *
1312
- * @since 4.0.0
1313
1422
  * @category constructors
1423
+ * @since 4.0.0
1314
1424
  */
1315
1425
  export declare const fromAsyncIterable: <A, D, E>(iterable: AsyncIterable<A, D>, onError: (error: unknown) => E) => Channel<A, E, D>;
1316
1426
  /**
1317
- * Creates a Channel from a AsyncIterable that emits arrays of elements.
1427
+ * Creates a channel from an `AsyncIterable`, emitting each yielded value as a
1428
+ * single-element non-empty array.
1429
+ *
1430
+ * The iterator's return value becomes the channel's done value. Thrown or
1431
+ * rejected iterator errors are converted with `onError`. If the channel scope
1432
+ * closes early and the iterator has a `return` method, that method is called.
1318
1433
  *
1319
- * @since 4.0.0
1320
1434
  * @category constructors
1435
+ * @since 4.0.0
1321
1436
  */
1322
1437
  export declare const fromAsyncIterableArray: <A, D, E>(iterable: AsyncIterable<A, D>, onError: (error: unknown) => E) => Channel<Arr.NonEmptyReadonlyArray<A>, E, D>;
1323
1438
  /**
1324
1439
  * Maps the output of this channel using the specified function.
1325
1440
  *
1326
- * @example
1441
+ * **Example** (Mapping channel output)
1442
+ *
1327
1443
  * ```ts
1328
1444
  * import { Channel, Data } from "effect"
1329
1445
  *
@@ -1355,14 +1471,15 @@ export declare const fromAsyncIterableArray: <A, D, E>(iterable: AsyncIterable<A
1355
1471
  * }))
1356
1472
  * ```
1357
1473
  *
1358
- * @since 2.0.0
1359
1474
  * @category Sequencing
1475
+ * @since 2.0.0
1360
1476
  */
1361
1477
  export declare const map: {
1362
1478
  /**
1363
1479
  * Maps the output of this channel using the specified function.
1364
1480
  *
1365
- * @example
1481
+ * **Example** (Mapping channel output)
1482
+ *
1366
1483
  * ```ts
1367
1484
  * import { Channel, Data } from "effect"
1368
1485
  *
@@ -1394,14 +1511,15 @@ export declare const map: {
1394
1511
  * }))
1395
1512
  * ```
1396
1513
  *
1397
- * @since 2.0.0
1398
1514
  * @category Sequencing
1515
+ * @since 2.0.0
1399
1516
  */
1400
1517
  <OutElem, OutElem2>(f: (o: OutElem, i: number) => OutElem2): <OutErr, OutDone, InElem, InErr, InDone, Env>(self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>) => Channel<OutElem2, OutErr, OutDone, InElem, InErr, InDone, Env>;
1401
1518
  /**
1402
1519
  * Maps the output of this channel using the specified function.
1403
1520
  *
1404
- * @example
1521
+ * **Example** (Mapping channel output)
1522
+ *
1405
1523
  * ```ts
1406
1524
  * import { Channel, Data } from "effect"
1407
1525
  *
@@ -1433,63 +1551,66 @@ export declare const map: {
1433
1551
  * }))
1434
1552
  * ```
1435
1553
  *
1436
- * @since 2.0.0
1437
1554
  * @category Sequencing
1555
+ * @since 2.0.0
1438
1556
  */
1439
1557
  <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env, OutElem2>(self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>, f: (o: OutElem, i: number) => OutElem2): Channel<OutElem2, OutErr, OutDone, InElem, InErr, InDone, Env>;
1440
1558
  };
1441
1559
  /**
1442
1560
  * Maps the done value of this channel using the specified function.
1443
1561
  *
1444
- * @since 2.0.0
1445
1562
  * @category Sequencing
1563
+ * @since 2.0.0
1446
1564
  */
1447
1565
  export declare const mapDone: {
1448
1566
  /**
1449
1567
  * Maps the done value of this channel using the specified function.
1450
1568
  *
1451
- * @since 2.0.0
1452
1569
  * @category Sequencing
1570
+ * @since 2.0.0
1453
1571
  */
1454
1572
  <OutDone, OutDone2>(f: (o: OutDone) => OutDone2): <OutElem, OutErr, InElem, InErr, InDone, Env>(self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>) => Channel<OutElem, OutErr, OutDone2, InElem, InErr, InDone, Env>;
1455
1573
  /**
1456
1574
  * Maps the done value of this channel using the specified function.
1457
1575
  *
1458
- * @since 2.0.0
1459
1576
  * @category Sequencing
1577
+ * @since 2.0.0
1460
1578
  */
1461
1579
  <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env, OutDone2>(self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>, f: (o: OutDone) => OutDone2): Channel<OutElem, OutErr, OutDone2, InElem, InErr, InDone, Env>;
1462
1580
  };
1463
1581
  /**
1464
1582
  * Maps the done value of this channel using the specified effectful function.
1465
1583
  *
1466
- * @since 2.0.0
1467
1584
  * @category Sequencing
1585
+ * @since 2.0.0
1468
1586
  */
1469
1587
  export declare const mapDoneEffect: {
1470
1588
  /**
1471
1589
  * Maps the done value of this channel using the specified effectful function.
1472
1590
  *
1473
- * @since 2.0.0
1474
1591
  * @category Sequencing
1592
+ * @since 2.0.0
1475
1593
  */
1476
1594
  <OutDone, OutDone2, E, R>(f: (o: OutDone) => Effect.Effect<OutDone2, E, R>): <OutElem, OutErr, InElem, InErr, InDone, Env>(self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>) => Channel<OutElem, OutErr | E, OutDone2, InElem, InErr, InDone, Env | R>;
1477
1595
  /**
1478
1596
  * Maps the done value of this channel using the specified effectful function.
1479
1597
  *
1480
- * @since 2.0.0
1481
1598
  * @category Sequencing
1599
+ * @since 2.0.0
1482
1600
  */
1483
1601
  <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env, OutDone2, E, R>(self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>, f: (o: OutDone) => Effect.Effect<OutDone2, E, R>): Channel<OutElem, OutErr | E, OutDone2, InElem, InErr, InDone, Env | R>;
1484
1602
  };
1485
1603
  /**
1486
- * Returns a new channel, which sequentially combines this channel, together
1487
- * with the provided factory function, which creates a second channel based on
1488
- * the output values of this channel. The result is a channel that will first
1489
- * perform the functions of this channel, before performing the functions of
1490
- * the created channel (including yielding its terminal value).
1604
+ * Maps each output element with an effectful function, preserving the source
1605
+ * channel's done value.
1606
+ *
1607
+ * The mapping function receives the output element and its zero-based index.
1608
+ * By default elements are mapped sequentially. Use `options.concurrency` to
1609
+ * map multiple elements concurrently, and `options.unordered` to allow
1610
+ * concurrently mapped outputs to be emitted as soon as they complete.
1611
+ *
1612
+ * **Example** (Mapping channel output with effects)
1491
1613
  *
1492
- * @example
1493
1614
  * ```ts
1494
1615
  * import { Channel, Data, Effect } from "effect"
1495
1616
  *
@@ -1526,18 +1647,21 @@ export declare const mapDoneEffect: {
1526
1647
  * )
1527
1648
  * ```
1528
1649
  *
1529
- * @since 2.0.0
1530
1650
  * @category sequencing
1651
+ * @since 2.0.0
1531
1652
  */
1532
1653
  export declare const mapEffect: {
1533
1654
  /**
1534
- * Returns a new channel, which sequentially combines this channel, together
1535
- * with the provided factory function, which creates a second channel based on
1536
- * the output values of this channel. The result is a channel that will first
1537
- * perform the functions of this channel, before performing the functions of
1538
- * the created channel (including yielding its terminal value).
1655
+ * Maps each output element with an effectful function, preserving the source
1656
+ * channel's done value.
1657
+ *
1658
+ * The mapping function receives the output element and its zero-based index.
1659
+ * By default elements are mapped sequentially. Use `options.concurrency` to
1660
+ * map multiple elements concurrently, and `options.unordered` to allow
1661
+ * concurrently mapped outputs to be emitted as soon as they complete.
1662
+ *
1663
+ * **Example** (Mapping channel output with effects)
1539
1664
  *
1540
- * @example
1541
1665
  * ```ts
1542
1666
  * import { Channel, Data, Effect } from "effect"
1543
1667
  *
@@ -1574,21 +1698,24 @@ export declare const mapEffect: {
1574
1698
  * )
1575
1699
  * ```
1576
1700
  *
1577
- * @since 2.0.0
1578
1701
  * @category sequencing
1702
+ * @since 2.0.0
1579
1703
  */
1580
1704
  <OutElem, OutElem1, OutErr1, Env1>(f: (d: OutElem, i: number) => Effect.Effect<OutElem1, OutErr1, Env1>, options?: {
1581
1705
  readonly concurrency?: number | "unbounded" | undefined;
1582
1706
  readonly unordered?: boolean | undefined;
1583
1707
  }): <OutErr, OutDone, InElem, InErr, InDone, Env>(self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>) => Channel<OutElem1, OutErr1 | OutErr, OutDone, InElem, InErr, InDone, Env1 | Env>;
1584
1708
  /**
1585
- * Returns a new channel, which sequentially combines this channel, together
1586
- * with the provided factory function, which creates a second channel based on
1587
- * the output values of this channel. The result is a channel that will first
1588
- * perform the functions of this channel, before performing the functions of
1589
- * the created channel (including yielding its terminal value).
1709
+ * Maps each output element with an effectful function, preserving the source
1710
+ * channel's done value.
1711
+ *
1712
+ * The mapping function receives the output element and its zero-based index.
1713
+ * By default elements are mapped sequentially. Use `options.concurrency` to
1714
+ * map multiple elements concurrently, and `options.unordered` to allow
1715
+ * concurrently mapped outputs to be emitted as soon as they complete.
1716
+ *
1717
+ * **Example** (Mapping channel output with effects)
1590
1718
  *
1591
- * @example
1592
1719
  * ```ts
1593
1720
  * import { Channel, Data, Effect } from "effect"
1594
1721
  *
@@ -1625,8 +1752,8 @@ export declare const mapEffect: {
1625
1752
  * )
1626
1753
  * ```
1627
1754
  *
1628
- * @since 2.0.0
1629
1755
  * @category sequencing
1756
+ * @since 2.0.0
1630
1757
  */
1631
1758
  <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env, OutElem1, OutErr1, Env1>(self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>, f: (d: OutElem, i: number) => Effect.Effect<OutElem1, OutErr1, Env1>, options?: {
1632
1759
  readonly concurrency?: number | "unbounded" | undefined;
@@ -1637,24 +1764,24 @@ export declare const mapEffect: {
1637
1764
  * Returns a new channel which is the same as this one but applies the given
1638
1765
  * function to the input channel’s input elements.
1639
1766
  *
1640
- * @since 2.0.0
1641
1767
  * @category sequencing
1768
+ * @since 2.0.0
1642
1769
  */
1643
1770
  export declare const mapInput: {
1644
1771
  /**
1645
1772
  * Returns a new channel which is the same as this one but applies the given
1646
1773
  * function to the input channel’s input elements.
1647
1774
  *
1648
- * @since 2.0.0
1649
1775
  * @category sequencing
1776
+ * @since 2.0.0
1650
1777
  */
1651
1778
  <InElem, InElem2, InErr, R = never>(f: (i: InElem2) => Effect.Effect<InElem, InErr, R>): <OutElem, OutErr, OutDone, InErr, InDone, Env>(self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env | R>) => Channel<OutElem, OutErr, OutDone, InElem2, InErr, InDone, Env>;
1652
1779
  /**
1653
1780
  * Returns a new channel which is the same as this one but applies the given
1654
1781
  * function to the input channel’s input elements.
1655
1782
  *
1656
- * @since 2.0.0
1657
1783
  * @category sequencing
1784
+ * @since 2.0.0
1658
1785
  */
1659
1786
  <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env, InElem2, R = never>(self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>, f: (i: InElem2) => Effect.Effect<InElem, InErr, R>): Channel<OutElem, OutErr, OutDone, InElem2, InErr, InDone, Env | R>;
1660
1787
  };
@@ -1662,24 +1789,24 @@ export declare const mapInput: {
1662
1789
  * Returns a new channel which is the same as this one but applies the given
1663
1790
  * function to the input errors.
1664
1791
  *
1665
- * @since 2.0.0
1666
1792
  * @category sequencing
1793
+ * @since 2.0.0
1667
1794
  */
1668
1795
  export declare const mapInputError: {
1669
1796
  /**
1670
1797
  * Returns a new channel which is the same as this one but applies the given
1671
1798
  * function to the input errors.
1672
1799
  *
1673
- * @since 2.0.0
1674
1800
  * @category sequencing
1801
+ * @since 2.0.0
1675
1802
  */
1676
1803
  <InErr, InErr2, R = never>(f: (i: InErr2) => Effect.Effect<InErr, InErr, R>): <OutElem, OutErr, OutDone, InElem, InDone, Env>(self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env | R>) => Channel<OutElem, OutErr, OutDone, InElem, InErr2, InDone, Env>;
1677
1804
  /**
1678
1805
  * Returns a new channel which is the same as this one but applies the given
1679
1806
  * function to the input errors.
1680
1807
  *
1681
- * @since 2.0.0
1682
1808
  * @category sequencing
1809
+ * @since 2.0.0
1683
1810
  */
1684
1811
  <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env, InErr2, R = never>(self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>, f: (i: InErr2) => Effect.Effect<InErr, InErr, R>): Channel<OutElem, OutErr, OutDone, InElem, InErr2, InDone, Env | R>;
1685
1812
  };
@@ -1691,7 +1818,8 @@ export declare const mapInputError: {
1691
1818
  * debugging) on each element emitted by a channel without modifying the
1692
1819
  * elements themselves.
1693
1820
  *
1694
- * @example
1821
+ * **Example** (Tapping channel output)
1822
+ *
1695
1823
  * ```ts
1696
1824
  * import { Channel, Console, Data } from "effect"
1697
1825
  *
@@ -1712,8 +1840,8 @@ export declare const mapInputError: {
1712
1840
  * // Outputs: 1, 2, 3 (while logging each)
1713
1841
  * ```
1714
1842
  *
1715
- * @since 4.0.0
1716
1843
  * @category sequencing
1844
+ * @since 4.0.0
1717
1845
  */
1718
1846
  export declare const tap: {
1719
1847
  /**
@@ -1724,7 +1852,8 @@ export declare const tap: {
1724
1852
  * debugging) on each element emitted by a channel without modifying the
1725
1853
  * elements themselves.
1726
1854
  *
1727
- * @example
1855
+ * **Example** (Tapping channel output)
1856
+ *
1728
1857
  * ```ts
1729
1858
  * import { Channel, Console, Data } from "effect"
1730
1859
  *
@@ -1745,8 +1874,8 @@ export declare const tap: {
1745
1874
  * // Outputs: 1, 2, 3 (while logging each)
1746
1875
  * ```
1747
1876
  *
1748
- * @since 4.0.0
1749
1877
  * @category sequencing
1878
+ * @since 4.0.0
1750
1879
  */
1751
1880
  <OutElem, X, OutErr1, Env1>(f: (d: Types.NoInfer<OutElem>) => Effect.Effect<X, OutErr1, Env1>, options?: {
1752
1881
  readonly concurrency?: number | "unbounded" | undefined;
@@ -1759,7 +1888,8 @@ export declare const tap: {
1759
1888
  * debugging) on each element emitted by a channel without modifying the
1760
1889
  * elements themselves.
1761
1890
  *
1762
- * @example
1891
+ * **Example** (Tapping channel output)
1892
+ *
1763
1893
  * ```ts
1764
1894
  * import { Channel, Console, Data } from "effect"
1765
1895
  *
@@ -1780,21 +1910,24 @@ export declare const tap: {
1780
1910
  * // Outputs: 1, 2, 3 (while logging each)
1781
1911
  * ```
1782
1912
  *
1783
- * @since 4.0.0
1784
1913
  * @category sequencing
1914
+ * @since 4.0.0
1785
1915
  */
1786
1916
  <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env, X, OutErr1, Env1>(self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>, f: (d: Types.NoInfer<OutElem>) => Effect.Effect<X, OutErr1, Env1>, options?: {
1787
1917
  readonly concurrency?: number | "unbounded" | undefined;
1788
1918
  }): Channel<OutElem, OutErr | OutErr1, OutDone, InElem, InErr, InDone, Env | Env1>;
1789
1919
  };
1790
1920
  /**
1791
- * Returns a new channel, which sequentially combines this channel, together
1792
- * with the provided factory function, which creates a second channel based on
1793
- * the output values of this channel. The result is a channel that will first
1794
- * perform the functions of this channel, before performing the functions of
1795
- * the created channel (including yielding its terminal value).
1921
+ * Maps each output element to a channel and flattens the child channel
1922
+ * outputs.
1923
+ *
1924
+ * The source channel's done value is preserved. Child channel done values are
1925
+ * used only for child-channel completion. By default child channels are run
1926
+ * sequentially. Use `options.concurrency` and `options.bufferSize` to run child
1927
+ * channels concurrently.
1928
+ *
1929
+ * **Example** (FlatMapping channel output)
1796
1930
  *
1797
- * @example
1798
1931
  * ```ts
1799
1932
  * import { Channel, Data } from "effect"
1800
1933
  *
@@ -1816,18 +1949,21 @@ export declare const tap: {
1816
1949
  * // Outputs: "item-1-0", "item-2-0", "item-2-1", "item-3-0", "item-3-1", "item-3-2"
1817
1950
  * ```
1818
1951
  *
1819
- * @since 2.0.0
1820
1952
  * @category sequencing
1953
+ * @since 2.0.0
1821
1954
  */
1822
1955
  export declare const flatMap: {
1823
1956
  /**
1824
- * Returns a new channel, which sequentially combines this channel, together
1825
- * with the provided factory function, which creates a second channel based on
1826
- * the output values of this channel. The result is a channel that will first
1827
- * perform the functions of this channel, before performing the functions of
1828
- * the created channel (including yielding its terminal value).
1957
+ * Maps each output element to a channel and flattens the child channel
1958
+ * outputs.
1959
+ *
1960
+ * The source channel's done value is preserved. Child channel done values are
1961
+ * used only for child-channel completion. By default child channels are run
1962
+ * sequentially. Use `options.concurrency` and `options.bufferSize` to run child
1963
+ * channels concurrently.
1964
+ *
1965
+ * **Example** (FlatMapping channel output)
1829
1966
  *
1830
- * @example
1831
1967
  * ```ts
1832
1968
  * import { Channel, Data } from "effect"
1833
1969
  *
@@ -1849,21 +1985,24 @@ export declare const flatMap: {
1849
1985
  * // Outputs: "item-1-0", "item-2-0", "item-2-1", "item-3-0", "item-3-1", "item-3-2"
1850
1986
  * ```
1851
1987
  *
1852
- * @since 2.0.0
1853
1988
  * @category sequencing
1989
+ * @since 2.0.0
1854
1990
  */
1855
1991
  <OutElem, OutElem1, OutErr1, OutDone1, InElem1, InErr1, InDone1, Env1>(f: (d: OutElem) => Channel<OutElem1, OutErr1, OutDone1, InElem1, InErr1, InDone1, Env1>, options?: {
1856
1992
  readonly concurrency?: number | "unbounded" | undefined;
1857
1993
  readonly bufferSize?: number | undefined;
1858
1994
  }): <OutErr, OutDone, InElem, InErr, InDone, Env>(self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>) => Channel<OutElem1, OutErr1 | OutErr, OutDone, InElem & InElem1, InErr & InErr1, InDone & InDone1, Env1 | Env>;
1859
1995
  /**
1860
- * Returns a new channel, which sequentially combines this channel, together
1861
- * with the provided factory function, which creates a second channel based on
1862
- * the output values of this channel. The result is a channel that will first
1863
- * perform the functions of this channel, before performing the functions of
1864
- * the created channel (including yielding its terminal value).
1996
+ * Maps each output element to a channel and flattens the child channel
1997
+ * outputs.
1998
+ *
1999
+ * The source channel's done value is preserved. Child channel done values are
2000
+ * used only for child-channel completion. By default child channels are run
2001
+ * sequentially. Use `options.concurrency` and `options.bufferSize` to run child
2002
+ * channels concurrently.
2003
+ *
2004
+ * **Example** (FlatMapping channel output)
1865
2005
  *
1866
- * @example
1867
2006
  * ```ts
1868
2007
  * import { Channel, Data } from "effect"
1869
2008
  *
@@ -1885,8 +2024,8 @@ export declare const flatMap: {
1885
2024
  * // Outputs: "item-1-0", "item-2-0", "item-2-1", "item-3-0", "item-3-1", "item-3-2"
1886
2025
  * ```
1887
2026
  *
1888
- * @since 2.0.0
1889
2027
  * @category sequencing
2028
+ * @since 2.0.0
1890
2029
  */
1891
2030
  <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env, OutElem1, OutErr1, OutDone1, InElem1, InErr1, InDone1, Env1>(self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>, f: (d: OutElem) => Channel<OutElem1, OutErr1, OutDone1, InElem1, InErr1, InDone1, Env1>, options?: {
1892
2031
  readonly concurrency?: number | "unbounded" | undefined;
@@ -1897,7 +2036,8 @@ export declare const flatMap: {
1897
2036
  * Concatenates this channel with another channel created from the terminal value
1898
2037
  * of this channel. The new channel is created using the provided function.
1899
2038
  *
1900
- * @example
2039
+ * **Example** (Concatenating with completion values)
2040
+ *
1901
2041
  * ```ts
1902
2042
  * import { Channel, Data } from "effect"
1903
2043
  *
@@ -1914,15 +2054,16 @@ export declare const flatMap: {
1914
2054
  * // Outputs: 1, 2, 3, then "Completed processing"
1915
2055
  * ```
1916
2056
  *
1917
- * @since 2.0.0
1918
2057
  * @category sequencing
2058
+ * @since 2.0.0
1919
2059
  */
1920
2060
  export declare const concatWith: {
1921
2061
  /**
1922
2062
  * Concatenates this channel with another channel created from the terminal value
1923
2063
  * of this channel. The new channel is created using the provided function.
1924
2064
  *
1925
- * @example
2065
+ * **Example** (Concatenating with completion values)
2066
+ *
1926
2067
  * ```ts
1927
2068
  * import { Channel, Data } from "effect"
1928
2069
  *
@@ -1939,15 +2080,16 @@ export declare const concatWith: {
1939
2080
  * // Outputs: 1, 2, 3, then "Completed processing"
1940
2081
  * ```
1941
2082
  *
1942
- * @since 2.0.0
1943
2083
  * @category sequencing
2084
+ * @since 2.0.0
1944
2085
  */
1945
2086
  <OutDone, OutElem1, OutErr1, OutDone1, InElem1, InErr1, InDone1, Env1>(f: (leftover: Types.NoInfer<OutDone>) => Channel<OutElem1, OutErr1, OutDone1, InElem1, InErr1, InDone1, Env1>): <OutElem, OutErr, InElem, InErr, InDone, Env>(self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>) => Channel<OutElem | OutElem1, OutErr1 | OutErr, OutDone1, InElem & InElem1, InErr & InErr1, InDone & InDone1, Env1 | Env>;
1946
2087
  /**
1947
2088
  * Concatenates this channel with another channel created from the terminal value
1948
2089
  * of this channel. The new channel is created using the provided function.
1949
2090
  *
1950
- * @example
2091
+ * **Example** (Concatenating with completion values)
2092
+ *
1951
2093
  * ```ts
1952
2094
  * import { Channel, Data } from "effect"
1953
2095
  *
@@ -1964,8 +2106,8 @@ export declare const concatWith: {
1964
2106
  * // Outputs: 1, 2, 3, then "Completed processing"
1965
2107
  * ```
1966
2108
  *
1967
- * @since 2.0.0
1968
2109
  * @category sequencing
2110
+ * @since 2.0.0
1969
2111
  */
1970
2112
  <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env, OutElem1, OutErr1, OutDone1, InElem1, InErr1, InDone1, Env1>(self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>, f: (leftover: Types.NoInfer<OutDone>) => Channel<OutElem1, OutErr1, OutDone1, InElem1, InErr1, InDone1, Env1>): Channel<OutElem | OutElem1, OutErr1 | OutErr, OutDone1, InElem & InElem1, InErr & InErr1, InDone & InDone1, Env1 | Env>;
1971
2113
  };
@@ -1973,7 +2115,8 @@ export declare const concatWith: {
1973
2115
  * Concatenates this channel with another channel, so that the second channel
1974
2116
  * starts emitting values after the first channel has completed.
1975
2117
  *
1976
- * @example
2118
+ * **Example** (Concatenating channels)
2119
+ *
1977
2120
  * ```ts
1978
2121
  * import { Channel, Data } from "effect"
1979
2122
  *
@@ -1991,15 +2134,16 @@ export declare const concatWith: {
1991
2134
  * // Outputs: 1, 2, 3, "a", "b", "c"
1992
2135
  * ```
1993
2136
  *
1994
- * @since 2.0.0
1995
2137
  * @category sequencing
2138
+ * @since 2.0.0
1996
2139
  */
1997
2140
  export declare const concat: {
1998
2141
  /**
1999
2142
  * Concatenates this channel with another channel, so that the second channel
2000
2143
  * starts emitting values after the first channel has completed.
2001
2144
  *
2002
- * @example
2145
+ * **Example** (Concatenating channels)
2146
+ *
2003
2147
  * ```ts
2004
2148
  * import { Channel, Data } from "effect"
2005
2149
  *
@@ -2017,15 +2161,16 @@ export declare const concat: {
2017
2161
  * // Outputs: 1, 2, 3, "a", "b", "c"
2018
2162
  * ```
2019
2163
  *
2020
- * @since 2.0.0
2021
2164
  * @category sequencing
2165
+ * @since 2.0.0
2022
2166
  */
2023
2167
  <OutElem1, OutErr1, OutDone1, InElem1, InErr1, InDone1, Env1>(that: Channel<OutElem1, OutErr1, OutDone1, InElem1, InErr1, InDone1, Env1>): <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>(self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>) => Channel<OutElem | OutElem1, OutErr1 | OutErr, OutDone1, InElem & InElem1, InErr & InErr1, InDone & InDone1, Env1 | Env>;
2024
2168
  /**
2025
2169
  * Concatenates this channel with another channel, so that the second channel
2026
2170
  * starts emitting values after the first channel has completed.
2027
2171
  *
2028
- * @example
2172
+ * **Example** (Concatenating channels)
2173
+ *
2029
2174
  * ```ts
2030
2175
  * import { Channel, Data } from "effect"
2031
2176
  *
@@ -2043,8 +2188,8 @@ export declare const concat: {
2043
2188
  * // Outputs: 1, 2, 3, "a", "b", "c"
2044
2189
  * ```
2045
2190
  *
2046
- * @since 2.0.0
2047
2191
  * @category sequencing
2192
+ * @since 2.0.0
2048
2193
  */
2049
2194
  <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env, OutElem1, OutErr1, OutDone1, InElem1, InErr1, InDone1, Env1>(self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>, that: Channel<OutElem1, OutErr1, OutDone1, InElem1, InErr1, InDone1, Env1>): Channel<OutElem | OutElem1, OutErr1 | OutErr, OutDone1, InElem & InElem1, InErr & InErr1, InDone & InDone1, Env1 | Env>;
2050
2195
  };
@@ -2055,8 +2200,8 @@ export declare const concat: {
2055
2200
  * some internal state to control the combining process, with the initial
2056
2201
  * state being specified by `s`.
2057
2202
  *
2058
- * @since 4.0.0
2059
2203
  * @category sequencing
2204
+ * @since 4.0.0
2060
2205
  */
2061
2206
  export declare const combine: {
2062
2207
  /**
@@ -2066,8 +2211,8 @@ export declare const combine: {
2066
2211
  * some internal state to control the combining process, with the initial
2067
2212
  * state being specified by `s`.
2068
2213
  *
2069
- * @since 4.0.0
2070
2214
  * @category sequencing
2215
+ * @since 4.0.0
2071
2216
  */
2072
2217
  <OutElem2, OutErr2, OutDone2, InElem2, InErr2, InDone2, Env2, S, OutElem, OutErr, OutDone, A, E, R>(that: Channel<OutElem2, OutErr2, OutDone2, InElem2, InErr2, InDone2, Env2>, s: LazyArg<S>, f: (s: S, pullLeft: Pull.Pull<OutElem, OutErr, OutDone>, pullRight: Pull.Pull<OutElem2, OutErr2, OutDone2>) => Effect.Effect<readonly [A, S], E, R>): <InElem, InErr, InDone, Env>(self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>) => Channel<A, Pull.ExcludeDone<E>, Cause.Done.Extract<E>, InElem & InElem2, InErr & InErr2, InDone & InDone2, Env | Env2 | R>;
2073
2218
  /**
@@ -2077,31 +2222,53 @@ export declare const combine: {
2077
2222
  * some internal state to control the combining process, with the initial
2078
2223
  * state being specified by `s`.
2079
2224
  *
2080
- * @since 4.0.0
2081
2225
  * @category sequencing
2226
+ * @since 4.0.0
2082
2227
  */
2083
2228
  <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env, OutElem2, OutErr2, OutDone2, InElem2, InErr2, InDone2, Env2, S, A, E, R>(self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>, that: Channel<OutElem2, OutErr2, OutDone2, InElem2, InErr2, InDone2, Env2>, s: LazyArg<S>, f: (s: S, pullLeft: Pull.Pull<OutElem, OutErr, OutDone>, pullRight: Pull.Pull<OutElem2, OutErr2, OutDone2>) => Effect.Effect<readonly [A, S], E, R>): Channel<A, Pull.ExcludeDone<E>, Cause.Done.Extract<E>, InElem & InElem2, InErr & InErr2, InDone & InDone2, Env | Env2 | R>;
2084
2229
  };
2085
2230
  /**
2086
- * @since 2.0.0
2231
+ * Runs a fallback channel if this channel completes without emitting any
2232
+ * output elements.
2233
+ *
2234
+ * If the source emits at least one element, the source is used unchanged. If
2235
+ * the source completes before emitting an element, the fallback function
2236
+ * receives the source done value and returns the replacement channel.
2237
+ *
2087
2238
  * @category sequencing
2239
+ * @since 2.0.0
2088
2240
  */
2089
2241
  export declare const orElseIfEmpty: {
2090
2242
  /**
2091
- * @since 2.0.0
2243
+ * Runs a fallback channel if this channel completes without emitting any
2244
+ * output elements.
2245
+ *
2246
+ * If the source emits at least one element, the source is used unchanged. If
2247
+ * the source completes before emitting an element, the fallback function
2248
+ * receives the source done value and returns the replacement channel.
2249
+ *
2092
2250
  * @category sequencing
2251
+ * @since 2.0.0
2093
2252
  */
2094
2253
  <OutDone, OutElem1, OutErr1, OutDone1, InElem1, InErr1, InDone1, Env1>(f: (leftover: Types.NoInfer<OutDone>) => Channel<OutElem1, OutErr1, OutDone1, InElem1, InErr1, InDone1, Env1>): <OutElem, OutErr, InElem, InErr, InDone, Env>(self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>) => Channel<OutElem | OutElem1, OutErr1 | OutErr, OutDone | OutDone1, InElem & InElem1, InErr & InErr1, InDone & InDone1, Env1 | Env>;
2095
2254
  /**
2096
- * @since 2.0.0
2255
+ * Runs a fallback channel if this channel completes without emitting any
2256
+ * output elements.
2257
+ *
2258
+ * If the source emits at least one element, the source is used unchanged. If
2259
+ * the source completes before emitting an element, the fallback function
2260
+ * receives the source done value and returns the replacement channel.
2261
+ *
2097
2262
  * @category sequencing
2263
+ * @since 2.0.0
2098
2264
  */
2099
2265
  <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env, OutElem1, OutErr1, OutDone1, InElem1, InErr1, InDone1, Env1>(self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>, f: (leftover: Types.NoInfer<OutDone>) => Channel<OutElem1, OutErr1, OutDone1, InElem1, InErr1, InDone1, Env1>): Channel<OutElem | OutElem1, OutErr1 | OutErr, OutDone | OutDone1, InElem & InElem1, InErr & InErr1, InDone & InDone1, Env1 | Env>;
2100
2266
  };
2101
2267
  /**
2102
2268
  * Flatten a channel of channels.
2103
2269
  *
2104
- * @example
2270
+ * **Example** (Flattening nested channels)
2271
+ *
2105
2272
  * ```ts
2106
2273
  * import { Channel, Data } from "effect"
2107
2274
  *
@@ -2122,14 +2289,15 @@ export declare const orElseIfEmpty: {
2122
2289
  * // Outputs: 1, 2, 3, 4, 5, 6
2123
2290
  * ```
2124
2291
  *
2125
- * @since 2.0.0
2126
2292
  * @category constructors
2293
+ * @since 2.0.0
2127
2294
  */
2128
2295
  export declare const flatten: <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env, OutErr1, OutDone1, InElem1, InErr1, InDone1, Env1>(channels: Channel<Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>, OutErr1, OutDone1, InElem1, InErr1, InDone1, Env1>) => Channel<OutElem, OutErr | OutErr1, OutDone1, InElem & InElem1, InErr & InErr1, InDone & InDone1, Env | Env1>;
2129
2296
  /**
2130
2297
  * Flattens a channel that outputs arrays into a channel that outputs individual elements.
2131
2298
  *
2132
- * @example
2299
+ * **Example** (Flattening arrays of channel output)
2300
+ *
2133
2301
  * ```ts
2134
2302
  * import { Channel, Data } from "effect"
2135
2303
  *
@@ -2150,20 +2318,27 @@ export declare const flatten: <OutElem, OutErr, OutDone, InElem, InErr, InDone,
2150
2318
  * // Outputs: 1, 2, 3, 4, 5, 6, 7, 8, 9
2151
2319
  * ```
2152
2320
  *
2153
- * @since 4.0.0
2154
2321
  * @category utils
2322
+ * @since 4.0.0
2155
2323
  */
2156
2324
  export declare const flattenArray: <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>(self: Channel<ReadonlyArray<OutElem>, OutErr, OutDone, InElem, InErr, InDone, Env>) => Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>;
2157
2325
  /**
2158
- * @since 4.0.0
2326
+ * Flattens a channel that emits `Take` values into a channel that emits the
2327
+ * `Take` outputs directly.
2328
+ *
2329
+ * Output `Take` values are emitted as non-empty arrays. Failed `Take` values
2330
+ * fail the returned channel. Done `Take` values complete the returned channel.
2331
+ *
2159
2332
  * @category utils
2333
+ * @since 4.0.0
2160
2334
  */
2161
2335
  export declare const flattenTake: <OutElem, OutErr, OutDone, OutErr2, OutDone2, InElem, InErr, InDone, Env>(self: Channel<Take.Take<OutElem, OutErr, OutDone>, OutErr2, OutDone2, InElem, InErr, InDone, Env>) => Channel<Arr.NonEmptyReadonlyArray<OutElem>, OutErr | OutErr2, OutDone, InElem, InErr, InDone, Env>;
2162
2336
  /**
2163
2337
  * Creates a new channel that consumes all output from the source channel
2164
2338
  * but emits nothing, preserving only the completion value.
2165
2339
  *
2166
- * @example
2340
+ * **Example** (Draining channel output)
2341
+ *
2167
2342
  * ```ts
2168
2343
  * import { Channel } from "effect"
2169
2344
  *
@@ -2177,52 +2352,76 @@ export declare const flattenTake: <OutElem, OutErr, OutDone, OutErr2, OutDone2,
2177
2352
  * // Useful for consuming side effects without collecting output
2178
2353
  * ```
2179
2354
  *
2180
- * @since 2.0.0
2181
2355
  * @category constructors
2356
+ * @since 2.0.0
2182
2357
  */
2183
2358
  export declare const drain: <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>(self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>) => Channel<never, OutErr, OutDone, InElem, InErr, InDone, Env>;
2184
2359
  /**
2185
2360
  * Repeats this channel according to the provided schedule.
2186
2361
  *
2187
- * @since 4.0.0
2188
2362
  * @category utils
2363
+ * @since 4.0.0
2189
2364
  */
2190
2365
  export declare const repeat: {
2191
2366
  /**
2192
2367
  * Repeats this channel according to the provided schedule.
2193
2368
  *
2194
- * @since 4.0.0
2195
2369
  * @category utils
2370
+ * @since 4.0.0
2196
2371
  */
2197
2372
  <SO, OutDone, SE, SR>(schedule: Schedule.Schedule<SO, Types.NoInfer<OutDone>, SE, SR> | (($: <SO, SE, SR>(_: Schedule.Schedule<SO, NoInfer<OutDone>, SE, SR>) => Schedule.Schedule<SO, OutDone, SE, SR>) => Schedule.Schedule<SO, Types.NoInfer<OutDone>, SE, SR>)): <OutElem, OutErr, InElem, InErr, InDone, Env>(self: Channel<OutElem, OutErr | SE, OutDone, InElem, InErr, InDone, Env | SR>) => Channel<OutElem, OutErr | SE, OutDone, InElem, InErr, InDone, Env | SR>;
2198
2373
  /**
2199
2374
  * Repeats this channel according to the provided schedule.
2200
2375
  *
2201
- * @since 4.0.0
2202
2376
  * @category utils
2377
+ * @since 4.0.0
2203
2378
  */
2204
2379
  <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env, SO, SE, SR>(self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>, schedule: Schedule.Schedule<SO, OutDone, SE, SR> | (($: <SO, SE, SR>(_: Schedule.Schedule<SO, NoInfer<OutDone>, SE, SR>) => Schedule.Schedule<SO, OutDone, SE, SR>) => Schedule.Schedule<SO, Types.NoInfer<OutDone>, SE, SR>)): Channel<OutElem, OutErr | SE, OutDone, InElem, InErr, InDone, Env | SR>;
2205
2380
  };
2206
2381
  /**
2207
2382
  * Repeats this channel forever.
2208
2383
  *
2209
- * @since 4.0.0
2210
2384
  * @category utils
2385
+ * @since 4.0.0
2211
2386
  */
2212
2387
  export declare const forever: <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>(self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>) => Channel<OutElem, OutErr, never, InElem, InErr, InDone, Env>;
2213
2388
  /**
2214
- * @since 4.0.0
2389
+ * Runs a schedule step for each output element while preserving the emitted
2390
+ * elements.
2391
+ *
2392
+ * The schedule receives each output element as input. Schedule delays are
2393
+ * applied between emitted elements. If the schedule fails, the returned channel
2394
+ * fails. If the schedule finishes, the returned channel completes with the
2395
+ * schedule output.
2396
+ *
2215
2397
  * @category utils
2398
+ * @since 4.0.0
2216
2399
  */
2217
2400
  export declare const schedule: {
2218
2401
  /**
2219
- * @since 4.0.0
2402
+ * Runs a schedule step for each output element while preserving the emitted
2403
+ * elements.
2404
+ *
2405
+ * The schedule receives each output element as input. Schedule delays are
2406
+ * applied between emitted elements. If the schedule fails, the returned channel
2407
+ * fails. If the schedule finishes, the returned channel completes with the
2408
+ * schedule output.
2409
+ *
2220
2410
  * @category utils
2411
+ * @since 4.0.0
2221
2412
  */
2222
2413
  <SO, OutElem, SE, SR>(schedule: Schedule.Schedule<SO, Types.NoInfer<OutElem>, SE, SR>): <OutErr, OutDone, InElem, InErr, InDone, Env>(self: Channel<OutElem, OutErr | SE, OutDone, InElem, InErr, InDone, Env | SR>) => Channel<OutElem, OutErr | SE, OutDone | SO, InElem, InErr, InDone, Env | SR>;
2223
2414
  /**
2224
- * @since 4.0.0
2415
+ * Runs a schedule step for each output element while preserving the emitted
2416
+ * elements.
2417
+ *
2418
+ * The schedule receives each output element as input. Schedule delays are
2419
+ * applied between emitted elements. If the schedule fails, the returned channel
2420
+ * fails. If the schedule finishes, the returned channel completes with the
2421
+ * schedule output.
2422
+ *
2225
2423
  * @category utils
2424
+ * @since 4.0.0
2226
2425
  */
2227
2426
  <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env, SO, SE, SR>(self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>, schedule: Schedule.Schedule<SO, OutElem, SE, SR>): Channel<OutElem, OutErr | SE, OutDone | SO, InElem, InErr, InDone, Env | SR>;
2228
2427
  };
@@ -2230,7 +2429,8 @@ export declare const schedule: {
2230
2429
  * Filters the output elements of a channel using a predicate function.
2231
2430
  * Elements that don't match the predicate are discarded.
2232
2431
  *
2233
- * @example
2432
+ * **Example** (Filtering channel output)
2433
+ *
2234
2434
  * ```ts
2235
2435
  * import { Channel } from "effect"
2236
2436
  *
@@ -2250,15 +2450,16 @@ export declare const schedule: {
2250
2450
  * // Outputs: 1, 2, 3 (all typed as numbers)
2251
2451
  * ```
2252
2452
  *
2253
- * @since 2.0.0
2254
2453
  * @category Filtering
2454
+ * @since 2.0.0
2255
2455
  */
2256
2456
  export declare const filter: {
2257
2457
  /**
2258
2458
  * Filters the output elements of a channel using a predicate function.
2259
2459
  * Elements that don't match the predicate are discarded.
2260
2460
  *
2261
- * @example
2461
+ * **Example** (Filtering channel output)
2462
+ *
2262
2463
  * ```ts
2263
2464
  * import { Channel } from "effect"
2264
2465
  *
@@ -2278,15 +2479,16 @@ export declare const filter: {
2278
2479
  * // Outputs: 1, 2, 3 (all typed as numbers)
2279
2480
  * ```
2280
2481
  *
2281
- * @since 2.0.0
2282
2482
  * @category Filtering
2483
+ * @since 2.0.0
2283
2484
  */
2284
2485
  <OutElem, B extends OutElem>(refinement: Predicate.Refinement<OutElem, B>): <OutErr, OutDone, InElem, InErr, InDone, Env>(self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>) => Channel<B, OutErr, OutDone, InElem, InErr, InDone, Env>;
2285
2486
  /**
2286
2487
  * Filters the output elements of a channel using a predicate function.
2287
2488
  * Elements that don't match the predicate are discarded.
2288
2489
  *
2289
- * @example
2490
+ * **Example** (Filtering channel output)
2491
+ *
2290
2492
  * ```ts
2291
2493
  * import { Channel } from "effect"
2292
2494
  *
@@ -2306,15 +2508,16 @@ export declare const filter: {
2306
2508
  * // Outputs: 1, 2, 3 (all typed as numbers)
2307
2509
  * ```
2308
2510
  *
2309
- * @since 2.0.0
2310
2511
  * @category Filtering
2512
+ * @since 2.0.0
2311
2513
  */
2312
2514
  <OutElem>(predicate: Predicate.Predicate<OutElem>): <OutErr, OutDone, InElem, InErr, InDone, Env>(self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>) => Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>;
2313
2515
  /**
2314
2516
  * Filters the output elements of a channel using a predicate function.
2315
2517
  * Elements that don't match the predicate are discarded.
2316
2518
  *
2317
- * @example
2519
+ * **Example** (Filtering channel output)
2520
+ *
2318
2521
  * ```ts
2319
2522
  * import { Channel } from "effect"
2320
2523
  *
@@ -2334,15 +2537,16 @@ export declare const filter: {
2334
2537
  * // Outputs: 1, 2, 3 (all typed as numbers)
2335
2538
  * ```
2336
2539
  *
2337
- * @since 2.0.0
2338
2540
  * @category Filtering
2541
+ * @since 2.0.0
2339
2542
  */
2340
2543
  <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env, B extends OutElem>(self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>, refinement: Predicate.Refinement<OutElem, B>): Channel<B, OutErr, OutDone, InElem, InErr, InDone, Env>;
2341
2544
  /**
2342
2545
  * Filters the output elements of a channel using a predicate function.
2343
2546
  * Elements that don't match the predicate are discarded.
2344
2547
  *
2345
- * @example
2548
+ * **Example** (Filtering channel output)
2549
+ *
2346
2550
  * ```ts
2347
2551
  * import { Channel } from "effect"
2348
2552
  *
@@ -2362,56 +2566,110 @@ export declare const filter: {
2362
2566
  * // Outputs: 1, 2, 3 (all typed as numbers)
2363
2567
  * ```
2364
2568
  *
2365
- * @since 2.0.0
2366
2569
  * @category Filtering
2570
+ * @since 2.0.0
2367
2571
  */
2368
2572
  <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>(self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>, predicate: Predicate.Predicate<OutElem>): Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>;
2369
2573
  };
2370
2574
  /**
2371
- * @since 4.0.0
2575
+ * Filters and maps output elements using a `Filter`.
2576
+ *
2577
+ * Successful filter results are emitted as mapped values. Failed filter
2578
+ * results are discarded. The source channel's errors and done value are
2579
+ * preserved.
2580
+ *
2372
2581
  * @category Filtering
2582
+ * @since 4.0.0
2373
2583
  */
2374
2584
  export declare const filterMap: {
2375
2585
  /**
2376
- * @since 4.0.0
2586
+ * Filters and maps output elements using a `Filter`.
2587
+ *
2588
+ * Successful filter results are emitted as mapped values. Failed filter
2589
+ * results are discarded. The source channel's errors and done value are
2590
+ * preserved.
2591
+ *
2377
2592
  * @category Filtering
2593
+ * @since 4.0.0
2378
2594
  */
2379
2595
  <OutElem, B, X>(filter: Filter.Filter<OutElem, B, X>): <OutErr, OutDone, InElem, InErr, InDone, Env>(self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>) => Channel<B, OutErr, OutDone, InElem, InErr, InDone, Env>;
2380
2596
  /**
2381
- * @since 4.0.0
2597
+ * Filters and maps output elements using a `Filter`.
2598
+ *
2599
+ * Successful filter results are emitted as mapped values. Failed filter
2600
+ * results are discarded. The source channel's errors and done value are
2601
+ * preserved.
2602
+ *
2382
2603
  * @category Filtering
2604
+ * @since 4.0.0
2383
2605
  */
2384
2606
  <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env, B, X>(self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>, filter: Filter.Filter<OutElem, B, X>): Channel<B, OutErr, OutDone, InElem, InErr, InDone, Env>;
2385
2607
  };
2386
2608
  /**
2387
- * @since 4.0.0
2609
+ * Filters output elements with an effectful predicate.
2610
+ *
2611
+ * Elements for which the predicate succeeds with `true` are emitted. Elements
2612
+ * for which the predicate succeeds with `false` are discarded. Predicate
2613
+ * failures fail the returned channel.
2614
+ *
2388
2615
  * @category Filtering
2616
+ * @since 4.0.0
2389
2617
  */
2390
2618
  export declare const filterEffect: {
2391
2619
  /**
2392
- * @since 4.0.0
2620
+ * Filters output elements with an effectful predicate.
2621
+ *
2622
+ * Elements for which the predicate succeeds with `true` are emitted. Elements
2623
+ * for which the predicate succeeds with `false` are discarded. Predicate
2624
+ * failures fail the returned channel.
2625
+ *
2393
2626
  * @category Filtering
2627
+ * @since 4.0.0
2394
2628
  */
2395
2629
  <OutElem, E, R>(predicate: (a: OutElem) => Effect.Effect<boolean, E, R>): <OutErr, OutDone, InElem, InErr, InDone, Env>(self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>) => Channel<OutElem, OutErr | E, OutDone, InElem, InErr, InDone, Env | R>;
2396
2630
  /**
2397
- * @since 4.0.0
2631
+ * Filters output elements with an effectful predicate.
2632
+ *
2633
+ * Elements for which the predicate succeeds with `true` are emitted. Elements
2634
+ * for which the predicate succeeds with `false` are discarded. Predicate
2635
+ * failures fail the returned channel.
2636
+ *
2398
2637
  * @category Filtering
2638
+ * @since 4.0.0
2399
2639
  */
2400
2640
  <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env, E, R>(self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>, predicate: (a: OutElem) => Effect.Effect<boolean, E, R>): Channel<OutElem, OutErr | E, OutDone, InElem, InErr, InDone, Env | R>;
2401
2641
  };
2402
2642
  /**
2403
- * @since 4.0.0
2643
+ * Filters and maps output elements using an effectful `Filter`.
2644
+ *
2645
+ * Successful filter results are emitted as mapped values. Failed filter
2646
+ * results are discarded. Failures from the effectful filter fail the returned
2647
+ * channel.
2648
+ *
2404
2649
  * @category Filtering
2650
+ * @since 4.0.0
2405
2651
  */
2406
2652
  export declare const filterMapEffect: {
2407
2653
  /**
2408
- * @since 4.0.0
2654
+ * Filters and maps output elements using an effectful `Filter`.
2655
+ *
2656
+ * Successful filter results are emitted as mapped values. Failed filter
2657
+ * results are discarded. Failures from the effectful filter fail the returned
2658
+ * channel.
2659
+ *
2409
2660
  * @category Filtering
2661
+ * @since 4.0.0
2410
2662
  */
2411
2663
  <OutElem, B, X, EX, RX>(filter: Filter.FilterEffect<OutElem, B, X, EX, RX>): <OutErr, OutDone, InElem, InErr, InDone, Env>(self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>) => Channel<B, OutErr | EX, OutDone, InElem, InErr, InDone, Env | RX>;
2412
2664
  /**
2413
- * @since 4.0.0
2665
+ * Filters and maps output elements using an effectful `Filter`.
2666
+ *
2667
+ * Successful filter results are emitted as mapped values. Failed filter
2668
+ * results are discarded. Failures from the effectful filter fail the returned
2669
+ * channel.
2670
+ *
2414
2671
  * @category Filtering
2672
+ * @since 4.0.0
2415
2673
  */
2416
2674
  <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env, B, X, EX, RX>(self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>, filter: Filter.FilterEffect<OutElem, B, X, EX, RX>): Channel<B, OutErr | EX, OutDone, InElem, InErr, InDone, Env | RX>;
2417
2675
  };
@@ -2419,7 +2677,8 @@ export declare const filterMapEffect: {
2419
2677
  * Filters arrays of elements emitted by a channel, applying the filter
2420
2678
  * to each element within the arrays and only emitting non-empty filtered arrays.
2421
2679
  *
2422
- * @example
2680
+ * **Example** (Filtering array output)
2681
+ *
2423
2682
  * ```ts
2424
2683
  * import { Array, Channel } from "effect"
2425
2684
  *
@@ -2447,15 +2706,16 @@ export declare const filterMapEffect: {
2447
2706
  * // Outputs: [2, 4] (the arrays [1,3,5] and [7,9] are discarded)
2448
2707
  * ```
2449
2708
  *
2450
- * @since 4.0.0
2451
2709
  * @category Filtering
2710
+ * @since 4.0.0
2452
2711
  */
2453
2712
  export declare const filterArray: {
2454
2713
  /**
2455
2714
  * Filters arrays of elements emitted by a channel, applying the filter
2456
2715
  * to each element within the arrays and only emitting non-empty filtered arrays.
2457
2716
  *
2458
- * @example
2717
+ * **Example** (Filtering array output)
2718
+ *
2459
2719
  * ```ts
2460
2720
  * import { Array, Channel } from "effect"
2461
2721
  *
@@ -2483,15 +2743,16 @@ export declare const filterArray: {
2483
2743
  * // Outputs: [2, 4] (the arrays [1,3,5] and [7,9] are discarded)
2484
2744
  * ```
2485
2745
  *
2486
- * @since 4.0.0
2487
2746
  * @category Filtering
2747
+ * @since 4.0.0
2488
2748
  */
2489
2749
  <OutElem, B extends OutElem>(refinement: Predicate.Refinement<OutElem, B>): <OutErr, OutDone, InElem, InErr, InDone, Env>(self: Channel<Arr.NonEmptyReadonlyArray<OutElem>, OutErr, OutDone, InElem, InErr, InDone, Env>) => Channel<Arr.NonEmptyReadonlyArray<B>, OutErr, OutDone, InElem, InErr, InDone, Env>;
2490
2750
  /**
2491
2751
  * Filters arrays of elements emitted by a channel, applying the filter
2492
2752
  * to each element within the arrays and only emitting non-empty filtered arrays.
2493
2753
  *
2494
- * @example
2754
+ * **Example** (Filtering array output)
2755
+ *
2495
2756
  * ```ts
2496
2757
  * import { Array, Channel } from "effect"
2497
2758
  *
@@ -2519,15 +2780,16 @@ export declare const filterArray: {
2519
2780
  * // Outputs: [2, 4] (the arrays [1,3,5] and [7,9] are discarded)
2520
2781
  * ```
2521
2782
  *
2522
- * @since 4.0.0
2523
2783
  * @category Filtering
2784
+ * @since 4.0.0
2524
2785
  */
2525
2786
  <OutElem>(predicate: Predicate.Predicate<Types.NoInfer<OutElem>>): <OutErr, OutDone, InElem, InErr, InDone, Env>(self: Channel<Arr.NonEmptyReadonlyArray<OutElem>, OutErr, OutDone, InElem, InErr, InDone, Env>) => Channel<Arr.NonEmptyReadonlyArray<OutElem>, OutErr, OutDone, InElem, InErr, InDone, Env>;
2526
2787
  /**
2527
2788
  * Filters arrays of elements emitted by a channel, applying the filter
2528
2789
  * to each element within the arrays and only emitting non-empty filtered arrays.
2529
2790
  *
2530
- * @example
2791
+ * **Example** (Filtering array output)
2792
+ *
2531
2793
  * ```ts
2532
2794
  * import { Array, Channel } from "effect"
2533
2795
  *
@@ -2555,15 +2817,16 @@ export declare const filterArray: {
2555
2817
  * // Outputs: [2, 4] (the arrays [1,3,5] and [7,9] are discarded)
2556
2818
  * ```
2557
2819
  *
2558
- * @since 4.0.0
2559
2820
  * @category Filtering
2821
+ * @since 4.0.0
2560
2822
  */
2561
2823
  <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env, B extends OutElem>(self: Channel<Arr.NonEmptyReadonlyArray<OutElem>, OutErr, OutDone, InElem, InErr, InDone, Env>, refinement: Predicate.Refinement<OutElem, B>): Channel<Arr.NonEmptyReadonlyArray<B>, OutErr, OutDone, InElem, InErr, InDone, Env>;
2562
2824
  /**
2563
2825
  * Filters arrays of elements emitted by a channel, applying the filter
2564
2826
  * to each element within the arrays and only emitting non-empty filtered arrays.
2565
2827
  *
2566
- * @example
2828
+ * **Example** (Filtering array output)
2829
+ *
2567
2830
  * ```ts
2568
2831
  * import { Array, Channel } from "effect"
2569
2832
  *
@@ -2591,63 +2854,124 @@ export declare const filterArray: {
2591
2854
  * // Outputs: [2, 4] (the arrays [1,3,5] and [7,9] are discarded)
2592
2855
  * ```
2593
2856
  *
2594
- * @since 4.0.0
2595
2857
  * @category Filtering
2858
+ * @since 4.0.0
2596
2859
  */
2597
2860
  <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>(self: Channel<Arr.NonEmptyReadonlyArray<OutElem>, OutErr, OutDone, InElem, InErr, InDone, Env>, predicate: Predicate.Predicate<Types.NoInfer<OutElem>>): Channel<Arr.NonEmptyReadonlyArray<OutElem>, OutErr, OutDone, InElem, InErr, InDone, Env>;
2598
2861
  };
2599
2862
  /**
2600
- * @since 4.0.0
2863
+ * Filters and maps each element inside emitted non-empty arrays using a
2864
+ * `Filter`.
2865
+ *
2866
+ * Successful filter results are kept as mapped values. Failed filter results
2867
+ * are removed from the array. Arrays that become empty are discarded.
2868
+ *
2601
2869
  * @category Filtering
2870
+ * @since 4.0.0
2602
2871
  */
2603
2872
  export declare const filterMapArray: {
2604
2873
  /**
2605
- * @since 4.0.0
2874
+ * Filters and maps each element inside emitted non-empty arrays using a
2875
+ * `Filter`.
2876
+ *
2877
+ * Successful filter results are kept as mapped values. Failed filter results
2878
+ * are removed from the array. Arrays that become empty are discarded.
2879
+ *
2606
2880
  * @category Filtering
2881
+ * @since 4.0.0
2607
2882
  */
2608
2883
  <OutElem, B, X>(filter: Filter.Filter<Types.NoInfer<OutElem>, B, X>): <OutErr, OutDone, InElem, InErr, InDone, Env>(self: Channel<Arr.NonEmptyReadonlyArray<OutElem>, OutErr, OutDone, InElem, InErr, InDone, Env>) => Channel<Arr.NonEmptyReadonlyArray<B>, OutErr, OutDone, InElem, InErr, InDone, Env>;
2609
2884
  /**
2610
- * @since 4.0.0
2885
+ * Filters and maps each element inside emitted non-empty arrays using a
2886
+ * `Filter`.
2887
+ *
2888
+ * Successful filter results are kept as mapped values. Failed filter results
2889
+ * are removed from the array. Arrays that become empty are discarded.
2890
+ *
2611
2891
  * @category Filtering
2892
+ * @since 4.0.0
2612
2893
  */
2613
2894
  <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env, B, X>(self: Channel<Arr.NonEmptyReadonlyArray<OutElem>, OutErr, OutDone, InElem, InErr, InDone, Env>, filter: Filter.Filter<OutElem, B, X>): Channel<Arr.NonEmptyReadonlyArray<B>, OutErr, OutDone, InElem, InErr, InDone, Env>;
2614
2895
  };
2615
2896
  /**
2616
- * @since 4.0.0
2897
+ * Filters each element inside emitted non-empty arrays with an effectful
2898
+ * predicate.
2899
+ *
2900
+ * The predicate receives the element and its index within the array. Elements
2901
+ * for which the predicate succeeds with `true` are kept. Arrays that become
2902
+ * empty are discarded. Predicate failures fail the returned channel.
2903
+ *
2617
2904
  * @category Filtering
2905
+ * @since 4.0.0
2618
2906
  */
2619
2907
  export declare const filterArrayEffect: {
2620
2908
  /**
2621
- * @since 4.0.0
2909
+ * Filters each element inside emitted non-empty arrays with an effectful
2910
+ * predicate.
2911
+ *
2912
+ * The predicate receives the element and its index within the array. Elements
2913
+ * for which the predicate succeeds with `true` are kept. Arrays that become
2914
+ * empty are discarded. Predicate failures fail the returned channel.
2915
+ *
2622
2916
  * @category Filtering
2917
+ * @since 4.0.0
2623
2918
  */
2624
2919
  <OutElem, E, R>(predicate: (a: Types.NoInfer<OutElem>, index: number) => Effect.Effect<boolean, E, R>): <OutErr, OutDone, InElem, InErr, InDone, Env>(self: Channel<Arr.NonEmptyReadonlyArray<OutElem>, OutErr, OutDone, InElem, InErr, InDone, Env>) => Channel<Arr.NonEmptyReadonlyArray<OutElem>, OutErr | E, OutDone, InElem, InErr, InDone, Env | R>;
2625
2920
  /**
2626
- * @since 4.0.0
2921
+ * Filters each element inside emitted non-empty arrays with an effectful
2922
+ * predicate.
2923
+ *
2924
+ * The predicate receives the element and its index within the array. Elements
2925
+ * for which the predicate succeeds with `true` are kept. Arrays that become
2926
+ * empty are discarded. Predicate failures fail the returned channel.
2927
+ *
2627
2928
  * @category Filtering
2929
+ * @since 4.0.0
2628
2930
  */
2629
2931
  <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env, E, R>(self: Channel<Arr.NonEmptyReadonlyArray<OutElem>, OutErr, OutDone, InElem, InErr, InDone, Env>, predicate: (a: Types.NoInfer<OutElem>, index: number) => Effect.Effect<boolean, E, R>): Channel<Arr.NonEmptyReadonlyArray<OutElem>, OutErr | E, OutDone, InElem, InErr, InDone, Env | R>;
2630
2932
  };
2631
2933
  /**
2632
- * @since 4.0.0
2934
+ * Filters and maps each element inside emitted non-empty arrays using an
2935
+ * effectful `Filter`.
2936
+ *
2937
+ * Successful filter results are kept as mapped values. Failed filter results
2938
+ * are removed from the array. Arrays that become empty are discarded. Failures
2939
+ * from the effectful filter fail the returned channel.
2940
+ *
2633
2941
  * @category Filtering
2942
+ * @since 4.0.0
2634
2943
  */
2635
2944
  export declare const filterMapArrayEffect: {
2636
2945
  /**
2637
- * @since 4.0.0
2946
+ * Filters and maps each element inside emitted non-empty arrays using an
2947
+ * effectful `Filter`.
2948
+ *
2949
+ * Successful filter results are kept as mapped values. Failed filter results
2950
+ * are removed from the array. Arrays that become empty are discarded. Failures
2951
+ * from the effectful filter fail the returned channel.
2952
+ *
2638
2953
  * @category Filtering
2954
+ * @since 4.0.0
2639
2955
  */
2640
2956
  <OutElem, B, X, EX, RX>(filter: Filter.FilterEffect<Types.NoInfer<OutElem>, B, X, EX, RX>): <OutErr, OutDone, InElem, InErr, InDone, Env>(self: Channel<Arr.NonEmptyReadonlyArray<OutElem>, OutErr, OutDone, InElem, InErr, InDone, Env>) => Channel<Arr.NonEmptyReadonlyArray<B>, OutErr | EX, OutDone, InElem, InErr, InDone, Env | RX>;
2641
2957
  /**
2642
- * @since 4.0.0
2958
+ * Filters and maps each element inside emitted non-empty arrays using an
2959
+ * effectful `Filter`.
2960
+ *
2961
+ * Successful filter results are kept as mapped values. Failed filter results
2962
+ * are removed from the array. Arrays that become empty are discarded. Failures
2963
+ * from the effectful filter fail the returned channel.
2964
+ *
2643
2965
  * @category Filtering
2966
+ * @since 4.0.0
2644
2967
  */
2645
2968
  <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env, B, X, EX, RX>(self: Channel<Arr.NonEmptyReadonlyArray<OutElem>, OutErr, OutDone, InElem, InErr, InDone, Env>, filter: Filter.FilterEffect<OutElem, B, X, EX, RX>): Channel<Arr.NonEmptyReadonlyArray<B>, OutErr | EX, OutDone, InElem, InErr, InDone, Env | RX>;
2646
2969
  };
2647
2970
  /**
2648
2971
  * Statefully maps over a channel with an accumulator, where each element can produce multiple output values.
2649
2972
  *
2650
- * @example
2973
+ * **Example** (Mapping with accumulated state)
2974
+ *
2651
2975
  * ```ts
2652
2976
  * import { Channel, Effect } from "effect"
2653
2977
  *
@@ -2678,14 +3002,15 @@ export declare const filterMapArrayEffect: {
2678
3002
  * )
2679
3003
  * ```
2680
3004
  *
2681
- * @since 2.0.0
2682
3005
  * @category Sequencing
3006
+ * @since 2.0.0
2683
3007
  */
2684
3008
  export declare const mapAccum: {
2685
3009
  /**
2686
3010
  * Statefully maps over a channel with an accumulator, where each element can produce multiple output values.
2687
3011
  *
2688
- * @example
3012
+ * **Example** (Mapping with accumulated state)
3013
+ *
2689
3014
  * ```ts
2690
3015
  * import { Channel, Effect } from "effect"
2691
3016
  *
@@ -2716,8 +3041,8 @@ export declare const mapAccum: {
2716
3041
  * )
2717
3042
  * ```
2718
3043
  *
2719
- * @since 2.0.0
2720
3044
  * @category Sequencing
3045
+ * @since 2.0.0
2721
3046
  */
2722
3047
  <S, OutElem, B, E = never, R = never>(initial: LazyArg<S>, f: (s: S, a: Types.NoInfer<OutElem>) => Effect.Effect<readonly [state: S, values: ReadonlyArray<B>], E, R> | readonly [state: S, values: ReadonlyArray<B>], options?: {
2723
3048
  readonly onHalt?: ((state: S) => Array<B>) | undefined;
@@ -2725,7 +3050,8 @@ export declare const mapAccum: {
2725
3050
  /**
2726
3051
  * Statefully maps over a channel with an accumulator, where each element can produce multiple output values.
2727
3052
  *
2728
- * @example
3053
+ * **Example** (Mapping with accumulated state)
3054
+ *
2729
3055
  * ```ts
2730
3056
  * import { Channel, Effect } from "effect"
2731
3057
  *
@@ -2756,8 +3082,8 @@ export declare const mapAccum: {
2756
3082
  * )
2757
3083
  * ```
2758
3084
  *
2759
- * @since 2.0.0
2760
3085
  * @category Sequencing
3086
+ * @since 2.0.0
2761
3087
  */
2762
3088
  <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env, S, B, E = never, R = never>(self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>, initial: LazyArg<S>, f: (s: S, a: Types.NoInfer<OutElem>) => Effect.Effect<readonly [state: S, values: ReadonlyArray<B>], E, R> | readonly [state: S, values: ReadonlyArray<B>], options?: {
2763
3089
  readonly onHalt?: ((state: S) => Array<B>) | undefined;
@@ -2767,7 +3093,8 @@ export declare const mapAccum: {
2767
3093
  * Statefully transforms a channel by scanning over its output with an accumulator function.
2768
3094
  * Emits the intermediate results of the scan operation.
2769
3095
  *
2770
- * @example
3096
+ * **Example** (Scanning channel output)
3097
+ *
2771
3098
  * ```ts
2772
3099
  * import { Channel } from "effect"
2773
3100
  *
@@ -2789,15 +3116,16 @@ export declare const mapAccum: {
2789
3116
  * // Outputs: "", "hello", "hello world", "hello world from", "hello world from effect"
2790
3117
  * ```
2791
3118
  *
2792
- * @since 2.0.0
2793
3119
  * @category Sequencing
3120
+ * @since 2.0.0
2794
3121
  */
2795
3122
  export declare const scan: {
2796
3123
  /**
2797
3124
  * Statefully transforms a channel by scanning over its output with an accumulator function.
2798
3125
  * Emits the intermediate results of the scan operation.
2799
3126
  *
2800
- * @example
3127
+ * **Example** (Scanning channel output)
3128
+ *
2801
3129
  * ```ts
2802
3130
  * import { Channel } from "effect"
2803
3131
  *
@@ -2819,15 +3147,16 @@ export declare const scan: {
2819
3147
  * // Outputs: "", "hello", "hello world", "hello world from", "hello world from effect"
2820
3148
  * ```
2821
3149
  *
2822
- * @since 2.0.0
2823
3150
  * @category Sequencing
3151
+ * @since 2.0.0
2824
3152
  */
2825
3153
  <S, OutElem>(initial: S, f: (s: S, a: Types.NoInfer<OutElem>) => S): <OutErr, OutDone, InElem, InErr, InDone, Env>(self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>) => Channel<S, OutErr, OutDone, InElem, InErr, InDone, Env>;
2826
3154
  /**
2827
3155
  * Statefully transforms a channel by scanning over its output with an accumulator function.
2828
3156
  * Emits the intermediate results of the scan operation.
2829
3157
  *
2830
- * @example
3158
+ * **Example** (Scanning channel output)
3159
+ *
2831
3160
  * ```ts
2832
3161
  * import { Channel } from "effect"
2833
3162
  *
@@ -2849,8 +3178,8 @@ export declare const scan: {
2849
3178
  * // Outputs: "", "hello", "hello world", "hello world from", "hello world from effect"
2850
3179
  * ```
2851
3180
  *
2852
- * @since 2.0.0
2853
3181
  * @category Sequencing
3182
+ * @since 2.0.0
2854
3183
  */
2855
3184
  <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env, S>(self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>, initial: S, f: (s: S, a: Types.NoInfer<OutElem>) => S): Channel<S, OutErr, OutDone, InElem, InErr, InDone, Env>;
2856
3185
  };
@@ -2858,7 +3187,8 @@ export declare const scan: {
2858
3187
  * Statefully transforms a channel by scanning over its output with an effectful accumulator function.
2859
3188
  * Emits the intermediate results of the scan operation.
2860
3189
  *
2861
- * @example
3190
+ * **Example** (Scanning channel output with effects)
3191
+ *
2862
3192
  * ```ts
2863
3193
  * import { Channel, Data, Effect } from "effect"
2864
3194
  *
@@ -2895,15 +3225,16 @@ export declare const scan: {
2895
3225
  * )
2896
3226
  * ```
2897
3227
  *
2898
- * @since 2.0.0
2899
3228
  * @category Sequencing
3229
+ * @since 2.0.0
2900
3230
  */
2901
3231
  export declare const scanEffect: {
2902
3232
  /**
2903
3233
  * Statefully transforms a channel by scanning over its output with an effectful accumulator function.
2904
3234
  * Emits the intermediate results of the scan operation.
2905
3235
  *
2906
- * @example
3236
+ * **Example** (Scanning channel output with effects)
3237
+ *
2907
3238
  * ```ts
2908
3239
  * import { Channel, Data, Effect } from "effect"
2909
3240
  *
@@ -2940,15 +3271,16 @@ export declare const scanEffect: {
2940
3271
  * )
2941
3272
  * ```
2942
3273
  *
2943
- * @since 2.0.0
2944
3274
  * @category Sequencing
3275
+ * @since 2.0.0
2945
3276
  */
2946
3277
  <S, OutElem, E, R>(initial: S, f: (s: S, a: Types.NoInfer<OutElem>) => Effect.Effect<S, E, R>): <OutErr, OutDone, InElem, InErr, InDone, Env>(self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>) => Channel<S, OutErr | E, OutDone, InElem, InErr, InDone, Env | R>;
2947
3278
  /**
2948
3279
  * Statefully transforms a channel by scanning over its output with an effectful accumulator function.
2949
3280
  * Emits the intermediate results of the scan operation.
2950
3281
  *
2951
- * @example
3282
+ * **Example** (Scanning channel output with effects)
3283
+ *
2952
3284
  * ```ts
2953
3285
  * import { Channel, Data, Effect } from "effect"
2954
3286
  *
@@ -2985,8 +3317,8 @@ export declare const scanEffect: {
2985
3317
  * )
2986
3318
  * ```
2987
3319
  *
2988
- * @since 2.0.0
2989
3320
  * @category Sequencing
3321
+ * @since 2.0.0
2990
3322
  */
2991
3323
  <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env, S, E, R>(self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>, initial: S, f: (s: S, a: Types.NoInfer<OutElem>) => Effect.Effect<S, E, R>): Channel<S, OutErr | E, OutDone, InElem, InErr, InDone, Env | R>;
2992
3324
  };
@@ -2994,7 +3326,8 @@ export declare const scanEffect: {
2994
3326
  * Catches any cause of failure from the channel and allows recovery by
2995
3327
  * creating a new channel based on the caught cause.
2996
3328
  *
2997
- * @example
3329
+ * **Example** (Recovering from failure causes)
3330
+ *
2998
3331
  * ```ts
2999
3332
  * import { Cause, Channel, Data } from "effect"
3000
3333
  *
@@ -3022,15 +3355,16 @@ export declare const scanEffect: {
3022
3355
  * // The channel recovers gracefully from errors
3023
3356
  * ```
3024
3357
  *
3025
- * @since 4.0.0
3026
3358
  * @category Error handling
3359
+ * @since 4.0.0
3027
3360
  */
3028
3361
  export declare const catchCause: {
3029
3362
  /**
3030
3363
  * Catches any cause of failure from the channel and allows recovery by
3031
3364
  * creating a new channel based on the caught cause.
3032
3365
  *
3033
- * @example
3366
+ * **Example** (Recovering from failure causes)
3367
+ *
3034
3368
  * ```ts
3035
3369
  * import { Cause, Channel, Data } from "effect"
3036
3370
  *
@@ -3058,15 +3392,16 @@ export declare const catchCause: {
3058
3392
  * // The channel recovers gracefully from errors
3059
3393
  * ```
3060
3394
  *
3061
- * @since 4.0.0
3062
3395
  * @category Error handling
3396
+ * @since 4.0.0
3063
3397
  */
3064
3398
  <OutErr, OutElem1, OutErr1, OutDone1, InElem1, InErr1, InDone1, Env1>(f: (d: Cause.Cause<OutErr>) => Channel<OutElem1, OutErr1, OutDone1, InElem1, InErr1, InDone1, Env1>): <OutElem, OutDone, InElem, InErr, InDone, Env>(self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>) => Channel<OutElem | OutElem1, OutErr1, OutDone | OutDone1, InElem & InElem1, InErr & InErr1, InDone & InDone1, Env | Env1>;
3065
3399
  /**
3066
3400
  * Catches any cause of failure from the channel and allows recovery by
3067
3401
  * creating a new channel based on the caught cause.
3068
3402
  *
3069
- * @example
3403
+ * **Example** (Recovering from failure causes)
3404
+ *
3070
3405
  * ```ts
3071
3406
  * import { Cause, Channel, Data } from "effect"
3072
3407
  *
@@ -3094,24 +3429,42 @@ export declare const catchCause: {
3094
3429
  * // The channel recovers gracefully from errors
3095
3430
  * ```
3096
3431
  *
3097
- * @since 4.0.0
3098
3432
  * @category Error handling
3433
+ * @since 4.0.0
3099
3434
  */
3100
3435
  <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env, OutElem1, OutErr1, OutDone1, InElem1, InErr1, InDone1, Env1>(self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>, f: (d: Cause.Cause<OutErr>) => Channel<OutElem1, OutErr1, OutDone1, InElem1, InErr1, InDone1, Env1>): Channel<OutElem | OutElem1, OutErr1, OutDone | OutDone1, InElem & InElem1, InErr & InErr1, InDone & InDone1, Env | Env1>;
3101
3436
  };
3102
3437
  /**
3103
- * @since 4.0.0
3438
+ * Runs an effect with the full failure `Cause` when the channel fails, then
3439
+ * fails the returned channel with the original cause.
3440
+ *
3441
+ * Use this for observing failures, such as logging or metrics. If the observer
3442
+ * effect fails, that failure can fail the returned channel.
3443
+ *
3104
3444
  * @category Error handling
3445
+ * @since 4.0.0
3105
3446
  */
3106
3447
  export declare const tapCause: {
3107
3448
  /**
3108
- * @since 4.0.0
3449
+ * Runs an effect with the full failure `Cause` when the channel fails, then
3450
+ * fails the returned channel with the original cause.
3451
+ *
3452
+ * Use this for observing failures, such as logging or metrics. If the observer
3453
+ * effect fails, that failure can fail the returned channel.
3454
+ *
3109
3455
  * @category Error handling
3456
+ * @since 4.0.0
3110
3457
  */
3111
3458
  <OutErr, A, E, R>(f: (d: Cause.Cause<OutErr>) => Effect.Effect<A, E, R>): <OutElem, OutDone, InElem, InErr, InDone, Env>(self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>) => Channel<OutElem, OutErr | E, OutDone | void, InElem, InErr, InDone, Env | R>;
3112
3459
  /**
3113
- * @since 4.0.0
3460
+ * Runs an effect with the full failure `Cause` when the channel fails, then
3461
+ * fails the returned channel with the original cause.
3462
+ *
3463
+ * Use this for observing failures, such as logging or metrics. If the observer
3464
+ * effect fails, that failure can fail the returned channel.
3465
+ *
3114
3466
  * @category Error handling
3467
+ * @since 4.0.0
3115
3468
  */
3116
3469
  <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env, A, E, R>(self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>, f: (d: Cause.Cause<OutErr>) => Effect.Effect<A, E, R>): Channel<OutElem, OutErr | E, OutDone | void, InElem, InErr, InDone, Env | R>;
3117
3470
  };
@@ -3119,40 +3472,58 @@ export declare const tapCause: {
3119
3472
  * Catches causes of failure that match a specific filter, allowing
3120
3473
  * conditional error recovery based on the type of failure.
3121
3474
  *
3122
- * @since 4.0.0
3123
3475
  * @category Error handling
3476
+ * @since 4.0.0
3124
3477
  */
3125
3478
  export declare const catchCauseIf: {
3126
3479
  /**
3127
3480
  * Catches causes of failure that match a specific filter, allowing
3128
3481
  * conditional error recovery based on the type of failure.
3129
3482
  *
3130
- * @since 4.0.0
3131
3483
  * @category Error handling
3484
+ * @since 4.0.0
3132
3485
  */
3133
3486
  <OutErr, OutElem1, OutErr1, OutDone1, InElem1, InErr1, InDone1, Env1>(predicate: Predicate.Predicate<Cause.Cause<OutErr>>, f: (cause: Cause.Cause<OutErr>) => Channel<OutElem1, OutErr1, OutDone1, InElem1, InErr1, InDone1, Env1>): <OutElem, OutDone, InElem, InErr, InDone, Env>(self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>) => Channel<OutElem | OutElem1, OutErr | OutErr1, OutDone | OutDone1, InElem & InElem1, InErr & InErr1, InDone & InDone1, Env | Env1>;
3134
3487
  /**
3135
3488
  * Catches causes of failure that match a specific filter, allowing
3136
3489
  * conditional error recovery based on the type of failure.
3137
3490
  *
3138
- * @since 4.0.0
3139
3491
  * @category Error handling
3492
+ * @since 4.0.0
3140
3493
  */
3141
3494
  <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env, OutElem1, OutErr1, OutDone1, InElem1, InErr1, InDone1, Env1>(self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>, predicate: Predicate.Predicate<Cause.Cause<OutErr>>, f: (cause: Cause.Cause<OutErr>) => Channel<OutElem1, OutErr1, OutDone1, InElem1, InErr1, InDone1, Env1>): Channel<OutElem | OutElem1, OutErr | OutErr1, OutDone | OutDone1, InElem & InElem1, InErr & InErr1, InDone & InDone1, Env | Env1>;
3142
3495
  };
3143
3496
  /**
3144
- * @since 4.0.0
3497
+ * Recovers from channel failures whose full `Cause` is selected by a `Filter`.
3498
+ *
3499
+ * When the filter succeeds, the recovery function receives the selected value
3500
+ * and the original cause. When the filter fails, the returned channel fails
3501
+ * with the residual cause produced by the filter.
3502
+ *
3145
3503
  * @category Error handling
3504
+ * @since 4.0.0
3146
3505
  */
3147
3506
  export declare const catchCauseFilter: {
3148
3507
  /**
3149
- * @since 4.0.0
3508
+ * Recovers from channel failures whose full `Cause` is selected by a `Filter`.
3509
+ *
3510
+ * When the filter succeeds, the recovery function receives the selected value
3511
+ * and the original cause. When the filter fails, the returned channel fails
3512
+ * with the residual cause produced by the filter.
3513
+ *
3150
3514
  * @category Error handling
3515
+ * @since 4.0.0
3151
3516
  */
3152
3517
  <OutErr, EB, X extends Cause.Cause<any>, OutElem1, OutErr1, OutDone1, InElem1, InErr1, InDone1, Env1>(filter: Filter.Filter<Cause.Cause<OutErr>, EB, X>, f: (failure: EB, cause: Cause.Cause<OutErr>) => Channel<OutElem1, OutErr1, OutDone1, InElem1, InErr1, InDone1, Env1>): <OutElem, OutDone, InElem, InErr, InDone, Env>(self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>) => Channel<OutElem | OutElem1, Cause.Cause.Error<X> | OutErr1, OutDone | OutDone1, InElem & InElem1, InErr & InErr1, InDone & InDone1, Env | Env1>;
3153
3518
  /**
3154
- * @since 4.0.0
3519
+ * Recovers from channel failures whose full `Cause` is selected by a `Filter`.
3520
+ *
3521
+ * When the filter succeeds, the recovery function receives the selected value
3522
+ * and the original cause. When the filter fails, the returned channel fails
3523
+ * with the residual cause produced by the filter.
3524
+ *
3155
3525
  * @category Error handling
3526
+ * @since 4.0.0
3156
3527
  */
3157
3528
  <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env, EB, X extends Cause.Cause<any>, OutElem1, OutErr1, OutDone1, InElem1, InErr1, InDone1, Env1>(self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>, filter: Filter.Filter<Cause.Cause<OutErr>, EB, X>, f: (failure: EB, cause: Cause.Cause<OutErr>) => Channel<OutElem1, OutErr1, OutDone1, InElem1, InErr1, InDone1, Env1>): Channel<OutElem | OutElem1, Cause.Cause.Error<X> | OutErr1, OutDone | OutDone1, InElem & InElem1, InErr & InErr1, InDone & InDone1, Env | Env1>;
3158
3529
  };
@@ -3162,88 +3533,173 @@ declare const catch_: {
3162
3533
  };
3163
3534
  export {
3164
3535
  /**
3165
- * @since 4.0.0
3166
3536
  * @category Error handling
3537
+ * @since 4.0.0
3167
3538
  */
3168
3539
  catch_ as catch };
3169
3540
  /**
3170
- * @since 4.0.0
3541
+ * Runs an effect when the channel fails with a typed error, then preserves the
3542
+ * original channel failure.
3543
+ *
3544
+ * The effect is not run for normal channel completion. If the observer effect
3545
+ * fails, that failure can fail the returned channel.
3546
+ *
3171
3547
  * @category Error handling
3548
+ * @since 4.0.0
3172
3549
  */
3173
3550
  export declare const tapError: {
3174
3551
  /**
3175
- * @since 4.0.0
3552
+ * Runs an effect when the channel fails with a typed error, then preserves the
3553
+ * original channel failure.
3554
+ *
3555
+ * The effect is not run for normal channel completion. If the observer effect
3556
+ * fails, that failure can fail the returned channel.
3557
+ *
3176
3558
  * @category Error handling
3559
+ * @since 4.0.0
3177
3560
  */
3178
3561
  <OutErr, A, E, R>(f: (d: OutErr) => Effect.Effect<A, E, R>): <OutElem, OutDone, InElem, InErr, InDone, Env>(self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>) => Channel<OutElem, OutErr | E, OutDone | void, InElem, InErr, InDone, Env | R>;
3179
3562
  /**
3180
- * @since 4.0.0
3563
+ * Runs an effect when the channel fails with a typed error, then preserves the
3564
+ * original channel failure.
3565
+ *
3566
+ * The effect is not run for normal channel completion. If the observer effect
3567
+ * fails, that failure can fail the returned channel.
3568
+ *
3181
3569
  * @category Error handling
3570
+ * @since 4.0.0
3182
3571
  */
3183
3572
  <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env, A, E, R>(self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>, f: (d: OutErr) => Effect.Effect<A, E, R>): Channel<OutElem, OutErr | E, OutDone | void, InElem, InErr, InDone, Env | R>;
3184
3573
  };
3185
3574
  /**
3186
- * @since 4.0.0
3575
+ * Recovers from typed channel errors that match a predicate or refinement.
3576
+ *
3577
+ * Matching errors are handled by the recovery function. Non-matching errors
3578
+ * are handled by `orElse` when provided. Without `orElse`, non-matching errors
3579
+ * are re-failed.
3580
+ *
3187
3581
  * @category Error handling
3582
+ * @since 4.0.0
3188
3583
  */
3189
3584
  export declare const catchIf: {
3190
3585
  /**
3191
- * @since 4.0.0
3586
+ * Recovers from typed channel errors that match a predicate or refinement.
3587
+ *
3588
+ * Matching errors are handled by the recovery function. Non-matching errors
3589
+ * are handled by `orElse` when provided. Without `orElse`, non-matching errors
3590
+ * are re-failed.
3591
+ *
3192
3592
  * @category Error handling
3593
+ * @since 4.0.0
3193
3594
  */
3194
3595
  <OutErr, EB extends OutErr, OutElem1, OutErr1, OutDone1, InElem1, InErr1, InDone1, Env1, OutElem2 = never, OutErr2 = Exclude<OutErr, EB>, OutDone2 = never, InElem2 = unknown, InErr2 = unknown, InDone2 = unknown, Env2 = never>(refinement: Predicate.Refinement<OutErr, EB>, f: (failure: EB) => Channel<OutElem1, OutErr1, OutDone1, InElem1, InErr1, InDone1, Env1>, orElse?: ((failure: Exclude<OutErr, EB>) => Channel<OutElem2, OutErr2, OutDone2, InElem2, InErr2, InDone2, Env2>) | undefined): <OutElem, OutDone, InElem, InErr, InDone, Env>(self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>) => Channel<OutElem | OutElem1 | OutElem2, OutErr1 | OutErr2, OutDone | OutDone1 | OutDone2, InElem & InElem1 & InElem2, InErr & InErr1 & InErr2, InDone & InDone1 & InDone2, Env | Env1 | Env2>;
3195
3596
  /**
3196
- * @since 4.0.0
3597
+ * Recovers from typed channel errors that match a predicate or refinement.
3598
+ *
3599
+ * Matching errors are handled by the recovery function. Non-matching errors
3600
+ * are handled by `orElse` when provided. Without `orElse`, non-matching errors
3601
+ * are re-failed.
3602
+ *
3197
3603
  * @category Error handling
3604
+ * @since 4.0.0
3198
3605
  */
3199
3606
  <OutErr, OutElem1, OutErr1, OutDone1, InElem1, InErr1, InDone1, Env1, OutElem2 = never, OutErr2 = OutErr, OutDone2 = never, InElem2 = unknown, InErr2 = unknown, InDone2 = unknown, Env2 = never>(predicate: Predicate.Predicate<OutErr>, f: (failure: OutErr) => Channel<OutElem1, OutErr1, OutDone1, InElem1, InErr1, InDone1, Env1>, orElse?: ((failure: OutErr) => Channel<OutElem2, OutErr2, OutDone2, InElem2, InErr2, InDone2, Env2>) | undefined): <OutElem, OutDone, InElem, InErr, InDone, Env>(self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>) => Channel<OutElem | OutElem1 | OutElem2, OutErr1 | OutErr2, OutDone | OutDone1 | OutDone2, InElem & InElem1 & InElem2, InErr & InErr1 & InErr2, InDone & InDone1 & InDone2, Env | Env1 | Env2>;
3200
3607
  /**
3201
- * @since 4.0.0
3608
+ * Recovers from typed channel errors that match a predicate or refinement.
3609
+ *
3610
+ * Matching errors are handled by the recovery function. Non-matching errors
3611
+ * are handled by `orElse` when provided. Without `orElse`, non-matching errors
3612
+ * are re-failed.
3613
+ *
3202
3614
  * @category Error handling
3615
+ * @since 4.0.0
3203
3616
  */
3204
3617
  <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env, EB extends OutErr, OutElem1, OutErr1, OutDone1, InElem1, InErr1, InDone1, Env1, OutElem2 = never, OutErr2 = Exclude<OutErr, EB>, OutDone2 = never, InElem2 = unknown, InErr2 = unknown, InDone2 = unknown, Env2 = never>(self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>, refinement: Predicate.Refinement<OutErr, EB>, f: (failure: EB) => Channel<OutElem1, OutErr1, OutDone1, InElem1, InErr1, InDone1, Env1>, orElse?: ((failure: Exclude<OutErr, EB>) => Channel<OutElem2, OutErr2, OutDone2, InElem2, InErr2, InDone2, Env2>) | undefined): Channel<OutElem | OutElem1 | OutElem2, OutErr1 | OutErr2, OutDone | OutDone1 | OutDone2, InElem & InElem1 & InElem2, InErr & InErr1 & InErr2, InDone & InDone1 & InDone2, Env | Env1 | Env2>;
3205
3618
  /**
3206
- * @since 4.0.0
3619
+ * Recovers from typed channel errors that match a predicate or refinement.
3620
+ *
3621
+ * Matching errors are handled by the recovery function. Non-matching errors
3622
+ * are handled by `orElse` when provided. Without `orElse`, non-matching errors
3623
+ * are re-failed.
3624
+ *
3207
3625
  * @category Error handling
3626
+ * @since 4.0.0
3208
3627
  */
3209
3628
  <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env, OutElem1, OutErr1, OutDone1, InElem1, InErr1, InDone1, Env1, OutElem2 = never, OutErr2 = OutErr, OutDone2 = never, InElem2 = unknown, InErr2 = unknown, InDone2 = unknown, Env2 = never>(self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>, predicate: Predicate.Predicate<OutErr>, f: (failure: OutErr) => Channel<OutElem1, OutErr1, OutDone1, InElem1, InErr1, InDone1, Env1>, orElse?: ((failure: OutErr) => Channel<OutElem2, OutErr2, OutDone2, InElem2, InErr2, InDone2, Env2>) | undefined): Channel<OutElem | OutElem1 | OutElem2, OutErr1 | OutErr2, OutDone | OutDone1 | OutDone2, InElem & InElem1 & InElem2, InErr & InErr1 & InErr2, InDone & InDone1 & InDone2, Env | Env1 | Env2>;
3210
3629
  };
3211
3630
  /**
3212
- * @since 4.0.0
3631
+ * Recovers from typed channel errors selected by a `Filter`.
3632
+ *
3633
+ * Successful filter results are handled by the recovery function. Failed
3634
+ * filter results are handled by `orElse` when provided. Without `orElse`,
3635
+ * failed filter results are re-failed.
3636
+ *
3213
3637
  * @category Error handling
3638
+ * @since 4.0.0
3214
3639
  */
3215
3640
  export declare const catchFilter: {
3216
3641
  /**
3217
- * @since 4.0.0
3642
+ * Recovers from typed channel errors selected by a `Filter`.
3643
+ *
3644
+ * Successful filter results are handled by the recovery function. Failed
3645
+ * filter results are handled by `orElse` when provided. Without `orElse`,
3646
+ * failed filter results are re-failed.
3647
+ *
3218
3648
  * @category Error handling
3649
+ * @since 4.0.0
3219
3650
  */
3220
3651
  <OutErr, EB, X, OutElem1, OutErr1, OutDone1, InElem1, InErr1, InDone1, Env1, OutElem2 = never, OutErr2 = X, OutDone2 = never, InElem2 = unknown, InErr2 = unknown, InDone2 = unknown, Env2 = never>(filter: Filter.Filter<OutErr, EB, X>, f: (failure: EB) => Channel<OutElem1, OutErr1, OutDone1, InElem1, InErr1, InDone1, Env1>, orElse?: ((failure: X) => Channel<OutElem2, OutErr2, OutDone2, InElem2, InErr2, InDone2, Env2>) | undefined): <OutElem, OutDone, InElem, InErr, InDone, Env>(self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>) => Channel<OutElem | OutElem1 | OutElem2, OutErr1 | OutErr2, OutDone | OutDone1 | OutDone2, InElem & InElem1 & InElem2, InErr & InErr1 & InErr2, InDone & InDone1 & InDone2, Env | Env1 | Env2>;
3221
3652
  /**
3222
- * @since 4.0.0
3653
+ * Recovers from typed channel errors selected by a `Filter`.
3654
+ *
3655
+ * Successful filter results are handled by the recovery function. Failed
3656
+ * filter results are handled by `orElse` when provided. Without `orElse`,
3657
+ * failed filter results are re-failed.
3658
+ *
3223
3659
  * @category Error handling
3660
+ * @since 4.0.0
3224
3661
  */
3225
3662
  <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env, EB, X, OutElem1, OutErr1, OutDone1, InElem1, InErr1, InDone1, Env1, OutElem2 = never, OutErr2 = X, OutDone2 = never, InElem2 = unknown, InErr2 = unknown, InDone2 = unknown, Env2 = never>(self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>, filter: Filter.Filter<OutErr, EB, X>, f: (failure: EB) => Channel<OutElem1, OutErr1, OutDone1, InElem1, InErr1, InDone1, Env1>, orElse?: ((failure: X) => Channel<OutElem2, OutErr2, OutDone2, InElem2, InErr2, InDone2, Env2>) | undefined): Channel<OutElem | OutElem1 | OutElem2, OutErr1 | OutErr2, OutDone | OutDone1 | OutDone2, InElem & InElem1 & InElem2, InErr & InErr1 & InErr2, InDone & InDone1 & InDone2, Env | Env1 | Env2>;
3226
3663
  };
3227
3664
  /**
3228
- * @since 4.0.0
3665
+ * Recovers from tagged channel errors whose `_tag` matches one or more tags.
3666
+ *
3667
+ * Matching tagged errors are handled by the recovery function. Non-matching
3668
+ * errors are handled by `orElse` when provided. Without `orElse`,
3669
+ * non-matching errors are re-failed.
3670
+ *
3229
3671
  * @category Error handling
3672
+ * @since 4.0.0
3230
3673
  */
3231
3674
  export declare const catchTag: {
3232
3675
  /**
3233
- * @since 4.0.0
3676
+ * Recovers from tagged channel errors whose `_tag` matches one or more tags.
3677
+ *
3678
+ * Matching tagged errors are handled by the recovery function. Non-matching
3679
+ * errors are handled by `orElse` when provided. Without `orElse`,
3680
+ * non-matching errors are re-failed.
3681
+ *
3234
3682
  * @category Error handling
3683
+ * @since 4.0.0
3235
3684
  */
3236
3685
  <OutErr, const K extends Types.Tags<OutErr> | Arr.NonEmptyReadonlyArray<Types.Tags<OutErr>>, OutElem1, OutErr1, OutDone1, InElem1, InErr1, InDone1, Env1, OutElem2 = never, OutErr2 = Types.ExcludeTag<OutErr, K extends Arr.NonEmptyReadonlyArray<string> ? K[number] : K>, OutDone2 = never, InElem2 = unknown, InErr2 = unknown, InDone2 = unknown, Env2 = never>(k: K, f: (e: Types.ExtractTag<NoInfer<OutErr>, K extends Arr.NonEmptyReadonlyArray<string> ? K[number] : K>) => Channel<OutElem1, OutErr1, OutDone1, InElem1, InErr1, InDone1, Env1>, orElse?: ((e: Types.ExcludeTag<NoInfer<OutErr>, K extends Arr.NonEmptyReadonlyArray<string> ? K[number] : K>) => Channel<OutElem2, OutErr2, OutDone2, InElem2, InErr2, InDone2, Env2>) | undefined): <OutElem, OutDone, InElem, InErr, InDone, Env>(self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>) => Channel<OutElem | OutElem1 | OutElem2, OutErr1 | OutErr2, OutDone | OutDone1 | OutDone2, InElem & InElem1 & InElem2, InErr & InErr1 & InErr2, InDone & InDone1 & InDone2, Env | Env1 | Env2>;
3237
3686
  /**
3238
- * @since 4.0.0
3687
+ * Recovers from tagged channel errors whose `_tag` matches one or more tags.
3688
+ *
3689
+ * Matching tagged errors are handled by the recovery function. Non-matching
3690
+ * errors are handled by `orElse` when provided. Without `orElse`,
3691
+ * non-matching errors are re-failed.
3692
+ *
3239
3693
  * @category Error handling
3694
+ * @since 4.0.0
3240
3695
  */
3241
3696
  <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env, const K extends Types.Tags<OutErr> | Arr.NonEmptyReadonlyArray<Types.Tags<OutErr>>, OutElem1, OutErr1, OutDone1, InElem1, InErr1, InDone1, Env1, OutElem2 = never, OutErr2 = Types.ExcludeTag<OutErr, K extends Arr.NonEmptyReadonlyArray<string> ? K[number] : K>, OutDone2 = never, InElem2 = unknown, InErr2 = unknown, InDone2 = unknown, Env2 = never>(self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>, k: K, f: (e: Types.ExtractTag<NoInfer<OutErr>, K extends Arr.NonEmptyReadonlyArray<string> ? K[number] : K>) => Channel<OutElem1, OutErr1, OutDone1, InElem1, InErr1, InDone1, Env1>, orElse?: ((e: Types.ExcludeTag<NoInfer<OutErr>, K extends Arr.NonEmptyReadonlyArray<string> ? K[number] : K>) => Channel<OutElem2, OutErr2, OutDone2, InElem2, InErr2, InDone2, Env2>) | undefined): Channel<OutElem | OutElem1 | OutElem2, OutErr1 | OutErr2, OutDone | OutDone1 | OutDone2, InElem & InElem1 & InElem2, InErr & InErr1 & InErr2, InDone & InDone1 & InDone2, Env | Env1 | Env2>;
3242
3697
  };
3243
3698
  /**
3244
3699
  * Catches a specific reason within a tagged error.
3245
3700
  *
3246
- * @example
3701
+ * **Example** (Recovering from nested reasons)
3702
+ *
3247
3703
  * ```ts
3248
3704
  * import { Channel, Data } from "effect"
3249
3705
  *
@@ -3270,14 +3726,15 @@ export declare const catchTag: {
3270
3726
  * )
3271
3727
  * ```
3272
3728
  *
3273
- * @since 4.0.0
3274
3729
  * @category Error handling
3730
+ * @since 4.0.0
3275
3731
  */
3276
3732
  export declare const catchReason: {
3277
3733
  /**
3278
3734
  * Catches a specific reason within a tagged error.
3279
3735
  *
3280
- * @example
3736
+ * **Example** (Recovering from nested reasons)
3737
+ *
3281
3738
  * ```ts
3282
3739
  * import { Channel, Data } from "effect"
3283
3740
  *
@@ -3304,14 +3761,15 @@ export declare const catchReason: {
3304
3761
  * )
3305
3762
  * ```
3306
3763
  *
3307
- * @since 4.0.0
3308
3764
  * @category Error handling
3765
+ * @since 4.0.0
3309
3766
  */
3310
3767
  <OutErr, K extends Types.Tags<OutErr>, RK extends Types.ReasonTags<Types.ExtractTag<Types.NoInfer<OutErr>, K>>, OutElem1, OutErr1, OutDone1, InElem1, InErr1, InDone1, Env1, OutElem2 = Types.unassigned, OutErr2 = never, OutDone2 = never, InElem2 = unknown, InErr2 = unknown, InDone2 = unknown, Env2 = never>(errorTag: K, reasonTag: RK, f: (reason: Types.ExtractReason<Types.ExtractTag<Types.NoInfer<OutErr>, K>, RK>, error: Types.NarrowReason<Types.ExtractTag<Types.NoInfer<OutErr>, K>, RK>) => Channel<OutElem1, OutErr1, OutDone1, InElem1, InErr1, InDone1, Env1>, orElse?: ((reason: Types.ExcludeReason<Types.ExtractTag<Types.NoInfer<OutErr>, K>, RK>, error: Types.OmitReason<Types.ExtractTag<Types.NoInfer<OutErr>, K>, RK>) => Channel<OutElem2, OutErr2, OutDone2, InElem2, InErr2, InDone2, Env2>) | undefined): <OutElem, OutDone, InElem, InErr, InDone, Env>(self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>) => Channel<OutElem | OutElem1 | Exclude<OutElem2, Types.unassigned>, (OutElem2 extends Types.unassigned ? OutErr : Types.ExcludeTag<OutErr, K>) | OutErr1 | OutErr2, OutDone | OutDone1 | OutDone2, InElem & InElem1 & InElem2, InErr & InErr1 & InErr2, InDone & InDone1 & InDone2, Env | Env1 | Env2>;
3311
3768
  /**
3312
3769
  * Catches a specific reason within a tagged error.
3313
3770
  *
3314
- * @example
3771
+ * **Example** (Recovering from nested reasons)
3772
+ *
3315
3773
  * ```ts
3316
3774
  * import { Channel, Data } from "effect"
3317
3775
  *
@@ -3338,23 +3796,23 @@ export declare const catchReason: {
3338
3796
  * )
3339
3797
  * ```
3340
3798
  *
3341
- * @since 4.0.0
3342
3799
  * @category Error handling
3800
+ * @since 4.0.0
3343
3801
  */
3344
3802
  <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env, K extends Types.Tags<OutErr>, RK extends Types.ReasonTags<Types.ExtractTag<Types.NoInfer<OutErr>, K>>, OutElem1, OutErr1, OutDone1, InElem1, InErr1, InDone1, Env1, OutElem2 = Types.unassigned, OutErr2 = never, OutDone2 = never, InElem2 = unknown, InErr2 = unknown, InDone2 = unknown, Env2 = never>(self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>, errorTag: K, reasonTag: RK, f: (reason: Types.ExtractReason<Types.ExtractTag<Types.NoInfer<OutErr>, K>, RK>, error: Types.NarrowReason<Types.ExtractTag<Types.NoInfer<OutErr>, K>, RK>) => Channel<OutElem1, OutErr1, OutDone1, InElem1, InErr1, InDone1, Env1>, orElse?: ((reason: Types.ExcludeReason<Types.ExtractTag<Types.NoInfer<OutErr>, K>, RK>, error: Types.OmitReason<Types.ExtractTag<Types.NoInfer<OutErr>, K>, RK>) => Channel<OutElem2, OutErr2, OutDone2, InElem2, InErr2, InDone2, Env2>) | undefined): Channel<OutElem | OutElem1 | Exclude<OutElem2, Types.unassigned>, (OutElem2 extends Types.unassigned ? OutErr : Types.ExcludeTag<OutErr, K>) | OutErr1 | OutErr2, OutDone | OutDone1 | OutDone2, InElem & InElem1 & InElem2, InErr & InErr1 & InErr2, InDone & InDone1 & InDone2, Env | Env1 | Env2>;
3345
3803
  };
3346
3804
  /**
3347
3805
  * Catches multiple reasons within a tagged error using an object of handlers.
3348
3806
  *
3349
- * @since 4.0.0
3350
3807
  * @category Error handling
3808
+ * @since 4.0.0
3351
3809
  */
3352
3810
  export declare const catchReasons: {
3353
3811
  /**
3354
3812
  * Catches multiple reasons within a tagged error using an object of handlers.
3355
3813
  *
3356
- * @since 4.0.0
3357
3814
  * @category Error handling
3815
+ * @since 4.0.0
3358
3816
  */
3359
3817
  <K extends Types.Tags<OutErr>, OutErr, Cases extends {
3360
3818
  [RK in Types.ReasonTags<Types.ExtractTag<Types.NoInfer<OutErr>, K>>]+?: (reason: Types.ExtractReason<Types.ExtractTag<Types.NoInfer<OutErr>, K>, RK>, error: Types.NarrowReason<Types.ExtractTag<Types.NoInfer<OutErr>, K>, RK>) => Channel<any, any, any, any, any, any, any>;
@@ -3376,8 +3834,8 @@ export declare const catchReasons: {
3376
3834
  /**
3377
3835
  * Catches multiple reasons within a tagged error using an object of handlers.
3378
3836
  *
3379
- * @since 4.0.0
3380
3837
  * @category Error handling
3838
+ * @since 4.0.0
3381
3839
  */
3382
3840
  <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env, K extends Types.Tags<OutErr>, Cases extends {
3383
3841
  [RK in Types.ReasonTags<Types.ExtractTag<OutErr, K>>]+?: (reason: Types.ExtractReason<Types.ExtractTag<OutErr, K>, RK>, error: Types.NarrowReason<Types.ExtractTag<OutErr, K>, RK>) => Channel<any, any, any, any, any, any, any>;
@@ -3400,7 +3858,8 @@ export declare const catchReasons: {
3400
3858
  /**
3401
3859
  * Promotes nested reason errors into the channel error, replacing the parent error.
3402
3860
  *
3403
- * @example
3861
+ * **Example** (Promoting nested reasons)
3862
+ *
3404
3863
  * ```ts
3405
3864
  * import { Channel, Data } from "effect"
3406
3865
  *
@@ -3423,14 +3882,15 @@ export declare const catchReasons: {
3423
3882
  * const unwrapped = channel.pipe(Channel.unwrapReason("AiError"))
3424
3883
  * ```
3425
3884
  *
3426
- * @since 4.0.0
3427
3885
  * @category Error handling
3886
+ * @since 4.0.0
3428
3887
  */
3429
3888
  export declare const unwrapReason: {
3430
3889
  /**
3431
3890
  * Promotes nested reason errors into the channel error, replacing the parent error.
3432
3891
  *
3433
- * @example
3892
+ * **Example** (Promoting nested reasons)
3893
+ *
3434
3894
  * ```ts
3435
3895
  * import { Channel, Data } from "effect"
3436
3896
  *
@@ -3453,14 +3913,15 @@ export declare const unwrapReason: {
3453
3913
  * const unwrapped = channel.pipe(Channel.unwrapReason("AiError"))
3454
3914
  * ```
3455
3915
  *
3456
- * @since 4.0.0
3457
3916
  * @category Error handling
3917
+ * @since 4.0.0
3458
3918
  */
3459
3919
  <K extends TagsWithReason<OutErr>, OutErr>(errorTag: K): <OutElem, OutDone, InElem, InErr, InDone, Env>(self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>) => Channel<OutElem, Types.ExcludeTag<OutErr, K> | Types.ReasonOf<Types.ExtractTag<OutErr, K>>, OutDone, InElem, InErr, InDone, Env>;
3460
3920
  /**
3461
3921
  * Promotes nested reason errors into the channel error, replacing the parent error.
3462
3922
  *
3463
- * @example
3923
+ * **Example** (Promoting nested reasons)
3924
+ *
3464
3925
  * ```ts
3465
3926
  * import { Channel, Data } from "effect"
3466
3927
  *
@@ -3483,8 +3944,8 @@ export declare const unwrapReason: {
3483
3944
  * const unwrapped = channel.pipe(Channel.unwrapReason("AiError"))
3484
3945
  * ```
3485
3946
  *
3486
- * @since 4.0.0
3487
3947
  * @category Error handling
3948
+ * @since 4.0.0
3488
3949
  */
3489
3950
  <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env, K extends TagsWithReason<OutErr>>(self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>, errorTag: K): Channel<OutElem, Types.ExcludeTag<OutErr, K> | Types.ReasonOf<Types.ExtractTag<OutErr, K>>, OutDone, InElem, InErr, InDone, Env>;
3490
3951
  };
@@ -3493,8 +3954,8 @@ export declare const unwrapReason: {
3493
3954
  * value of the returned channel is created by applying the specified function
3494
3955
  * to the failure value of this channel.
3495
3956
  *
3496
- * @since 2.0.0
3497
3957
  * @category Error handling
3958
+ * @since 2.0.0
3498
3959
  */
3499
3960
  export declare const mapError: {
3500
3961
  /**
@@ -3502,8 +3963,8 @@ export declare const mapError: {
3502
3963
  * value of the returned channel is created by applying the specified function
3503
3964
  * to the failure value of this channel.
3504
3965
  *
3505
- * @since 2.0.0
3506
3966
  * @category Error handling
3967
+ * @since 2.0.0
3507
3968
  */
3508
3969
  <OutErr, OutErr2>(f: (err: OutErr) => OutErr2): <OutElem, OutDone, InElem, InErr, InDone, Env>(self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>) => Channel<OutElem, OutErr2, OutDone, InElem, InErr, InDone, Env>;
3509
3970
  /**
@@ -3511,8 +3972,8 @@ export declare const mapError: {
3511
3972
  * value of the returned channel is created by applying the specified function
3512
3973
  * to the failure value of this channel.
3513
3974
  *
3514
- * @since 2.0.0
3515
3975
  * @category Error handling
3976
+ * @since 2.0.0
3516
3977
  */
3517
3978
  <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env, OutErr2>(self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>, f: (err: OutErr) => OutErr2): Channel<OutElem, OutErr2, OutDone, InElem, InErr, InDone, Env>;
3518
3979
  };
@@ -3520,7 +3981,8 @@ export declare const mapError: {
3520
3981
  * Converts all errors in the channel to defects (unrecoverable failures).
3521
3982
  * This is useful when you want to treat errors as programming errors.
3522
3983
  *
3523
- * @example
3984
+ * **Example** (Converting failures to defects)
3985
+ *
3524
3986
  * ```ts
3525
3987
  * import { Channel, Data } from "effect"
3526
3988
  *
@@ -3537,8 +3999,8 @@ export declare const mapError: {
3537
3999
  * // Any failure will now become a defect (uncaught exception)
3538
4000
  * ```
3539
4001
  *
3540
- * @since 4.0.0
3541
4002
  * @category Error handling
4003
+ * @since 4.0.0
3542
4004
  */
3543
4005
  export declare const orDie: <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>(self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>) => Channel<OutElem, never, OutDone, InElem, InErr, InDone, Env>;
3544
4006
  /**
@@ -3546,8 +4008,8 @@ export declare const orDie: <OutElem, OutErr, OutDone, InElem, InErr, InDone, En
3546
4008
  *
3547
4009
  * Use the `log` option to emit the full {@link Cause} when the channel fails.
3548
4010
  *
3549
- * @since 4.0.0
3550
4011
  * @category Error handling
4012
+ * @since 4.0.0
3551
4013
  */
3552
4014
  export declare const ignore: <Arg extends Channel<any, any, any, any, any, any, any> | {
3553
4015
  readonly log?: boolean | Severity | undefined;
@@ -3563,8 +4025,8 @@ export declare const ignore: <Arg extends Channel<any, any, any, any, any, any,
3563
4025
  *
3564
4026
  * Use the `log` option to emit the full {@link Cause} when the channel fails.
3565
4027
  *
3566
- * @since 4.0.0
3567
4028
  * @category Error handling
4029
+ * @since 4.0.0
3568
4030
  */
3569
4031
  export declare const ignoreCause: <Arg extends Channel<any, any, any, any, any, any, any> | {
3570
4032
  readonly log?: boolean | Severity | undefined;
@@ -3579,35 +4041,37 @@ export declare const ignoreCause: <Arg extends Channel<any, any, any, any, any,
3579
4041
  * Returns a new channel that retries this channel according to the specified
3580
4042
  * schedule whenever it fails.
3581
4043
  *
3582
- * @since 4.0.0
3583
4044
  * @category utils
4045
+ * @since 4.0.0
3584
4046
  */
3585
4047
  export declare const retry: {
3586
4048
  /**
3587
4049
  * Returns a new channel that retries this channel according to the specified
3588
4050
  * schedule whenever it fails.
3589
4051
  *
3590
- * @since 4.0.0
3591
4052
  * @category utils
4053
+ * @since 4.0.0
3592
4054
  */
3593
4055
  <SO, OutErr, SE, SR>(schedule: Schedule.Schedule<SO, Types.NoInfer<OutErr>, SE, SR> | (($: <SO, SE, SR>(_: Schedule.Schedule<SO, Types.NoInfer<OutErr>, SE, SR>) => Schedule.Schedule<SO, OutErr, SE, SR>) => Schedule.Schedule<SO, Types.NoInfer<OutErr>, SE, SR>)): <OutElem, OutDone, InElem, InErr, InDone, Env>(self: Channel<OutElem, OutErr | SE, OutDone, InElem, InErr, InDone, Env | SR>) => Channel<OutElem, OutErr | SE, OutDone, InElem, InErr, InDone, Env | SR>;
3594
4056
  /**
3595
4057
  * Returns a new channel that retries this channel according to the specified
3596
4058
  * schedule whenever it fails.
3597
4059
  *
3598
- * @since 4.0.0
3599
4060
  * @category utils
4061
+ * @since 4.0.0
3600
4062
  */
3601
4063
  <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env, SO, SE, SR>(self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>, schedule: Schedule.Schedule<SO, OutErr, SE, SR> | (($: <SO, SE, SR>(_: Schedule.Schedule<SO, Types.NoInfer<OutErr>, SE, SR>) => Schedule.Schedule<SO, OutErr, SE, SR>) => Schedule.Schedule<SO, Types.NoInfer<OutErr>, SE, SR>)): Channel<OutElem, OutErr | SE, OutDone, InElem, InErr, InDone, Env | SR>;
3602
4064
  };
3603
4065
  /**
3604
- * Returns a new channel, which sequentially combines this channel, together
3605
- * with the provided factory function, which creates a second channel based on
3606
- * the output values of this channel. The result is a channel that will first
3607
- * perform the functions of this channel, before performing the functions of
3608
- * the created channel (including yielding its terminal value).
4066
+ * Maps each output element to a channel and emits values from the most recent
4067
+ * active child channels.
4068
+ *
4069
+ * With the default concurrency of `1`, starting a new child channel interrupts
4070
+ * the previous child channel. Use `options.concurrency` to allow more active
4071
+ * child channels. The source channel's done value is preserved.
4072
+ *
4073
+ * **Example** (Switching mapped channels)
3609
4074
  *
3610
- * @example
3611
4075
  * ```ts
3612
4076
  * import { Channel, Data } from "effect"
3613
4077
  *
@@ -3627,18 +4091,20 @@ export declare const retry: {
3627
4091
  * // Outputs: "value-1", "value-2", "value-3"
3628
4092
  * ```
3629
4093
  *
3630
- * @since 2.0.0
3631
4094
  * @category sequencing
4095
+ * @since 2.0.0
3632
4096
  */
3633
4097
  export declare const switchMap: {
3634
4098
  /**
3635
- * Returns a new channel, which sequentially combines this channel, together
3636
- * with the provided factory function, which creates a second channel based on
3637
- * the output values of this channel. The result is a channel that will first
3638
- * perform the functions of this channel, before performing the functions of
3639
- * the created channel (including yielding its terminal value).
4099
+ * Maps each output element to a channel and emits values from the most recent
4100
+ * active child channels.
4101
+ *
4102
+ * With the default concurrency of `1`, starting a new child channel interrupts
4103
+ * the previous child channel. Use `options.concurrency` to allow more active
4104
+ * child channels. The source channel's done value is preserved.
4105
+ *
4106
+ * **Example** (Switching mapped channels)
3640
4107
  *
3641
- * @example
3642
4108
  * ```ts
3643
4109
  * import { Channel, Data } from "effect"
3644
4110
  *
@@ -3658,21 +4124,23 @@ export declare const switchMap: {
3658
4124
  * // Outputs: "value-1", "value-2", "value-3"
3659
4125
  * ```
3660
4126
  *
3661
- * @since 2.0.0
3662
4127
  * @category sequencing
4128
+ * @since 2.0.0
3663
4129
  */
3664
4130
  <OutElem, OutElem1, OutErr1, OutDone1, InElem1, InErr1, InDone1, Env1>(f: (d: OutElem) => Channel<OutElem1, OutErr1, OutDone1, InElem1, InErr1, InDone1, Env1>, options?: {
3665
4131
  readonly concurrency?: number | "unbounded" | undefined;
3666
4132
  readonly bufferSize?: number | undefined;
3667
4133
  }): <OutErr, OutDone, InElem, InErr, InDone, Env>(self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>) => Channel<OutElem1, OutErr1 | OutErr, OutDone, InElem & InElem1, InErr & InErr1, InDone & InDone1, Env1 | Env>;
3668
4134
  /**
3669
- * Returns a new channel, which sequentially combines this channel, together
3670
- * with the provided factory function, which creates a second channel based on
3671
- * the output values of this channel. The result is a channel that will first
3672
- * perform the functions of this channel, before performing the functions of
3673
- * the created channel (including yielding its terminal value).
4135
+ * Maps each output element to a channel and emits values from the most recent
4136
+ * active child channels.
4137
+ *
4138
+ * With the default concurrency of `1`, starting a new child channel interrupts
4139
+ * the previous child channel. Use `options.concurrency` to allow more active
4140
+ * child channels. The source channel's done value is preserved.
4141
+ *
4142
+ * **Example** (Switching mapped channels)
3674
4143
  *
3675
- * @example
3676
4144
  * ```ts
3677
4145
  * import { Channel, Data } from "effect"
3678
4146
  *
@@ -3692,8 +4160,8 @@ export declare const switchMap: {
3692
4160
  * // Outputs: "value-1", "value-2", "value-3"
3693
4161
  * ```
3694
4162
  *
3695
- * @since 2.0.0
3696
4163
  * @category sequencing
4164
+ * @since 2.0.0
3697
4165
  */
3698
4166
  <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env, OutElem1, OutErr1, OutDone1, InElem1, InErr1, InDone1, Env1>(self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>, f: (d: OutElem) => Channel<OutElem1, OutErr1, OutDone1, InElem1, InErr1, InDone1, Env1>, options?: {
3699
4167
  readonly concurrency?: number | "unbounded" | undefined;
@@ -3703,7 +4171,8 @@ export declare const switchMap: {
3703
4171
  /**
3704
4172
  * Merges multiple channels with specified concurrency and buffering options.
3705
4173
  *
3706
- * @example
4174
+ * **Example** (Merging nested channels)
4175
+ *
3707
4176
  * ```ts
3708
4177
  * import { Channel, Data } from "effect"
3709
4178
  *
@@ -3727,14 +4196,15 @@ export declare const switchMap: {
3727
4196
  * // Outputs: 1, 2, 3, 4, 5, 6 (order may vary due to concurrency)
3728
4197
  * ```
3729
4198
  *
3730
- * @since 2.0.0
3731
4199
  * @category utils
4200
+ * @since 2.0.0
3732
4201
  */
3733
4202
  export declare const mergeAll: {
3734
4203
  /**
3735
4204
  * Merges multiple channels with specified concurrency and buffering options.
3736
4205
  *
3737
- * @example
4206
+ * **Example** (Merging nested channels)
4207
+ *
3738
4208
  * ```ts
3739
4209
  * import { Channel, Data } from "effect"
3740
4210
  *
@@ -3758,8 +4228,8 @@ export declare const mergeAll: {
3758
4228
  * // Outputs: 1, 2, 3, 4, 5, 6 (order may vary due to concurrency)
3759
4229
  * ```
3760
4230
  *
3761
- * @since 2.0.0
3762
4231
  * @category utils
4232
+ * @since 2.0.0
3763
4233
  */
3764
4234
  (options: {
3765
4235
  readonly concurrency: number | "unbounded";
@@ -3769,7 +4239,8 @@ export declare const mergeAll: {
3769
4239
  /**
3770
4240
  * Merges multiple channels with specified concurrency and buffering options.
3771
4241
  *
3772
- * @example
4242
+ * **Example** (Merging nested channels)
4243
+ *
3773
4244
  * ```ts
3774
4245
  * import { Channel, Data } from "effect"
3775
4246
  *
@@ -3793,8 +4264,8 @@ export declare const mergeAll: {
3793
4264
  * // Outputs: 1, 2, 3, 4, 5, 6 (order may vary due to concurrency)
3794
4265
  * ```
3795
4266
  *
3796
- * @since 2.0.0
3797
4267
  * @category utils
4268
+ * @since 2.0.0
3798
4269
  */
3799
4270
  <OutElem, OutErr1, OutDone1, InElem1, InErr1, InDone1, Env1, OutErr, OutDone, InElem, InErr, InDone, Env>(channels: Channel<Channel<OutElem, OutErr1, OutDone1, InElem1, InErr1, InDone1, Env1>, OutErr, OutDone, InElem, InErr, InDone, Env>, options: {
3800
4271
  readonly concurrency: number | "unbounded";
@@ -3805,7 +4276,8 @@ export declare const mergeAll: {
3805
4276
  /**
3806
4277
  * Represents strategies for halting merged channels when one completes or fails.
3807
4278
  *
3808
- * @example
4279
+ * **Example** (Choosing merge halt strategies)
4280
+ *
3809
4281
  * ```ts
3810
4282
  * import type { Channel } from "effect"
3811
4283
  *
@@ -3816,15 +4288,16 @@ export declare const mergeAll: {
3816
4288
  * const either: Channel.HaltStrategy = "either" // Stop when either channel halts
3817
4289
  * ```
3818
4290
  *
3819
- * @since 2.0.0
3820
4291
  * @category models
4292
+ * @since 2.0.0
3821
4293
  */
3822
4294
  export type HaltStrategy = "left" | "right" | "both" | "either";
3823
4295
  /**
3824
4296
  * Returns a new channel, which is the merge of this channel and the specified
3825
4297
  * channel.
3826
4298
  *
3827
- * @example
4299
+ * **Example** (Merging channels)
4300
+ *
3828
4301
  * ```ts
3829
4302
  * import { Channel, Data } from "effect"
3830
4303
  *
@@ -3845,15 +4318,16 @@ export type HaltStrategy = "left" | "right" | "both" | "either";
3845
4318
  * // Order may vary: 1, "a", 2, "b", 3, "c"
3846
4319
  * ```
3847
4320
  *
3848
- * @since 2.0.0
3849
4321
  * @category utils
4322
+ * @since 2.0.0
3850
4323
  */
3851
4324
  export declare const merge: {
3852
4325
  /**
3853
4326
  * Returns a new channel, which is the merge of this channel and the specified
3854
4327
  * channel.
3855
4328
  *
3856
- * @example
4329
+ * **Example** (Merging channels)
4330
+ *
3857
4331
  * ```ts
3858
4332
  * import { Channel, Data } from "effect"
3859
4333
  *
@@ -3874,8 +4348,8 @@ export declare const merge: {
3874
4348
  * // Order may vary: 1, "a", 2, "b", 3, "c"
3875
4349
  * ```
3876
4350
  *
3877
- * @since 2.0.0
3878
4351
  * @category utils
4352
+ * @since 2.0.0
3879
4353
  */
3880
4354
  <OutElem1, OutErr1, OutDone1, InElem1, InErr1, InDone1, Env1>(right: Channel<OutElem1, OutErr1, OutDone1, InElem1, InErr1, InDone1, Env1>, options?: {
3881
4355
  readonly haltStrategy?: HaltStrategy | undefined;
@@ -3884,7 +4358,8 @@ export declare const merge: {
3884
4358
  * Returns a new channel, which is the merge of this channel and the specified
3885
4359
  * channel.
3886
4360
  *
3887
- * @example
4361
+ * **Example** (Merging channels)
4362
+ *
3888
4363
  * ```ts
3889
4364
  * import { Channel, Data } from "effect"
3890
4365
  *
@@ -3905,26 +4380,44 @@ export declare const merge: {
3905
4380
  * // Order may vary: 1, "a", 2, "b", 3, "c"
3906
4381
  * ```
3907
4382
  *
3908
- * @since 2.0.0
3909
4383
  * @category utils
4384
+ * @since 2.0.0
3910
4385
  */
3911
4386
  <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env, OutElem1, OutErr1, OutDone1, InElem1, InErr1, InDone1, Env1>(left: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>, right: Channel<OutElem1, OutErr1, OutDone1, InElem1, InErr1, InDone1, Env1>, options?: {
3912
4387
  readonly haltStrategy?: HaltStrategy | undefined;
3913
4388
  } | undefined): Channel<OutElem | OutElem1, OutErr | OutErr1, OutDone | OutDone1, InElem & InElem1, InErr & InErr1, InDone & InDone1, Env | Env1>;
3914
4389
  };
3915
4390
  /**
3916
- * @since 4.0.0
4391
+ * Runs an effect concurrently with a channel while emitting only the channel's
4392
+ * output elements.
4393
+ *
4394
+ * The effect's successful value is ignored. If the effect fails while the
4395
+ * channel is running, the returned channel fails with that error.
4396
+ *
3917
4397
  * @category utils
4398
+ * @since 4.0.0
3918
4399
  */
3919
4400
  export declare const mergeEffect: {
3920
4401
  /**
3921
- * @since 4.0.0
4402
+ * Runs an effect concurrently with a channel while emitting only the channel's
4403
+ * output elements.
4404
+ *
4405
+ * The effect's successful value is ignored. If the effect fails while the
4406
+ * channel is running, the returned channel fails with that error.
4407
+ *
3922
4408
  * @category utils
4409
+ * @since 4.0.0
3923
4410
  */
3924
4411
  <X, E, R>(effect: Effect.Effect<X, E, R>): <OutElem, OutDone, OutErr, InElem, InErr, InDone, Env>(self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>) => Channel<OutElem, OutErr | E, OutDone, InElem, InErr, InDone, Env | R>;
3925
4412
  /**
3926
- * @since 4.0.0
4413
+ * Runs an effect concurrently with a channel while emitting only the channel's
4414
+ * output elements.
4415
+ *
4416
+ * The effect's successful value is ignored. If the effect fails while the
4417
+ * channel is running, the returned channel fails with that error.
4418
+ *
3927
4419
  * @category utils
4420
+ * @since 4.0.0
3928
4421
  */
3929
4422
  <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env, X, E, R>(self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>, effect: Effect.Effect<X, E, R>): Channel<OutElem, OutErr | E, OutDone, InElem, InErr, InDone, Env | R>;
3930
4423
  };
@@ -3938,7 +4431,7 @@ export declare const mergeEffect: {
3938
4431
  * if the stream ends without a terminator the final partial line is still
3939
4432
  * emitted.
3940
4433
  *
3941
- * **Example**
4434
+ * **Example** (Splitting string chunks into lines)
3942
4435
  *
3943
4436
  * ```ts
3944
4437
  * import { Effect, Stream } from "effect"
@@ -3952,18 +4445,27 @@ export declare const mergeEffect: {
3952
4445
  * }))
3953
4446
  * ```
3954
4447
  *
3955
- * @since 2.0.0
3956
4448
  * @category String manipulation
4449
+ * @since 2.0.0
3957
4450
  */
3958
4451
  export declare const splitLines: <Err, Done>() => Channel<Arr.NonEmptyReadonlyArray<string>, Err, Done, Arr.NonEmptyReadonlyArray<string>, Err, Done>;
3959
4452
  /**
3960
- * @since 4.0.0
4453
+ * Decodes incoming `Uint8Array` chunks into strings using `TextDecoder`.
4454
+ *
4455
+ * Each `Uint8Array` inside an emitted array is decoded independently. The
4456
+ * optional `encoding` and `options` are passed to `TextDecoder`.
4457
+ *
3961
4458
  * @category String manipulation
4459
+ * @since 4.0.0
3962
4460
  */
3963
4461
  export declare const decodeText: <Err, Done>(encoding?: string, options?: TextDecoderOptions) => Channel<Arr.NonEmptyReadonlyArray<string>, Err, Done, Arr.NonEmptyReadonlyArray<Uint8Array>, Err, Done>;
3964
4462
  /**
3965
- * @since 4.0.0
4463
+ * Encodes incoming string chunks into `Uint8Array` values using `TextEncoder`.
4464
+ *
4465
+ * Each string inside an emitted array is encoded independently.
4466
+ *
3966
4467
  * @category String manipulation
4468
+ * @since 4.0.0
3967
4469
  */
3968
4470
  export declare const encodeText: <Err, Done>() => Channel<Arr.NonEmptyReadonlyArray<Uint8Array>, Err, Done, Arr.NonEmptyReadonlyArray<string>, Err, Done>;
3969
4471
  /**
@@ -3972,7 +4474,8 @@ export declare const encodeText: <Err, Done>() => Channel<Arr.NonEmptyReadonlyAr
3972
4474
  * and the output type of the specified channel, terminating with the value of
3973
4475
  * the specified channel.
3974
4476
  *
3975
- * @example
4477
+ * **Example** (Piping one channel into another)
4478
+ *
3976
4479
  * ```ts
3977
4480
  * import { Channel, Data } from "effect"
3978
4481
  *
@@ -3990,8 +4493,8 @@ export declare const encodeText: <Err, Done>() => Channel<Arr.NonEmptyReadonlyAr
3990
4493
  * // Outputs: 2, 4, 6
3991
4494
  * ```
3992
4495
  *
3993
- * @since 2.0.0
3994
4496
  * @category utils
4497
+ * @since 2.0.0
3995
4498
  */
3996
4499
  export declare const pipeTo: {
3997
4500
  /**
@@ -4000,7 +4503,8 @@ export declare const pipeTo: {
4000
4503
  * and the output type of the specified channel, terminating with the value of
4001
4504
  * the specified channel.
4002
4505
  *
4003
- * @example
4506
+ * **Example** (Piping one channel into another)
4507
+ *
4004
4508
  * ```ts
4005
4509
  * import { Channel, Data } from "effect"
4006
4510
  *
@@ -4018,8 +4522,8 @@ export declare const pipeTo: {
4018
4522
  * // Outputs: 2, 4, 6
4019
4523
  * ```
4020
4524
  *
4021
- * @since 2.0.0
4022
4525
  * @category utils
4526
+ * @since 2.0.0
4023
4527
  */
4024
4528
  <OutElem2, OutErr2, OutDone2, OutElem, OutErr, OutDone, Env2>(that: Channel<OutElem2, OutErr2, OutDone2, OutElem, OutErr, OutDone, Env2>): <InElem, InErr, InDone, Env>(self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>) => Channel<OutElem2, OutErr2, OutDone2, InElem, InErr, InDone, Env2 | Env>;
4025
4529
  /**
@@ -4028,7 +4532,8 @@ export declare const pipeTo: {
4028
4532
  * and the output type of the specified channel, terminating with the value of
4029
4533
  * the specified channel.
4030
4534
  *
4031
- * @example
4535
+ * **Example** (Piping one channel into another)
4536
+ *
4032
4537
  * ```ts
4033
4538
  * import { Channel, Data } from "effect"
4034
4539
  *
@@ -4046,8 +4551,8 @@ export declare const pipeTo: {
4046
4551
  * // Outputs: 2, 4, 6
4047
4552
  * ```
4048
4553
  *
4049
- * @since 2.0.0
4050
4554
  * @category utils
4555
+ * @since 2.0.0
4051
4556
  */
4052
4557
  <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env, OutElem2, OutErr2, OutDone2, Env2>(self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>, that: Channel<OutElem2, OutErr2, OutDone2, OutElem, OutErr, OutDone, Env2>): Channel<OutElem2, OutErr2, OutDone2, InElem, InErr, InDone, Env2 | Env>;
4053
4558
  };
@@ -4056,7 +4561,8 @@ export declare const pipeTo: {
4056
4561
  * specified channel and preserves this channel's failures without providing
4057
4562
  * them to the other channel for observation.
4058
4563
  *
4059
- * @example
4564
+ * **Example** (Piping while preserving failures)
4565
+ *
4060
4566
  * ```ts
4061
4567
  * import { Channel, Data } from "effect"
4062
4568
  *
@@ -4074,8 +4580,8 @@ export declare const pipeTo: {
4074
4580
  * // Source errors are preserved and not sent to transform channel
4075
4581
  * ```
4076
4582
  *
4077
- * @since 2.0.0
4078
4583
  * @category utils
4584
+ * @since 2.0.0
4079
4585
  */
4080
4586
  export declare const pipeToOrFail: {
4081
4587
  /**
@@ -4083,7 +4589,8 @@ export declare const pipeToOrFail: {
4083
4589
  * specified channel and preserves this channel's failures without providing
4084
4590
  * them to the other channel for observation.
4085
4591
  *
4086
- * @example
4592
+ * **Example** (Piping while preserving failures)
4593
+ *
4087
4594
  * ```ts
4088
4595
  * import { Channel, Data } from "effect"
4089
4596
  *
@@ -4101,8 +4608,8 @@ export declare const pipeToOrFail: {
4101
4608
  * // Source errors are preserved and not sent to transform channel
4102
4609
  * ```
4103
4610
  *
4104
- * @since 2.0.0
4105
4611
  * @category utils
4612
+ * @since 2.0.0
4106
4613
  */
4107
4614
  <OutElem2, OutErr2, OutDone2, OutElem, OutDone, Env2>(that: Channel<OutElem2, OutErr2, OutDone2, OutElem, never, OutDone, Env2>): <OutErr, InElem, InErr, InDone, Env>(self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>) => Channel<OutElem2, OutErr | OutErr2, OutDone2, InElem, InErr, InDone, Env2 | Env>;
4108
4615
  /**
@@ -4110,7 +4617,8 @@ export declare const pipeToOrFail: {
4110
4617
  * specified channel and preserves this channel's failures without providing
4111
4618
  * them to the other channel for observation.
4112
4619
  *
4113
- * @example
4620
+ * **Example** (Piping while preserving failures)
4621
+ *
4114
4622
  * ```ts
4115
4623
  * import { Channel, Data } from "effect"
4116
4624
  *
@@ -4128,8 +4636,8 @@ export declare const pipeToOrFail: {
4128
4636
  * // Source errors are preserved and not sent to transform channel
4129
4637
  * ```
4130
4638
  *
4131
- * @since 2.0.0
4132
4639
  * @category utils
4640
+ * @since 2.0.0
4133
4641
  */
4134
4642
  <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env, OutElem2, OutErr2, OutDone2, Env2>(self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>, that: Channel<OutElem2, OutErr2, OutDone2, OutElem, never, OutDone, Env2>): Channel<OutElem2, OutErr | OutErr2, OutDone2, InElem, InErr, InDone, Env2 | Env>;
4135
4643
  };
@@ -4137,7 +4645,8 @@ export declare const pipeToOrFail: {
4137
4645
  * Constructs a `Channel` from a scoped effect that will result in a
4138
4646
  * `Channel` if successful.
4139
4647
  *
4140
- * @example
4648
+ * **Example** (Unwrapping channel effects)
4649
+ *
4141
4650
  * ```ts
4142
4651
  * import { Channel, Data, Effect } from "effect"
4143
4652
  *
@@ -4156,88 +4665,115 @@ export declare const pipeToOrFail: {
4156
4665
  * // The resulting channel outputs: 1, 2, 3
4157
4666
  * ```
4158
4667
  *
4159
- * @since 2.0.0
4160
4668
  * @category constructors
4669
+ * @since 2.0.0
4161
4670
  */
4162
4671
  export declare const unwrap: <OutElem, OutErr, OutDone, InElem, InErr, InDone, R2, E, R>(channel: Effect.Effect<Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, R2>, E, R>) => Channel<OutElem, E | OutErr, OutDone, InElem, InErr, InDone, Exclude<R, Scope.Scope> | R2>;
4163
4672
  /**
4164
- * @since 2.0.0
4673
+ * Runs a channel with a scope provided for the duration of the channel
4674
+ * execution, removing the channel's `Scope` requirement.
4675
+ *
4165
4676
  * @category utils
4677
+ * @since 2.0.0
4166
4678
  */
4167
4679
  export declare const scoped: <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>(self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>) => Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Exclude<Env, Scope.Scope>>;
4168
4680
  /**
4169
- * Returns a new channel which embeds the given input handler into a Channel.
4681
+ * Runs an input handler against the upstream pull while the wrapped channel
4682
+ * runs without receiving upstream input directly.
4170
4683
  *
4171
- * @example
4172
- * ```ts
4173
- * import { Channel, Data, Effect } from "effect"
4684
+ * The input handler is forked in the channel scope. The wrapped channel is run
4685
+ * with an already-completed input.
4174
4686
  *
4175
- * class EmbedError extends Data.TaggedError("EmbedError")<{
4176
- * readonly stage: string
4177
- * }> {}
4687
+ * **Example** (Embedding custom input handling)
4688
+ *
4689
+ * ```ts
4690
+ * import { Channel, Effect } from "effect"
4178
4691
  *
4179
4692
  * // Create a base channel
4180
4693
  * const baseChannel = Channel.fromIterable([1, 2, 3])
4181
4694
  *
4182
- * // Embed input handling - simplified example
4695
+ * // Drain the embedded input while the base channel runs
4183
4696
  * const embeddedChannel = Channel.embedInput(
4184
4697
  * baseChannel,
4185
- * (_upstream) => Effect.void
4698
+ * (upstream) =>
4699
+ * upstream.pipe(
4700
+ * Effect.tap((message) =>
4701
+ * Effect.sync(() => console.log(message))
4702
+ * ),
4703
+ * Effect.forever,
4704
+ * Effect.ignore
4705
+ * )
4186
4706
  * )
4187
4707
  * ```
4188
4708
  *
4189
- * @since 2.0.0
4190
4709
  * @category utils
4710
+ * @since 2.0.0
4191
4711
  */
4192
4712
  export declare const embedInput: {
4193
4713
  /**
4194
- * Returns a new channel which embeds the given input handler into a Channel.
4714
+ * Runs an input handler against the upstream pull while the wrapped channel
4715
+ * runs without receiving upstream input directly.
4195
4716
  *
4196
- * @example
4197
- * ```ts
4198
- * import { Channel, Data, Effect } from "effect"
4717
+ * The input handler is forked in the channel scope. The wrapped channel is run
4718
+ * with an already-completed input.
4199
4719
  *
4200
- * class EmbedError extends Data.TaggedError("EmbedError")<{
4201
- * readonly stage: string
4202
- * }> {}
4720
+ * **Example** (Embedding custom input handling)
4721
+ *
4722
+ * ```ts
4723
+ * import { Channel, Effect } from "effect"
4203
4724
  *
4204
4725
  * // Create a base channel
4205
4726
  * const baseChannel = Channel.fromIterable([1, 2, 3])
4206
4727
  *
4207
- * // Embed input handling - simplified example
4728
+ * // Drain the embedded input while the base channel runs
4208
4729
  * const embeddedChannel = Channel.embedInput(
4209
4730
  * baseChannel,
4210
- * (_upstream) => Effect.void
4731
+ * (upstream) =>
4732
+ * upstream.pipe(
4733
+ * Effect.tap((message) =>
4734
+ * Effect.sync(() => console.log(message))
4735
+ * ),
4736
+ * Effect.forever,
4737
+ * Effect.ignore
4738
+ * )
4211
4739
  * )
4212
4740
  * ```
4213
4741
  *
4214
- * @since 2.0.0
4215
4742
  * @category utils
4743
+ * @since 2.0.0
4216
4744
  */
4217
4745
  <InElem, InErr, InDone, R>(input: (upstream: Pull.Pull<InElem, InErr, InDone>) => Effect.Effect<void, never, R>): <OutElem, OutErr, OutDone, Env>(self: Channel<OutElem, OutErr, OutDone, unknown, unknown, unknown, Env>) => Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env | R>;
4218
4746
  /**
4219
- * Returns a new channel which embeds the given input handler into a Channel.
4747
+ * Runs an input handler against the upstream pull while the wrapped channel
4748
+ * runs without receiving upstream input directly.
4220
4749
  *
4221
- * @example
4222
- * ```ts
4223
- * import { Channel, Data, Effect } from "effect"
4750
+ * The input handler is forked in the channel scope. The wrapped channel is run
4751
+ * with an already-completed input.
4224
4752
  *
4225
- * class EmbedError extends Data.TaggedError("EmbedError")<{
4226
- * readonly stage: string
4227
- * }> {}
4753
+ * **Example** (Embedding custom input handling)
4754
+ *
4755
+ * ```ts
4756
+ * import { Channel, Effect } from "effect"
4228
4757
  *
4229
4758
  * // Create a base channel
4230
4759
  * const baseChannel = Channel.fromIterable([1, 2, 3])
4231
4760
  *
4232
- * // Embed input handling - simplified example
4761
+ * // Drain the embedded input while the base channel runs
4233
4762
  * const embeddedChannel = Channel.embedInput(
4234
4763
  * baseChannel,
4235
- * (_upstream) => Effect.void
4764
+ * (upstream) =>
4765
+ * upstream.pipe(
4766
+ * Effect.tap((message) =>
4767
+ * Effect.sync(() => console.log(message))
4768
+ * ),
4769
+ * Effect.forever,
4770
+ * Effect.ignore
4771
+ * )
4236
4772
  * )
4237
4773
  * ```
4238
4774
  *
4239
- * @since 2.0.0
4240
4775
  * @category utils
4776
+ * @since 2.0.0
4241
4777
  */
4242
4778
  <OutElem, OutErr, OutDone, Env, InErr, InElem, InDone, R>(self: Channel<OutElem, OutErr, OutDone, unknown, unknown, unknown, Env>, input: (upstream: Pull.Pull<InElem, InErr, InDone>) => Effect.Effect<void, never, R>): Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env | R>;
4243
4779
  };
@@ -4245,16 +4781,16 @@ export declare const embedInput: {
4245
4781
  * Allows a faster producer to progress independently of a slower consumer by
4246
4782
  * buffering up to `capacity` elements in a queue.
4247
4783
  *
4248
- * @since 2.0.0
4249
4784
  * @category Buffering
4785
+ * @since 2.0.0
4250
4786
  */
4251
4787
  export declare const buffer: {
4252
4788
  /**
4253
4789
  * Allows a faster producer to progress independently of a slower consumer by
4254
4790
  * buffering up to `capacity` elements in a queue.
4255
4791
  *
4256
- * @since 2.0.0
4257
4792
  * @category Buffering
4793
+ * @since 2.0.0
4258
4794
  */
4259
4795
  (options: {
4260
4796
  readonly capacity: "unbounded";
@@ -4266,8 +4802,8 @@ export declare const buffer: {
4266
4802
  * Allows a faster producer to progress independently of a slower consumer by
4267
4803
  * buffering up to `capacity` elements in a queue.
4268
4804
  *
4269
- * @since 2.0.0
4270
4805
  * @category Buffering
4806
+ * @since 2.0.0
4271
4807
  */
4272
4808
  <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>(self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>, options: {
4273
4809
  readonly capacity: "unbounded";
@@ -4280,16 +4816,16 @@ export declare const buffer: {
4280
4816
  * Allows a faster producer to progress independently of a slower consumer by
4281
4817
  * buffering up to `capacity` elements in a queue.
4282
4818
  *
4283
- * @since 2.0.0
4284
4819
  * @category Buffering
4820
+ * @since 2.0.0
4285
4821
  */
4286
4822
  export declare const bufferArray: {
4287
4823
  /**
4288
4824
  * Allows a faster producer to progress independently of a slower consumer by
4289
4825
  * buffering up to `capacity` elements in a queue.
4290
4826
  *
4291
- * @since 2.0.0
4292
4827
  * @category Buffering
4828
+ * @since 2.0.0
4293
4829
  */
4294
4830
  (options: {
4295
4831
  readonly capacity: "unbounded";
@@ -4301,8 +4837,8 @@ export declare const bufferArray: {
4301
4837
  * Allows a faster producer to progress independently of a slower consumer by
4302
4838
  * buffering up to `capacity` elements in a queue.
4303
4839
  *
4304
- * @since 2.0.0
4305
4840
  * @category Buffering
4841
+ * @since 2.0.0
4306
4842
  */
4307
4843
  <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>(self: Channel<Arr.NonEmptyReadonlyArray<OutElem>, OutErr, OutDone, InElem, InErr, InDone, Env>, options: {
4308
4844
  readonly capacity: "unbounded";
@@ -4320,8 +4856,8 @@ export declare const bufferArray: {
4320
4856
  * returned channel will yield the success value of the underlying channel as
4321
4857
  * its terminal value.
4322
4858
  *
4323
- * @since 2.0.0
4324
4859
  * @category utils
4860
+ * @since 2.0.0
4325
4861
  */
4326
4862
  export declare const interruptWhen: {
4327
4863
  /**
@@ -4333,8 +4869,8 @@ export declare const interruptWhen: {
4333
4869
  * returned channel will yield the success value of the underlying channel as
4334
4870
  * its terminal value.
4335
4871
  *
4336
- * @since 2.0.0
4337
4872
  * @category utils
4873
+ * @since 2.0.0
4338
4874
  */
4339
4875
  <OutDone2, OutErr2, Env2>(effect: Effect.Effect<OutDone2, OutErr2, Env2>): <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>(self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>) => Channel<OutElem, OutErr | OutErr2, OutDone | OutDone2, InElem, InErr, InDone, Env2 | Env>;
4340
4876
  /**
@@ -4346,40 +4882,76 @@ export declare const interruptWhen: {
4346
4882
  * returned channel will yield the success value of the underlying channel as
4347
4883
  * its terminal value.
4348
4884
  *
4349
- * @since 2.0.0
4350
4885
  * @category utils
4886
+ * @since 2.0.0
4351
4887
  */
4352
4888
  <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env, OutDone2, OutErr2, Env2>(self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>, effect: Effect.Effect<OutDone2, OutErr2, Env2>): Channel<OutElem, OutErr | OutErr2, OutDone | OutDone2, InElem, InErr, InDone, Env2 | Env>;
4353
4889
  };
4354
4890
  /**
4355
- * @since 4.0.0
4891
+ * Halts a channel when the specified effect completes or fails.
4892
+ *
4893
+ * If the effect completes before the channel is done, its success value becomes
4894
+ * the returned channel's done value. If the effect fails, the returned channel
4895
+ * fails with that error. If the channel completes first, the channel's done
4896
+ * value is preserved.
4897
+ *
4356
4898
  * @category utils
4899
+ * @since 4.0.0
4357
4900
  */
4358
4901
  export declare const haltWhen: {
4359
4902
  /**
4360
- * @since 4.0.0
4903
+ * Halts a channel when the specified effect completes or fails.
4904
+ *
4905
+ * If the effect completes before the channel is done, its success value becomes
4906
+ * the returned channel's done value. If the effect fails, the returned channel
4907
+ * fails with that error. If the channel completes first, the channel's done
4908
+ * value is preserved.
4909
+ *
4361
4910
  * @category utils
4911
+ * @since 4.0.0
4362
4912
  */
4363
4913
  <OutDone2, OutErr2, Env2>(effect: Effect.Effect<OutDone2, OutErr2, Env2>): <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>(self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>) => Channel<OutElem, OutErr | OutErr2, OutDone | OutDone2, InElem, InErr, InDone, Env2 | Env>;
4364
4914
  /**
4365
- * @since 4.0.0
4915
+ * Halts a channel when the specified effect completes or fails.
4916
+ *
4917
+ * If the effect completes before the channel is done, its success value becomes
4918
+ * the returned channel's done value. If the effect fails, the returned channel
4919
+ * fails with that error. If the channel completes first, the channel's done
4920
+ * value is preserved.
4921
+ *
4366
4922
  * @category utils
4923
+ * @since 4.0.0
4367
4924
  */
4368
4925
  <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env, OutDone2, OutErr2, Env2>(self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>, effect: Effect.Effect<OutDone2, OutErr2, Env2>): Channel<OutElem, OutErr | OutErr2, OutDone | OutDone2, InElem, InErr, InDone, Env2 | Env>;
4369
4926
  };
4370
4927
  /**
4371
- * @since 4.0.0
4928
+ * Attaches a finalizer that runs only when the channel exits with failure.
4929
+ *
4930
+ * The finalizer receives the failure `Cause`. The original channel failure is
4931
+ * preserved. The finalizer itself must not fail.
4932
+ *
4372
4933
  * @category utils
4934
+ * @since 4.0.0
4373
4935
  */
4374
4936
  export declare const onError: {
4375
4937
  /**
4376
- * @since 4.0.0
4938
+ * Attaches a finalizer that runs only when the channel exits with failure.
4939
+ *
4940
+ * The finalizer receives the failure `Cause`. The original channel failure is
4941
+ * preserved. The finalizer itself must not fail.
4942
+ *
4377
4943
  * @category utils
4944
+ * @since 4.0.0
4378
4945
  */
4379
4946
  <OutDone, OutErr, Env2>(finalizer: (cause: Cause.Cause<OutErr>) => Effect.Effect<unknown, never, Env2>): <OutElem, InElem, InErr, InDone, Env>(self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>) => Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env2 | Env>;
4380
4947
  /**
4381
- * @since 4.0.0
4948
+ * Attaches a finalizer that runs only when the channel exits with failure.
4949
+ *
4950
+ * The finalizer receives the failure `Cause`. The original channel failure is
4951
+ * preserved. The finalizer itself must not fail.
4952
+ *
4382
4953
  * @category utils
4954
+ * @since 4.0.0
4383
4955
  */
4384
4956
  <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env, Env2>(self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>, finalizer: (cause: Cause.Cause<OutErr>) => Effect.Effect<unknown, never, Env2>): Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env2 | Env>;
4385
4957
  };
@@ -4388,7 +4960,8 @@ export declare const onError: {
4388
4960
  * guaranteed to be executed so long as the channel begins execution (and
4389
4961
  * regardless of whether or not it completes).
4390
4962
  *
4391
- * @example
4963
+ * **Example** (Running exit finalizers)
4964
+ *
4392
4965
  * ```ts
4393
4966
  * import { Channel, Console, Data, Exit } from "effect"
4394
4967
  *
@@ -4409,8 +4982,8 @@ export declare const onError: {
4409
4982
  * })
4410
4983
  * ```
4411
4984
  *
4412
- * @since 4.0.0
4413
4985
  * @category utils
4986
+ * @since 4.0.0
4414
4987
  */
4415
4988
  export declare const onExit: {
4416
4989
  /**
@@ -4418,7 +4991,8 @@ export declare const onExit: {
4418
4991
  * guaranteed to be executed so long as the channel begins execution (and
4419
4992
  * regardless of whether or not it completes).
4420
4993
  *
4421
- * @example
4994
+ * **Example** (Running exit finalizers)
4995
+ *
4422
4996
  * ```ts
4423
4997
  * import { Channel, Console, Data, Exit } from "effect"
4424
4998
  *
@@ -4439,8 +5013,8 @@ export declare const onExit: {
4439
5013
  * })
4440
5014
  * ```
4441
5015
  *
4442
- * @since 4.0.0
4443
5016
  * @category utils
5017
+ * @since 4.0.0
4444
5018
  */
4445
5019
  <OutDone, OutErr, Env2>(finalizer: (e: Exit.Exit<OutDone, OutErr>) => Effect.Effect<unknown, never, Env2>): <OutElem, InElem, InErr, InDone, Env>(self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>) => Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env2 | Env>;
4446
5020
  /**
@@ -4448,7 +5022,8 @@ export declare const onExit: {
4448
5022
  * guaranteed to be executed so long as the channel begins execution (and
4449
5023
  * regardless of whether or not it completes).
4450
5024
  *
4451
- * @example
5025
+ * **Example** (Running exit finalizers)
5026
+ *
4452
5027
  * ```ts
4453
5028
  * import { Channel, Console, Data, Exit } from "effect"
4454
5029
  *
@@ -4469,56 +5044,107 @@ export declare const onExit: {
4469
5044
  * })
4470
5045
  * ```
4471
5046
  *
4472
- * @since 4.0.0
4473
5047
  * @category utils
5048
+ * @since 4.0.0
4474
5049
  */
4475
5050
  <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env, Env2>(self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>, finalizer: (e: Exit.Exit<OutDone, OutErr>) => Effect.Effect<unknown, never, Env2>): Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env2 | Env>;
4476
5051
  };
4477
5052
  /**
4478
- * @since 4.0.0
5053
+ * Runs an effect before the channel starts.
5054
+ *
5055
+ * The effect's successful value is ignored. If the effect fails, the returned
5056
+ * channel fails before running the source channel.
5057
+ *
4479
5058
  * @category utils
5059
+ * @since 4.0.0
4480
5060
  */
4481
5061
  export declare const onStart: {
4482
5062
  /**
4483
- * @since 4.0.0
5063
+ * Runs an effect before the channel starts.
5064
+ *
5065
+ * The effect's successful value is ignored. If the effect fails, the returned
5066
+ * channel fails before running the source channel.
5067
+ *
4484
5068
  * @category utils
5069
+ * @since 4.0.0
4485
5070
  */
4486
5071
  <A, E, R>(onStart: Effect.Effect<A, E, R>): <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>(self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>) => Channel<OutElem, OutErr | E, OutDone, InElem, InErr, InDone, Env | R>;
4487
5072
  /**
4488
- * @since 4.0.0
5073
+ * Runs an effect before the channel starts.
5074
+ *
5075
+ * The effect's successful value is ignored. If the effect fails, the returned
5076
+ * channel fails before running the source channel.
5077
+ *
4489
5078
  * @category utils
5079
+ * @since 4.0.0
4490
5080
  */
4491
5081
  <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env, A, E, R>(self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>, onStart: Effect.Effect<A, E, R>): Channel<OutElem, OutErr | E, OutDone, InElem, InErr, InDone, Env | R>;
4492
5082
  };
4493
5083
  /**
4494
- * @since 4.0.0
5084
+ * Runs an effect the first time the channel emits an output element.
5085
+ *
5086
+ * The effect receives the first emitted element. The first element is still
5087
+ * emitted unchanged. The effect is not run if the channel completes without
5088
+ * emitting an element.
5089
+ *
4495
5090
  * @category utils
5091
+ * @since 4.0.0
4496
5092
  */
4497
5093
  export declare const onFirst: {
4498
5094
  /**
4499
- * @since 4.0.0
5095
+ * Runs an effect the first time the channel emits an output element.
5096
+ *
5097
+ * The effect receives the first emitted element. The first element is still
5098
+ * emitted unchanged. The effect is not run if the channel completes without
5099
+ * emitting an element.
5100
+ *
4500
5101
  * @category utils
5102
+ * @since 4.0.0
4501
5103
  */
4502
5104
  <OutElem, A, E, R>(onFirst: (element: Types.NoInfer<OutElem>) => Effect.Effect<A, E, R>): <OutErr, OutDone, InElem, InErr, InDone, Env>(self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>) => Channel<OutElem, OutErr | E, OutDone, InElem, InErr, InDone, Env | R>;
4503
5105
  /**
4504
- * @since 4.0.0
5106
+ * Runs an effect the first time the channel emits an output element.
5107
+ *
5108
+ * The effect receives the first emitted element. The first element is still
5109
+ * emitted unchanged. The effect is not run if the channel completes without
5110
+ * emitting an element.
5111
+ *
4505
5112
  * @category utils
5113
+ * @since 4.0.0
4506
5114
  */
4507
5115
  <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env, A, E, R>(self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>, onFirst: (element: Types.NoInfer<OutElem>) => Effect.Effect<A, E, R>): Channel<OutElem, OutErr | E, OutDone, InElem, InErr, InDone, Env | R>;
4508
5116
  };
4509
5117
  /**
4510
- * @since 4.0.0
5118
+ * Runs an effect when the channel completes successfully.
5119
+ *
5120
+ * The effect runs before the original done value is propagated. The effect is
5121
+ * not run when the channel fails. If the effect fails, the returned channel
5122
+ * fails with that error.
5123
+ *
4511
5124
  * @category utils
5125
+ * @since 4.0.0
4512
5126
  */
4513
5127
  export declare const onEnd: {
4514
5128
  /**
4515
- * @since 4.0.0
5129
+ * Runs an effect when the channel completes successfully.
5130
+ *
5131
+ * The effect runs before the original done value is propagated. The effect is
5132
+ * not run when the channel fails. If the effect fails, the returned channel
5133
+ * fails with that error.
5134
+ *
4516
5135
  * @category utils
5136
+ * @since 4.0.0
4517
5137
  */
4518
5138
  <A, E, R>(onEnd: Effect.Effect<A, E, R>): <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>(self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>) => Channel<OutElem, OutErr | E, OutDone, InElem, InErr, InDone, Env | R>;
4519
5139
  /**
4520
- * @since 4.0.0
5140
+ * Runs an effect when the channel completes successfully.
5141
+ *
5142
+ * The effect runs before the original done value is propagated. The effect is
5143
+ * not run when the channel fails. If the effect fails, the returned channel
5144
+ * fails with that error.
5145
+ *
4521
5146
  * @category utils
5147
+ * @since 4.0.0
4522
5148
  */
4523
5149
  <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env, A, E, R>(self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>, onEnd: Effect.Effect<A, E, R>): Channel<OutElem, OutErr | E, OutDone, InElem, InErr, InDone, Env | R>;
4524
5150
  };
@@ -4527,7 +5153,8 @@ export declare const onEnd: {
4527
5153
  * guaranteed to be executed so long as the channel begins execution (and
4528
5154
  * regardless of whether or not it completes).
4529
5155
  *
4530
- * @example
5156
+ * **Example** (Ensuring cleanup runs)
5157
+ *
4531
5158
  * ```ts
4532
5159
  * import { Channel, Console, Data } from "effect"
4533
5160
  *
@@ -4545,8 +5172,8 @@ export declare const onEnd: {
4545
5172
  * )
4546
5173
  * ```
4547
5174
  *
4548
- * @since 2.0.0
4549
5175
  * @category utils
5176
+ * @since 2.0.0
4550
5177
  */
4551
5178
  export declare const ensuring: {
4552
5179
  /**
@@ -4554,7 +5181,8 @@ export declare const ensuring: {
4554
5181
  * guaranteed to be executed so long as the channel begins execution (and
4555
5182
  * regardless of whether or not it completes).
4556
5183
  *
4557
- * @example
5184
+ * **Example** (Ensuring cleanup runs)
5185
+ *
4558
5186
  * ```ts
4559
5187
  * import { Channel, Console, Data } from "effect"
4560
5188
  *
@@ -4572,8 +5200,8 @@ export declare const ensuring: {
4572
5200
  * )
4573
5201
  * ```
4574
5202
  *
4575
- * @since 2.0.0
4576
5203
  * @category utils
5204
+ * @since 2.0.0
4577
5205
  */
4578
5206
  <Env2>(finalizer: Effect.Effect<unknown, never, Env2>): <OutElem, OutDone, OutErr, InElem, InErr, InDone, Env>(self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>) => Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env2 | Env>;
4579
5207
  /**
@@ -4581,7 +5209,8 @@ export declare const ensuring: {
4581
5209
  * guaranteed to be executed so long as the channel begins execution (and
4582
5210
  * regardless of whether or not it completes).
4583
5211
  *
4584
- * @example
5212
+ * **Example** (Ensuring cleanup runs)
5213
+ *
4585
5214
  * ```ts
4586
5215
  * import { Channel, Console, Data } from "effect"
4587
5216
  *
@@ -4599,149 +5228,244 @@ export declare const ensuring: {
4599
5228
  * )
4600
5229
  * ```
4601
5230
  *
4602
- * @since 2.0.0
4603
5231
  * @category utils
5232
+ * @since 2.0.0
4604
5233
  */
4605
5234
  <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env, Env2>(self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>, finalizer: Effect.Effect<unknown, never, Env2>): Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env2 | Env>;
4606
5235
  };
4607
5236
  /**
4608
5237
  * Create a channel from the specified services.
4609
5238
  *
4610
- * @since 2.0.0
4611
5239
  * @category Services
5240
+ * @since 2.0.0
4612
5241
  */
4613
5242
  export declare const contextWith: <Env, OutElem, OutErr, OutDone, InElem, InErr, InDone, Env2>(f: (context: Context.Context<Env>) => Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env2>) => Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env | Env2>;
4614
5243
  /**
4615
- * Provides a layer or context to the channel, removing the corresponding
4616
- * service requirements. Use `options.local` to build the layer every time; by
4617
- * default, layers are shared between provide calls.
5244
+ * Provides a `Context` to the channel, removing the corresponding service
5245
+ * requirements from the returned channel.
4618
5246
  *
4619
- * @since 4.0.0
4620
5247
  * @category Services
5248
+ * @since 4.0.0
4621
5249
  */
4622
5250
  export declare const provideContext: {
4623
5251
  /**
4624
- * Provides a layer or context to the channel, removing the corresponding
4625
- * service requirements. Use `options.local` to build the layer every time; by
4626
- * default, layers are shared between provide calls.
5252
+ * Provides a `Context` to the channel, removing the corresponding service
5253
+ * requirements from the returned channel.
4627
5254
  *
4628
- * @since 4.0.0
4629
5255
  * @category Services
5256
+ * @since 4.0.0
4630
5257
  */
4631
5258
  <R2>(context: Context.Context<R2>): <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>(self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>) => Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Exclude<Env, R2>>;
4632
5259
  /**
4633
- * Provides a layer or context to the channel, removing the corresponding
4634
- * service requirements. Use `options.local` to build the layer every time; by
4635
- * default, layers are shared between provide calls.
5260
+ * Provides a `Context` to the channel, removing the corresponding service
5261
+ * requirements from the returned channel.
4636
5262
  *
4637
- * @since 4.0.0
4638
5263
  * @category Services
5264
+ * @since 4.0.0
4639
5265
  */
4640
5266
  <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env, R2>(self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>, context: Context.Context<R2>): Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Exclude<Env, R2>>;
4641
5267
  };
4642
5268
  /**
4643
- * @since 4.0.0
5269
+ * Provides a concrete service for a context key, removing that service
5270
+ * requirement from the returned channel.
5271
+ *
4644
5272
  * @category Services
5273
+ * @since 4.0.0
4645
5274
  */
4646
5275
  export declare const provideService: {
4647
5276
  /**
4648
- * @since 4.0.0
5277
+ * Provides a concrete service for a context key, removing that service
5278
+ * requirement from the returned channel.
5279
+ *
4649
5280
  * @category Services
5281
+ * @since 4.0.0
4650
5282
  */
4651
5283
  <I, S>(key: Context.Key<I, S>, service: NoInfer<S>): <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>(self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>) => Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Exclude<Env, I>>;
4652
5284
  /**
4653
- * @since 4.0.0
5285
+ * Provides a concrete service for a context key, removing that service
5286
+ * requirement from the returned channel.
5287
+ *
4654
5288
  * @category Services
5289
+ * @since 4.0.0
4655
5290
  */
4656
5291
  <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env, I, S>(self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>, key: Context.Key<I, S>, service: NoInfer<S>): Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Exclude<Env, I>>;
4657
5292
  };
4658
5293
  /**
4659
- * @since 4.0.0
5294
+ * Evaluates an effect to obtain a service, then provides that service to the
5295
+ * channel.
5296
+ *
5297
+ * If the service effect fails, the returned channel fails. The provided service
5298
+ * removes the corresponding service requirement from the returned channel.
5299
+ *
4660
5300
  * @category Services
5301
+ * @since 4.0.0
4661
5302
  */
4662
5303
  export declare const provideServiceEffect: {
4663
5304
  /**
4664
- * @since 4.0.0
5305
+ * Evaluates an effect to obtain a service, then provides that service to the
5306
+ * channel.
5307
+ *
5308
+ * If the service effect fails, the returned channel fails. The provided service
5309
+ * removes the corresponding service requirement from the returned channel.
5310
+ *
4665
5311
  * @category Services
5312
+ * @since 4.0.0
4666
5313
  */
4667
5314
  <I, S, ES, RS>(key: Context.Key<I, S>, service: Effect.Effect<NoInfer<S>, ES, RS>): <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>(self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>) => Channel<OutElem, OutErr | ES, OutDone, InElem, InErr, InDone, Exclude<Env, I> | RS>;
4668
5315
  /**
4669
- * @since 4.0.0
5316
+ * Evaluates an effect to obtain a service, then provides that service to the
5317
+ * channel.
5318
+ *
5319
+ * If the service effect fails, the returned channel fails. The provided service
5320
+ * removes the corresponding service requirement from the returned channel.
5321
+ *
4670
5322
  * @category Services
5323
+ * @since 4.0.0
4671
5324
  */
4672
5325
  <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env, I, S, ES, RS>(self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>, key: Context.Key<I, S>, service: Effect.Effect<NoInfer<S>, ES, RS>): Channel<OutElem, OutErr | ES, OutDone, InElem, InErr, InDone, Exclude<Env, I> | RS>;
4673
5326
  };
4674
5327
  /**
4675
- * @since 4.0.0
5328
+ * Provides a `Layer` or `Context` to the channel, removing the corresponding
5329
+ * service requirements.
5330
+ *
5331
+ * Providing a `Context` delegates to `provideContext`. Providing a `Layer`
5332
+ * builds the layer in the channel scope. Use `options.local` to build a fresh
5333
+ * layer instance for this provision.
5334
+ *
4676
5335
  * @category Services
5336
+ * @since 4.0.0
4677
5337
  */
4678
5338
  export declare const provide: {
4679
5339
  /**
4680
- * @since 4.0.0
5340
+ * Provides a `Layer` or `Context` to the channel, removing the corresponding
5341
+ * service requirements.
5342
+ *
5343
+ * Providing a `Context` delegates to `provideContext`. Providing a `Layer`
5344
+ * builds the layer in the channel scope. Use `options.local` to build a fresh
5345
+ * layer instance for this provision.
5346
+ *
4681
5347
  * @category Services
5348
+ * @since 4.0.0
4682
5349
  */
4683
5350
  <A, E = never, R = never>(layer: Layer.Layer<A, E, R> | Context.Context<A>, options?: {
4684
5351
  readonly local?: boolean | undefined;
4685
5352
  } | undefined): <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>(self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>) => Channel<OutElem, OutErr | E, OutDone, InElem, InErr, InDone, Exclude<Env, A> | R>;
4686
5353
  /**
4687
- * @since 4.0.0
5354
+ * Provides a `Layer` or `Context` to the channel, removing the corresponding
5355
+ * service requirements.
5356
+ *
5357
+ * Providing a `Context` delegates to `provideContext`. Providing a `Layer`
5358
+ * builds the layer in the channel scope. Use `options.local` to build a fresh
5359
+ * layer instance for this provision.
5360
+ *
4688
5361
  * @category Services
5362
+ * @since 4.0.0
4689
5363
  */
4690
5364
  <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env, A, E = never, R = never>(self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>, layer: Layer.Layer<A, E, R> | Context.Context<A>, options?: {
4691
5365
  readonly local?: boolean | undefined;
4692
5366
  } | undefined): Channel<OutElem, OutErr | E, OutDone, InElem, InErr, InDone, Exclude<Env, A> | R>;
4693
5367
  };
4694
5368
  /**
4695
- * @since 2.0.0
5369
+ * Transforms the current context before running the channel.
5370
+ *
5371
+ * The function receives the surrounding context and returns the context to
5372
+ * provide to the channel. The returned channel requires the services needed to
5373
+ * build that context.
5374
+ *
4696
5375
  * @category Services
5376
+ * @since 2.0.0
4697
5377
  */
4698
5378
  export declare const updateContext: {
4699
5379
  /**
4700
- * @since 2.0.0
5380
+ * Transforms the current context before running the channel.
5381
+ *
5382
+ * The function receives the surrounding context and returns the context to
5383
+ * provide to the channel. The returned channel requires the services needed to
5384
+ * build that context.
5385
+ *
4701
5386
  * @category Services
5387
+ * @since 2.0.0
4702
5388
  */
4703
5389
  <Env, R2>(f: (context: Context.Context<R2>) => Context.Context<Env>): <OutElem, OutErr, OutDone, InElem, InErr, InDone>(self: Channel<OutElem, InElem, OutErr, InErr, OutDone, InDone, Env>) => Channel<OutElem, InElem, OutErr, InErr, OutDone, InDone, R2>;
4704
5390
  /**
4705
- * @since 2.0.0
5391
+ * Transforms the current context before running the channel.
5392
+ *
5393
+ * The function receives the surrounding context and returns the context to
5394
+ * provide to the channel. The returned channel requires the services needed to
5395
+ * build that context.
5396
+ *
4706
5397
  * @category Services
5398
+ * @since 2.0.0
4707
5399
  */
4708
5400
  <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env, R2>(self: Channel<OutElem, InElem, OutErr, InErr, OutDone, InDone, Env>, f: (context: Context.Context<R2>) => Context.Context<Env>): Channel<OutElem, InElem, OutErr, InErr, OutDone, InDone, R2>;
4709
5401
  };
4710
5402
  /**
4711
- * @since 2.0.0
5403
+ * Updates a service in the current context before running the channel.
5404
+ *
5405
+ * The existing service is read from the context. The updated service is
5406
+ * provided to the channel under the same key.
5407
+ *
4712
5408
  * @category Services
5409
+ * @since 2.0.0
4713
5410
  */
4714
5411
  export declare const updateService: {
4715
5412
  /**
4716
- * @since 2.0.0
5413
+ * Updates a service in the current context before running the channel.
5414
+ *
5415
+ * The existing service is read from the context. The updated service is
5416
+ * provided to the channel under the same key.
5417
+ *
4717
5418
  * @category Services
5419
+ * @since 2.0.0
4718
5420
  */
4719
5421
  <I, S>(key: Context.Key<I, S>, f: (service: NoInfer<S>) => S): <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>(self: Channel<OutElem, InElem, OutErr, InErr, OutDone, InDone, Env>) => Channel<OutElem, InElem, OutErr, InErr, OutDone, InDone, Env | I>;
4720
5422
  /**
4721
- * @since 2.0.0
5423
+ * Updates a service in the current context before running the channel.
5424
+ *
5425
+ * The existing service is read from the context. The updated service is
5426
+ * provided to the channel under the same key.
5427
+ *
4722
5428
  * @category Services
5429
+ * @since 2.0.0
4723
5430
  */
4724
5431
  <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env, I, S>(self: Channel<OutElem, InElem, OutErr, InErr, OutDone, InDone, Env>, service: Context.Key<I, S>, f: (service: NoInfer<S>) => S): Channel<OutElem, InElem, OutErr, InErr, OutDone, InDone, Env | I>;
4725
5432
  };
4726
5433
  /**
4727
- * @since 4.0.0
5434
+ * Runs the channel inside a tracing span with the specified name and options.
5435
+ *
5436
+ * The created span is provided as the current parent span while the channel
5437
+ * runs. The span is ended with the channel's exit value.
5438
+ *
4728
5439
  * @category Tracing
5440
+ * @since 4.0.0
4729
5441
  */
4730
5442
  export declare const withSpan: {
4731
5443
  /**
4732
- * @since 4.0.0
5444
+ * Runs the channel inside a tracing span with the specified name and options.
5445
+ *
5446
+ * The created span is provided as the current parent span while the channel
5447
+ * runs. The span is ended with the channel's exit value.
5448
+ *
4733
5449
  * @category Tracing
5450
+ * @since 4.0.0
4734
5451
  */
4735
5452
  (name: string, options?: SpanOptions): <OutElem, OutErr, OutDone, InElem, InErr, InDone, R>(self: Channel<OutElem, InElem, OutErr, InErr, OutDone, InDone, R>) => Channel<OutElem, InElem, OutErr, InErr, OutDone, InDone, Exclude<R, ParentSpan>>;
4736
5453
  /**
4737
- * @since 4.0.0
5454
+ * Runs the channel inside a tracing span with the specified name and options.
5455
+ *
5456
+ * The created span is provided as the current parent span while the channel
5457
+ * runs. The span is ended with the channel's exit value.
5458
+ *
4738
5459
  * @category Tracing
5460
+ * @since 4.0.0
4739
5461
  */
4740
5462
  <OutElem, OutErr, OutDone, InElem, InErr, InDone, R>(self: Channel<OutElem, InElem, OutErr, InErr, OutDone, InDone, R>, name: string, options?: SpanOptions): Channel<OutElem, InElem, OutErr, InErr, OutDone, InDone, Exclude<R, ParentSpan>>;
4741
5463
  };
4742
5464
  /**
4743
- * @since 4.0.0
5465
+ * The starting channel for Do notation, emitting an empty object.
5466
+ *
4744
5467
  * @category Do notation
5468
+ * @since 4.0.0
4745
5469
  */
4746
5470
  export declare const Do: Channel<{}>;
4747
5471
  declare const let_: {
@@ -4754,18 +5478,32 @@ declare const let_: {
4754
5478
  };
4755
5479
  export {
4756
5480
  /**
4757
- * @since 4.0.0
4758
5481
  * @category Do notation
5482
+ * @since 4.0.0
4759
5483
  */
4760
5484
  let_ as let };
4761
5485
  /**
4762
- * @since 4.0.0
5486
+ * Adds a field to each object emitted by a channel by running another channel
5487
+ * derived from that object.
5488
+ *
5489
+ * The field name must not already exist on the emitted object. The derived
5490
+ * channel's output becomes the value of the new field. `options.concurrency`
5491
+ * and `options.bufferSize` control how derived channels are flattened.
5492
+ *
4763
5493
  * @category Do notation
5494
+ * @since 4.0.0
4764
5495
  */
4765
5496
  export declare const bind: {
4766
5497
  /**
4767
- * @since 4.0.0
5498
+ * Adds a field to each object emitted by a channel by running another channel
5499
+ * derived from that object.
5500
+ *
5501
+ * The field name must not already exist on the emitted object. The derived
5502
+ * channel's output becomes the value of the new field. `options.concurrency`
5503
+ * and `options.bufferSize` control how derived channels are flattened.
5504
+ *
4768
5505
  * @category Do notation
5506
+ * @since 4.0.0
4769
5507
  */
4770
5508
  <N extends string, OutElem extends object, B, OutErr2, OutDone2, InElem2, InErr2, InDone2, Env2>(name: Exclude<N, keyof OutElem>, f: (a: NoInfer<OutElem>) => Channel<B, OutErr2, OutDone2, InElem2, InErr2, InDone2, Env2>, options?: {
4771
5509
  readonly concurrency?: number | "unbounded" | undefined;
@@ -4774,8 +5512,15 @@ export declare const bind: {
4774
5512
  [K in N | keyof OutElem]: K extends keyof OutElem ? OutElem[K] : B;
4775
5513
  }, OutErr2 | OutErr, OutDone, InElem & InElem2, InErr & InErr2, InDone & InDone2, Env2 | Env>;
4776
5514
  /**
4777
- * @since 4.0.0
5515
+ * Adds a field to each object emitted by a channel by running another channel
5516
+ * derived from that object.
5517
+ *
5518
+ * The field name must not already exist on the emitted object. The derived
5519
+ * channel's output becomes the value of the new field. `options.concurrency`
5520
+ * and `options.bufferSize` control how derived channels are flattened.
5521
+ *
4778
5522
  * @category Do notation
5523
+ * @since 4.0.0
4779
5524
  */
4780
5525
  <OutElem extends object, OutErr, OutDone, InElem, InErr, InDone, Env, N extends string, B, OutErr2, OutDone2, InElem2, InErr2, InDone2, Env2>(self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>, name: Exclude<N, keyof OutElem>, f: (a: NoInfer<OutElem>) => Channel<B, OutErr2, OutDone2, InElem2, InErr2, InDone2, Env2>, options?: {
4781
5526
  readonly concurrency?: number | "unbounded" | undefined;
@@ -4785,20 +5530,26 @@ export declare const bind: {
4785
5530
  }, OutErr2 | OutErr, OutDone, InElem & InElem2, InErr & InErr2, InDone & InDone2, Env2 | Env>;
4786
5531
  };
4787
5532
  /**
4788
- * @since 4.0.0
5533
+ * Wraps each output element in an object under the specified field name.
5534
+ *
4789
5535
  * @category Do notation
5536
+ * @since 4.0.0
4790
5537
  */
4791
5538
  export declare const bindTo: {
4792
5539
  /**
4793
- * @since 4.0.0
5540
+ * Wraps each output element in an object under the specified field name.
5541
+ *
4794
5542
  * @category Do notation
5543
+ * @since 4.0.0
4795
5544
  */
4796
5545
  <N extends string>(name: N): <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>(self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>) => Channel<{
4797
5546
  [K in N]: OutElem;
4798
5547
  }, OutErr, OutDone, InElem, InErr, InDone, Env>;
4799
5548
  /**
4800
- * @since 4.0.0
5549
+ * Wraps each output element in an object under the specified field name.
5550
+ *
4801
5551
  * @category Do notation
5552
+ * @since 4.0.0
4802
5553
  */
4803
5554
  <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env, N extends string>(self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>, name: N): Channel<{
4804
5555
  [K in N]: OutElem;
@@ -4807,7 +5558,8 @@ export declare const bindTo: {
4807
5558
  /**
4808
5559
  * Runs a channel and counts the number of elements it outputs.
4809
5560
  *
4810
- * @example
5561
+ * **Example** (Counting channel output)
5562
+ *
4811
5563
  * ```ts
4812
5564
  * import { Channel, Data } from "effect"
4813
5565
  *
@@ -4824,14 +5576,15 @@ export declare const bindTo: {
4824
5576
  * // Effect.runSync(countEffect) // Returns: 5
4825
5577
  * ```
4826
5578
  *
4827
- * @since 2.0.0
4828
5579
  * @category execution
5580
+ * @since 2.0.0
4829
5581
  */
4830
5582
  export declare const runCount: <OutElem, OutErr, OutDone, Env>(self: Channel<OutElem, OutErr, OutDone, unknown, unknown, unknown, Env>) => Effect.Effect<void, OutErr, Env>;
4831
5583
  /**
4832
5584
  * Runs a channel and discards all output elements, returning only the final result.
4833
5585
  *
4834
- * @example
5586
+ * **Example** (Draining channel output at runtime)
5587
+ *
4835
5588
  * ```ts
4836
5589
  * import { Channel, Data } from "effect"
4837
5590
  *
@@ -4852,14 +5605,15 @@ export declare const runCount: <OutElem, OutErr, OutDone, Env>(self: Channel<Out
4852
5605
  * // Effect.runSync(drainEffect) // Returns: "completed"
4853
5606
  * ```
4854
5607
  *
4855
- * @since 2.0.0
4856
5608
  * @category execution
5609
+ * @since 2.0.0
4857
5610
  */
4858
5611
  export declare const runDrain: <OutElem, OutErr, OutDone, Env>(self: Channel<OutElem, OutErr, OutDone, unknown, unknown, unknown, Env>) => Effect.Effect<OutDone, OutErr, Env>;
4859
5612
  /**
4860
5613
  * Runs a channel and applies an effect to each output element.
4861
5614
  *
4862
- * @example
5615
+ * **Example** (Running effects for each output)
5616
+ *
4863
5617
  * ```ts
4864
5618
  * import { Channel, Console, Data } from "effect"
4865
5619
  *
@@ -4879,14 +5633,15 @@ export declare const runDrain: <OutElem, OutErr, OutDone, Env>(self: Channel<Out
4879
5633
  * // Logs: "Processing: 1", "Processing: 2", "Processing: 3"
4880
5634
  * ```
4881
5635
  *
4882
- * @since 2.0.0
4883
5636
  * @category execution
5637
+ * @since 2.0.0
4884
5638
  */
4885
5639
  export declare const runForEach: {
4886
5640
  /**
4887
5641
  * Runs a channel and applies an effect to each output element.
4888
5642
  *
4889
- * @example
5643
+ * **Example** (Running effects for each output)
5644
+ *
4890
5645
  * ```ts
4891
5646
  * import { Channel, Console, Data } from "effect"
4892
5647
  *
@@ -4906,14 +5661,15 @@ export declare const runForEach: {
4906
5661
  * // Logs: "Processing: 1", "Processing: 2", "Processing: 3"
4907
5662
  * ```
4908
5663
  *
4909
- * @since 2.0.0
4910
5664
  * @category execution
5665
+ * @since 2.0.0
4911
5666
  */
4912
5667
  <OutElem, EX, RX>(f: (o: OutElem) => Effect.Effect<void, EX, RX>): <OutErr, OutDone, Env>(self: Channel<OutElem, OutErr, OutDone, unknown, unknown, unknown, Env>) => Effect.Effect<OutDone, OutErr | EX, Env | RX>;
4913
5668
  /**
4914
5669
  * Runs a channel and applies an effect to each output element.
4915
5670
  *
4916
- * @example
5671
+ * **Example** (Running effects for each output)
5672
+ *
4917
5673
  * ```ts
4918
5674
  * import { Channel, Console, Data } from "effect"
4919
5675
  *
@@ -4933,31 +5689,50 @@ export declare const runForEach: {
4933
5689
  * // Logs: "Processing: 1", "Processing: 2", "Processing: 3"
4934
5690
  * ```
4935
5691
  *
4936
- * @since 2.0.0
4937
5692
  * @category execution
5693
+ * @since 2.0.0
4938
5694
  */
4939
5695
  <OutElem, OutErr, OutDone, Env, EX, RX>(self: Channel<OutElem, OutErr, OutDone, unknown, unknown, unknown, Env>, f: (o: OutElem) => Effect.Effect<void, EX, RX>): Effect.Effect<OutDone, OutErr | EX, Env | RX>;
4940
5696
  };
4941
5697
  /**
4942
- * @since 2.0.0
5698
+ * Runs a channel and applies an effectful predicate to each output element
5699
+ * until the predicate returns `false`.
5700
+ *
5701
+ * Returning `true` continues consuming the channel. Returning `false` stops
5702
+ * consumption early. The returned effect completes with `void`.
5703
+ *
4943
5704
  * @category execution
5705
+ * @since 2.0.0
4944
5706
  */
4945
5707
  export declare const runForEachWhile: {
4946
5708
  /**
4947
- * @since 2.0.0
5709
+ * Runs a channel and applies an effectful predicate to each output element
5710
+ * until the predicate returns `false`.
5711
+ *
5712
+ * Returning `true` continues consuming the channel. Returning `false` stops
5713
+ * consumption early. The returned effect completes with `void`.
5714
+ *
4948
5715
  * @category execution
5716
+ * @since 2.0.0
4949
5717
  */
4950
5718
  <OutElem, EX, RX>(f: (o: OutElem) => Effect.Effect<boolean, EX, RX>): <OutErr, OutDone, Env>(self: Channel<OutElem, OutErr, OutDone, unknown, unknown, unknown, Env>) => Effect.Effect<void, OutErr | EX, Env | RX>;
4951
5719
  /**
4952
- * @since 2.0.0
5720
+ * Runs a channel and applies an effectful predicate to each output element
5721
+ * until the predicate returns `false`.
5722
+ *
5723
+ * Returning `true` continues consuming the channel. Returning `false` stops
5724
+ * consumption early. The returned effect completes with `void`.
5725
+ *
4953
5726
  * @category execution
5727
+ * @since 2.0.0
4954
5728
  */
4955
5729
  <OutElem, OutErr, OutDone, Env, EX, RX>(self: Channel<OutElem, OutErr, OutDone, unknown, unknown, unknown, Env>, f: (o: OutElem) => Effect.Effect<boolean, EX, RX>): Effect.Effect<void, OutErr | EX, Env | RX>;
4956
5730
  };
4957
5731
  /**
4958
5732
  * Runs a channel and collects all output elements into an array.
4959
5733
  *
4960
- * @example
5734
+ * **Example** (Collecting channel output)
5735
+ *
4961
5736
  * ```ts
4962
5737
  * import { Channel, Data } from "effect"
4963
5738
  *
@@ -4974,31 +5749,44 @@ export declare const runForEachWhile: {
4974
5749
  * // Effect.runSync(collectEffect) // Returns: [1, 2, 3, 4, 5]
4975
5750
  * ```
4976
5751
  *
4977
- * @since 2.0.0
4978
5752
  * @category execution
5753
+ * @since 2.0.0
4979
5754
  */
4980
5755
  export declare const runCollect: <OutElem, OutErr, OutDone, Env>(self: Channel<OutElem, OutErr, OutDone, unknown, unknown, unknown, Env>) => Effect.Effect<Array<OutElem>, OutErr, Env>;
4981
5756
  /**
4982
5757
  * Runs a channel and outputs the done value.
4983
5758
  *
4984
- * @since 4.0.0
4985
5759
  * @category execution
5760
+ * @since 4.0.0
4986
5761
  */
4987
5762
  export declare const runDone: <OutElem, OutErr, OutDone, Env>(self: Channel<OutElem, OutErr, OutDone, unknown, unknown, unknown, Env>) => Effect.Effect<OutDone, OutErr, Env>;
4988
5763
  /**
4989
- * @since 2.0.0
5764
+ * Runs a channel until the first output element is available, returning it in
5765
+ * an `Option`.
5766
+ *
5767
+ * Returns `Option.some` with the first output element, or `Option.none` if the
5768
+ * channel completes without emitting output.
5769
+ *
4990
5770
  * @category execution
5771
+ * @since 2.0.0
4991
5772
  */
4992
5773
  export declare const runHead: <OutElem, OutErr, OutDone, Env>(self: Channel<OutElem, OutErr, OutDone, unknown, unknown, unknown, Env>) => Effect.Effect<Option.Option<OutElem>, OutErr, Env>;
4993
5774
  /**
4994
- * @since 2.0.0
5775
+ * Runs a channel to completion and returns the last output element in an
5776
+ * `Option`.
5777
+ *
5778
+ * Returns `Option.some` with the last emitted element, or `Option.none` if the
5779
+ * channel completes without emitting output.
5780
+ *
4995
5781
  * @category execution
5782
+ * @since 2.0.0
4996
5783
  */
4997
5784
  export declare const runLast: <OutElem, OutErr, OutDone, Env>(self: Channel<OutElem, OutErr, OutDone, unknown, unknown, unknown, Env>) => Effect.Effect<Option.Option<OutElem>, OutErr, Env>;
4998
5785
  /**
4999
5786
  * Runs a channel and folds over all output elements with an accumulator.
5000
5787
  *
5001
- * @example
5788
+ * **Example** (Folding channel output)
5789
+ *
5002
5790
  * ```ts
5003
5791
  * import { Channel, Data } from "effect"
5004
5792
  *
@@ -5015,14 +5803,15 @@ export declare const runLast: <OutElem, OutErr, OutDone, Env>(self: Channel<OutE
5015
5803
  * // Effect.runSync(sumEffect) // Returns: 15
5016
5804
  * ```
5017
5805
  *
5018
- * @since 2.0.0
5019
5806
  * @category execution
5807
+ * @since 2.0.0
5020
5808
  */
5021
5809
  export declare const runFold: {
5022
5810
  /**
5023
5811
  * Runs a channel and folds over all output elements with an accumulator.
5024
5812
  *
5025
- * @example
5813
+ * **Example** (Folding channel output)
5814
+ *
5026
5815
  * ```ts
5027
5816
  * import { Channel, Data } from "effect"
5028
5817
  *
@@ -5039,14 +5828,15 @@ export declare const runFold: {
5039
5828
  * // Effect.runSync(sumEffect) // Returns: 15
5040
5829
  * ```
5041
5830
  *
5042
- * @since 2.0.0
5043
5831
  * @category execution
5832
+ * @since 2.0.0
5044
5833
  */
5045
5834
  <Z, OutElem>(initial: LazyArg<Z>, f: (acc: Z, o: OutElem) => Z): <OutErr, OutDone, Env>(self: Channel<OutElem, OutErr, OutDone, unknown, unknown, unknown, Env>) => Effect.Effect<Z, OutErr, Env>;
5046
5835
  /**
5047
5836
  * Runs a channel and folds over all output elements with an accumulator.
5048
5837
  *
5049
- * @example
5838
+ * **Example** (Folding channel output)
5839
+ *
5050
5840
  * ```ts
5051
5841
  * import { Channel, Data } from "effect"
5052
5842
  *
@@ -5063,31 +5853,54 @@ export declare const runFold: {
5063
5853
  * // Effect.runSync(sumEffect) // Returns: 15
5064
5854
  * ```
5065
5855
  *
5066
- * @since 2.0.0
5067
5856
  * @category execution
5857
+ * @since 2.0.0
5068
5858
  */
5069
5859
  <OutElem, OutErr, OutDone, Env, Z>(self: Channel<OutElem, OutErr, OutDone, unknown, unknown, unknown, Env>, initial: LazyArg<Z>, f: (acc: Z, o: OutElem) => Z): Effect.Effect<Z, OutErr, Env>;
5070
5860
  };
5071
5861
  /**
5072
- * @since 2.0.0
5862
+ * Runs a channel and effectfully folds all output elements with an accumulator.
5863
+ *
5864
+ * The initial accumulator is evaluated lazily. Each output element is passed to
5865
+ * the effectful accumulator function. The returned effect succeeds with the
5866
+ * final accumulator value.
5867
+ *
5073
5868
  * @category execution
5869
+ * @since 2.0.0
5074
5870
  */
5075
5871
  export declare const runFoldEffect: {
5076
5872
  /**
5077
- * @since 2.0.0
5873
+ * Runs a channel and effectfully folds all output elements with an accumulator.
5874
+ *
5875
+ * The initial accumulator is evaluated lazily. Each output element is passed to
5876
+ * the effectful accumulator function. The returned effect succeeds with the
5877
+ * final accumulator value.
5878
+ *
5078
5879
  * @category execution
5880
+ * @since 2.0.0
5079
5881
  */
5080
5882
  <OutElem, Z, E, R>(initial: LazyArg<Z>, f: (acc: Z, o: OutElem) => Effect.Effect<Z, E, R>): <OutErr, OutDone, Env>(self: Channel<OutElem, OutErr, OutDone, unknown, unknown, unknown, Env>) => Effect.Effect<Z, OutErr | E, Env | R>;
5081
5883
  /**
5082
- * @since 2.0.0
5884
+ * Runs a channel and effectfully folds all output elements with an accumulator.
5885
+ *
5886
+ * The initial accumulator is evaluated lazily. Each output element is passed to
5887
+ * the effectful accumulator function. The returned effect succeeds with the
5888
+ * final accumulator value.
5889
+ *
5083
5890
  * @category execution
5891
+ * @since 2.0.0
5084
5892
  */
5085
5893
  <OutElem, OutErr, OutDone, Env, Z, E, R>(self: Channel<OutElem, OutErr, OutDone, unknown, unknown, unknown, Env>, initial: LazyArg<Z>, f: (acc: Z, o: OutElem) => Effect.Effect<Z, E, R>): Effect.Effect<Z, OutErr | E, Env | R>;
5086
5894
  };
5087
5895
  /**
5088
- * Converts a channel to a Pull data structure for low-level consumption.
5896
+ * Converts a channel to a scoped `Pull` for low-level consumption.
5897
+ *
5898
+ * The effect requires a `Scope`. The returned pull should be consumed only
5899
+ * while that scope remains open. Pulls are serialized so only one pull is
5900
+ * evaluated at a time.
5901
+ *
5902
+ * **Example** (Converting channels to pulls)
5089
5903
  *
5090
- * @example
5091
5904
  * ```ts
5092
5905
  * import { Channel, Data, Effect } from "effect"
5093
5906
  *
@@ -5106,14 +5919,15 @@ export declare const runFoldEffect: {
5106
5919
  * // Use the Pull to manually consume elements
5107
5920
  * ```
5108
5921
  *
5109
- * @since 2.0.0
5110
5922
  * @category Destructors
5923
+ * @since 2.0.0
5111
5924
  */
5112
5925
  export declare const toPull: <OutElem, OutErr, OutDone, Env>(self: Channel<OutElem, OutErr, OutDone, unknown, unknown, unknown, Env>) => Effect.Effect<Pull.Pull<OutElem, OutErr, OutDone>, never, Env | Scope.Scope>;
5113
5926
  /**
5114
5927
  * Converts a channel to a Pull within an existing scope.
5115
5928
  *
5116
- * @example
5929
+ * **Example** (Converting channels to scoped pulls)
5930
+ *
5117
5931
  * ```ts
5118
5932
  * import { Channel, Data, Effect, Scope } from "effect"
5119
5933
  *
@@ -5132,46 +5946,91 @@ export declare const toPull: <OutElem, OutErr, OutDone, Env>(self: Channel<OutEl
5132
5946
  * })
5133
5947
  * ```
5134
5948
  *
5135
- * @since 4.0.0
5136
5949
  * @category Destructors
5950
+ * @since 4.0.0
5137
5951
  */
5138
5952
  export declare const toPullScoped: <OutElem, OutErr, OutDone, Env>(self: Channel<OutElem, OutErr, OutDone, unknown, unknown, unknown, Env>, scope: Scope.Scope) => Effect.Effect<Pull.Pull<OutElem, OutErr, OutDone, Env>, never, Env>;
5139
5953
  /**
5140
- * @since 4.0.0
5954
+ * Runs a channel and offers each output element into a queue.
5955
+ *
5956
+ * When the channel completes, the queue is ended. When the channel fails, the
5957
+ * queue is failed with the channel's cause. The returned effect itself
5958
+ * completes with `void`.
5959
+ *
5141
5960
  * @category Destructors
5961
+ * @since 4.0.0
5142
5962
  */
5143
5963
  export declare const runIntoQueue: {
5144
5964
  /**
5145
- * @since 4.0.0
5965
+ * Runs a channel and offers each output element into a queue.
5966
+ *
5967
+ * When the channel completes, the queue is ended. When the channel fails, the
5968
+ * queue is failed with the channel's cause. The returned effect itself
5969
+ * completes with `void`.
5970
+ *
5146
5971
  * @category Destructors
5972
+ * @since 4.0.0
5147
5973
  */
5148
5974
  <OutElem, OutErr>(queue: Queue.Queue<OutElem, OutErr | Cause.Done>): <OutDone, Env>(self: Channel<OutElem, OutErr, OutDone, unknown, unknown, unknown, Env>) => Effect.Effect<void, never, Env>;
5149
5975
  /**
5150
- * @since 4.0.0
5976
+ * Runs a channel and offers each output element into a queue.
5977
+ *
5978
+ * When the channel completes, the queue is ended. When the channel fails, the
5979
+ * queue is failed with the channel's cause. The returned effect itself
5980
+ * completes with `void`.
5981
+ *
5151
5982
  * @category Destructors
5983
+ * @since 4.0.0
5152
5984
  */
5153
5985
  <OutElem, OutErr, OutDone, Env>(self: Channel<OutElem, OutErr, OutDone, unknown, unknown, unknown, Env>, queue: Queue.Queue<OutElem, OutErr | Cause.Done>): Effect.Effect<void, never, Env>;
5154
5986
  };
5155
5987
  /**
5156
- * @since 4.0.0
5988
+ * Runs a channel that emits non-empty arrays and offers each array element into
5989
+ * a queue.
5990
+ *
5991
+ * When the channel completes, the queue is ended. When the channel fails, the
5992
+ * queue is failed with the channel's cause. The returned effect itself
5993
+ * completes with `void`.
5994
+ *
5157
5995
  * @category Destructors
5996
+ * @since 4.0.0
5158
5997
  */
5159
5998
  export declare const runIntoQueueArray: {
5160
5999
  /**
5161
- * @since 4.0.0
6000
+ * Runs a channel that emits non-empty arrays and offers each array element into
6001
+ * a queue.
6002
+ *
6003
+ * When the channel completes, the queue is ended. When the channel fails, the
6004
+ * queue is failed with the channel's cause. The returned effect itself
6005
+ * completes with `void`.
6006
+ *
5162
6007
  * @category Destructors
6008
+ * @since 4.0.0
5163
6009
  */
5164
6010
  <OutElem, OutErr>(queue: Queue.Queue<OutElem, OutErr | Cause.Done>): <OutDone, Env>(self: Channel<Arr.NonEmptyReadonlyArray<OutElem>, OutErr, OutDone, unknown, unknown, unknown, Env>) => Effect.Effect<void, never, Env>;
5165
6011
  /**
5166
- * @since 4.0.0
6012
+ * Runs a channel that emits non-empty arrays and offers each array element into
6013
+ * a queue.
6014
+ *
6015
+ * When the channel completes, the queue is ended. When the channel fails, the
6016
+ * queue is failed with the channel's cause. The returned effect itself
6017
+ * completes with `void`.
6018
+ *
5167
6019
  * @category Destructors
6020
+ * @since 4.0.0
5168
6021
  */
5169
6022
  <OutElem, OutErr, OutDone, Env>(self: Channel<Arr.NonEmptyReadonlyArray<OutElem>, OutErr, OutDone, unknown, unknown, unknown, Env>, queue: Queue.Queue<OutElem, OutErr | Cause.Done>): Effect.Effect<void, never, Env>;
5170
6023
  };
5171
6024
  /**
5172
- * Converts a channel to a queue for concurrent consumption.
6025
+ * Creates a scoped queue and forks the channel to feed it for concurrent
6026
+ * consumption.
6027
+ *
6028
+ * Output elements are offered to the queue. Channel completion and failure are
6029
+ * signaled through the queue. The queue is shut down when the surrounding scope
6030
+ * closes.
6031
+ *
6032
+ * **Example** (Converting channels to queues)
5173
6033
  *
5174
- * @example
5175
6034
  * ```ts
5176
6035
  * import { Channel, Data } from "effect"
5177
6036
  *
@@ -5189,14 +6048,20 @@ export declare const runIntoQueueArray: {
5189
6048
  * // Multiple consumers can read from the queue
5190
6049
  * ```
5191
6050
  *
5192
- * @since 4.0.0
5193
6051
  * @category Destructors
6052
+ * @since 4.0.0
5194
6053
  */
5195
6054
  export declare const toQueue: {
5196
6055
  /**
5197
- * Converts a channel to a queue for concurrent consumption.
6056
+ * Creates a scoped queue and forks the channel to feed it for concurrent
6057
+ * consumption.
6058
+ *
6059
+ * Output elements are offered to the queue. Channel completion and failure are
6060
+ * signaled through the queue. The queue is shut down when the surrounding scope
6061
+ * closes.
6062
+ *
6063
+ * **Example** (Converting channels to queues)
5198
6064
  *
5199
- * @example
5200
6065
  * ```ts
5201
6066
  * import { Channel, Data } from "effect"
5202
6067
  *
@@ -5214,8 +6079,8 @@ export declare const toQueue: {
5214
6079
  * // Multiple consumers can read from the queue
5215
6080
  * ```
5216
6081
  *
5217
- * @since 4.0.0
5218
6082
  * @category Destructors
6083
+ * @since 4.0.0
5219
6084
  */
5220
6085
  (options: {
5221
6086
  readonly capacity: "unbounded";
@@ -5224,9 +6089,15 @@ export declare const toQueue: {
5224
6089
  readonly strategy?: "dropping" | "sliding" | "suspend" | undefined;
5225
6090
  }): <OutElem, OutErr, OutDone, Env>(self: Channel<OutElem, OutErr, OutDone, unknown, unknown, unknown, Env>) => Effect.Effect<Queue.Dequeue<OutElem, OutErr | Cause.Done>, never, Env | Scope.Scope>;
5226
6091
  /**
5227
- * Converts a channel to a queue for concurrent consumption.
6092
+ * Creates a scoped queue and forks the channel to feed it for concurrent
6093
+ * consumption.
6094
+ *
6095
+ * Output elements are offered to the queue. Channel completion and failure are
6096
+ * signaled through the queue. The queue is shut down when the surrounding scope
6097
+ * closes.
6098
+ *
6099
+ * **Example** (Converting channels to queues)
5228
6100
  *
5229
- * @example
5230
6101
  * ```ts
5231
6102
  * import { Channel, Data } from "effect"
5232
6103
  *
@@ -5244,8 +6115,8 @@ export declare const toQueue: {
5244
6115
  * // Multiple consumers can read from the queue
5245
6116
  * ```
5246
6117
  *
5247
- * @since 4.0.0
5248
6118
  * @category Destructors
6119
+ * @since 4.0.0
5249
6120
  */
5250
6121
  <OutElem, OutErr, OutDone, Env>(self: Channel<OutElem, OutErr, OutDone, unknown, unknown, unknown, Env>, options: {
5251
6122
  readonly capacity: "unbounded";
@@ -5255,13 +6126,25 @@ export declare const toQueue: {
5255
6126
  }): Effect.Effect<Queue.Dequeue<OutElem, OutErr | Cause.Done>, never, Env | Scope.Scope>;
5256
6127
  };
5257
6128
  /**
5258
- * @since 4.0.0
6129
+ * Creates a scoped queue and forks an array-emitting channel to feed it.
6130
+ *
6131
+ * Each element inside emitted non-empty arrays is offered to the queue. Channel
6132
+ * completion and failure are signaled through the queue. The queue is shut down
6133
+ * when the surrounding scope closes.
6134
+ *
5259
6135
  * @category Destructors
6136
+ * @since 4.0.0
5260
6137
  */
5261
6138
  export declare const toQueueArray: {
5262
6139
  /**
5263
- * @since 4.0.0
6140
+ * Creates a scoped queue and forks an array-emitting channel to feed it.
6141
+ *
6142
+ * Each element inside emitted non-empty arrays is offered to the queue. Channel
6143
+ * completion and failure are signaled through the queue. The queue is shut down
6144
+ * when the surrounding scope closes.
6145
+ *
5264
6146
  * @category Destructors
6147
+ * @since 4.0.0
5265
6148
  */
5266
6149
  (options: {
5267
6150
  readonly capacity: "unbounded";
@@ -5270,8 +6153,14 @@ export declare const toQueueArray: {
5270
6153
  readonly strategy?: "dropping" | "sliding" | "suspend" | undefined;
5271
6154
  }): <OutElem, OutErr, OutDone, Env>(self: Channel<Arr.NonEmptyReadonlyArray<OutElem>, OutErr, OutDone, unknown, unknown, unknown, Env>) => Effect.Effect<Queue.Dequeue<OutElem, OutErr | Cause.Done>, never, Env | Scope.Scope>;
5272
6155
  /**
5273
- * @since 4.0.0
6156
+ * Creates a scoped queue and forks an array-emitting channel to feed it.
6157
+ *
6158
+ * Each element inside emitted non-empty arrays is offered to the queue. Channel
6159
+ * completion and failure are signaled through the queue. The queue is shut down
6160
+ * when the surrounding scope closes.
6161
+ *
5274
6162
  * @category Destructors
6163
+ * @since 4.0.0
5275
6164
  */
5276
6165
  <OutElem, OutErr, OutDone, Env>(self: Channel<Arr.NonEmptyReadonlyArray<OutElem>, OutErr, OutDone, unknown, unknown, unknown, Env>, options: {
5277
6166
  readonly capacity: "unbounded";
@@ -5286,8 +6175,8 @@ export declare const toQueueArray: {
5286
6175
  * `shutdownOnEnd` indicates whether the PubSub should be shut down when the
5287
6176
  * channel ends. By default this is `true`.
5288
6177
  *
5289
- * @since 4.0.0
5290
6178
  * @category Destructors
6179
+ * @since 4.0.0
5291
6180
  */
5292
6181
  export declare const toPubSub: {
5293
6182
  /**
@@ -5296,8 +6185,8 @@ export declare const toPubSub: {
5296
6185
  * `shutdownOnEnd` indicates whether the PubSub should be shut down when the
5297
6186
  * channel ends. By default this is `true`.
5298
6187
  *
5299
- * @since 4.0.0
5300
6188
  * @category Destructors
6189
+ * @since 4.0.0
5301
6190
  */
5302
6191
  (options: {
5303
6192
  readonly capacity: "unbounded";
@@ -5315,8 +6204,8 @@ export declare const toPubSub: {
5315
6204
  * `shutdownOnEnd` indicates whether the PubSub should be shut down when the
5316
6205
  * channel ends. By default this is `true`.
5317
6206
  *
5318
- * @since 4.0.0
5319
6207
  * @category Destructors
6208
+ * @since 4.0.0
5320
6209
  */
5321
6210
  <OutElem, OutErr, OutDone, Env>(self: Channel<OutElem, OutErr, OutDone, unknown, unknown, unknown, Env>, options: {
5322
6211
  readonly capacity: "unbounded";
@@ -5330,43 +6219,62 @@ export declare const toPubSub: {
5330
6219
  }): Effect.Effect<PubSub.PubSub<OutElem>, never, Env | Scope.Scope>;
5331
6220
  };
5332
6221
  /**
5333
- * @since 4.0.0
6222
+ * Runs a channel and publishes each output element to a `PubSub`.
6223
+ *
6224
+ * The channel's output values are published as individual PubSub messages. Use
6225
+ * `options.shutdownOnEnd` to shut down the PubSub when channel execution ends.
6226
+ *
5334
6227
  * @category Destructors
6228
+ * @since 4.0.0
5335
6229
  */
5336
6230
  export declare const runIntoPubSub: {
5337
6231
  /**
5338
- * @since 4.0.0
6232
+ * Runs a channel and publishes each output element to a `PubSub`.
6233
+ *
6234
+ * The channel's output values are published as individual PubSub messages. Use
6235
+ * `options.shutdownOnEnd` to shut down the PubSub when channel execution ends.
6236
+ *
5339
6237
  * @category Destructors
6238
+ * @since 4.0.0
5340
6239
  */
5341
6240
  <OutElem>(pubsub: PubSub.PubSub<OutElem>, options?: {
5342
6241
  readonly shutdownOnEnd?: boolean | undefined;
5343
6242
  } | undefined): <OutErr, OutDone, Env>(self: Channel<OutElem, OutErr, OutDone, unknown, unknown, unknown, Env>) => Effect.Effect<void, never, Env>;
5344
6243
  /**
5345
- * @since 4.0.0
6244
+ * Runs a channel and publishes each output element to a `PubSub`.
6245
+ *
6246
+ * The channel's output values are published as individual PubSub messages. Use
6247
+ * `options.shutdownOnEnd` to shut down the PubSub when channel execution ends.
6248
+ *
5346
6249
  * @category Destructors
6250
+ * @since 4.0.0
5347
6251
  */
5348
6252
  <OutElem, OutErr, OutDone, Env>(self: Channel<OutElem, OutErr, OutDone, unknown, unknown, unknown, Env>, pubsub: PubSub.PubSub<OutElem>, options?: {
5349
6253
  readonly shutdownOnEnd?: boolean | undefined;
5350
6254
  } | undefined): Effect.Effect<void, never, Env>;
5351
6255
  };
5352
6256
  /**
5353
- * Converts a channel to a PubSub for concurrent consumption.
6257
+ * Converts an array-emitting channel to a scoped `PubSub` for concurrent
6258
+ * consumption.
5354
6259
  *
5355
- * `shutdownOnEnd` indicates whether the PubSub should be shut down when the
5356
- * channel ends. By default this is `true`.
6260
+ * Each element inside emitted non-empty arrays is published as an individual
6261
+ * PubSub message. `shutdownOnEnd` indicates whether the PubSub should be shut
6262
+ * down when the channel ends. By default this is `true`.
5357
6263
  *
5358
- * @since 4.0.0
5359
6264
  * @category Destructors
6265
+ * @since 4.0.0
5360
6266
  */
5361
6267
  export declare const toPubSubArray: {
5362
6268
  /**
5363
- * Converts a channel to a PubSub for concurrent consumption.
6269
+ * Converts an array-emitting channel to a scoped `PubSub` for concurrent
6270
+ * consumption.
5364
6271
  *
5365
- * `shutdownOnEnd` indicates whether the PubSub should be shut down when the
5366
- * channel ends. By default this is `true`.
6272
+ * Each element inside emitted non-empty arrays is published as an individual
6273
+ * PubSub message. `shutdownOnEnd` indicates whether the PubSub should be shut
6274
+ * down when the channel ends. By default this is `true`.
5367
6275
  *
5368
- * @since 4.0.0
5369
6276
  * @category Destructors
6277
+ * @since 4.0.0
5370
6278
  */
5371
6279
  (options: {
5372
6280
  readonly capacity: "unbounded";
@@ -5379,13 +6287,15 @@ export declare const toPubSubArray: {
5379
6287
  readonly shutdownOnEnd?: boolean | undefined;
5380
6288
  }): <OutElem, OutErr, OutDone, Env>(self: Channel<Arr.NonEmptyReadonlyArray<OutElem>, OutErr, OutDone, unknown, unknown, unknown, Env>) => Effect.Effect<PubSub.PubSub<OutElem>, never, Env | Scope.Scope>;
5381
6289
  /**
5382
- * Converts a channel to a PubSub for concurrent consumption.
6290
+ * Converts an array-emitting channel to a scoped `PubSub` for concurrent
6291
+ * consumption.
5383
6292
  *
5384
- * `shutdownOnEnd` indicates whether the PubSub should be shut down when the
5385
- * channel ends. By default this is `true`.
6293
+ * Each element inside emitted non-empty arrays is published as an individual
6294
+ * PubSub message. `shutdownOnEnd` indicates whether the PubSub should be shut
6295
+ * down when the channel ends. By default this is `true`.
5386
6296
  *
5387
- * @since 4.0.0
5388
6297
  * @category Destructors
6298
+ * @since 4.0.0
5389
6299
  */
5390
6300
  <OutElem, OutErr, OutDone, Env>(self: Channel<Arr.NonEmptyReadonlyArray<OutElem>, OutErr, OutDone, unknown, unknown, unknown, Env>, options: {
5391
6301
  readonly capacity: "unbounded";
@@ -5399,37 +6309,66 @@ export declare const toPubSubArray: {
5399
6309
  }): Effect.Effect<PubSub.PubSub<OutElem>, never, Env | Scope.Scope>;
5400
6310
  };
5401
6311
  /**
5402
- * @since 4.0.0
6312
+ * Runs an array-emitting channel and publishes each array element to a
6313
+ * `PubSub`.
6314
+ *
6315
+ * Each element inside emitted non-empty arrays is published as an individual
6316
+ * PubSub message. Use `options.shutdownOnEnd` to shut down the PubSub when
6317
+ * channel execution ends.
6318
+ *
5403
6319
  * @category Destructors
6320
+ * @since 4.0.0
5404
6321
  */
5405
6322
  export declare const runIntoPubSubArray: {
5406
6323
  /**
5407
- * @since 4.0.0
6324
+ * Runs an array-emitting channel and publishes each array element to a
6325
+ * `PubSub`.
6326
+ *
6327
+ * Each element inside emitted non-empty arrays is published as an individual
6328
+ * PubSub message. Use `options.shutdownOnEnd` to shut down the PubSub when
6329
+ * channel execution ends.
6330
+ *
5408
6331
  * @category Destructors
6332
+ * @since 4.0.0
5409
6333
  */
5410
6334
  <OutElem>(pubsub: PubSub.PubSub<OutElem>, options?: {
5411
6335
  readonly shutdownOnEnd?: boolean | undefined;
5412
6336
  } | undefined): <OutErr, OutDone, Env>(self: Channel<Arr.NonEmptyReadonlyArray<OutElem>, OutErr, OutDone, unknown, unknown, unknown, Env>) => Effect.Effect<OutDone, OutErr, Env>;
5413
6337
  /**
5414
- * @since 4.0.0
6338
+ * Runs an array-emitting channel and publishes each array element to a
6339
+ * `PubSub`.
6340
+ *
6341
+ * Each element inside emitted non-empty arrays is published as an individual
6342
+ * PubSub message. Use `options.shutdownOnEnd` to shut down the PubSub when
6343
+ * channel execution ends.
6344
+ *
5415
6345
  * @category Destructors
6346
+ * @since 4.0.0
5416
6347
  */
5417
6348
  <OutElem, OutErr, OutDone, Env>(self: Channel<Arr.NonEmptyReadonlyArray<OutElem>, OutErr, OutDone, unknown, unknown, unknown, Env>, pubsub: PubSub.PubSub<OutElem>, options?: {
5418
6349
  readonly shutdownOnEnd?: boolean | undefined;
5419
6350
  } | undefined): Effect.Effect<OutDone, OutErr, Env>;
5420
6351
  };
5421
6352
  /**
5422
- * Converts a channel to a PubSub for concurrent consumption.
6353
+ * Converts a channel to a scoped `PubSub` of `Take` values.
6354
+ *
6355
+ * Emitted non-empty arrays are published as output `Take` values. When the
6356
+ * channel ends, its final `Exit` is published so subscribers can observe
6357
+ * completion or failure.
5423
6358
  *
5424
- * @since 4.0.0
5425
6359
  * @category Destructors
6360
+ * @since 4.0.0
5426
6361
  */
5427
6362
  export declare const toPubSubTake: {
5428
6363
  /**
5429
- * Converts a channel to a PubSub for concurrent consumption.
6364
+ * Converts a channel to a scoped `PubSub` of `Take` values.
6365
+ *
6366
+ * Emitted non-empty arrays are published as output `Take` values. When the
6367
+ * channel ends, its final `Exit` is published so subscribers can observe
6368
+ * completion or failure.
5430
6369
  *
5431
- * @since 4.0.0
5432
6370
  * @category Destructors
6371
+ * @since 4.0.0
5433
6372
  */
5434
6373
  (options: {
5435
6374
  readonly capacity: "unbounded";
@@ -5440,10 +6379,14 @@ export declare const toPubSubTake: {
5440
6379
  readonly replay?: number | undefined;
5441
6380
  }): <OutElem, OutErr, OutDone, Env>(self: Channel<Arr.NonEmptyReadonlyArray<OutDone>, OutErr, OutDone, unknown, unknown, unknown, Env>) => Effect.Effect<PubSub.PubSub<Take.Take<OutElem, OutErr, OutDone>>, never, Env | Scope.Scope>;
5442
6381
  /**
5443
- * Converts a channel to a PubSub for concurrent consumption.
6382
+ * Converts a channel to a scoped `PubSub` of `Take` values.
6383
+ *
6384
+ * Emitted non-empty arrays are published as output `Take` values. When the
6385
+ * channel ends, its final `Exit` is published so subscribers can observe
6386
+ * completion or failure.
5444
6387
  *
5445
- * @since 4.0.0
5446
6388
  * @category Destructors
6389
+ * @since 4.0.0
5447
6390
  */
5448
6391
  <OutElem, OutErr, OutDone, Env>(self: Channel<Arr.NonEmptyReadonlyArray<OutElem>, OutErr, OutDone, unknown, unknown, unknown, Env>, options: {
5449
6392
  readonly capacity: "unbounded";