effect 4.0.0-beta.6 → 4.0.0-beta.60
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.
- package/dist/Array.d.ts +213 -385
- package/dist/Array.d.ts.map +1 -1
- package/dist/Array.js +149 -102
- package/dist/Array.js.map +1 -1
- package/dist/BigDecimal.d.ts +82 -45
- package/dist/BigDecimal.d.ts.map +1 -1
- package/dist/BigDecimal.js +105 -52
- package/dist/BigDecimal.js.map +1 -1
- package/dist/BigInt.d.ts +39 -32
- package/dist/BigInt.d.ts.map +1 -1
- package/dist/BigInt.js +36 -33
- package/dist/BigInt.js.map +1 -1
- package/dist/Brand.d.ts +3 -5
- package/dist/Brand.d.ts.map +1 -1
- package/dist/Brand.js +1 -1
- package/dist/Brand.js.map +1 -1
- package/dist/Cache.d.ts +14 -45
- package/dist/Cache.d.ts.map +1 -1
- package/dist/Cache.js +21 -47
- package/dist/Cache.js.map +1 -1
- package/dist/Cause.d.ts +53 -22
- package/dist/Cause.d.ts.map +1 -1
- package/dist/Cause.js +108 -10
- package/dist/Cause.js.map +1 -1
- package/dist/Channel.d.ts +166 -48
- package/dist/Channel.d.ts.map +1 -1
- package/dist/Channel.js +176 -87
- package/dist/Channel.js.map +1 -1
- package/dist/Chunk.d.ts +112 -304
- package/dist/Chunk.d.ts.map +1 -1
- package/dist/Chunk.js +56 -88
- package/dist/Chunk.js.map +1 -1
- package/dist/Clock.d.ts +2 -2
- package/dist/Clock.d.ts.map +1 -1
- package/dist/Clock.js.map +1 -1
- package/dist/Combiner.d.ts +280 -13
- package/dist/Combiner.d.ts.map +1 -1
- package/dist/Combiner.js +198 -7
- package/dist/Combiner.js.map +1 -1
- package/dist/Config.d.ts +189 -29
- package/dist/Config.d.ts.map +1 -1
- package/dist/Config.js +85 -35
- package/dist/Config.js.map +1 -1
- package/dist/ConfigProvider.d.ts +6 -6
- package/dist/ConfigProvider.d.ts.map +1 -1
- package/dist/ConfigProvider.js +5 -5
- package/dist/ConfigProvider.js.map +1 -1
- package/dist/Console.d.ts +2 -2
- package/dist/Console.d.ts.map +1 -1
- package/dist/Console.js.map +1 -1
- package/dist/Context.d.ts +1150 -0
- package/dist/Context.d.ts.map +1 -0
- package/dist/{ServiceMap.js → Context.js} +181 -165
- package/dist/Context.js.map +1 -0
- package/dist/Cron.d.ts +11 -7
- package/dist/Cron.d.ts.map +1 -1
- package/dist/Cron.js +120 -63
- package/dist/Cron.js.map +1 -1
- package/dist/Data.d.ts +533 -365
- package/dist/Data.d.ts.map +1 -1
- package/dist/Data.js +125 -73
- package/dist/Data.js.map +1 -1
- package/dist/DateTime.d.ts +74 -255
- package/dist/DateTime.d.ts.map +1 -1
- package/dist/DateTime.js +17 -62
- package/dist/DateTime.js.map +1 -1
- package/dist/Deferred.d.ts +12 -5
- package/dist/Deferred.d.ts.map +1 -1
- package/dist/Deferred.js +13 -5
- package/dist/Deferred.js.map +1 -1
- package/dist/Duration.d.ts +74 -40
- package/dist/Duration.d.ts.map +1 -1
- package/dist/Duration.js +126 -87
- package/dist/Duration.js.map +1 -1
- package/dist/Effect.d.ts +1391 -927
- package/dist/Effect.d.ts.map +1 -1
- package/dist/Effect.js +472 -328
- package/dist/Effect.js.map +1 -1
- package/dist/Effectable.d.ts +29 -0
- package/dist/Effectable.d.ts.map +1 -0
- package/dist/Effectable.js +31 -0
- package/dist/Effectable.js.map +1 -0
- package/dist/Encoding.d.ts +1 -1
- package/dist/Equal.d.ts +276 -109
- package/dist/Equal.d.ts.map +1 -1
- package/dist/Equal.js +140 -48
- package/dist/Equal.js.map +1 -1
- package/dist/Equivalence.d.ts +60 -3
- package/dist/Equivalence.d.ts.map +1 -1
- package/dist/Equivalence.js +70 -13
- package/dist/Equivalence.js.map +1 -1
- package/dist/ErrorReporter.d.ts +374 -0
- package/dist/ErrorReporter.d.ts.map +1 -0
- package/dist/ErrorReporter.js +245 -0
- package/dist/ErrorReporter.js.map +1 -0
- package/dist/ExecutionPlan.d.ts +6 -6
- package/dist/ExecutionPlan.d.ts.map +1 -1
- package/dist/ExecutionPlan.js +4 -4
- package/dist/ExecutionPlan.js.map +1 -1
- package/dist/Exit.d.ts +24 -12
- package/dist/Exit.d.ts.map +1 -1
- package/dist/Exit.js +8 -4
- package/dist/Exit.js.map +1 -1
- package/dist/Fiber.d.ts +10 -8
- package/dist/Fiber.d.ts.map +1 -1
- package/dist/Fiber.js.map +1 -1
- package/dist/FiberHandle.d.ts +11 -10
- package/dist/FiberHandle.d.ts.map +1 -1
- package/dist/FiberHandle.js +12 -11
- package/dist/FiberHandle.js.map +1 -1
- package/dist/FiberMap.d.ts +22 -21
- package/dist/FiberMap.d.ts.map +1 -1
- package/dist/FiberMap.js +10 -10
- package/dist/FiberMap.js.map +1 -1
- package/dist/FiberSet.d.ts +2 -2
- package/dist/FiberSet.d.ts.map +1 -1
- package/dist/FiberSet.js +4 -4
- package/dist/FiberSet.js.map +1 -1
- package/dist/FileSystem.d.ts +20 -19
- package/dist/FileSystem.d.ts.map +1 -1
- package/dist/FileSystem.js +15 -11
- package/dist/FileSystem.js.map +1 -1
- package/dist/Filter.d.ts +4 -37
- package/dist/Filter.d.ts.map +1 -1
- package/dist/Filter.js +0 -13
- package/dist/Filter.js.map +1 -1
- package/dist/Formatter.d.ts +131 -47
- package/dist/Formatter.d.ts.map +1 -1
- package/dist/Formatter.js +243 -55
- package/dist/Formatter.js.map +1 -1
- package/dist/Function.d.ts +1 -9
- package/dist/Function.d.ts.map +1 -1
- package/dist/Function.js +2 -10
- package/dist/Function.js.map +1 -1
- package/dist/Graph.d.ts +65 -65
- package/dist/Graph.d.ts.map +1 -1
- package/dist/Graph.js +58 -60
- package/dist/Graph.js.map +1 -1
- package/dist/Hash.js +1 -1
- package/dist/Hash.js.map +1 -1
- package/dist/HashMap.d.ts +26 -19
- package/dist/HashMap.d.ts.map +1 -1
- package/dist/HashMap.js +7 -5
- package/dist/HashMap.js.map +1 -1
- package/dist/Inspectable.d.ts +0 -4
- package/dist/Inspectable.d.ts.map +1 -1
- package/dist/Inspectable.js +4 -13
- package/dist/Inspectable.js.map +1 -1
- package/dist/Iterable.d.ts +50 -50
- package/dist/Iterable.d.ts.map +1 -1
- package/dist/Iterable.js +106 -34
- package/dist/Iterable.js.map +1 -1
- package/dist/JsonSchema.d.ts +299 -10
- package/dist/JsonSchema.d.ts.map +1 -1
- package/dist/JsonSchema.js +323 -4
- package/dist/JsonSchema.js.map +1 -1
- package/dist/Latch.d.ts +69 -3
- package/dist/Latch.d.ts.map +1 -1
- package/dist/Latch.js +58 -0
- package/dist/Latch.js.map +1 -1
- package/dist/Layer.d.ts +599 -379
- package/dist/Layer.d.ts.map +1 -1
- package/dist/Layer.js +249 -180
- package/dist/Layer.js.map +1 -1
- package/dist/LayerMap.d.ts +27 -26
- package/dist/LayerMap.d.ts.map +1 -1
- package/dist/LayerMap.js +21 -18
- package/dist/LayerMap.js.map +1 -1
- package/dist/LogLevel.d.ts +32 -0
- package/dist/LogLevel.d.ts.map +1 -1
- package/dist/LogLevel.js +28 -100
- package/dist/LogLevel.js.map +1 -1
- package/dist/Logger.d.ts +31 -97
- package/dist/Logger.d.ts.map +1 -1
- package/dist/Logger.js +2 -3
- package/dist/Logger.js.map +1 -1
- package/dist/ManagedRuntime.d.ts +8 -8
- package/dist/ManagedRuntime.d.ts.map +1 -1
- package/dist/ManagedRuntime.js +34 -25
- package/dist/ManagedRuntime.js.map +1 -1
- package/dist/Metric.d.ts +23 -25
- package/dist/Metric.d.ts.map +1 -1
- package/dist/Metric.js +24 -26
- package/dist/Metric.js.map +1 -1
- package/dist/MutableHashMap.d.ts +7 -0
- package/dist/MutableHashMap.d.ts.map +1 -1
- package/dist/MutableHashMap.js +8 -0
- package/dist/MutableHashMap.js.map +1 -1
- package/dist/MutableHashSet.d.ts +7 -0
- package/dist/MutableHashSet.d.ts.map +1 -1
- package/dist/MutableHashSet.js +8 -0
- package/dist/MutableHashSet.js.map +1 -1
- package/dist/MutableList.d.ts.map +1 -1
- package/dist/MutableList.js +3 -0
- package/dist/MutableList.js.map +1 -1
- package/dist/Newtype.d.ts +291 -0
- package/dist/Newtype.d.ts.map +1 -0
- package/dist/Newtype.js +161 -0
- package/dist/Newtype.js.map +1 -0
- package/dist/Number.d.ts +74 -18
- package/dist/Number.d.ts.map +1 -1
- package/dist/Number.js +46 -18
- package/dist/Number.js.map +1 -1
- package/dist/Optic.d.ts +947 -18
- package/dist/Optic.d.ts.map +1 -1
- package/dist/Optic.js +454 -5
- package/dist/Optic.js.map +1 -1
- package/dist/Option.d.ts +25 -16
- package/dist/Option.d.ts.map +1 -1
- package/dist/Option.js +15 -9
- package/dist/Option.js.map +1 -1
- package/dist/Order.d.ts +6 -1
- package/dist/Order.d.ts.map +1 -1
- package/dist/Order.js +19 -14
- package/dist/Order.js.map +1 -1
- package/dist/PartitionedSemaphore.d.ts +183 -0
- package/dist/PartitionedSemaphore.d.ts.map +1 -0
- package/dist/PartitionedSemaphore.js +231 -0
- package/dist/PartitionedSemaphore.js.map +1 -0
- package/dist/Path.d.ts +2 -2
- package/dist/Path.d.ts.map +1 -1
- package/dist/Path.js +2 -2
- package/dist/Path.js.map +1 -1
- package/dist/PlatformError.d.ts +2 -2
- package/dist/Pool.d.ts +1 -1
- package/dist/Pool.d.ts.map +1 -1
- package/dist/Pool.js +5 -5
- package/dist/Pool.js.map +1 -1
- package/dist/Predicate.d.ts +1 -1
- package/dist/Predicate.d.ts.map +1 -1
- package/dist/PubSub.d.ts +5 -4
- package/dist/PubSub.d.ts.map +1 -1
- package/dist/PubSub.js +15 -8
- package/dist/PubSub.js.map +1 -1
- package/dist/Pull.d.ts.map +1 -1
- package/dist/Pull.js +1 -1
- package/dist/Pull.js.map +1 -1
- package/dist/Queue.d.ts +9 -6
- package/dist/Queue.d.ts.map +1 -1
- package/dist/Queue.js +7 -5
- package/dist/Queue.js.map +1 -1
- package/dist/Random.d.ts +36 -2
- package/dist/Random.d.ts.map +1 -1
- package/dist/Random.js +46 -35
- package/dist/Random.js.map +1 -1
- package/dist/RcMap.d.ts +4 -4
- package/dist/RcMap.d.ts.map +1 -1
- package/dist/RcMap.js +13 -13
- package/dist/RcMap.js.map +1 -1
- package/dist/RcRef.d.ts +1 -1
- package/dist/RcRef.d.ts.map +1 -1
- package/dist/Record.d.ts +63 -160
- package/dist/Record.d.ts.map +1 -1
- package/dist/Record.js +37 -56
- package/dist/Record.js.map +1 -1
- package/dist/Redactable.d.ts +139 -62
- package/dist/Redactable.d.ts.map +1 -1
- package/dist/Redactable.js +59 -55
- package/dist/Redactable.js.map +1 -1
- package/dist/Reducer.d.ts +166 -7
- package/dist/Reducer.d.ts.map +1 -1
- package/dist/Reducer.js +135 -1
- package/dist/Reducer.js.map +1 -1
- package/dist/References.d.ts +257 -229
- package/dist/References.d.ts.map +1 -1
- package/dist/References.js +240 -259
- package/dist/References.js.map +1 -1
- package/dist/Request.d.ts +5 -5
- package/dist/Request.d.ts.map +1 -1
- package/dist/Request.js.map +1 -1
- package/dist/RequestResolver.d.ts +25 -25
- package/dist/RequestResolver.d.ts.map +1 -1
- package/dist/RequestResolver.js +15 -16
- package/dist/RequestResolver.js.map +1 -1
- package/dist/Resource.d.ts +0 -3
- package/dist/Resource.d.ts.map +1 -1
- package/dist/Resource.js +5 -4
- package/dist/Resource.js.map +1 -1
- package/dist/Result.d.ts +1 -1
- package/dist/Result.d.ts.map +1 -1
- package/dist/Result.js +1 -2
- package/dist/Result.js.map +1 -1
- package/dist/Runtime.d.ts +66 -0
- package/dist/Runtime.d.ts.map +1 -1
- package/dist/Runtime.js +79 -6
- package/dist/Runtime.js.map +1 -1
- package/dist/Schedule.d.ts +174 -291
- package/dist/Schedule.d.ts.map +1 -1
- package/dist/Schedule.js +132 -120
- package/dist/Schedule.js.map +1 -1
- package/dist/Scheduler.d.ts +36 -125
- package/dist/Scheduler.d.ts.map +1 -1
- package/dist/Scheduler.js +37 -126
- package/dist/Scheduler.js.map +1 -1
- package/dist/Schema.d.ts +3213 -392
- package/dist/Schema.d.ts.map +1 -1
- package/dist/Schema.js +2058 -252
- package/dist/Schema.js.map +1 -1
- package/dist/SchemaAST.d.ts +13 -2
- package/dist/SchemaAST.d.ts.map +1 -1
- package/dist/SchemaAST.js +340 -257
- package/dist/SchemaAST.js.map +1 -1
- package/dist/SchemaGetter.d.ts +55 -13
- package/dist/SchemaGetter.d.ts.map +1 -1
- package/dist/SchemaGetter.js +73 -11
- package/dist/SchemaGetter.js.map +1 -1
- package/dist/SchemaIssue.d.ts.map +1 -1
- package/dist/SchemaIssue.js +29 -11
- package/dist/SchemaIssue.js.map +1 -1
- package/dist/SchemaParser.d.ts +44 -54
- package/dist/SchemaParser.d.ts.map +1 -1
- package/dist/SchemaParser.js +69 -4
- package/dist/SchemaParser.js.map +1 -1
- package/dist/SchemaRepresentation.d.ts +2 -2
- package/dist/SchemaRepresentation.d.ts.map +1 -1
- package/dist/SchemaRepresentation.js +63 -39
- package/dist/SchemaRepresentation.js.map +1 -1
- package/dist/SchemaTransformation.d.ts +245 -3
- package/dist/SchemaTransformation.d.ts.map +1 -1
- package/dist/SchemaTransformation.js +297 -33
- package/dist/SchemaTransformation.js.map +1 -1
- package/dist/Scope.d.ts +2 -2
- package/dist/Scope.d.ts.map +1 -1
- package/dist/Scope.js.map +1 -1
- package/dist/ScopedCache.d.ts +2 -2
- package/dist/ScopedCache.d.ts.map +1 -1
- package/dist/ScopedCache.js +5 -5
- package/dist/ScopedCache.js.map +1 -1
- package/dist/Semaphore.d.ts +148 -52
- package/dist/Semaphore.d.ts.map +1 -1
- package/dist/Semaphore.js +135 -117
- package/dist/Semaphore.js.map +1 -1
- package/dist/Sink.d.ts +22 -19
- package/dist/Sink.d.ts.map +1 -1
- package/dist/Sink.js +54 -7
- package/dist/Sink.js.map +1 -1
- package/dist/Stdio.d.ts +18 -6
- package/dist/Stdio.d.ts.map +1 -1
- package/dist/Stdio.js +20 -2
- package/dist/Stdio.js.map +1 -1
- package/dist/Stream.d.ts +465 -542
- package/dist/Stream.d.ts.map +1 -1
- package/dist/Stream.js +329 -145
- package/dist/Stream.js.map +1 -1
- package/dist/String.d.ts +114 -47
- package/dist/String.d.ts.map +1 -1
- package/dist/String.js +29 -47
- package/dist/String.js.map +1 -1
- package/dist/Struct.d.ts +7 -7
- package/dist/Struct.d.ts.map +1 -1
- package/dist/SubscriptionRef.d.ts +1 -2
- package/dist/SubscriptionRef.d.ts.map +1 -1
- package/dist/SubscriptionRef.js +83 -116
- package/dist/SubscriptionRef.js.map +1 -1
- package/dist/Terminal.d.ts +5 -4
- package/dist/Terminal.d.ts.map +1 -1
- package/dist/Terminal.js +2 -2
- package/dist/Terminal.js.map +1 -1
- package/dist/Tracer.d.ts +21 -20
- package/dist/Tracer.d.ts.map +1 -1
- package/dist/Tracer.js +13 -9
- package/dist/Tracer.js.map +1 -1
- package/dist/Trie.d.ts +44 -31
- package/dist/Trie.d.ts.map +1 -1
- package/dist/Trie.js +13 -9
- package/dist/Trie.js.map +1 -1
- package/dist/TxChunk.d.ts +4 -4
- package/dist/TxChunk.d.ts.map +1 -1
- package/dist/TxChunk.js +4 -4
- package/dist/TxChunk.js.map +1 -1
- package/dist/TxDeferred.d.ts +328 -0
- package/dist/TxDeferred.d.ts.map +1 -0
- package/dist/TxDeferred.js +197 -0
- package/dist/TxDeferred.js.map +1 -0
- package/dist/TxHashMap.d.ts +105 -86
- package/dist/TxHashMap.d.ts.map +1 -1
- package/dist/TxHashMap.js +51 -44
- package/dist/TxHashMap.js.map +1 -1
- package/dist/TxHashSet.d.ts +2 -2
- package/dist/TxHashSet.d.ts.map +1 -1
- package/dist/TxHashSet.js +16 -15
- package/dist/TxHashSet.js.map +1 -1
- package/dist/TxPriorityQueue.d.ts +609 -0
- package/dist/TxPriorityQueue.d.ts.map +1 -0
- package/dist/TxPriorityQueue.js +416 -0
- package/dist/TxPriorityQueue.js.map +1 -0
- package/dist/TxPubSub.d.ts +585 -0
- package/dist/TxPubSub.d.ts.map +1 -0
- package/dist/TxPubSub.js +521 -0
- package/dist/TxPubSub.js.map +1 -0
- package/dist/TxQueue.d.ts +1 -1
- package/dist/TxQueue.d.ts.map +1 -1
- package/dist/TxQueue.js +42 -57
- package/dist/TxQueue.js.map +1 -1
- package/dist/TxReentrantLock.d.ts +500 -0
- package/dist/TxReentrantLock.d.ts.map +1 -0
- package/dist/TxReentrantLock.js +481 -0
- package/dist/TxReentrantLock.js.map +1 -0
- package/dist/TxRef.d.ts +14 -20
- package/dist/TxRef.d.ts.map +1 -1
- package/dist/TxRef.js +8 -10
- package/dist/TxRef.js.map +1 -1
- package/dist/TxSemaphore.d.ts +162 -2
- package/dist/TxSemaphore.d.ts.map +1 -1
- package/dist/TxSemaphore.js +25 -10
- package/dist/TxSemaphore.js.map +1 -1
- package/dist/TxSubscriptionRef.d.ts +508 -0
- package/dist/TxSubscriptionRef.d.ts.map +1 -0
- package/dist/TxSubscriptionRef.js +293 -0
- package/dist/TxSubscriptionRef.js.map +1 -0
- package/dist/Types.d.ts +80 -22
- package/dist/Types.d.ts.map +1 -1
- package/dist/Unify.d.ts +8 -2
- package/dist/Unify.d.ts.map +1 -1
- package/dist/Unify.js.map +1 -1
- package/dist/Utils.d.ts +137 -65
- package/dist/Utils.d.ts.map +1 -1
- package/dist/Utils.js +38 -66
- package/dist/Utils.js.map +1 -1
- package/dist/index.d.ts +886 -71
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +886 -71
- package/dist/index.js.map +1 -1
- package/dist/internal/core.js.map +1 -1
- package/dist/internal/dateTime.js +77 -71
- package/dist/internal/dateTime.js.map +1 -1
- package/dist/internal/effect.js +488 -326
- package/dist/internal/effect.js.map +1 -1
- package/dist/internal/hashMap.js +7 -5
- package/dist/internal/hashMap.js.map +1 -1
- package/dist/internal/layer.js +3 -3
- package/dist/internal/layer.js.map +1 -1
- package/dist/internal/option.js +6 -0
- package/dist/internal/option.js.map +1 -1
- package/dist/internal/random.d.ts +2 -0
- package/dist/internal/random.d.ts.map +1 -0
- package/dist/internal/random.js +13 -0
- package/dist/internal/random.js.map +1 -0
- package/dist/internal/rcRef.js +9 -9
- package/dist/internal/rcRef.js.map +1 -1
- package/dist/internal/references.d.ts +2 -0
- package/dist/internal/references.d.ts.map +1 -0
- package/dist/internal/references.js +51 -0
- package/dist/internal/references.js.map +1 -0
- package/dist/internal/request.js +6 -6
- package/dist/internal/request.js.map +1 -1
- package/dist/internal/schedule.js +1 -1
- package/dist/internal/schedule.js.map +1 -1
- package/dist/internal/schema/annotations.js +2 -0
- package/dist/internal/schema/annotations.js.map +1 -1
- package/dist/internal/schema/representation.js +87 -109
- package/dist/internal/schema/representation.js.map +1 -1
- package/dist/internal/schema/schema.d.ts +10 -1
- package/dist/internal/schema/schema.d.ts.map +1 -1
- package/dist/internal/schema/schema.js +59 -1
- package/dist/internal/schema/schema.js.map +1 -1
- package/dist/internal/trie.js +8 -7
- package/dist/internal/trie.js.map +1 -1
- package/dist/testing/TestClock.d.ts +5 -5
- package/dist/testing/TestClock.d.ts.map +1 -1
- package/dist/testing/TestClock.js +2 -2
- package/dist/testing/TestClock.js.map +1 -1
- package/dist/testing/TestSchema.d.ts +267 -33
- package/dist/testing/TestSchema.d.ts.map +1 -1
- package/dist/testing/TestSchema.js +296 -23
- package/dist/testing/TestSchema.js.map +1 -1
- package/dist/testing/index.d.ts +64 -1
- package/dist/testing/index.d.ts.map +1 -1
- package/dist/testing/index.js +64 -1
- package/dist/testing/index.js.map +1 -1
- package/dist/unstable/ai/AiError.d.ts +127 -45
- package/dist/unstable/ai/AiError.d.ts.map +1 -1
- package/dist/unstable/ai/AiError.js +29 -23
- package/dist/unstable/ai/AiError.js.map +1 -1
- package/dist/unstable/ai/AnthropicStructuredOutput.d.ts +1 -1
- package/dist/unstable/ai/AnthropicStructuredOutput.d.ts.map +1 -1
- package/dist/unstable/ai/AnthropicStructuredOutput.js +9 -2
- package/dist/unstable/ai/AnthropicStructuredOutput.js.map +1 -1
- package/dist/unstable/ai/Chat.d.ts +39 -11
- package/dist/unstable/ai/Chat.d.ts.map +1 -1
- package/dist/unstable/ai/Chat.js +40 -47
- package/dist/unstable/ai/Chat.js.map +1 -1
- package/dist/unstable/ai/EmbeddingModel.d.ts +130 -0
- package/dist/unstable/ai/EmbeddingModel.d.ts.map +1 -0
- package/dist/unstable/ai/EmbeddingModel.js +127 -0
- package/dist/unstable/ai/EmbeddingModel.js.map +1 -0
- package/dist/unstable/ai/IdGenerator.d.ts +2 -2
- package/dist/unstable/ai/IdGenerator.d.ts.map +1 -1
- package/dist/unstable/ai/IdGenerator.js +2 -2
- package/dist/unstable/ai/IdGenerator.js.map +1 -1
- package/dist/unstable/ai/LanguageModel.d.ts +119 -49
- package/dist/unstable/ai/LanguageModel.d.ts.map +1 -1
- package/dist/unstable/ai/LanguageModel.js +260 -61
- package/dist/unstable/ai/LanguageModel.js.map +1 -1
- package/dist/unstable/ai/McpSchema.d.ts +207 -112
- package/dist/unstable/ai/McpSchema.d.ts.map +1 -1
- package/dist/unstable/ai/McpSchema.js +71 -19
- package/dist/unstable/ai/McpSchema.js.map +1 -1
- package/dist/unstable/ai/McpServer.d.ts +68 -15
- package/dist/unstable/ai/McpServer.d.ts.map +1 -1
- package/dist/unstable/ai/McpServer.js +225 -73
- package/dist/unstable/ai/McpServer.js.map +1 -1
- package/dist/unstable/ai/Model.d.ts +27 -9
- package/dist/unstable/ai/Model.d.ts.map +1 -1
- package/dist/unstable/ai/Model.js +25 -9
- package/dist/unstable/ai/Model.js.map +1 -1
- package/dist/unstable/ai/OpenAiStructuredOutput.d.ts +1 -1
- package/dist/unstable/ai/OpenAiStructuredOutput.d.ts.map +1 -1
- package/dist/unstable/ai/OpenAiStructuredOutput.js +9 -1
- package/dist/unstable/ai/OpenAiStructuredOutput.js.map +1 -1
- package/dist/unstable/ai/Prompt.d.ts +17 -17
- package/dist/unstable/ai/Prompt.d.ts.map +1 -1
- package/dist/unstable/ai/Prompt.js +6 -9
- package/dist/unstable/ai/Prompt.js.map +1 -1
- package/dist/unstable/ai/Response.d.ts +24 -24
- package/dist/unstable/ai/Response.d.ts.map +1 -1
- package/dist/unstable/ai/Response.js +7 -8
- package/dist/unstable/ai/Response.js.map +1 -1
- package/dist/unstable/ai/ResponseIdTracker.d.ts +38 -0
- package/dist/unstable/ai/ResponseIdTracker.d.ts.map +1 -0
- package/dist/unstable/ai/ResponseIdTracker.js +68 -0
- package/dist/unstable/ai/ResponseIdTracker.js.map +1 -0
- package/dist/unstable/ai/Telemetry.d.ts +35 -2
- package/dist/unstable/ai/Telemetry.d.ts.map +1 -1
- package/dist/unstable/ai/Telemetry.js +2 -2
- package/dist/unstable/ai/Telemetry.js.map +1 -1
- package/dist/unstable/ai/Tokenizer.d.ts +2 -2
- package/dist/unstable/ai/Tokenizer.d.ts.map +1 -1
- package/dist/unstable/ai/Tokenizer.js +2 -2
- package/dist/unstable/ai/Tokenizer.js.map +1 -1
- package/dist/unstable/ai/Tool.d.ts +46 -16
- package/dist/unstable/ai/Tool.d.ts.map +1 -1
- package/dist/unstable/ai/Tool.js +68 -22
- package/dist/unstable/ai/Tool.js.map +1 -1
- package/dist/unstable/ai/Toolkit.d.ts +4 -4
- package/dist/unstable/ai/Toolkit.d.ts.map +1 -1
- package/dist/unstable/ai/Toolkit.js +14 -21
- package/dist/unstable/ai/Toolkit.js.map +1 -1
- package/dist/unstable/ai/index.d.ts +22 -1
- package/dist/unstable/ai/index.d.ts.map +1 -1
- package/dist/unstable/ai/index.js +22 -1
- package/dist/unstable/ai/index.js.map +1 -1
- package/dist/unstable/ai/internal/codec-transformer.js +5 -7
- package/dist/unstable/ai/internal/codec-transformer.js.map +1 -1
- package/dist/unstable/cli/Argument.d.ts +4 -7
- package/dist/unstable/cli/Argument.d.ts.map +1 -1
- package/dist/unstable/cli/Argument.js +1 -3
- package/dist/unstable/cli/Argument.js.map +1 -1
- package/dist/unstable/cli/CliError.d.ts +51 -63
- package/dist/unstable/cli/CliError.d.ts.map +1 -1
- package/dist/unstable/cli/CliError.js +32 -57
- package/dist/unstable/cli/CliError.js.map +1 -1
- package/dist/unstable/cli/CliOutput.d.ts +5 -4
- package/dist/unstable/cli/CliOutput.d.ts.map +1 -1
- package/dist/unstable/cli/CliOutput.js +67 -12
- package/dist/unstable/cli/CliOutput.js.map +1 -1
- package/dist/unstable/cli/Command.d.ts +372 -59
- package/dist/unstable/cli/Command.d.ts.map +1 -1
- package/dist/unstable/cli/Command.js +328 -66
- package/dist/unstable/cli/Command.js.map +1 -1
- package/dist/unstable/cli/Completions.d.ts +97 -0
- package/dist/unstable/cli/Completions.d.ts.map +1 -0
- package/dist/unstable/cli/Completions.js +25 -0
- package/dist/unstable/cli/Completions.js.map +1 -0
- package/dist/unstable/cli/Flag.d.ts +4 -5
- package/dist/unstable/cli/Flag.d.ts.map +1 -1
- package/dist/unstable/cli/Flag.js +1 -1
- package/dist/unstable/cli/Flag.js.map +1 -1
- package/dist/unstable/cli/GlobalFlag.d.ts +125 -0
- package/dist/unstable/cli/GlobalFlag.d.ts.map +1 -0
- package/dist/unstable/cli/GlobalFlag.js +118 -0
- package/dist/unstable/cli/GlobalFlag.js.map +1 -0
- package/dist/unstable/cli/HelpDoc.d.ts +81 -11
- package/dist/unstable/cli/HelpDoc.d.ts.map +1 -1
- package/dist/unstable/cli/Param.d.ts +34 -6
- package/dist/unstable/cli/Param.d.ts.map +1 -1
- package/dist/unstable/cli/Param.js +24 -14
- package/dist/unstable/cli/Param.js.map +1 -1
- package/dist/unstable/cli/Primitive.d.ts +2 -2
- package/dist/unstable/cli/Primitive.d.ts.map +1 -1
- package/dist/unstable/cli/Primitive.js +1 -1
- package/dist/unstable/cli/Primitive.js.map +1 -1
- package/dist/unstable/cli/Prompt.js +266 -86
- package/dist/unstable/cli/Prompt.js.map +1 -1
- package/dist/unstable/cli/index.d.ts +10 -0
- package/dist/unstable/cli/index.d.ts.map +1 -1
- package/dist/unstable/cli/index.js +10 -0
- package/dist/unstable/cli/index.js.map +1 -1
- package/dist/unstable/cli/internal/command.d.ts +41 -15
- package/dist/unstable/cli/internal/command.d.ts.map +1 -1
- package/dist/unstable/cli/internal/command.js +84 -47
- package/dist/unstable/cli/internal/command.js.map +1 -1
- package/dist/unstable/cli/internal/completions/bash.js.map +1 -1
- package/dist/unstable/cli/internal/completions/descriptor.d.ts +2 -0
- package/dist/unstable/cli/internal/completions/descriptor.d.ts.map +1 -0
- package/dist/unstable/cli/internal/completions/{CommandDescriptor.js → descriptor.js} +17 -5
- package/dist/unstable/cli/internal/completions/descriptor.js.map +1 -0
- package/dist/unstable/cli/internal/completions/fish.js.map +1 -1
- package/dist/unstable/cli/internal/completions/zsh.js.map +1 -1
- package/dist/unstable/cli/internal/config.js +42 -0
- package/dist/unstable/cli/internal/config.js.map +1 -1
- package/dist/unstable/cli/internal/help.d.ts +33 -0
- package/dist/unstable/cli/internal/help.d.ts.map +1 -0
- package/dist/unstable/cli/internal/help.js +125 -0
- package/dist/unstable/cli/internal/help.js.map +1 -0
- package/dist/unstable/cli/internal/parser.js +155 -58
- package/dist/unstable/cli/internal/parser.js.map +1 -1
- package/dist/unstable/cluster/ClusterCron.d.ts +1 -1
- package/dist/unstable/cluster/ClusterCron.d.ts.map +1 -1
- package/dist/unstable/cluster/ClusterCron.js +1 -1
- package/dist/unstable/cluster/ClusterCron.js.map +1 -1
- package/dist/unstable/cluster/ClusterError.d.ts +7 -7
- package/dist/unstable/cluster/ClusterSchema.d.ts +28 -7
- package/dist/unstable/cluster/ClusterSchema.d.ts.map +1 -1
- package/dist/unstable/cluster/ClusterSchema.js +28 -8
- package/dist/unstable/cluster/ClusterSchema.js.map +1 -1
- package/dist/unstable/cluster/ClusterWorkflowEngine.d.ts +4 -2
- package/dist/unstable/cluster/ClusterWorkflowEngine.d.ts.map +1 -1
- package/dist/unstable/cluster/ClusterWorkflowEngine.js +96 -63
- package/dist/unstable/cluster/ClusterWorkflowEngine.js.map +1 -1
- package/dist/unstable/cluster/DeliverAt.js +1 -1
- package/dist/unstable/cluster/DeliverAt.js.map +1 -1
- package/dist/unstable/cluster/Entity.d.ts +17 -16
- package/dist/unstable/cluster/Entity.d.ts.map +1 -1
- package/dist/unstable/cluster/Entity.js +31 -25
- package/dist/unstable/cluster/Entity.js.map +1 -1
- package/dist/unstable/cluster/EntityAddress.d.ts +2 -2
- package/dist/unstable/cluster/EntityAddress.d.ts.map +1 -1
- package/dist/unstable/cluster/EntityAddress.js +1 -1
- package/dist/unstable/cluster/EntityAddress.js.map +1 -1
- package/dist/unstable/cluster/EntityProxy.js +3 -3
- package/dist/unstable/cluster/EntityProxy.js.map +1 -1
- package/dist/unstable/cluster/EntityProxyServer.d.ts.map +1 -1
- package/dist/unstable/cluster/EntityProxyServer.js +6 -6
- package/dist/unstable/cluster/EntityProxyServer.js.map +1 -1
- package/dist/unstable/cluster/EntityResource.d.ts +4 -4
- package/dist/unstable/cluster/EntityResource.d.ts.map +1 -1
- package/dist/unstable/cluster/EntityResource.js +2 -2
- package/dist/unstable/cluster/EntityResource.js.map +1 -1
- package/dist/unstable/cluster/Envelope.d.ts +3 -3
- package/dist/unstable/cluster/HttpRunner.js +2 -2
- package/dist/unstable/cluster/HttpRunner.js.map +1 -1
- package/dist/unstable/cluster/K8sHttpClient.d.ts +4 -4
- package/dist/unstable/cluster/K8sHttpClient.d.ts.map +1 -1
- package/dist/unstable/cluster/K8sHttpClient.js +6 -6
- package/dist/unstable/cluster/K8sHttpClient.js.map +1 -1
- package/dist/unstable/cluster/Message.d.ts +16 -10
- package/dist/unstable/cluster/Message.d.ts.map +1 -1
- package/dist/unstable/cluster/Message.js +16 -8
- package/dist/unstable/cluster/Message.js.map +1 -1
- package/dist/unstable/cluster/MessageStorage.d.ts +46 -23
- package/dist/unstable/cluster/MessageStorage.d.ts.map +1 -1
- package/dist/unstable/cluster/MessageStorage.js +40 -25
- package/dist/unstable/cluster/MessageStorage.js.map +1 -1
- package/dist/unstable/cluster/Reply.d.ts +7 -6
- package/dist/unstable/cluster/Reply.d.ts.map +1 -1
- package/dist/unstable/cluster/Reply.js +8 -7
- package/dist/unstable/cluster/Reply.js.map +1 -1
- package/dist/unstable/cluster/Runner.d.ts +1 -1
- package/dist/unstable/cluster/Runner.d.ts.map +1 -1
- package/dist/unstable/cluster/Runner.js +1 -1
- package/dist/unstable/cluster/Runner.js.map +1 -1
- package/dist/unstable/cluster/RunnerAddress.d.ts +1 -1
- package/dist/unstable/cluster/RunnerAddress.d.ts.map +1 -1
- package/dist/unstable/cluster/RunnerAddress.js +1 -1
- package/dist/unstable/cluster/RunnerAddress.js.map +1 -1
- package/dist/unstable/cluster/RunnerHealth.d.ts +2 -2
- package/dist/unstable/cluster/RunnerHealth.d.ts.map +1 -1
- package/dist/unstable/cluster/RunnerHealth.js +2 -2
- package/dist/unstable/cluster/RunnerHealth.js.map +1 -1
- package/dist/unstable/cluster/RunnerServer.d.ts.map +1 -1
- package/dist/unstable/cluster/RunnerServer.js +10 -9
- package/dist/unstable/cluster/RunnerServer.js.map +1 -1
- package/dist/unstable/cluster/RunnerStorage.d.ts +12 -12
- package/dist/unstable/cluster/RunnerStorage.d.ts.map +1 -1
- package/dist/unstable/cluster/RunnerStorage.js +3 -3
- package/dist/unstable/cluster/RunnerStorage.js.map +1 -1
- package/dist/unstable/cluster/Runners.d.ts +5 -4
- package/dist/unstable/cluster/Runners.d.ts.map +1 -1
- package/dist/unstable/cluster/Runners.js +16 -14
- package/dist/unstable/cluster/Runners.js.map +1 -1
- package/dist/unstable/cluster/ShardId.d.ts +35 -49
- package/dist/unstable/cluster/ShardId.d.ts.map +1 -1
- package/dist/unstable/cluster/ShardId.js +65 -67
- package/dist/unstable/cluster/ShardId.js.map +1 -1
- package/dist/unstable/cluster/Sharding.d.ts +4 -4
- package/dist/unstable/cluster/Sharding.d.ts.map +1 -1
- package/dist/unstable/cluster/Sharding.js +59 -49
- package/dist/unstable/cluster/Sharding.js.map +1 -1
- package/dist/unstable/cluster/ShardingConfig.d.ts +28 -27
- package/dist/unstable/cluster/ShardingConfig.d.ts.map +1 -1
- package/dist/unstable/cluster/ShardingConfig.js +27 -27
- package/dist/unstable/cluster/ShardingConfig.js.map +1 -1
- package/dist/unstable/cluster/SingletonAddress.d.ts +2 -2
- package/dist/unstable/cluster/Snowflake.d.ts +2 -2
- package/dist/unstable/cluster/Snowflake.d.ts.map +1 -1
- package/dist/unstable/cluster/Snowflake.js +2 -2
- package/dist/unstable/cluster/Snowflake.js.map +1 -1
- package/dist/unstable/cluster/SqlMessageStorage.d.ts.map +1 -1
- package/dist/unstable/cluster/SqlMessageStorage.js +24 -20
- package/dist/unstable/cluster/SqlMessageStorage.js.map +1 -1
- package/dist/unstable/cluster/SqlRunnerStorage.d.ts.map +1 -1
- package/dist/unstable/cluster/SqlRunnerStorage.js +7 -7
- package/dist/unstable/cluster/SqlRunnerStorage.js.map +1 -1
- package/dist/unstable/cluster/internal/entityManager.js +30 -24
- package/dist/unstable/cluster/internal/entityManager.js.map +1 -1
- package/dist/unstable/cluster/internal/entityReaper.js +2 -2
- package/dist/unstable/cluster/internal/entityReaper.js.map +1 -1
- package/dist/unstable/cluster/internal/resourceMap.js +3 -3
- package/dist/unstable/cluster/internal/resourceMap.js.map +1 -1
- package/dist/unstable/devtools/DevToolsClient.d.ts +2 -2
- package/dist/unstable/devtools/DevToolsClient.d.ts.map +1 -1
- package/dist/unstable/devtools/DevToolsClient.js +9 -8
- package/dist/unstable/devtools/DevToolsClient.js.map +1 -1
- package/dist/unstable/devtools/DevToolsSchema.d.ts +4 -4
- package/dist/unstable/devtools/DevToolsSchema.d.ts.map +1 -1
- package/dist/unstable/devtools/DevToolsSchema.js +9 -2
- package/dist/unstable/devtools/DevToolsSchema.js.map +1 -1
- package/dist/unstable/encoding/Msgpack.d.ts +1 -1
- package/dist/unstable/encoding/Ndjson.d.ts +9 -9
- package/dist/unstable/encoding/Ndjson.d.ts.map +1 -1
- package/dist/unstable/encoding/Ndjson.js.map +1 -1
- package/dist/unstable/encoding/Sse.d.ts +3 -3
- package/dist/unstable/encoding/Sse.d.ts.map +1 -1
- package/dist/unstable/encoding/Sse.js +1 -1
- package/dist/unstable/encoding/Sse.js.map +1 -1
- package/dist/unstable/eventlog/Event.d.ts +0 -6
- package/dist/unstable/eventlog/Event.d.ts.map +1 -1
- package/dist/unstable/eventlog/Event.js +0 -5
- package/dist/unstable/eventlog/Event.js.map +1 -1
- package/dist/unstable/eventlog/EventGroup.d.ts +0 -2
- package/dist/unstable/eventlog/EventGroup.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventGroup.js +0 -2
- package/dist/unstable/eventlog/EventGroup.js.map +1 -1
- package/dist/unstable/eventlog/EventJournal.d.ts +27 -10
- package/dist/unstable/eventlog/EventJournal.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventJournal.js +130 -71
- package/dist/unstable/eventlog/EventJournal.js.map +1 -1
- package/dist/unstable/eventlog/EventLog.d.ts +94 -37
- package/dist/unstable/eventlog/EventLog.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLog.js +225 -151
- package/dist/unstable/eventlog/EventLog.js.map +1 -1
- package/dist/unstable/eventlog/EventLogEncryption.d.ts +11 -9
- package/dist/unstable/eventlog/EventLogEncryption.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogEncryption.js +15 -17
- package/dist/unstable/eventlog/EventLogEncryption.js.map +1 -1
- package/dist/unstable/eventlog/EventLogMessage.d.ts +228 -0
- package/dist/unstable/eventlog/EventLogMessage.d.ts.map +1 -0
- package/dist/unstable/eventlog/EventLogMessage.js +214 -0
- package/dist/unstable/eventlog/EventLogMessage.js.map +1 -0
- package/dist/unstable/eventlog/EventLogRemote.d.ts +112 -194
- package/dist/unstable/eventlog/EventLogRemote.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogRemote.js +168 -322
- package/dist/unstable/eventlog/EventLogRemote.js.map +1 -1
- package/dist/unstable/eventlog/EventLogServer.d.ts +26 -48
- package/dist/unstable/eventlog/EventLogServer.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogServer.js +128 -199
- package/dist/unstable/eventlog/EventLogServer.js.map +1 -1
- package/dist/unstable/eventlog/EventLogServerEncrypted.d.ts +60 -0
- package/dist/unstable/eventlog/EventLogServerEncrypted.d.ts.map +1 -0
- package/dist/unstable/eventlog/EventLogServerEncrypted.js +166 -0
- package/dist/unstable/eventlog/EventLogServerEncrypted.js.map +1 -0
- package/dist/unstable/eventlog/EventLogServerUnencrypted.d.ts +183 -0
- package/dist/unstable/eventlog/EventLogServerUnencrypted.d.ts.map +1 -0
- package/dist/unstable/eventlog/EventLogServerUnencrypted.js +461 -0
- package/dist/unstable/eventlog/EventLogServerUnencrypted.js.map +1 -0
- package/dist/unstable/eventlog/EventLogSessionAuth.d.ts +117 -0
- package/dist/unstable/eventlog/EventLogSessionAuth.d.ts.map +1 -0
- package/dist/unstable/eventlog/EventLogSessionAuth.js +284 -0
- package/dist/unstable/eventlog/EventLogSessionAuth.js.map +1 -0
- package/dist/unstable/eventlog/{SqlEventLogJournal.d.ts → SqlEventJournal.d.ts} +2 -2
- package/dist/unstable/eventlog/SqlEventJournal.d.ts.map +1 -0
- package/dist/unstable/eventlog/{SqlEventLogJournal.js → SqlEventJournal.js} +28 -21
- package/dist/unstable/eventlog/SqlEventJournal.js.map +1 -0
- package/dist/unstable/eventlog/{SqlEventLogServer.d.ts → SqlEventLogServerEncrypted.d.ts} +5 -5
- package/dist/unstable/eventlog/SqlEventLogServerEncrypted.d.ts.map +1 -0
- package/dist/unstable/eventlog/{SqlEventLogServer.js → SqlEventLogServerEncrypted.js} +69 -27
- package/dist/unstable/eventlog/SqlEventLogServerEncrypted.js.map +1 -0
- package/dist/unstable/eventlog/SqlEventLogServerUnencrypted.d.ts +25 -0
- package/dist/unstable/eventlog/SqlEventLogServerUnencrypted.d.ts.map +1 -0
- package/dist/unstable/eventlog/SqlEventLogServerUnencrypted.js +355 -0
- package/dist/unstable/eventlog/SqlEventLogServerUnencrypted.js.map +1 -0
- package/dist/unstable/eventlog/index.d.ts +22 -2
- package/dist/unstable/eventlog/index.d.ts.map +1 -1
- package/dist/unstable/eventlog/index.js +22 -2
- package/dist/unstable/eventlog/index.js.map +1 -1
- package/dist/unstable/eventlog/internal/identityRootSecretDerivation.d.ts +2 -0
- package/dist/unstable/eventlog/internal/identityRootSecretDerivation.d.ts.map +1 -0
- package/dist/unstable/eventlog/internal/identityRootSecretDerivation.js +89 -0
- package/dist/unstable/eventlog/internal/identityRootSecretDerivation.js.map +1 -0
- package/dist/unstable/http/Cookies.d.ts +51 -6
- package/dist/unstable/http/Cookies.d.ts.map +1 -1
- package/dist/unstable/http/Cookies.js +27 -6
- package/dist/unstable/http/Cookies.js.map +1 -1
- package/dist/unstable/http/Etag.d.ts +2 -2
- package/dist/unstable/http/Etag.d.ts.map +1 -1
- package/dist/unstable/http/Etag.js +7 -3
- package/dist/unstable/http/Etag.js.map +1 -1
- package/dist/unstable/http/FetchHttpClient.d.ts +6 -3
- package/dist/unstable/http/FetchHttpClient.d.ts.map +1 -1
- package/dist/unstable/http/FetchHttpClient.js +5 -5
- package/dist/unstable/http/FetchHttpClient.js.map +1 -1
- package/dist/unstable/http/Headers.d.ts +24 -4
- package/dist/unstable/http/Headers.d.ts.map +1 -1
- package/dist/unstable/http/Headers.js +42 -13
- package/dist/unstable/http/Headers.js.map +1 -1
- package/dist/unstable/http/HttpBody.d.ts +1 -1
- package/dist/unstable/http/HttpClient.d.ts +125 -21
- package/dist/unstable/http/HttpClient.d.ts.map +1 -1
- package/dist/unstable/http/HttpClient.js +197 -19
- package/dist/unstable/http/HttpClient.js.map +1 -1
- package/dist/unstable/http/HttpClientError.d.ts +8 -8
- package/dist/unstable/http/HttpClientRequest.d.ts +43 -15
- package/dist/unstable/http/HttpClientRequest.d.ts.map +1 -1
- package/dist/unstable/http/HttpClientRequest.js +131 -21
- package/dist/unstable/http/HttpClientRequest.js.map +1 -1
- package/dist/unstable/http/HttpClientResponse.d.ts +2 -1
- package/dist/unstable/http/HttpClientResponse.d.ts.map +1 -1
- package/dist/unstable/http/HttpClientResponse.js +18 -3
- package/dist/unstable/http/HttpClientResponse.js.map +1 -1
- package/dist/unstable/http/HttpEffect.d.ts +13 -11
- package/dist/unstable/http/HttpEffect.d.ts.map +1 -1
- package/dist/unstable/http/HttpEffect.js +51 -51
- package/dist/unstable/http/HttpEffect.js.map +1 -1
- package/dist/unstable/http/HttpIncomingMessage.d.ts +5 -4
- package/dist/unstable/http/HttpIncomingMessage.d.ts.map +1 -1
- package/dist/unstable/http/HttpIncomingMessage.js +6 -10
- package/dist/unstable/http/HttpIncomingMessage.js.map +1 -1
- package/dist/unstable/http/HttpMethod.d.ts +4 -4
- package/dist/unstable/http/HttpMethod.d.ts.map +1 -1
- package/dist/unstable/http/HttpMethod.js +3 -3
- package/dist/unstable/http/HttpMethod.js.map +1 -1
- package/dist/unstable/http/HttpMiddleware.d.ts +4 -9
- package/dist/unstable/http/HttpMiddleware.d.ts.map +1 -1
- package/dist/unstable/http/HttpMiddleware.js +47 -43
- package/dist/unstable/http/HttpMiddleware.js.map +1 -1
- package/dist/unstable/http/HttpPlatform.d.ts +2 -2
- package/dist/unstable/http/HttpPlatform.d.ts.map +1 -1
- package/dist/unstable/http/HttpPlatform.js +5 -4
- package/dist/unstable/http/HttpPlatform.js.map +1 -1
- package/dist/unstable/http/HttpRouter.d.ts +9 -8
- package/dist/unstable/http/HttpRouter.d.ts.map +1 -1
- package/dist/unstable/http/HttpRouter.js +36 -36
- package/dist/unstable/http/HttpRouter.js.map +1 -1
- package/dist/unstable/http/HttpServer.d.ts +2 -2
- package/dist/unstable/http/HttpServer.d.ts.map +1 -1
- package/dist/unstable/http/HttpServer.js +4 -4
- package/dist/unstable/http/HttpServer.js.map +1 -1
- package/dist/unstable/http/HttpServerError.d.ts +22 -34
- package/dist/unstable/http/HttpServerError.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerError.js +39 -45
- package/dist/unstable/http/HttpServerError.js.map +1 -1
- package/dist/unstable/http/HttpServerRequest.d.ts +19 -7
- package/dist/unstable/http/HttpServerRequest.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerRequest.js +307 -13
- package/dist/unstable/http/HttpServerRequest.js.map +1 -1
- package/dist/unstable/http/HttpServerRespondable.d.ts +2 -2
- package/dist/unstable/http/HttpServerRespondable.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerRespondable.js +5 -5
- package/dist/unstable/http/HttpServerRespondable.js.map +1 -1
- package/dist/unstable/http/HttpServerResponse.d.ts +52 -5
- package/dist/unstable/http/HttpServerResponse.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerResponse.js +240 -5
- package/dist/unstable/http/HttpServerResponse.js.map +1 -1
- package/dist/unstable/http/HttpStaticServer.d.ts +69 -0
- package/dist/unstable/http/HttpStaticServer.d.ts.map +1 -0
- package/dist/unstable/http/HttpStaticServer.js +353 -0
- package/dist/unstable/http/HttpStaticServer.js.map +1 -0
- package/dist/unstable/http/HttpTraceContext.d.ts +3 -2
- package/dist/unstable/http/HttpTraceContext.d.ts.map +1 -1
- package/dist/unstable/http/HttpTraceContext.js +27 -15
- package/dist/unstable/http/HttpTraceContext.js.map +1 -1
- package/dist/unstable/http/Multipart.d.ts +7 -7
- package/dist/unstable/http/Multipart.d.ts.map +1 -1
- package/dist/unstable/http/Multipart.js +7 -7
- package/dist/unstable/http/Multipart.js.map +1 -1
- package/dist/unstable/http/Url.d.ts +604 -0
- package/dist/unstable/http/Url.d.ts.map +1 -0
- package/dist/unstable/http/Url.js +256 -0
- package/dist/unstable/http/Url.js.map +1 -0
- package/dist/unstable/http/UrlParams.d.ts +18 -9
- package/dist/unstable/http/UrlParams.d.ts.map +1 -1
- package/dist/unstable/http/UrlParams.js +6 -7
- package/dist/unstable/http/UrlParams.js.map +1 -1
- package/dist/unstable/http/index.d.ts +8 -0
- package/dist/unstable/http/index.d.ts.map +1 -1
- package/dist/unstable/http/index.js +8 -0
- package/dist/unstable/http/index.js.map +1 -1
- package/dist/unstable/http/internal/preResponseHandler.d.ts +2 -0
- package/dist/unstable/http/internal/preResponseHandler.d.ts.map +1 -0
- package/dist/unstable/http/internal/preResponseHandler.js +10 -0
- package/dist/unstable/http/internal/preResponseHandler.js.map +1 -0
- package/dist/unstable/httpapi/HttpApi.d.ts +11 -11
- package/dist/unstable/httpapi/HttpApi.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApi.js +8 -8
- package/dist/unstable/httpapi/HttpApi.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiBuilder.d.ts +12 -9
- package/dist/unstable/httpapi/HttpApiBuilder.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiBuilder.js +59 -40
- package/dist/unstable/httpapi/HttpApiBuilder.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiClient.d.ts +82 -7
- package/dist/unstable/httpapi/HttpApiClient.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiClient.js +79 -11
- package/dist/unstable/httpapi/HttpApiClient.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiEndpoint.d.ts +210 -105
- package/dist/unstable/httpapi/HttpApiEndpoint.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiEndpoint.js +52 -47
- package/dist/unstable/httpapi/HttpApiEndpoint.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiError.d.ts +66 -29
- package/dist/unstable/httpapi/HttpApiError.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiError.js +138 -32
- package/dist/unstable/httpapi/HttpApiError.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiGroup.d.ts +9 -8
- package/dist/unstable/httpapi/HttpApiGroup.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiGroup.js +4 -4
- package/dist/unstable/httpapi/HttpApiGroup.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiMiddleware.d.ts +49 -17
- package/dist/unstable/httpapi/HttpApiMiddleware.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiMiddleware.js +38 -8
- package/dist/unstable/httpapi/HttpApiMiddleware.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiSchema.d.ts +88 -9
- package/dist/unstable/httpapi/HttpApiSchema.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiSchema.js +86 -11
- package/dist/unstable/httpapi/HttpApiSchema.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiSecurity.d.ts +9 -6
- package/dist/unstable/httpapi/HttpApiSecurity.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiSecurity.js +6 -6
- package/dist/unstable/httpapi/HttpApiSecurity.js.map +1 -1
- package/dist/unstable/httpapi/OpenApi.d.ts +17 -25
- package/dist/unstable/httpapi/OpenApi.d.ts.map +1 -1
- package/dist/unstable/httpapi/OpenApi.js +59 -60
- package/dist/unstable/httpapi/OpenApi.js.map +1 -1
- package/dist/unstable/observability/Otlp.d.ts +12 -12
- package/dist/unstable/observability/Otlp.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpExporter.d.ts +2 -2
- package/dist/unstable/observability/OtlpExporter.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpExporter.js +8 -8
- package/dist/unstable/observability/OtlpExporter.js.map +1 -1
- package/dist/unstable/observability/OtlpLogger.d.ts +4 -4
- package/dist/unstable/observability/OtlpLogger.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpLogger.js +7 -4
- package/dist/unstable/observability/OtlpLogger.js.map +1 -1
- package/dist/unstable/observability/OtlpMetrics.d.ts +4 -4
- package/dist/unstable/observability/OtlpMetrics.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpMetrics.js +2 -2
- package/dist/unstable/observability/OtlpMetrics.js.map +1 -1
- package/dist/unstable/observability/OtlpSerialization.d.ts +2 -2
- package/dist/unstable/observability/OtlpSerialization.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpSerialization.js +2 -2
- package/dist/unstable/observability/OtlpSerialization.js.map +1 -1
- package/dist/unstable/observability/OtlpTracer.d.ts +4 -4
- package/dist/unstable/observability/OtlpTracer.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpTracer.js +7 -3
- package/dist/unstable/observability/OtlpTracer.js.map +1 -1
- package/dist/unstable/observability/PrometheusMetrics.d.ts +3 -3
- package/dist/unstable/observability/PrometheusMetrics.d.ts.map +1 -1
- package/dist/unstable/observability/PrometheusMetrics.js +4 -33
- package/dist/unstable/observability/PrometheusMetrics.js.map +1 -1
- package/dist/unstable/observability/internal/protobuf.js +4 -4
- package/dist/unstable/observability/internal/protobuf.js.map +1 -1
- package/dist/unstable/persistence/KeyValueStore.d.ts +24 -3
- package/dist/unstable/persistence/KeyValueStore.d.ts.map +1 -1
- package/dist/unstable/persistence/KeyValueStore.js +144 -2
- package/dist/unstable/persistence/KeyValueStore.js.map +1 -1
- package/dist/unstable/persistence/Persistable.d.ts +2 -2
- package/dist/unstable/persistence/Persistable.d.ts.map +1 -1
- package/dist/unstable/persistence/Persistable.js +1 -1
- package/dist/unstable/persistence/Persistable.js.map +1 -1
- package/dist/unstable/persistence/PersistedCache.d.ts +1 -2
- package/dist/unstable/persistence/PersistedCache.d.ts.map +1 -1
- package/dist/unstable/persistence/PersistedCache.js +10 -11
- package/dist/unstable/persistence/PersistedCache.js.map +1 -1
- package/dist/unstable/persistence/PersistedQueue.d.ts +16 -16
- package/dist/unstable/persistence/PersistedQueue.d.ts.map +1 -1
- package/dist/unstable/persistence/PersistedQueue.js +9 -9
- package/dist/unstable/persistence/PersistedQueue.js.map +1 -1
- package/dist/unstable/persistence/Persistence.d.ts +5 -5
- package/dist/unstable/persistence/Persistence.d.ts.map +1 -1
- package/dist/unstable/persistence/Persistence.js +5 -5
- package/dist/unstable/persistence/Persistence.js.map +1 -1
- package/dist/unstable/persistence/RateLimiter.d.ts +9 -9
- package/dist/unstable/persistence/RateLimiter.d.ts.map +1 -1
- package/dist/unstable/persistence/RateLimiter.js +4 -4
- package/dist/unstable/persistence/RateLimiter.js.map +1 -1
- package/dist/unstable/persistence/Redis.d.ts +3 -3
- package/dist/unstable/persistence/Redis.d.ts.map +1 -1
- package/dist/unstable/persistence/Redis.js +2 -2
- package/dist/unstable/persistence/Redis.js.map +1 -1
- package/dist/unstable/process/ChildProcess.d.ts +5 -128
- package/dist/unstable/process/ChildProcess.d.ts.map +1 -1
- package/dist/unstable/process/ChildProcess.js +1 -65
- package/dist/unstable/process/ChildProcess.js.map +1 -1
- package/dist/unstable/process/ChildProcessSpawner.d.ts +83 -8
- package/dist/unstable/process/ChildProcessSpawner.d.ts.map +1 -1
- package/dist/unstable/process/ChildProcessSpawner.js +22 -2
- package/dist/unstable/process/ChildProcessSpawner.js.map +1 -1
- package/dist/unstable/reactivity/AsyncResult.d.ts +37 -17
- package/dist/unstable/reactivity/AsyncResult.d.ts.map +1 -1
- package/dist/unstable/reactivity/AsyncResult.js +9 -0
- package/dist/unstable/reactivity/AsyncResult.js.map +1 -1
- package/dist/unstable/reactivity/Atom.d.ts +108 -47
- package/dist/unstable/reactivity/Atom.d.ts.map +1 -1
- package/dist/unstable/reactivity/Atom.js +105 -25
- package/dist/unstable/reactivity/Atom.js.map +1 -1
- package/dist/unstable/reactivity/AtomHttpApi.d.ts +25 -20
- package/dist/unstable/reactivity/AtomHttpApi.d.ts.map +1 -1
- package/dist/unstable/reactivity/AtomHttpApi.js +58 -26
- package/dist/unstable/reactivity/AtomHttpApi.js.map +1 -1
- package/dist/unstable/reactivity/AtomRegistry.d.ts +8 -2
- package/dist/unstable/reactivity/AtomRegistry.d.ts.map +1 -1
- package/dist/unstable/reactivity/AtomRegistry.js +57 -14
- package/dist/unstable/reactivity/AtomRegistry.js.map +1 -1
- package/dist/unstable/reactivity/AtomRpc.d.ts +12 -12
- package/dist/unstable/reactivity/AtomRpc.d.ts.map +1 -1
- package/dist/unstable/reactivity/AtomRpc.js +59 -31
- package/dist/unstable/reactivity/AtomRpc.js.map +1 -1
- package/dist/unstable/reactivity/Reactivity.d.ts +2 -2
- package/dist/unstable/reactivity/Reactivity.d.ts.map +1 -1
- package/dist/unstable/reactivity/Reactivity.js +6 -6
- package/dist/unstable/reactivity/Reactivity.js.map +1 -1
- package/dist/unstable/rpc/Rpc.d.ts +137 -19
- package/dist/unstable/rpc/Rpc.d.ts.map +1 -1
- package/dist/unstable/rpc/Rpc.js +99 -7
- package/dist/unstable/rpc/Rpc.js.map +1 -1
- package/dist/unstable/rpc/RpcClient.d.ts +26 -47
- package/dist/unstable/rpc/RpcClient.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcClient.js +117 -75
- package/dist/unstable/rpc/RpcClient.js.map +1 -1
- package/dist/unstable/rpc/RpcClientError.d.ts +2 -2
- package/dist/unstable/rpc/RpcGroup.d.ts +15 -11
- package/dist/unstable/rpc/RpcGroup.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcGroup.js +30 -20
- package/dist/unstable/rpc/RpcGroup.js.map +1 -1
- package/dist/unstable/rpc/RpcMiddleware.d.ts +12 -12
- package/dist/unstable/rpc/RpcMiddleware.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcMiddleware.js +5 -5
- package/dist/unstable/rpc/RpcMiddleware.js.map +1 -1
- package/dist/unstable/rpc/RpcSchema.d.ts +14 -1
- package/dist/unstable/rpc/RpcSchema.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcSchema.js +17 -2
- package/dist/unstable/rpc/RpcSchema.js.map +1 -1
- package/dist/unstable/rpc/RpcSerialization.d.ts +13 -2
- package/dist/unstable/rpc/RpcSerialization.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcSerialization.js +60 -27
- package/dist/unstable/rpc/RpcSerialization.js.map +1 -1
- package/dist/unstable/rpc/RpcServer.d.ts +8 -12
- package/dist/unstable/rpc/RpcServer.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcServer.js +73 -43
- package/dist/unstable/rpc/RpcServer.js.map +1 -1
- package/dist/unstable/rpc/RpcWorker.d.ts +2 -2
- package/dist/unstable/rpc/RpcWorker.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcWorker.js +4 -4
- package/dist/unstable/rpc/RpcWorker.js.map +1 -1
- package/dist/unstable/rpc/Utils.d.ts +6 -3
- package/dist/unstable/rpc/Utils.d.ts.map +1 -1
- package/dist/unstable/rpc/Utils.js +46 -5
- package/dist/unstable/rpc/Utils.js.map +1 -1
- package/dist/unstable/schema/Model.d.ts +24 -3
- package/dist/unstable/schema/Model.d.ts.map +1 -1
- package/dist/unstable/schema/Model.js +17 -4
- package/dist/unstable/schema/Model.js.map +1 -1
- package/dist/unstable/schema/VariantSchema.d.ts +7 -7
- package/dist/unstable/schema/VariantSchema.d.ts.map +1 -1
- package/dist/unstable/schema/VariantSchema.js +7 -18
- package/dist/unstable/schema/VariantSchema.js.map +1 -1
- package/dist/unstable/socket/Socket.d.ts +35 -15
- package/dist/unstable/socket/Socket.d.ts.map +1 -1
- package/dist/unstable/socket/Socket.js +34 -27
- package/dist/unstable/socket/Socket.js.map +1 -1
- package/dist/unstable/socket/SocketServer.d.ts +8 -5
- package/dist/unstable/socket/SocketServer.d.ts.map +1 -1
- package/dist/unstable/socket/SocketServer.js +2 -2
- package/dist/unstable/socket/SocketServer.js.map +1 -1
- package/dist/unstable/sql/Migrator.d.ts +1 -1
- package/dist/unstable/sql/Migrator.d.ts.map +1 -1
- package/dist/unstable/sql/Migrator.js +2 -2
- package/dist/unstable/sql/Migrator.js.map +1 -1
- package/dist/unstable/sql/SqlClient.d.ts +24 -6
- package/dist/unstable/sql/SqlClient.d.ts.map +1 -1
- package/dist/unstable/sql/SqlClient.js +37 -32
- package/dist/unstable/sql/SqlClient.js.map +1 -1
- package/dist/unstable/sql/SqlConnection.d.ts +2 -2
- package/dist/unstable/sql/SqlConnection.d.ts.map +1 -1
- package/dist/unstable/sql/SqlConnection.js +5 -2
- package/dist/unstable/sql/SqlConnection.js.map +1 -1
- package/dist/unstable/sql/SqlError.d.ts +237 -17
- package/dist/unstable/sql/SqlError.d.ts.map +1 -1
- package/dist/unstable/sql/SqlError.js +260 -4
- package/dist/unstable/sql/SqlError.js.map +1 -1
- package/dist/unstable/sql/SqlModel.d.ts +8 -9
- package/dist/unstable/sql/SqlModel.d.ts.map +1 -1
- package/dist/unstable/sql/SqlModel.js +12 -38
- package/dist/unstable/sql/SqlModel.js.map +1 -1
- package/dist/unstable/sql/SqlResolver.js +24 -17
- package/dist/unstable/sql/SqlResolver.js.map +1 -1
- package/dist/unstable/sql/SqlSchema.d.ts +17 -6
- package/dist/unstable/sql/SqlSchema.d.ts.map +1 -1
- package/dist/unstable/sql/SqlSchema.js +17 -7
- package/dist/unstable/sql/SqlSchema.js.map +1 -1
- package/dist/unstable/sql/Statement.d.ts +3 -5
- package/dist/unstable/sql/Statement.d.ts.map +1 -1
- package/dist/unstable/sql/Statement.js +14 -13
- package/dist/unstable/sql/Statement.js.map +1 -1
- package/dist/unstable/workers/Transferable.d.ts +4 -4
- package/dist/unstable/workers/Transferable.d.ts.map +1 -1
- package/dist/unstable/workers/Transferable.js +7 -7
- package/dist/unstable/workers/Transferable.js.map +1 -1
- package/dist/unstable/workers/Worker.d.ts +3 -3
- package/dist/unstable/workers/Worker.d.ts.map +1 -1
- package/dist/unstable/workers/Worker.js +6 -3
- package/dist/unstable/workers/Worker.js.map +1 -1
- package/dist/unstable/workers/WorkerError.d.ts +5 -5
- package/dist/unstable/workers/WorkerRunner.d.ts +2 -2
- package/dist/unstable/workers/WorkerRunner.d.ts.map +1 -1
- package/dist/unstable/workers/WorkerRunner.js +5 -2
- package/dist/unstable/workers/WorkerRunner.js.map +1 -1
- package/dist/unstable/workflow/Activity.d.ts +8 -3
- package/dist/unstable/workflow/Activity.d.ts.map +1 -1
- package/dist/unstable/workflow/Activity.js +25 -11
- package/dist/unstable/workflow/Activity.js.map +1 -1
- package/dist/unstable/workflow/DurableClock.d.ts +3 -6
- package/dist/unstable/workflow/DurableClock.d.ts.map +1 -1
- package/dist/unstable/workflow/DurableClock.js +6 -6
- package/dist/unstable/workflow/DurableClock.js.map +1 -1
- package/dist/unstable/workflow/DurableDeferred.d.ts +2 -5
- package/dist/unstable/workflow/DurableDeferred.d.ts.map +1 -1
- package/dist/unstable/workflow/DurableDeferred.js +33 -15
- package/dist/unstable/workflow/DurableDeferred.js.map +1 -1
- package/dist/unstable/workflow/Workflow.d.ts +12 -14
- package/dist/unstable/workflow/Workflow.d.ts.map +1 -1
- package/dist/unstable/workflow/Workflow.js +30 -26
- package/dist/unstable/workflow/Workflow.js.map +1 -1
- package/dist/unstable/workflow/WorkflowEngine.d.ts +24 -7
- package/dist/unstable/workflow/WorkflowEngine.d.ts.map +1 -1
- package/dist/unstable/workflow/WorkflowEngine.js +165 -16
- package/dist/unstable/workflow/WorkflowEngine.js.map +1 -1
- package/dist/unstable/workflow/WorkflowProxyServer.d.ts.map +1 -1
- package/dist/unstable/workflow/WorkflowProxyServer.js +4 -4
- package/dist/unstable/workflow/WorkflowProxyServer.js.map +1 -1
- package/package.json +11 -10
- package/src/Array.ts +304 -447
- package/src/BigDecimal.ts +137 -82
- package/src/BigInt.ts +53 -45
- package/src/Brand.ts +3 -5
- package/src/Cache.ts +27 -54
- package/src/Cause.ts +57 -22
- package/src/Channel.ts +687 -220
- package/src/Chunk.ts +149 -331
- package/src/Clock.ts +2 -2
- package/src/Combiner.ts +280 -13
- package/src/Config.ts +214 -52
- package/src/ConfigProvider.ts +5 -5
- package/src/Console.ts +2 -2
- package/src/Context.ts +1454 -0
- package/src/Cron.ts +155 -63
- package/src/Data.ts +530 -368
- package/src/DateTime.ts +77 -258
- package/src/Deferred.ts +15 -6
- package/src/Duration.ts +151 -81
- package/src/Effect.ts +1581 -1050
- package/src/Effectable.ts +47 -0
- package/src/Equal.ts +293 -109
- package/src/Equivalence.ts +114 -52
- package/src/ErrorReporter.ts +458 -0
- package/src/ExecutionPlan.ts +8 -9
- package/src/Exit.ts +24 -12
- package/src/Fiber.ts +17 -8
- package/src/FiberHandle.ts +15 -14
- package/src/FiberMap.ts +27 -27
- package/src/FiberSet.ts +5 -5
- package/src/FileSystem.ts +30 -26
- package/src/Filter.ts +4 -62
- package/src/Formatter.ts +268 -60
- package/src/Function.ts +2 -10
- package/src/Graph.ts +123 -112
- package/src/Hash.ts +2 -2
- package/src/HashMap.ts +26 -19
- package/src/Inspectable.ts +2 -22
- package/src/Iterable.ts +117 -63
- package/src/JsonSchema.ts +383 -10
- package/src/Latch.ts +85 -3
- package/src/Layer.ts +728 -441
- package/src/LayerMap.ts +38 -35
- package/src/LogLevel.ts +37 -0
- package/src/Logger.ts +35 -102
- package/src/ManagedRuntime.ts +61 -48
- package/src/Metric.ts +64 -66
- package/src/MutableHashMap.ts +9 -0
- package/src/MutableHashSet.ts +9 -0
- package/src/MutableList.ts +3 -0
- package/src/Newtype.ts +308 -0
- package/src/Number.ts +98 -29
- package/src/Optic.ts +948 -19
- package/src/Option.ts +34 -24
- package/src/Order.ts +39 -32
- package/src/PartitionedSemaphore.ts +414 -0
- package/src/Path.ts +2 -2
- package/src/Pool.ts +9 -9
- package/src/Predicate.ts +1 -1
- package/src/PubSub.ts +20 -11
- package/src/Pull.ts +1 -1
- package/src/Queue.ts +11 -9
- package/src/Random.ts +51 -14
- package/src/RcMap.ts +19 -19
- package/src/RcRef.ts +1 -1
- package/src/Record.ts +94 -199
- package/src/Redactable.ts +146 -72
- package/src/Reducer.ts +166 -7
- package/src/References.ts +283 -287
- package/src/Request.ts +5 -5
- package/src/RequestResolver.ts +34 -35
- package/src/Resource.ts +6 -5
- package/src/Result.ts +2 -4
- package/src/Runtime.ts +102 -6
- package/src/Schedule.ts +243 -336
- package/src/Scheduler.ts +52 -129
- package/src/Schema.ts +3769 -597
- package/src/SchemaAST.ts +480 -302
- package/src/SchemaGetter.ts +80 -24
- package/src/SchemaIssue.ts +28 -15
- package/src/SchemaParser.ts +100 -29
- package/src/SchemaRepresentation.ts +57 -33
- package/src/SchemaTransformation.ts +321 -32
- package/src/Scope.ts +2 -2
- package/src/ScopedCache.ts +8 -8
- package/src/Semaphore.ts +268 -182
- package/src/Sink.ts +89 -34
- package/src/Stdio.ts +29 -6
- package/src/Stream.ts +908 -752
- package/src/String.ts +122 -69
- package/src/Struct.ts +7 -7
- package/src/SubscriptionRef.ts +98 -118
- package/src/Terminal.ts +5 -4
- package/src/Tracer.ts +23 -22
- package/src/Trie.ts +44 -31
- package/src/TxChunk.ts +26 -16
- package/src/TxDeferred.ts +391 -0
- package/src/TxHashMap.ts +347 -291
- package/src/TxHashSet.ts +54 -61
- package/src/TxPriorityQueue.ts +762 -0
- package/src/TxPubSub.ts +787 -0
- package/src/TxQueue.ts +221 -245
- package/src/TxReentrantLock.ts +729 -0
- package/src/TxRef.ts +31 -31
- package/src/TxSemaphore.ts +203 -31
- package/src/TxSubscriptionRef.ts +637 -0
- package/src/Types.ts +75 -23
- package/src/Unify.ts +26 -2
- package/src/Utils.ts +137 -111
- package/src/index.ts +896 -73
- package/src/internal/core.ts +9 -10
- package/src/internal/dateTime.ts +91 -96
- package/src/internal/effect.ts +1168 -621
- package/src/internal/hashMap.ts +12 -10
- package/src/internal/layer.ts +7 -7
- package/src/internal/option.ts +7 -0
- package/src/internal/random.ts +20 -0
- package/src/internal/rcRef.ts +12 -12
- package/src/internal/references.ts +72 -0
- package/src/internal/request.ts +8 -8
- package/src/internal/schedule.ts +3 -1
- package/src/internal/schema/annotations.ts +2 -0
- package/src/internal/schema/representation.ts +82 -97
- package/src/internal/schema/schema.ts +68 -1
- package/src/internal/trie.ts +21 -15
- package/src/testing/TestClock.ts +6 -6
- package/src/testing/TestSchema.ts +333 -36
- package/src/testing/index.ts +64 -1
- package/src/unstable/ai/AiError.ts +111 -53
- package/src/unstable/ai/AnthropicStructuredOutput.ts +7 -3
- package/src/unstable/ai/Chat.ts +136 -88
- package/src/unstable/ai/EmbeddingModel.ts +209 -0
- package/src/unstable/ai/IdGenerator.ts +2 -2
- package/src/unstable/ai/LanguageModel.ts +685 -255
- package/src/unstable/ai/McpSchema.ts +84 -22
- package/src/unstable/ai/McpServer.ts +307 -87
- package/src/unstable/ai/Model.ts +44 -13
- package/src/unstable/ai/OpenAiStructuredOutput.ts +9 -2
- package/src/unstable/ai/Prompt.ts +23 -29
- package/src/unstable/ai/Response.ts +29 -31
- package/src/unstable/ai/ResponseIdTracker.ts +95 -0
- package/src/unstable/ai/Telemetry.ts +2 -2
- package/src/unstable/ai/Tokenizer.ts +2 -2
- package/src/unstable/ai/Tool.ts +62 -36
- package/src/unstable/ai/Toolkit.ts +17 -26
- package/src/unstable/ai/index.ts +24 -1
- package/src/unstable/ai/internal/codec-transformer.ts +3 -9
- package/src/unstable/cli/Argument.ts +5 -8
- package/src/unstable/cli/CliError.ts +67 -66
- package/src/unstable/cli/CliOutput.ts +87 -15
- package/src/unstable/cli/Command.ts +808 -193
- package/src/unstable/cli/Completions.ts +107 -0
- package/src/unstable/cli/Flag.ts +5 -6
- package/src/unstable/cli/GlobalFlag.ts +242 -0
- package/src/unstable/cli/HelpDoc.ts +91 -11
- package/src/unstable/cli/Param.ts +54 -27
- package/src/unstable/cli/Primitive.ts +2 -2
- package/src/unstable/cli/Prompt.ts +275 -104
- package/src/unstable/cli/index.ts +12 -0
- package/src/unstable/cli/internal/command.ts +125 -64
- package/src/unstable/cli/internal/completions/bash.ts +7 -7
- package/src/unstable/cli/internal/completions/{CommandDescriptor.ts → descriptor.ts} +16 -58
- package/src/unstable/cli/internal/completions/fish.ts +7 -7
- package/src/unstable/cli/internal/completions/zsh.ts +8 -14
- package/src/unstable/cli/internal/config.ts +49 -0
- package/src/unstable/cli/internal/help.ts +171 -0
- package/src/unstable/cli/internal/parser.ts +201 -84
- package/src/unstable/cluster/ClusterCron.ts +2 -2
- package/src/unstable/cluster/ClusterSchema.ts +38 -10
- package/src/unstable/cluster/ClusterWorkflowEngine.ts +142 -80
- package/src/unstable/cluster/DeliverAt.ts +1 -1
- package/src/unstable/cluster/Entity.ts +58 -45
- package/src/unstable/cluster/EntityAddress.ts +1 -1
- package/src/unstable/cluster/EntityProxy.ts +3 -3
- package/src/unstable/cluster/EntityProxyServer.ts +6 -6
- package/src/unstable/cluster/EntityResource.ts +6 -6
- package/src/unstable/cluster/HttpRunner.ts +2 -2
- package/src/unstable/cluster/K8sHttpClient.ts +7 -7
- package/src/unstable/cluster/Message.ts +30 -17
- package/src/unstable/cluster/MessageStorage.ts +74 -45
- package/src/unstable/cluster/Reply.ts +13 -10
- package/src/unstable/cluster/Runner.ts +1 -1
- package/src/unstable/cluster/RunnerAddress.ts +1 -1
- package/src/unstable/cluster/RunnerHealth.ts +2 -2
- package/src/unstable/cluster/RunnerServer.ts +11 -14
- package/src/unstable/cluster/RunnerStorage.ts +9 -9
- package/src/unstable/cluster/Runners.ts +22 -18
- package/src/unstable/cluster/ShardId.ts +84 -74
- package/src/unstable/cluster/Sharding.ts +75 -60
- package/src/unstable/cluster/ShardingConfig.ts +39 -40
- package/src/unstable/cluster/Snowflake.ts +2 -2
- package/src/unstable/cluster/SqlMessageStorage.ts +29 -20
- package/src/unstable/cluster/SqlRunnerStorage.ts +13 -7
- package/src/unstable/cluster/internal/entityManager.ts +60 -41
- package/src/unstable/cluster/internal/entityReaper.ts +2 -2
- package/src/unstable/cluster/internal/resourceMap.ts +3 -3
- package/src/unstable/devtools/DevToolsClient.ts +26 -21
- package/src/unstable/devtools/DevToolsSchema.ts +16 -3
- package/src/unstable/encoding/Ndjson.ts +17 -17
- package/src/unstable/encoding/Sse.ts +3 -5
- package/src/unstable/eventlog/Event.ts +0 -8
- package/src/unstable/eventlog/EventGroup.ts +0 -4
- package/src/unstable/eventlog/EventJournal.ts +148 -80
- package/src/unstable/eventlog/EventLog.ts +360 -234
- package/src/unstable/eventlog/EventLogEncryption.ts +18 -32
- package/src/unstable/eventlog/EventLogMessage.ts +277 -0
- package/src/unstable/eventlog/EventLogRemote.ts +264 -410
- package/src/unstable/eventlog/EventLogServer.ts +183 -275
- package/src/unstable/eventlog/EventLogServerEncrypted.ts +206 -0
- package/src/unstable/eventlog/EventLogServerUnencrypted.ts +749 -0
- package/src/unstable/eventlog/EventLogSessionAuth.ts +437 -0
- package/src/unstable/eventlog/{SqlEventLogJournal.ts → SqlEventJournal.ts} +38 -22
- package/src/unstable/eventlog/{SqlEventLogServer.ts → SqlEventLogServerEncrypted.ts} +110 -43
- package/src/unstable/eventlog/SqlEventLogServerUnencrypted.ts +506 -0
- package/src/unstable/eventlog/index.ts +27 -2
- package/src/unstable/eventlog/internal/identityRootSecretDerivation.ts +153 -0
- package/src/unstable/http/Cookies.ts +94 -11
- package/src/unstable/http/Etag.ts +7 -5
- package/src/unstable/http/FetchHttpClient.ts +5 -5
- package/src/unstable/http/Headers.ts +70 -20
- package/src/unstable/http/HttpClient.ts +385 -42
- package/src/unstable/http/HttpClientRequest.ts +151 -39
- package/src/unstable/http/HttpClientResponse.ts +24 -8
- package/src/unstable/http/HttpEffect.ts +71 -77
- package/src/unstable/http/HttpIncomingMessage.ts +9 -8
- package/src/unstable/http/HttpMethod.ts +16 -4
- package/src/unstable/http/HttpMiddleware.ts +50 -50
- package/src/unstable/http/HttpPlatform.ts +5 -4
- package/src/unstable/http/HttpRouter.ts +46 -46
- package/src/unstable/http/HttpServer.ts +5 -11
- package/src/unstable/http/HttpServerError.ts +45 -47
- package/src/unstable/http/HttpServerRequest.ts +414 -23
- package/src/unstable/http/HttpServerRespondable.ts +6 -6
- package/src/unstable/http/HttpServerResponse.ts +351 -13
- package/src/unstable/http/HttpStaticServer.ts +456 -0
- package/src/unstable/http/HttpTraceContext.ts +31 -17
- package/src/unstable/http/Multipart.ts +8 -8
- package/src/unstable/http/Url.ts +650 -0
- package/src/unstable/http/UrlParams.ts +30 -18
- package/src/unstable/http/index.ts +10 -0
- package/src/unstable/http/internal/preResponseHandler.ts +15 -0
- package/src/unstable/httpapi/HttpApi.ts +22 -22
- package/src/unstable/httpapi/HttpApiBuilder.ts +134 -54
- package/src/unstable/httpapi/HttpApiClient.ts +185 -34
- package/src/unstable/httpapi/HttpApiEndpoint.ts +225 -114
- package/src/unstable/httpapi/HttpApiError.ts +129 -30
- package/src/unstable/httpapi/HttpApiGroup.ts +18 -17
- package/src/unstable/httpapi/HttpApiMiddleware.ts +95 -32
- package/src/unstable/httpapi/HttpApiSchema.ts +106 -11
- package/src/unstable/httpapi/HttpApiSecurity.ts +13 -13
- package/src/unstable/httpapi/OpenApi.ts +74 -73
- package/src/unstable/observability/Otlp.ts +12 -12
- package/src/unstable/observability/OtlpExporter.ts +14 -10
- package/src/unstable/observability/OtlpLogger.ts +13 -9
- package/src/unstable/observability/OtlpMetrics.ts +6 -6
- package/src/unstable/observability/OtlpSerialization.ts +2 -2
- package/src/unstable/observability/OtlpTracer.ts +14 -10
- package/src/unstable/observability/PrometheusMetrics.ts +5 -5
- package/src/unstable/observability/internal/protobuf.ts +4 -4
- package/src/unstable/persistence/KeyValueStore.ts +226 -3
- package/src/unstable/persistence/Persistable.ts +3 -3
- package/src/unstable/persistence/PersistedCache.ts +20 -17
- package/src/unstable/persistence/PersistedQueue.ts +21 -21
- package/src/unstable/persistence/Persistence.ts +7 -7
- package/src/unstable/persistence/RateLimiter.ts +7 -7
- package/src/unstable/persistence/Redis.ts +2 -2
- package/src/unstable/process/ChildProcess.ts +6 -208
- package/src/unstable/process/ChildProcessSpawner.ts +114 -15
- package/src/unstable/reactivity/AsyncResult.ts +59 -17
- package/src/unstable/reactivity/Atom.ts +280 -124
- package/src/unstable/reactivity/AtomHttpApi.ts +127 -61
- package/src/unstable/reactivity/AtomRegistry.ts +70 -16
- package/src/unstable/reactivity/AtomRpc.ts +82 -37
- package/src/unstable/reactivity/Reactivity.ts +6 -6
- package/src/unstable/rpc/Rpc.ts +212 -32
- package/src/unstable/rpc/RpcClient.ts +161 -142
- package/src/unstable/rpc/RpcGroup.ts +51 -34
- package/src/unstable/rpc/RpcMiddleware.ts +28 -22
- package/src/unstable/rpc/RpcSchema.ts +24 -6
- package/src/unstable/rpc/RpcSerialization.ts +97 -54
- package/src/unstable/rpc/RpcServer.ts +91 -65
- package/src/unstable/rpc/RpcWorker.ts +5 -5
- package/src/unstable/rpc/Utils.ts +63 -4
- package/src/unstable/schema/Model.ts +35 -6
- package/src/unstable/schema/VariantSchema.ts +14 -27
- package/src/unstable/socket/Socket.ts +102 -62
- package/src/unstable/socket/SocketServer.ts +2 -2
- package/src/unstable/sql/Migrator.ts +7 -5
- package/src/unstable/sql/SqlClient.ts +48 -19
- package/src/unstable/sql/SqlConnection.ts +2 -2
- package/src/unstable/sql/SqlError.ts +365 -11
- package/src/unstable/sql/SqlModel.ts +57 -85
- package/src/unstable/sql/SqlResolver.ts +28 -20
- package/src/unstable/sql/SqlSchema.ts +42 -26
- package/src/unstable/sql/Statement.ts +21 -25
- package/src/unstable/workers/Transferable.ts +17 -19
- package/src/unstable/workers/Worker.ts +4 -4
- package/src/unstable/workers/WorkerRunner.ts +2 -2
- package/src/unstable/workflow/Activity.ts +36 -13
- package/src/unstable/workflow/DurableClock.ts +11 -11
- package/src/unstable/workflow/DurableDeferred.ts +36 -18
- package/src/unstable/workflow/Workflow.ts +46 -35
- package/src/unstable/workflow/WorkflowEngine.ts +236 -23
- package/src/unstable/workflow/WorkflowProxyServer.ts +4 -4
- package/dist/NullOr.d.ts +0 -149
- package/dist/NullOr.d.ts.map +0 -1
- package/dist/NullOr.js +0 -152
- package/dist/NullOr.js.map +0 -1
- package/dist/ServiceMap.d.ts +0 -1126
- package/dist/ServiceMap.d.ts.map +0 -1
- package/dist/ServiceMap.js.map +0 -1
- package/dist/internal/schema/to-codec.d.ts +0 -2
- package/dist/internal/schema/to-codec.d.ts.map +0 -1
- package/dist/internal/schema/to-codec.js +0 -129
- package/dist/internal/schema/to-codec.js.map +0 -1
- package/dist/unstable/cli/internal/builtInFlags.d.ts +0 -7
- package/dist/unstable/cli/internal/builtInFlags.d.ts.map +0 -1
- package/dist/unstable/cli/internal/builtInFlags.js +0 -44
- package/dist/unstable/cli/internal/builtInFlags.js.map +0 -1
- package/dist/unstable/cli/internal/completions/CommandDescriptor.d.ts +0 -2
- package/dist/unstable/cli/internal/completions/CommandDescriptor.d.ts.map +0 -1
- package/dist/unstable/cli/internal/completions/CommandDescriptor.js.map +0 -1
- package/dist/unstable/cli/internal/completions/Completions.d.ts +0 -2
- package/dist/unstable/cli/internal/completions/Completions.d.ts.map +0 -1
- package/dist/unstable/cli/internal/completions/Completions.js +0 -23
- package/dist/unstable/cli/internal/completions/Completions.js.map +0 -1
- package/dist/unstable/eventlog/SqlEventLogJournal.d.ts.map +0 -1
- package/dist/unstable/eventlog/SqlEventLogJournal.js.map +0 -1
- package/dist/unstable/eventlog/SqlEventLogServer.d.ts.map +0 -1
- package/dist/unstable/eventlog/SqlEventLogServer.js.map +0 -1
- package/src/NullOr.ts +0 -204
- package/src/ServiceMap.ts +0 -1410
- package/src/internal/schema/to-codec.ts +0 -148
- package/src/unstable/cli/internal/builtInFlags.ts +0 -78
- package/src/unstable/cli/internal/completions/Completions.ts +0 -31
package/dist/Stream.d.ts
CHANGED
|
@@ -4,15 +4,16 @@
|
|
|
4
4
|
import * as Arr from "./Array.ts";
|
|
5
5
|
import * as Cause from "./Cause.ts";
|
|
6
6
|
import * as Channel from "./Channel.ts";
|
|
7
|
+
import * as Context from "./Context.ts";
|
|
7
8
|
import * as Duration from "./Duration.ts";
|
|
8
9
|
import * as Effect from "./Effect.ts";
|
|
9
10
|
import * as ExecutionPlan from "./ExecutionPlan.ts";
|
|
10
11
|
import * as Exit from "./Exit.ts";
|
|
11
|
-
import * as Filter from "./Filter.ts";
|
|
12
|
+
import type * as Filter from "./Filter.ts";
|
|
12
13
|
import type { LazyArg } from "./Function.ts";
|
|
13
14
|
import type { TypeLambda } from "./HKT.ts";
|
|
14
15
|
import type * as Layer from "./Layer.ts";
|
|
15
|
-
import type {
|
|
16
|
+
import type { Severity } from "./LogLevel.ts";
|
|
16
17
|
import * as Option from "./Option.ts";
|
|
17
18
|
import type { Pipeable } from "./Pipeable.ts";
|
|
18
19
|
import type { Predicate, Refinement } from "./Predicate.ts";
|
|
@@ -22,13 +23,21 @@ import * as Queue from "./Queue.ts";
|
|
|
22
23
|
import * as Result from "./Result.ts";
|
|
23
24
|
import * as Schedule from "./Schedule.ts";
|
|
24
25
|
import * as Scope from "./Scope.ts";
|
|
25
|
-
import * as ServiceMap from "./ServiceMap.ts";
|
|
26
26
|
import * as Sink from "./Sink.ts";
|
|
27
27
|
import type * as Take from "./Take.ts";
|
|
28
28
|
import type { ParentSpan, SpanOptions } from "./Tracer.ts";
|
|
29
|
-
import type { Covariant, ExcludeReason, ExcludeTag, ExtractReason, ExtractTag, NoInfer, ReasonTags, Tags, unassigned } from "./Types.ts";
|
|
29
|
+
import type { Covariant, ExcludeReason, ExcludeTag, ExtractReason, ExtractTag, NarrowReason, NoInfer, OmitReason, ReasonTags, Tags, unassigned } from "./Types.ts";
|
|
30
30
|
import type * as Unify from "./Unify.ts";
|
|
31
|
-
|
|
31
|
+
/**
|
|
32
|
+
* @since 4.0.0
|
|
33
|
+
* @category Type Identifiers
|
|
34
|
+
*/
|
|
35
|
+
export type TypeId = "~effect/Stream";
|
|
36
|
+
/**
|
|
37
|
+
* @since 4.0.0
|
|
38
|
+
* @category Type Identifiers
|
|
39
|
+
*/
|
|
40
|
+
export declare const TypeId: TypeId;
|
|
32
41
|
/**
|
|
33
42
|
* A `Stream<A, E, R>` describes a program that can emit many `A` values, fail
|
|
34
43
|
* with `E`, and require `R`.
|
|
@@ -102,7 +111,7 @@ export interface StreamUnify<A extends {
|
|
|
102
111
|
* @category Models
|
|
103
112
|
* @since 2.0.0
|
|
104
113
|
*/
|
|
105
|
-
export interface StreamUnifyIgnore
|
|
114
|
+
export interface StreamUnifyIgnore {
|
|
106
115
|
Effect?: true;
|
|
107
116
|
}
|
|
108
117
|
/**
|
|
@@ -298,6 +307,76 @@ export declare const fromChannel: <Arr extends Arr.NonEmptyReadonlyArray<any>, E
|
|
|
298
307
|
* @category Constructors
|
|
299
308
|
*/
|
|
300
309
|
export declare const fromEffect: <A, E, R>(effect: Effect.Effect<A, E, R>) => Stream<A, E, R>;
|
|
310
|
+
/**
|
|
311
|
+
* Accesses a service from the context and emits it as a single element.
|
|
312
|
+
*
|
|
313
|
+
* @example
|
|
314
|
+
* ```ts
|
|
315
|
+
* import { Effect, Context, Stream } from "effect"
|
|
316
|
+
*
|
|
317
|
+
* class Greeter extends Context.Service<Greeter, {
|
|
318
|
+
* readonly greet: (name: string) => string
|
|
319
|
+
* }>()("Greeter") {}
|
|
320
|
+
*
|
|
321
|
+
* const stream = Stream.service(Greeter).pipe(
|
|
322
|
+
* Stream.map((greeter) => greeter.greet("World"))
|
|
323
|
+
* )
|
|
324
|
+
*
|
|
325
|
+
* const program = Effect.gen(function*() {
|
|
326
|
+
* return yield* stream.pipe(
|
|
327
|
+
* Stream.provideService(Greeter, {
|
|
328
|
+
* greet: (name) => `Hello, ${name}!`
|
|
329
|
+
* }),
|
|
330
|
+
* Stream.runCollect
|
|
331
|
+
* )
|
|
332
|
+
* })
|
|
333
|
+
*
|
|
334
|
+
* Effect.runPromise(program)
|
|
335
|
+
* // Output: [ "Hello, World!" ]
|
|
336
|
+
* ```
|
|
337
|
+
*
|
|
338
|
+
* @since 4.0.0
|
|
339
|
+
* @category Context
|
|
340
|
+
*/
|
|
341
|
+
export declare const service: <I, S>(service: Context.Key<I, S>) => Stream<S, never, I>;
|
|
342
|
+
/**
|
|
343
|
+
* Optionally accesses a service from the context and emits the result as a
|
|
344
|
+
* single element.
|
|
345
|
+
*
|
|
346
|
+
* @example
|
|
347
|
+
* ```ts
|
|
348
|
+
* import { Effect, Option, Context, Stream } from "effect"
|
|
349
|
+
*
|
|
350
|
+
* class Greeter extends Context.Service<Greeter, {
|
|
351
|
+
* readonly greet: (name: string) => string
|
|
352
|
+
* }>()("Greeter") {}
|
|
353
|
+
*
|
|
354
|
+
* const stream = Stream.serviceOption(Greeter).pipe(
|
|
355
|
+
* Stream.map((maybeGreeter) =>
|
|
356
|
+
* Option.match(maybeGreeter, {
|
|
357
|
+
* onNone: () => "No greeter",
|
|
358
|
+
* onSome: (greeter) => greeter.greet("World")
|
|
359
|
+
* })
|
|
360
|
+
* )
|
|
361
|
+
* )
|
|
362
|
+
*
|
|
363
|
+
* const program = Effect.gen(function*() {
|
|
364
|
+
* return yield* stream.pipe(
|
|
365
|
+
* Stream.provideService(Greeter, {
|
|
366
|
+
* greet: (name) => `Hello, ${name}!`
|
|
367
|
+
* }),
|
|
368
|
+
* Stream.runCollect
|
|
369
|
+
* )
|
|
370
|
+
* })
|
|
371
|
+
*
|
|
372
|
+
* Effect.runPromise(program)
|
|
373
|
+
* // Output: [ "Hello, World!" ]
|
|
374
|
+
* ```
|
|
375
|
+
*
|
|
376
|
+
* @since 4.0.0
|
|
377
|
+
* @category Context
|
|
378
|
+
*/
|
|
379
|
+
export declare const serviceOption: <I, S>(service: Context.Key<I, S>) => Stream<Option.Option<S>>;
|
|
301
380
|
/**
|
|
302
381
|
* Creates a stream that runs the effect and emits no elements.
|
|
303
382
|
*
|
|
@@ -401,7 +480,7 @@ export declare const fromEffectSchedule: <A, E, R, X, AS extends A, ES, RS>(effe
|
|
|
401
480
|
* @since 2.0.0
|
|
402
481
|
* @category Constructors
|
|
403
482
|
*/
|
|
404
|
-
export declare const tick: (interval: Duration.
|
|
483
|
+
export declare const tick: (interval: Duration.Input) => Stream<void>;
|
|
405
484
|
/**
|
|
406
485
|
* Creates a stream from a pull effect, such as one produced by `Stream.toPull`.
|
|
407
486
|
*
|
|
@@ -823,6 +902,10 @@ export declare const fromIteratorSucceed: <A>(iterator: IterableIterator<A>, max
|
|
|
823
902
|
/**
|
|
824
903
|
* Creates a new `Stream` from an iterable collection of values.
|
|
825
904
|
*
|
|
905
|
+
* **Options**
|
|
906
|
+
*
|
|
907
|
+
* - `chunkSize`: Maximum number of values emitted per chunk.
|
|
908
|
+
*
|
|
826
909
|
* @example
|
|
827
910
|
* ```ts
|
|
828
911
|
* import { Console, Effect, Stream } from "effect"
|
|
@@ -842,15 +925,17 @@ export declare const fromIteratorSucceed: <A>(iterator: IterableIterator<A>, max
|
|
|
842
925
|
* @since 2.0.0
|
|
843
926
|
* @category Constructors
|
|
844
927
|
*/
|
|
845
|
-
export declare const fromIterable: <A>(iterable: Iterable<A
|
|
928
|
+
export declare const fromIterable: <A>(iterable: Iterable<A>, options?: {
|
|
929
|
+
readonly chunkSize?: number | undefined;
|
|
930
|
+
}) => Stream<A>;
|
|
846
931
|
/**
|
|
847
932
|
* Creates a stream from an effect producing an iterable of values.
|
|
848
933
|
*
|
|
849
934
|
* @example
|
|
850
935
|
* ```ts
|
|
851
|
-
* import { Console, Effect,
|
|
936
|
+
* import { Console, Effect, Context, Stream } from "effect"
|
|
852
937
|
*
|
|
853
|
-
* class UserRepo extends
|
|
938
|
+
* class UserRepo extends Context.Service<UserRepo, {
|
|
854
939
|
* readonly list: Effect.Effect<ReadonlyArray<string>>
|
|
855
940
|
* }>()("UserRepo") {}
|
|
856
941
|
*
|
|
@@ -1083,7 +1168,9 @@ export declare const fromPubSubTake: <A, E>(pubsub: PubSub.PubSub<Take.Take<A, E
|
|
|
1083
1168
|
*
|
|
1084
1169
|
* @example
|
|
1085
1170
|
* ```ts
|
|
1086
|
-
* import { Console, Effect, Stream } from "effect"
|
|
1171
|
+
* import { Console, Data, Effect, Stream } from "effect"
|
|
1172
|
+
*
|
|
1173
|
+
* class StreamError extends Data.TaggedError("StreamError")<{ readonly cause: unknown }> {}
|
|
1087
1174
|
*
|
|
1088
1175
|
* const readableStream = new ReadableStream({
|
|
1089
1176
|
* start(controller) {
|
|
@@ -1097,7 +1184,7 @@ export declare const fromPubSubTake: <A, E>(pubsub: PubSub.PubSub<Take.Take<A, E
|
|
|
1097
1184
|
* const program = Effect.gen(function*() {
|
|
1098
1185
|
* const stream = Stream.fromReadableStream({
|
|
1099
1186
|
* evaluate: () => readableStream,
|
|
1100
|
-
* onError: (
|
|
1187
|
+
* onError: (cause) => new StreamError({ cause })
|
|
1101
1188
|
* })
|
|
1102
1189
|
* const values = yield* Stream.runCollect(stream)
|
|
1103
1190
|
* yield* Console.log(values)
|
|
@@ -1120,7 +1207,9 @@ export declare const fromReadableStream: <A, E>(options: {
|
|
|
1120
1207
|
*
|
|
1121
1208
|
* @example
|
|
1122
1209
|
* ```ts
|
|
1123
|
-
* import { Console, Effect, Stream } from "effect"
|
|
1210
|
+
* import { Console, Data, Effect, Stream } from "effect"
|
|
1211
|
+
*
|
|
1212
|
+
* class StreamError extends Data.TaggedError("StreamError")<{ readonly cause: unknown }> {}
|
|
1124
1213
|
*
|
|
1125
1214
|
* const iterable = (async function*() {
|
|
1126
1215
|
* yield 1
|
|
@@ -1129,7 +1218,7 @@ export declare const fromReadableStream: <A, E>(options: {
|
|
|
1129
1218
|
* })()
|
|
1130
1219
|
*
|
|
1131
1220
|
* const program = Effect.gen(function*() {
|
|
1132
|
-
* const stream = Stream.fromAsyncIterable(iterable, (
|
|
1221
|
+
* const stream = Stream.fromAsyncIterable(iterable, (cause) => new StreamError({ cause }))
|
|
1133
1222
|
* const values = yield* Stream.runCollect(stream)
|
|
1134
1223
|
* yield* Console.log(values)
|
|
1135
1224
|
* })
|
|
@@ -1152,7 +1241,7 @@ export declare const fromAsyncIterable: <A, E>(iterable: AsyncIterable<A>, onErr
|
|
|
1152
1241
|
*
|
|
1153
1242
|
* const program = Effect.gen(function*() {
|
|
1154
1243
|
* const schedule = Schedule.spaced("50 millis").pipe(
|
|
1155
|
-
* Schedule.
|
|
1244
|
+
* Schedule.both(Schedule.recurs(2))
|
|
1156
1245
|
* )
|
|
1157
1246
|
* const stream = Stream.fromSchedule(schedule)
|
|
1158
1247
|
* const values = yield* Stream.runCollect(stream)
|
|
@@ -2767,7 +2856,7 @@ export declare const timeout: {
|
|
|
2767
2856
|
* @since 2.0.0
|
|
2768
2857
|
* @category Rate Limiting
|
|
2769
2858
|
*/
|
|
2770
|
-
(duration: Duration.
|
|
2859
|
+
(duration: Duration.Input): <A, E, R>(self: Stream<A, E, R>) => Stream<A, E, R>;
|
|
2771
2860
|
/**
|
|
2772
2861
|
* Ends the stream if it does not produce a value within the specified duration.
|
|
2773
2862
|
*
|
|
@@ -2791,7 +2880,29 @@ export declare const timeout: {
|
|
|
2791
2880
|
* @since 2.0.0
|
|
2792
2881
|
* @category Rate Limiting
|
|
2793
2882
|
*/
|
|
2794
|
-
<A, E, R>(self: Stream<A, E, R>, duration: Duration.
|
|
2883
|
+
<A, E, R>(self: Stream<A, E, R>, duration: Duration.Input): Stream<A, E, R>;
|
|
2884
|
+
};
|
|
2885
|
+
/**
|
|
2886
|
+
* @since 2.0.0
|
|
2887
|
+
* @category Rate Limiting
|
|
2888
|
+
*/
|
|
2889
|
+
export declare const timeoutOrElse: {
|
|
2890
|
+
/**
|
|
2891
|
+
* @since 2.0.0
|
|
2892
|
+
* @category Rate Limiting
|
|
2893
|
+
*/
|
|
2894
|
+
<B, E2, R2>(options: {
|
|
2895
|
+
readonly duration: Duration.Input;
|
|
2896
|
+
readonly orElse: () => Stream<B, E2, R2>;
|
|
2897
|
+
}): <A, E, R>(self: Stream<A, E, R>) => Stream<A | B, E | E2, R | R2>;
|
|
2898
|
+
/**
|
|
2899
|
+
* @since 2.0.0
|
|
2900
|
+
* @category Rate Limiting
|
|
2901
|
+
*/
|
|
2902
|
+
<A, E, R, B, E2, R2>(self: Stream<A, E, R>, options: {
|
|
2903
|
+
readonly duration: Duration.Input;
|
|
2904
|
+
readonly orElse: () => Stream<B, E2, R2>;
|
|
2905
|
+
}): Stream<A | B, E | E2, R | R2>;
|
|
2795
2906
|
};
|
|
2796
2907
|
/**
|
|
2797
2908
|
* Repeats each element of the stream according to the provided schedule,
|
|
@@ -4775,7 +4886,7 @@ export declare const filter: {
|
|
|
4775
4886
|
* @since 2.0.0
|
|
4776
4887
|
* @category Filtering
|
|
4777
4888
|
*/
|
|
4778
|
-
<A
|
|
4889
|
+
<A>(predicate: Predicate<NoInfer<A>>): <E, R>(self: Stream<A, E, R>) => Stream<A, E, R>;
|
|
4779
4890
|
/**
|
|
4780
4891
|
* Filters a stream to the elements that satisfy a predicate.
|
|
4781
4892
|
*
|
|
@@ -4821,20 +4932,38 @@ export declare const filter: {
|
|
|
4821
4932
|
* @since 2.0.0
|
|
4822
4933
|
* @category Filtering
|
|
4823
4934
|
*/
|
|
4824
|
-
<A, E, R
|
|
4935
|
+
<A, E, R>(self: Stream<A, E, R>, predicate: Predicate<A>): Stream<A, E, R>;
|
|
4825
4936
|
};
|
|
4826
4937
|
/**
|
|
4827
|
-
*
|
|
4938
|
+
* Filters and maps stream elements in one pass using a `Filter`.
|
|
4939
|
+
*
|
|
4940
|
+
* @since 4.0.0
|
|
4941
|
+
* @category Filtering
|
|
4942
|
+
*/
|
|
4943
|
+
export declare const filterMap: {
|
|
4944
|
+
/**
|
|
4945
|
+
* Filters and maps stream elements in one pass using a `Filter`.
|
|
4946
|
+
*
|
|
4947
|
+
* @since 4.0.0
|
|
4948
|
+
* @category Filtering
|
|
4949
|
+
*/
|
|
4950
|
+
<A, B, X>(filter: Filter.Filter<NoInfer<A>, B, X>): <E, R>(self: Stream<A, E, R>) => Stream<B, E, R>;
|
|
4951
|
+
/**
|
|
4952
|
+
* Filters and maps stream elements in one pass using a `Filter`.
|
|
4953
|
+
*
|
|
4954
|
+
* @since 4.0.0
|
|
4955
|
+
* @category Filtering
|
|
4956
|
+
*/
|
|
4957
|
+
<A, E, R, B, X>(self: Stream<A, E, R>, filter: Filter.Filter<A, B, X>): Stream<B, E, R>;
|
|
4958
|
+
};
|
|
4959
|
+
/**
|
|
4960
|
+
* Effectfully filters elements in a single pass.
|
|
4828
4961
|
*
|
|
4829
4962
|
* @example
|
|
4830
4963
|
* ```ts
|
|
4831
|
-
* import { Console, Effect,
|
|
4832
|
-
*
|
|
4833
|
-
* const filter = Filter.makeEffect((n: number) =>
|
|
4834
|
-
* Effect.succeed(n > 2 ? Result.succeed(n + 1) : Result.fail(n))
|
|
4835
|
-
* )
|
|
4964
|
+
* import { Console, Effect, Stream } from "effect"
|
|
4836
4965
|
*
|
|
4837
|
-
* const stream = Stream.make(1, 2, 3, 4).pipe(Stream.filterEffect(
|
|
4966
|
+
* const stream = Stream.make(1, 2, 3, 4).pipe(Stream.filterEffect((n) => Effect.succeed(n > 2)))
|
|
4838
4967
|
*
|
|
4839
4968
|
* const program = Effect.gen(function*() {
|
|
4840
4969
|
* const result = yield* Stream.runCollect(stream)
|
|
@@ -4842,7 +4971,7 @@ export declare const filter: {
|
|
|
4842
4971
|
* })
|
|
4843
4972
|
*
|
|
4844
4973
|
* Effect.runPromise(program)
|
|
4845
|
-
* // Output: [
|
|
4974
|
+
* // Output: [ 3, 4 ]
|
|
4846
4975
|
* ```
|
|
4847
4976
|
*
|
|
4848
4977
|
* @since 2.0.0
|
|
@@ -4850,17 +4979,13 @@ export declare const filter: {
|
|
|
4850
4979
|
*/
|
|
4851
4980
|
export declare const filterEffect: {
|
|
4852
4981
|
/**
|
|
4853
|
-
* Effectfully filters
|
|
4982
|
+
* Effectfully filters elements in a single pass.
|
|
4854
4983
|
*
|
|
4855
4984
|
* @example
|
|
4856
4985
|
* ```ts
|
|
4857
|
-
* import { Console, Effect,
|
|
4858
|
-
*
|
|
4859
|
-
* const filter = Filter.makeEffect((n: number) =>
|
|
4860
|
-
* Effect.succeed(n > 2 ? Result.succeed(n + 1) : Result.fail(n))
|
|
4861
|
-
* )
|
|
4986
|
+
* import { Console, Effect, Stream } from "effect"
|
|
4862
4987
|
*
|
|
4863
|
-
* const stream = Stream.make(1, 2, 3, 4).pipe(Stream.filterEffect(
|
|
4988
|
+
* const stream = Stream.make(1, 2, 3, 4).pipe(Stream.filterEffect((n) => Effect.succeed(n > 2)))
|
|
4864
4989
|
*
|
|
4865
4990
|
* const program = Effect.gen(function*() {
|
|
4866
4991
|
* const result = yield* Stream.runCollect(stream)
|
|
@@ -4868,25 +4993,21 @@ export declare const filterEffect: {
|
|
|
4868
4993
|
* })
|
|
4869
4994
|
*
|
|
4870
4995
|
* Effect.runPromise(program)
|
|
4871
|
-
* // Output: [
|
|
4996
|
+
* // Output: [ 3, 4 ]
|
|
4872
4997
|
* ```
|
|
4873
4998
|
*
|
|
4874
4999
|
* @since 2.0.0
|
|
4875
5000
|
* @category Filtering
|
|
4876
5001
|
*/
|
|
4877
|
-
<A,
|
|
5002
|
+
<A, EX, RX>(predicate: (a: NoInfer<A>, i: number) => Effect.Effect<boolean, EX, RX>): <E, R>(self: Stream<A, E, R>) => Stream<A, E | EX, R | RX>;
|
|
4878
5003
|
/**
|
|
4879
|
-
* Effectfully filters
|
|
5004
|
+
* Effectfully filters elements in a single pass.
|
|
4880
5005
|
*
|
|
4881
5006
|
* @example
|
|
4882
5007
|
* ```ts
|
|
4883
|
-
* import { Console, Effect,
|
|
4884
|
-
*
|
|
4885
|
-
* const filter = Filter.makeEffect((n: number) =>
|
|
4886
|
-
* Effect.succeed(n > 2 ? Result.succeed(n + 1) : Result.fail(n))
|
|
4887
|
-
* )
|
|
5008
|
+
* import { Console, Effect, Stream } from "effect"
|
|
4888
5009
|
*
|
|
4889
|
-
* const stream = Stream.make(1, 2, 3, 4).pipe(Stream.filterEffect(
|
|
5010
|
+
* const stream = Stream.make(1, 2, 3, 4).pipe(Stream.filterEffect((n) => Effect.succeed(n > 2)))
|
|
4890
5011
|
*
|
|
4891
5012
|
* const program = Effect.gen(function*() {
|
|
4892
5013
|
* const result = yield* Stream.runCollect(stream)
|
|
@@ -4894,28 +5015,48 @@ export declare const filterEffect: {
|
|
|
4894
5015
|
* })
|
|
4895
5016
|
*
|
|
4896
5017
|
* Effect.runPromise(program)
|
|
4897
|
-
* // Output: [
|
|
5018
|
+
* // Output: [ 3, 4 ]
|
|
4898
5019
|
* ```
|
|
4899
5020
|
*
|
|
4900
5021
|
* @since 2.0.0
|
|
4901
5022
|
* @category Filtering
|
|
4902
5023
|
*/
|
|
5024
|
+
<A, E, R, EX, RX>(self: Stream<A, E, R>, predicate: (a: NoInfer<A>, i: number) => Effect.Effect<boolean, EX, RX>): Stream<A, E | EX, R | RX>;
|
|
5025
|
+
};
|
|
5026
|
+
/**
|
|
5027
|
+
* Effectfully filters and maps elements in a single pass.
|
|
5028
|
+
*
|
|
5029
|
+
* @since 4.0.0
|
|
5030
|
+
* @category Filtering
|
|
5031
|
+
*/
|
|
5032
|
+
export declare const filterMapEffect: {
|
|
5033
|
+
/**
|
|
5034
|
+
* Effectfully filters and maps elements in a single pass.
|
|
5035
|
+
*
|
|
5036
|
+
* @since 4.0.0
|
|
5037
|
+
* @category Filtering
|
|
5038
|
+
*/
|
|
5039
|
+
<A, B, X, EX, RX>(filter: Filter.FilterEffect<NoInfer<A>, B, X, EX, RX>): <E, R>(self: Stream<A, E, R>) => Stream<B, E | EX, R | RX>;
|
|
5040
|
+
/**
|
|
5041
|
+
* Effectfully filters and maps elements in a single pass.
|
|
5042
|
+
*
|
|
5043
|
+
* @since 4.0.0
|
|
5044
|
+
* @category Filtering
|
|
5045
|
+
*/
|
|
4903
5046
|
<A, E, R, B, X, EX, RX>(self: Stream<A, E, R>, filter: Filter.FilterEffect<A, B, X, EX, RX>): Stream<B, E | EX, R | RX>;
|
|
4904
5047
|
};
|
|
4905
5048
|
/**
|
|
4906
|
-
* Partitions a stream using a Filter and exposes passing and failing values as queues.
|
|
5049
|
+
* Partitions a stream using a `Filter` and exposes passing and failing values as queues.
|
|
4907
5050
|
*
|
|
4908
5051
|
* Each queue fails with the stream error or `Cause.Done` when the source ends.
|
|
4909
5052
|
*
|
|
4910
5053
|
* @example
|
|
4911
5054
|
* ```ts
|
|
4912
|
-
* import { Console, Effect,
|
|
5055
|
+
* import { Console, Effect, Result, Stream } from "effect"
|
|
4913
5056
|
*
|
|
4914
5057
|
* const program = Effect.gen(function*() {
|
|
4915
5058
|
* const [passes, fails] = yield* Stream.make(1, 2, 3, 4).pipe(
|
|
4916
|
-
* Stream.partitionQueue(
|
|
4917
|
-
* Filter.make((n) => (n % 2 === 0 ? Result.succeed(n) : Result.fail(n)))
|
|
4918
|
-
* )
|
|
5059
|
+
* Stream.partitionQueue((n) => n % 2 === 0 ? Result.succeed(n) : Result.fail(n))
|
|
4919
5060
|
* )
|
|
4920
5061
|
*
|
|
4921
5062
|
* const passValues = yield* Stream.fromQueue(passes).pipe(Stream.runCollect)
|
|
@@ -4935,56 +5076,17 @@ export declare const filterEffect: {
|
|
|
4935
5076
|
*/
|
|
4936
5077
|
export declare const partitionQueue: {
|
|
4937
5078
|
/**
|
|
4938
|
-
* Partitions a stream using a Filter and exposes passing and failing values as queues.
|
|
4939
|
-
*
|
|
4940
|
-
* Each queue fails with the stream error or `Cause.Done` when the source ends.
|
|
4941
|
-
*
|
|
4942
|
-
* @example
|
|
4943
|
-
* ```ts
|
|
4944
|
-
* import { Console, Effect, Filter, Result, Stream } from "effect"
|
|
4945
|
-
*
|
|
4946
|
-
* const program = Effect.gen(function*() {
|
|
4947
|
-
* const [passes, fails] = yield* Stream.make(1, 2, 3, 4).pipe(
|
|
4948
|
-
* Stream.partitionQueue(
|
|
4949
|
-
* Filter.make((n) => (n % 2 === 0 ? Result.succeed(n) : Result.fail(n)))
|
|
4950
|
-
* )
|
|
4951
|
-
* )
|
|
4952
|
-
*
|
|
4953
|
-
* const passValues = yield* Stream.fromQueue(passes).pipe(Stream.runCollect)
|
|
4954
|
-
* const failValues = yield* Stream.fromQueue(fails).pipe(Stream.runCollect)
|
|
4955
|
-
*
|
|
4956
|
-
* yield* Console.log(passValues)
|
|
4957
|
-
* // Output: [ 2, 4 ]
|
|
4958
|
-
* yield* Console.log(failValues)
|
|
4959
|
-
* // Output: [ 1, 3 ]
|
|
4960
|
-
* })
|
|
4961
|
-
*
|
|
4962
|
-
* Effect.runPromise(Effect.scoped(program))
|
|
4963
|
-
* ```
|
|
4964
|
-
*
|
|
4965
|
-
* @since 4.0.0
|
|
4966
|
-
* @category Filtering
|
|
4967
|
-
*/
|
|
4968
|
-
<A, B extends A>(refinement: Refinement<NoInfer<A>, B>, options?: {
|
|
4969
|
-
readonly capacity?: number | "unbounded" | undefined;
|
|
4970
|
-
}): <E, R>(self: Stream<A, E, R>) => Effect.Effect<[
|
|
4971
|
-
passes: Queue.Dequeue<B, E | Cause.Done>,
|
|
4972
|
-
fails: Queue.Dequeue<Exclude<A, B>, E | Cause.Done>
|
|
4973
|
-
], never, R | Scope.Scope>;
|
|
4974
|
-
/**
|
|
4975
|
-
* Partitions a stream using a Filter and exposes passing and failing values as queues.
|
|
5079
|
+
* Partitions a stream using a `Filter` and exposes passing and failing values as queues.
|
|
4976
5080
|
*
|
|
4977
5081
|
* Each queue fails with the stream error or `Cause.Done` when the source ends.
|
|
4978
5082
|
*
|
|
4979
5083
|
* @example
|
|
4980
5084
|
* ```ts
|
|
4981
|
-
* import { Console, Effect,
|
|
5085
|
+
* import { Console, Effect, Result, Stream } from "effect"
|
|
4982
5086
|
*
|
|
4983
5087
|
* const program = Effect.gen(function*() {
|
|
4984
5088
|
* const [passes, fails] = yield* Stream.make(1, 2, 3, 4).pipe(
|
|
4985
|
-
* Stream.partitionQueue(
|
|
4986
|
-
* Filter.make((n) => (n % 2 === 0 ? Result.succeed(n) : Result.fail(n)))
|
|
4987
|
-
* )
|
|
5089
|
+
* Stream.partitionQueue((n) => n % 2 === 0 ? Result.succeed(n) : Result.fail(n))
|
|
4988
5090
|
* )
|
|
4989
5091
|
*
|
|
4990
5092
|
* const passValues = yield* Stream.fromQueue(passes).pipe(Stream.runCollect)
|
|
@@ -5002,63 +5104,24 @@ export declare const partitionQueue: {
|
|
|
5002
5104
|
* @since 4.0.0
|
|
5003
5105
|
* @category Filtering
|
|
5004
5106
|
*/
|
|
5005
|
-
<A,
|
|
5107
|
+
<A, Pass, Fail>(filter: Filter.Filter<NoInfer<A>, Pass, Fail>, options?: {
|
|
5006
5108
|
readonly capacity?: number | "unbounded" | undefined;
|
|
5007
5109
|
}): <E, R>(self: Stream<A, E, R>) => Effect.Effect<[
|
|
5008
|
-
passes: Queue.Dequeue<
|
|
5009
|
-
fails: Queue.Dequeue<
|
|
5010
|
-
], never, R | Scope.Scope>;
|
|
5011
|
-
/**
|
|
5012
|
-
* Partitions a stream using a Filter and exposes passing and failing values as queues.
|
|
5013
|
-
*
|
|
5014
|
-
* Each queue fails with the stream error or `Cause.Done` when the source ends.
|
|
5015
|
-
*
|
|
5016
|
-
* @example
|
|
5017
|
-
* ```ts
|
|
5018
|
-
* import { Console, Effect, Filter, Result, Stream } from "effect"
|
|
5019
|
-
*
|
|
5020
|
-
* const program = Effect.gen(function*() {
|
|
5021
|
-
* const [passes, fails] = yield* Stream.make(1, 2, 3, 4).pipe(
|
|
5022
|
-
* Stream.partitionQueue(
|
|
5023
|
-
* Filter.make((n) => (n % 2 === 0 ? Result.succeed(n) : Result.fail(n)))
|
|
5024
|
-
* )
|
|
5025
|
-
* )
|
|
5026
|
-
*
|
|
5027
|
-
* const passValues = yield* Stream.fromQueue(passes).pipe(Stream.runCollect)
|
|
5028
|
-
* const failValues = yield* Stream.fromQueue(fails).pipe(Stream.runCollect)
|
|
5029
|
-
*
|
|
5030
|
-
* yield* Console.log(passValues)
|
|
5031
|
-
* // Output: [ 2, 4 ]
|
|
5032
|
-
* yield* Console.log(failValues)
|
|
5033
|
-
* // Output: [ 1, 3 ]
|
|
5034
|
-
* })
|
|
5035
|
-
*
|
|
5036
|
-
* Effect.runPromise(Effect.scoped(program))
|
|
5037
|
-
* ```
|
|
5038
|
-
*
|
|
5039
|
-
* @since 4.0.0
|
|
5040
|
-
* @category Filtering
|
|
5041
|
-
*/
|
|
5042
|
-
<A, E, R, B extends A>(self: Stream<A, E, R>, refinement: Refinement<A, B>, options?: {
|
|
5043
|
-
readonly capacity?: number | "unbounded" | undefined;
|
|
5044
|
-
}): Effect.Effect<[
|
|
5045
|
-
passes: Queue.Dequeue<B, E | Cause.Done>,
|
|
5046
|
-
fails: Queue.Dequeue<Exclude<A, B>, E | Cause.Done>
|
|
5110
|
+
passes: Queue.Dequeue<Pass, E | Cause.Done>,
|
|
5111
|
+
fails: Queue.Dequeue<Fail, E | Cause.Done>
|
|
5047
5112
|
], never, R | Scope.Scope>;
|
|
5048
5113
|
/**
|
|
5049
|
-
* Partitions a stream using a Filter and exposes passing and failing values as queues.
|
|
5114
|
+
* Partitions a stream using a `Filter` and exposes passing and failing values as queues.
|
|
5050
5115
|
*
|
|
5051
5116
|
* Each queue fails with the stream error or `Cause.Done` when the source ends.
|
|
5052
5117
|
*
|
|
5053
5118
|
* @example
|
|
5054
5119
|
* ```ts
|
|
5055
|
-
* import { Console, Effect,
|
|
5120
|
+
* import { Console, Effect, Result, Stream } from "effect"
|
|
5056
5121
|
*
|
|
5057
5122
|
* const program = Effect.gen(function*() {
|
|
5058
5123
|
* const [passes, fails] = yield* Stream.make(1, 2, 3, 4).pipe(
|
|
5059
|
-
* Stream.partitionQueue(
|
|
5060
|
-
* Filter.make((n) => (n % 2 === 0 ? Result.succeed(n) : Result.fail(n)))
|
|
5061
|
-
* )
|
|
5124
|
+
* Stream.partitionQueue((n) => n % 2 === 0 ? Result.succeed(n) : Result.fail(n))
|
|
5062
5125
|
* )
|
|
5063
5126
|
*
|
|
5064
5127
|
* const passValues = yield* Stream.fromQueue(passes).pipe(Stream.runCollect)
|
|
@@ -5076,119 +5139,49 @@ export declare const partitionQueue: {
|
|
|
5076
5139
|
* @since 4.0.0
|
|
5077
5140
|
* @category Filtering
|
|
5078
5141
|
*/
|
|
5079
|
-
<A, E, R,
|
|
5142
|
+
<A, E, R, Pass, Fail>(self: Stream<A, E, R>, filter: Filter.Filter<NoInfer<A>, Pass, Fail>, options?: {
|
|
5080
5143
|
readonly capacity?: number | "unbounded" | undefined;
|
|
5081
5144
|
}): Effect.Effect<[
|
|
5082
|
-
passes: Queue.Dequeue<
|
|
5083
|
-
fails: Queue.Dequeue<
|
|
5145
|
+
passes: Queue.Dequeue<Pass, E | Cause.Done>,
|
|
5146
|
+
fails: Queue.Dequeue<Fail, E | Cause.Done>
|
|
5084
5147
|
], never, R | Scope.Scope>;
|
|
5085
5148
|
};
|
|
5086
5149
|
/**
|
|
5087
|
-
* Splits a stream using an effectful
|
|
5150
|
+
* Splits a stream using an effectful `Filter`, producing pass and fail streams.
|
|
5088
5151
|
*
|
|
5089
5152
|
* @since 4.0.0
|
|
5090
5153
|
* @category Filtering
|
|
5091
|
-
*
|
|
5092
|
-
* @example
|
|
5093
|
-
* ```ts
|
|
5094
|
-
* import { Console, Effect, Result, Stream } from "effect"
|
|
5095
|
-
*
|
|
5096
|
-
* const program = Effect.scoped(
|
|
5097
|
-
* Effect.gen(function*() {
|
|
5098
|
-
* const [evens, odds] = yield* Stream.make(1, 2, 3, 4).pipe(
|
|
5099
|
-
* Stream.partitionEffect((n) =>
|
|
5100
|
-
* Effect.succeed(n % 2 === 0 ? Result.succeed(n) : Result.fail(n))
|
|
5101
|
-
* )
|
|
5102
|
-
* )
|
|
5103
|
-
* const result = yield* Effect.all({
|
|
5104
|
-
* evens: Stream.runCollect(evens),
|
|
5105
|
-
* odds: Stream.runCollect(odds)
|
|
5106
|
-
* })
|
|
5107
|
-
* yield* Console.log(result)
|
|
5108
|
-
* })
|
|
5109
|
-
* )
|
|
5110
|
-
*
|
|
5111
|
-
* Effect.runPromise(program)
|
|
5112
|
-
* // Output: { evens: [ 2, 4 ], odds: [ 1, 3 ] }
|
|
5113
|
-
* ```
|
|
5114
5154
|
*/
|
|
5115
5155
|
export declare const partitionEffect: {
|
|
5116
5156
|
/**
|
|
5117
|
-
* Splits a stream using an effectful
|
|
5157
|
+
* Splits a stream using an effectful `Filter`, producing pass and fail streams.
|
|
5118
5158
|
*
|
|
5119
5159
|
* @since 4.0.0
|
|
5120
5160
|
* @category Filtering
|
|
5121
|
-
*
|
|
5122
|
-
* @example
|
|
5123
|
-
* ```ts
|
|
5124
|
-
* import { Console, Effect, Result, Stream } from "effect"
|
|
5125
|
-
*
|
|
5126
|
-
* const program = Effect.scoped(
|
|
5127
|
-
* Effect.gen(function*() {
|
|
5128
|
-
* const [evens, odds] = yield* Stream.make(1, 2, 3, 4).pipe(
|
|
5129
|
-
* Stream.partitionEffect((n) =>
|
|
5130
|
-
* Effect.succeed(n % 2 === 0 ? Result.succeed(n) : Result.fail(n))
|
|
5131
|
-
* )
|
|
5132
|
-
* )
|
|
5133
|
-
* const result = yield* Effect.all({
|
|
5134
|
-
* evens: Stream.runCollect(evens),
|
|
5135
|
-
* odds: Stream.runCollect(odds)
|
|
5136
|
-
* })
|
|
5137
|
-
* yield* Console.log(result)
|
|
5138
|
-
* })
|
|
5139
|
-
* )
|
|
5140
|
-
*
|
|
5141
|
-
* Effect.runPromise(program)
|
|
5142
|
-
* // Output: { evens: [ 2, 4 ], odds: [ 1, 3 ] }
|
|
5143
|
-
* ```
|
|
5144
5161
|
*/
|
|
5145
|
-
<A,
|
|
5162
|
+
<A, Pass, Fail, EX, RX>(filter: Filter.FilterEffect<NoInfer<A>, Pass, Fail, EX, RX>, options?: {
|
|
5146
5163
|
readonly capacity?: number | "unbounded" | undefined;
|
|
5147
5164
|
readonly concurrency?: number | "unbounded" | undefined;
|
|
5148
5165
|
}): <E, R>(self: Stream<A, E, R>) => Effect.Effect<[
|
|
5149
|
-
passes: Stream<
|
|
5150
|
-
fails: Stream<
|
|
5166
|
+
passes: Stream<Pass, E | EX>,
|
|
5167
|
+
fails: Stream<Fail, E | EX>
|
|
5151
5168
|
], never, R | RX | Scope.Scope>;
|
|
5152
5169
|
/**
|
|
5153
|
-
* Splits a stream using an effectful
|
|
5170
|
+
* Splits a stream using an effectful `Filter`, producing pass and fail streams.
|
|
5154
5171
|
*
|
|
5155
5172
|
* @since 4.0.0
|
|
5156
5173
|
* @category Filtering
|
|
5157
|
-
*
|
|
5158
|
-
* @example
|
|
5159
|
-
* ```ts
|
|
5160
|
-
* import { Console, Effect, Result, Stream } from "effect"
|
|
5161
|
-
*
|
|
5162
|
-
* const program = Effect.scoped(
|
|
5163
|
-
* Effect.gen(function*() {
|
|
5164
|
-
* const [evens, odds] = yield* Stream.make(1, 2, 3, 4).pipe(
|
|
5165
|
-
* Stream.partitionEffect((n) =>
|
|
5166
|
-
* Effect.succeed(n % 2 === 0 ? Result.succeed(n) : Result.fail(n))
|
|
5167
|
-
* )
|
|
5168
|
-
* )
|
|
5169
|
-
* const result = yield* Effect.all({
|
|
5170
|
-
* evens: Stream.runCollect(evens),
|
|
5171
|
-
* odds: Stream.runCollect(odds)
|
|
5172
|
-
* })
|
|
5173
|
-
* yield* Console.log(result)
|
|
5174
|
-
* })
|
|
5175
|
-
* )
|
|
5176
|
-
*
|
|
5177
|
-
* Effect.runPromise(program)
|
|
5178
|
-
* // Output: { evens: [ 2, 4 ], odds: [ 1, 3 ] }
|
|
5179
|
-
* ```
|
|
5180
5174
|
*/
|
|
5181
|
-
<A, E, R,
|
|
5175
|
+
<A, E, R, Pass, Fail, EX, RX>(self: Stream<A, E, R>, filter: Filter.FilterEffect<NoInfer<A>, Pass, Fail, EX, RX>, options?: {
|
|
5182
5176
|
readonly capacity?: number | "unbounded" | undefined;
|
|
5183
5177
|
readonly concurrency?: number | "unbounded" | undefined;
|
|
5184
5178
|
}): Effect.Effect<[
|
|
5185
|
-
passes: Stream<
|
|
5186
|
-
fails: Stream<
|
|
5179
|
+
passes: Stream<Pass, E | EX>,
|
|
5180
|
+
fails: Stream<Fail, E | EX>
|
|
5187
5181
|
], never, R | RX | Scope.Scope>;
|
|
5188
5182
|
};
|
|
5189
5183
|
/**
|
|
5190
|
-
* Splits a stream into excluded and satisfying substreams using a
|
|
5191
|
-
* refinement, or Filter.
|
|
5184
|
+
* Splits a stream into excluded and satisfying substreams using a `Filter`.
|
|
5192
5185
|
*
|
|
5193
5186
|
* The faster stream may advance up to `bufferSize` elements ahead of the slower
|
|
5194
5187
|
* one.
|
|
@@ -5198,12 +5191,12 @@ export declare const partitionEffect: {
|
|
|
5198
5191
|
*
|
|
5199
5192
|
* @example
|
|
5200
5193
|
* ```ts
|
|
5201
|
-
* import { Console, Effect, Stream } from "effect"
|
|
5194
|
+
* import { Console, Effect, Result, Stream } from "effect"
|
|
5202
5195
|
*
|
|
5203
5196
|
* const program = Effect.gen(function*() {
|
|
5204
5197
|
* const [excluded, satisfying] = yield* Stream.partition(
|
|
5205
5198
|
* Stream.make(1, 2, 3, 4),
|
|
5206
|
-
* (n) => n % 2 === 0
|
|
5199
|
+
* (n) => n % 2 === 0 ? Result.succeed(n) : Result.fail(n)
|
|
5207
5200
|
* )
|
|
5208
5201
|
* const left = yield* Stream.runCollect(excluded)
|
|
5209
5202
|
* const right = yield* Stream.runCollect(satisfying)
|
|
@@ -5216,42 +5209,7 @@ export declare const partitionEffect: {
|
|
|
5216
5209
|
*/
|
|
5217
5210
|
export declare const partition: {
|
|
5218
5211
|
/**
|
|
5219
|
-
* Splits a stream into excluded and satisfying substreams using a
|
|
5220
|
-
* refinement, or Filter.
|
|
5221
|
-
*
|
|
5222
|
-
* The faster stream may advance up to `bufferSize` elements ahead of the slower
|
|
5223
|
-
* one.
|
|
5224
|
-
*
|
|
5225
|
-
* @since 4.0.0
|
|
5226
|
-
* @category Filtering
|
|
5227
|
-
*
|
|
5228
|
-
* @example
|
|
5229
|
-
* ```ts
|
|
5230
|
-
* import { Console, Effect, Stream } from "effect"
|
|
5231
|
-
*
|
|
5232
|
-
* const program = Effect.gen(function*() {
|
|
5233
|
-
* const [excluded, satisfying] = yield* Stream.partition(
|
|
5234
|
-
* Stream.make(1, 2, 3, 4),
|
|
5235
|
-
* (n) => n % 2 === 0
|
|
5236
|
-
* )
|
|
5237
|
-
* const left = yield* Stream.runCollect(excluded)
|
|
5238
|
-
* const right = yield* Stream.runCollect(satisfying)
|
|
5239
|
-
* yield* Console.log(left)
|
|
5240
|
-
* // Output: [ 1, 3 ]
|
|
5241
|
-
* yield* Console.log(right)
|
|
5242
|
-
* // Output: [ 2, 4 ]
|
|
5243
|
-
* })
|
|
5244
|
-
* ```
|
|
5245
|
-
*/
|
|
5246
|
-
<C extends A, B extends A, A = C>(refinement: Refinement<NoInfer<A>, B>, options?: {
|
|
5247
|
-
readonly bufferSize?: number | undefined;
|
|
5248
|
-
}): <E, R>(self: Stream<C, E, R>) => Effect.Effect<[
|
|
5249
|
-
excluded: Stream<Exclude<C, B>, E>,
|
|
5250
|
-
satisfying: Stream<B, E>
|
|
5251
|
-
], never, R | Scope.Scope>;
|
|
5252
|
-
/**
|
|
5253
|
-
* Splits a stream into excluded and satisfying substreams using a predicate,
|
|
5254
|
-
* refinement, or Filter.
|
|
5212
|
+
* Splits a stream into excluded and satisfying substreams using a `Filter`.
|
|
5255
5213
|
*
|
|
5256
5214
|
* The faster stream may advance up to `bufferSize` elements ahead of the slower
|
|
5257
5215
|
* one.
|
|
@@ -5261,12 +5219,12 @@ export declare const partition: {
|
|
|
5261
5219
|
*
|
|
5262
5220
|
* @example
|
|
5263
5221
|
* ```ts
|
|
5264
|
-
* import { Console, Effect, Stream } from "effect"
|
|
5222
|
+
* import { Console, Effect, Result, Stream } from "effect"
|
|
5265
5223
|
*
|
|
5266
5224
|
* const program = Effect.gen(function*() {
|
|
5267
5225
|
* const [excluded, satisfying] = yield* Stream.partition(
|
|
5268
5226
|
* Stream.make(1, 2, 3, 4),
|
|
5269
|
-
* (n) => n % 2 === 0
|
|
5227
|
+
* (n) => n % 2 === 0 ? Result.succeed(n) : Result.fail(n)
|
|
5270
5228
|
* )
|
|
5271
5229
|
* const left = yield* Stream.runCollect(excluded)
|
|
5272
5230
|
* const right = yield* Stream.runCollect(satisfying)
|
|
@@ -5277,49 +5235,14 @@ export declare const partition: {
|
|
|
5277
5235
|
* })
|
|
5278
5236
|
* ```
|
|
5279
5237
|
*/
|
|
5280
|
-
<A,
|
|
5238
|
+
<A, Pass, Fail>(filter: Filter.Filter<NoInfer<A>, Pass, Fail>, options?: {
|
|
5281
5239
|
readonly bufferSize?: number | undefined;
|
|
5282
5240
|
}): <E, R>(self: Stream<A, E, R>) => Effect.Effect<[
|
|
5283
|
-
excluded: Stream<
|
|
5284
|
-
satisfying: Stream<
|
|
5285
|
-
], never, R | Scope.Scope>;
|
|
5286
|
-
/**
|
|
5287
|
-
* Splits a stream into excluded and satisfying substreams using a predicate,
|
|
5288
|
-
* refinement, or Filter.
|
|
5289
|
-
*
|
|
5290
|
-
* The faster stream may advance up to `bufferSize` elements ahead of the slower
|
|
5291
|
-
* one.
|
|
5292
|
-
*
|
|
5293
|
-
* @since 4.0.0
|
|
5294
|
-
* @category Filtering
|
|
5295
|
-
*
|
|
5296
|
-
* @example
|
|
5297
|
-
* ```ts
|
|
5298
|
-
* import { Console, Effect, Stream } from "effect"
|
|
5299
|
-
*
|
|
5300
|
-
* const program = Effect.gen(function*() {
|
|
5301
|
-
* const [excluded, satisfying] = yield* Stream.partition(
|
|
5302
|
-
* Stream.make(1, 2, 3, 4),
|
|
5303
|
-
* (n) => n % 2 === 0
|
|
5304
|
-
* )
|
|
5305
|
-
* const left = yield* Stream.runCollect(excluded)
|
|
5306
|
-
* const right = yield* Stream.runCollect(satisfying)
|
|
5307
|
-
* yield* Console.log(left)
|
|
5308
|
-
* // Output: [ 1, 3 ]
|
|
5309
|
-
* yield* Console.log(right)
|
|
5310
|
-
* // Output: [ 2, 4 ]
|
|
5311
|
-
* })
|
|
5312
|
-
* ```
|
|
5313
|
-
*/
|
|
5314
|
-
<C extends A, E, R, B extends A, A = C>(self: Stream<C, E, R>, refinement: Refinement<A, B>, options?: {
|
|
5315
|
-
readonly bufferSize?: number | undefined;
|
|
5316
|
-
}): Effect.Effect<[
|
|
5317
|
-
excluded: Stream<Exclude<C, B>, E>,
|
|
5318
|
-
satisfying: Stream<B, E>
|
|
5241
|
+
excluded: Stream<Fail, E>,
|
|
5242
|
+
satisfying: Stream<Pass, E>
|
|
5319
5243
|
], never, R | Scope.Scope>;
|
|
5320
5244
|
/**
|
|
5321
|
-
* Splits a stream into excluded and satisfying substreams using a
|
|
5322
|
-
* refinement, or Filter.
|
|
5245
|
+
* Splits a stream into excluded and satisfying substreams using a `Filter`.
|
|
5323
5246
|
*
|
|
5324
5247
|
* The faster stream may advance up to `bufferSize` elements ahead of the slower
|
|
5325
5248
|
* one.
|
|
@@ -5329,12 +5252,12 @@ export declare const partition: {
|
|
|
5329
5252
|
*
|
|
5330
5253
|
* @example
|
|
5331
5254
|
* ```ts
|
|
5332
|
-
* import { Console, Effect, Stream } from "effect"
|
|
5255
|
+
* import { Console, Effect, Result, Stream } from "effect"
|
|
5333
5256
|
*
|
|
5334
5257
|
* const program = Effect.gen(function*() {
|
|
5335
5258
|
* const [excluded, satisfying] = yield* Stream.partition(
|
|
5336
5259
|
* Stream.make(1, 2, 3, 4),
|
|
5337
|
-
* (n) => n % 2 === 0
|
|
5260
|
+
* (n) => n % 2 === 0 ? Result.succeed(n) : Result.fail(n)
|
|
5338
5261
|
* )
|
|
5339
5262
|
* const left = yield* Stream.runCollect(excluded)
|
|
5340
5263
|
* const right = yield* Stream.runCollect(satisfying)
|
|
@@ -5345,11 +5268,11 @@ export declare const partition: {
|
|
|
5345
5268
|
* })
|
|
5346
5269
|
* ```
|
|
5347
5270
|
*/
|
|
5348
|
-
<A, E, R,
|
|
5271
|
+
<A, E, R, Pass, Fail>(self: Stream<A, E, R>, filter: Filter.Filter<NoInfer<A>, Pass, Fail>, options?: {
|
|
5349
5272
|
readonly bufferSize?: number | undefined;
|
|
5350
5273
|
}): Effect.Effect<[
|
|
5351
|
-
excluded: Stream<
|
|
5352
|
-
satisfying: Stream<
|
|
5274
|
+
excluded: Stream<Fail, E>,
|
|
5275
|
+
satisfying: Stream<Pass, E>
|
|
5353
5276
|
], never, R | Scope.Scope>;
|
|
5354
5277
|
};
|
|
5355
5278
|
/**
|
|
@@ -6043,7 +5966,7 @@ export declare const tapError: {
|
|
|
6043
5966
|
<A, E, R, A2, E2, R2>(self: Stream<A, E, R>, f: (error: E) => Effect.Effect<A2, E2, R2>): Stream<A, E | E2, R | R2>;
|
|
6044
5967
|
};
|
|
6045
5968
|
/**
|
|
6046
|
-
* Recovers from errors that match a
|
|
5969
|
+
* Recovers from errors that match a predicate by switching to a recovery stream.
|
|
6047
5970
|
*
|
|
6048
5971
|
* When a failure matches the filter, the stream switches to the recovery
|
|
6049
5972
|
* stream. Non-matching failures propagate downstream, so the error type is
|
|
@@ -6057,12 +5980,12 @@ export declare const tapError: {
|
|
|
6057
5980
|
*
|
|
6058
5981
|
* @example
|
|
6059
5982
|
* ```ts
|
|
6060
|
-
* import { Console, Effect,
|
|
5983
|
+
* import { Console, Effect, Stream } from "effect"
|
|
6061
5984
|
*
|
|
6062
5985
|
* const stream = Stream.make(1, 2).pipe(
|
|
6063
5986
|
* Stream.concat(Stream.fail(42)),
|
|
6064
5987
|
* Stream.catchIf(
|
|
6065
|
-
*
|
|
5988
|
+
* (error): error is 42 => error === 42,
|
|
6066
5989
|
* () => Stream.make(999)
|
|
6067
5990
|
* )
|
|
6068
5991
|
* )
|
|
@@ -6081,7 +6004,7 @@ export declare const tapError: {
|
|
|
6081
6004
|
*/
|
|
6082
6005
|
export declare const catchIf: {
|
|
6083
6006
|
/**
|
|
6084
|
-
* Recovers from errors that match a
|
|
6007
|
+
* Recovers from errors that match a predicate by switching to a recovery stream.
|
|
6085
6008
|
*
|
|
6086
6009
|
* When a failure matches the filter, the stream switches to the recovery
|
|
6087
6010
|
* stream. Non-matching failures propagate downstream, so the error type is
|
|
@@ -6095,12 +6018,12 @@ export declare const catchIf: {
|
|
|
6095
6018
|
*
|
|
6096
6019
|
* @example
|
|
6097
6020
|
* ```ts
|
|
6098
|
-
* import { Console, Effect,
|
|
6021
|
+
* import { Console, Effect, Stream } from "effect"
|
|
6099
6022
|
*
|
|
6100
6023
|
* const stream = Stream.make(1, 2).pipe(
|
|
6101
6024
|
* Stream.concat(Stream.fail(42)),
|
|
6102
6025
|
* Stream.catchIf(
|
|
6103
|
-
*
|
|
6026
|
+
* (error): error is 42 => error === 42,
|
|
6104
6027
|
* () => Stream.make(999)
|
|
6105
6028
|
* )
|
|
6106
6029
|
* )
|
|
@@ -6119,7 +6042,7 @@ export declare const catchIf: {
|
|
|
6119
6042
|
*/
|
|
6120
6043
|
<E, EB extends E, A2, E2, R2, A3 = never, E3 = Exclude<E, EB>, R3 = never>(refinement: Refinement<NoInfer<E>, EB>, f: (e: EB) => Stream<A2, E2, R2>, orElse?: ((e: Exclude<E, EB>) => Stream<A3, E3, R3>) | undefined): <A, R>(self: Stream<A, E, R>) => Stream<A2 | A | A3, E2 | E3, R2 | R | R3>;
|
|
6121
6044
|
/**
|
|
6122
|
-
* Recovers from errors that match a
|
|
6045
|
+
* Recovers from errors that match a predicate by switching to a recovery stream.
|
|
6123
6046
|
*
|
|
6124
6047
|
* When a failure matches the filter, the stream switches to the recovery
|
|
6125
6048
|
* stream. Non-matching failures propagate downstream, so the error type is
|
|
@@ -6133,12 +6056,12 @@ export declare const catchIf: {
|
|
|
6133
6056
|
*
|
|
6134
6057
|
* @example
|
|
6135
6058
|
* ```ts
|
|
6136
|
-
* import { Console, Effect,
|
|
6059
|
+
* import { Console, Effect, Stream } from "effect"
|
|
6137
6060
|
*
|
|
6138
6061
|
* const stream = Stream.make(1, 2).pipe(
|
|
6139
6062
|
* Stream.concat(Stream.fail(42)),
|
|
6140
6063
|
* Stream.catchIf(
|
|
6141
|
-
*
|
|
6064
|
+
* (error): error is 42 => error === 42,
|
|
6142
6065
|
* () => Stream.make(999)
|
|
6143
6066
|
* )
|
|
6144
6067
|
* )
|
|
@@ -6155,9 +6078,9 @@ export declare const catchIf: {
|
|
|
6155
6078
|
* @since 4.0.0
|
|
6156
6079
|
* @category Error Handling
|
|
6157
6080
|
*/
|
|
6158
|
-
<E,
|
|
6081
|
+
<E, A2, E2, R2, A3 = never, E3 = E, R3 = never>(predicate: Predicate<NoInfer<E>>, f: (e: NoInfer<E>) => Stream<A2, E2, R2>, orElse?: ((e: NoInfer<E>) => Stream<A3, E3, R3>) | undefined): <A, R>(self: Stream<A, E, R>) => Stream<A2 | A | A3, E2 | E3, R2 | R | R3>;
|
|
6159
6082
|
/**
|
|
6160
|
-
* Recovers from errors that match a
|
|
6083
|
+
* Recovers from errors that match a predicate by switching to a recovery stream.
|
|
6161
6084
|
*
|
|
6162
6085
|
* When a failure matches the filter, the stream switches to the recovery
|
|
6163
6086
|
* stream. Non-matching failures propagate downstream, so the error type is
|
|
@@ -6171,12 +6094,12 @@ export declare const catchIf: {
|
|
|
6171
6094
|
*
|
|
6172
6095
|
* @example
|
|
6173
6096
|
* ```ts
|
|
6174
|
-
* import { Console, Effect,
|
|
6097
|
+
* import { Console, Effect, Stream } from "effect"
|
|
6175
6098
|
*
|
|
6176
6099
|
* const stream = Stream.make(1, 2).pipe(
|
|
6177
6100
|
* Stream.concat(Stream.fail(42)),
|
|
6178
6101
|
* Stream.catchIf(
|
|
6179
|
-
*
|
|
6102
|
+
* (error): error is 42 => error === 42,
|
|
6180
6103
|
* () => Stream.make(999)
|
|
6181
6104
|
* )
|
|
6182
6105
|
* )
|
|
@@ -6195,7 +6118,7 @@ export declare const catchIf: {
|
|
|
6195
6118
|
*/
|
|
6196
6119
|
<A, E, R, EB extends E, A2, E2, R2, A3 = never, E3 = Exclude<E, EB>, R3 = never>(self: Stream<A, E, R>, refinement: Refinement<E, EB>, f: (e: EB) => Stream<A2, E2, R2>, orElse?: ((e: Exclude<E, EB>) => Stream<A3, E3, R3>) | undefined): Stream<A | A2 | A3, E2 | E3, R | R2 | R3>;
|
|
6197
6120
|
/**
|
|
6198
|
-
* Recovers from errors that match a
|
|
6121
|
+
* Recovers from errors that match a predicate by switching to a recovery stream.
|
|
6199
6122
|
*
|
|
6200
6123
|
* When a failure matches the filter, the stream switches to the recovery
|
|
6201
6124
|
* stream. Non-matching failures propagate downstream, so the error type is
|
|
@@ -6209,12 +6132,12 @@ export declare const catchIf: {
|
|
|
6209
6132
|
*
|
|
6210
6133
|
* @example
|
|
6211
6134
|
* ```ts
|
|
6212
|
-
* import { Console, Effect,
|
|
6135
|
+
* import { Console, Effect, Stream } from "effect"
|
|
6213
6136
|
*
|
|
6214
6137
|
* const stream = Stream.make(1, 2).pipe(
|
|
6215
6138
|
* Stream.concat(Stream.fail(42)),
|
|
6216
6139
|
* Stream.catchIf(
|
|
6217
|
-
*
|
|
6140
|
+
* (error): error is 42 => error === 42,
|
|
6218
6141
|
* () => Stream.make(999)
|
|
6219
6142
|
* )
|
|
6220
6143
|
* )
|
|
@@ -6231,7 +6154,32 @@ export declare const catchIf: {
|
|
|
6231
6154
|
* @since 4.0.0
|
|
6232
6155
|
* @category Error Handling
|
|
6233
6156
|
*/
|
|
6234
|
-
<A, E, R,
|
|
6157
|
+
<A, E, R, A2, E2, R2, A3 = never, E3 = E, R3 = never>(self: Stream<A, E, R>, predicate: Predicate<E>, f: (e: E) => Stream<A2, E2, R2>, orElse?: ((e: E) => Stream<A3, E3, R3>) | undefined): Stream<A | A2 | A3, E2 | E3, R | R2 | R3>;
|
|
6158
|
+
};
|
|
6159
|
+
/**
|
|
6160
|
+
* Recovers from errors that match a `Filter` by switching to a recovery
|
|
6161
|
+
* stream.
|
|
6162
|
+
*
|
|
6163
|
+
* @since 4.0.0
|
|
6164
|
+
* @category Error Handling
|
|
6165
|
+
*/
|
|
6166
|
+
export declare const catchFilter: {
|
|
6167
|
+
/**
|
|
6168
|
+
* Recovers from errors that match a `Filter` by switching to a recovery
|
|
6169
|
+
* stream.
|
|
6170
|
+
*
|
|
6171
|
+
* @since 4.0.0
|
|
6172
|
+
* @category Error Handling
|
|
6173
|
+
*/
|
|
6174
|
+
<E, EB, A2, E2, R2, X, A3 = never, E3 = X, R3 = never>(filter: Filter.Filter<NoInfer<E>, EB, X>, f: (failure: EB) => Stream<A2, E2, R2>, orElse?: ((failure: X) => Stream<A3, E3, R3>) | undefined): <A, R>(self: Stream<A, E, R>) => Stream<A | A2 | A3, E2 | E3, R | R2 | R3>;
|
|
6175
|
+
/**
|
|
6176
|
+
* Recovers from errors that match a `Filter` by switching to a recovery
|
|
6177
|
+
* stream.
|
|
6178
|
+
*
|
|
6179
|
+
* @since 4.0.0
|
|
6180
|
+
* @category Error Handling
|
|
6181
|
+
*/
|
|
6182
|
+
<A, E, R, EB, A2, E2, R2, X, A3 = never, E3 = X, R3 = never>(self: Stream<A, E, R>, filter: Filter.Filter<NoInfer<E>, EB, X>, f: (failure: EB) => Stream<A2, E2, R2>, orElse?: ((failure: X) => Stream<A3, E3, R3>) | undefined): Stream<A | A2 | A3, E2 | E3, R | R2 | R3>;
|
|
6235
6183
|
};
|
|
6236
6184
|
/**
|
|
6237
6185
|
* Recovers from failures whose `_tag` matches the provided value by switching to
|
|
@@ -6567,7 +6515,7 @@ export declare const catchReason: {
|
|
|
6567
6515
|
* @since 4.0.0
|
|
6568
6516
|
* @category Error Handling
|
|
6569
6517
|
*/
|
|
6570
|
-
<K extends Tags<E>, E, RK extends ReasonTags<ExtractTag<NoInfer<E>, K>>, A2, E2, R2, A3 = unassigned, E3 = never, R3 = never>(errorTag: K, reasonTag: RK, f: (reason: ExtractReason<ExtractTag<NoInfer<E>, K>, RK>) => Stream<A2, E2, R2>, orElse?: ((reason: ExcludeReason<ExtractTag<NoInfer<E>, K>, RK>) => Stream<A3, E3, R3>) | undefined): <A, R>(self: Stream<A, E, R>) => Stream<A | A2 | Exclude<A3, unassigned>, (A3 extends unassigned ? E : ExcludeTag<E, K>) | E2 | E3, R | R2 | R3>;
|
|
6518
|
+
<K extends Tags<E>, E, RK extends ReasonTags<ExtractTag<NoInfer<E>, K>>, A2, E2, R2, A3 = unassigned, E3 = never, R3 = never>(errorTag: K, reasonTag: RK, f: (reason: ExtractReason<ExtractTag<NoInfer<E>, K>, RK>, error: NarrowReason<ExtractTag<NoInfer<E>, K>, RK>) => Stream<A2, E2, R2>, orElse?: ((reason: ExcludeReason<ExtractTag<NoInfer<E>, K>, RK>, error: OmitReason<ExtractTag<NoInfer<E>, K>, RK>) => Stream<A3, E3, R3>) | undefined): <A, R>(self: Stream<A, E, R>) => Stream<A | A2 | Exclude<A3, unassigned>, (A3 extends unassigned ? E : ExcludeTag<E, K>) | E2 | E3, R | R2 | R3>;
|
|
6571
6519
|
/**
|
|
6572
6520
|
* Catches a specific reason within a tagged error.
|
|
6573
6521
|
*
|
|
@@ -6611,7 +6559,7 @@ export declare const catchReason: {
|
|
|
6611
6559
|
* @since 4.0.0
|
|
6612
6560
|
* @category Error Handling
|
|
6613
6561
|
*/
|
|
6614
|
-
<A, E, R, K extends Tags<E>, RK extends ReasonTags<ExtractTag<E, K>>, A2, E2, R2, A3 = unassigned, E3 = never, R3 = never>(self: Stream<A, E, R>, errorTag: K, reasonTag: RK, f: (reason: ExtractReason<ExtractTag<E, K>, RK>) => Stream<A2, E2, R2>, orElse?: ((reason: ExcludeReason<ExtractTag<E, K>, RK>) => Stream<A3, E3, R3>) | undefined): Stream<A | A2 | Exclude<A3, unassigned>, (A3 extends unassigned ? E : ExcludeTag<E, K>) | E2 | E3, R | R2 | R3>;
|
|
6562
|
+
<A, E, R, K extends Tags<E>, RK extends ReasonTags<ExtractTag<E, K>>, A2, E2, R2, A3 = unassigned, E3 = never, R3 = never>(self: Stream<A, E, R>, errorTag: K, reasonTag: RK, f: (reason: ExtractReason<ExtractTag<E, K>, RK>, error: NarrowReason<ExtractTag<E, K>, RK>) => Stream<A2, E2, R2>, orElse?: ((reason: ExcludeReason<ExtractTag<E, K>, RK>, error: OmitReason<ExtractTag<E, K>, RK>) => Stream<A3, E3, R3>) | undefined): Stream<A | A2 | Exclude<A3, unassigned>, (A3 extends unassigned ? E : ExcludeTag<E, K>) | E2 | E3, R | R2 | R3>;
|
|
6615
6563
|
};
|
|
6616
6564
|
/**
|
|
6617
6565
|
* Catches multiple reasons within a tagged error using an object of handlers.
|
|
@@ -6697,8 +6645,8 @@ export declare const catchReasons: {
|
|
|
6697
6645
|
* @category Error Handling
|
|
6698
6646
|
*/
|
|
6699
6647
|
<K extends Tags<E>, E, Cases extends {
|
|
6700
|
-
[RK in ReasonTags<ExtractTag<NoInfer<E>, K>>]+?: (reason: ExtractReason<ExtractTag<NoInfer<E>, K>, RK>) => Stream<any, any, any>;
|
|
6701
|
-
}, A2 = unassigned, E2 = never, R2 = never>(errorTag: K, cases: Cases, orElse?: ((reason: ExcludeReason<ExtractTag<NoInfer<E>, K>, Extract<keyof Cases, string>>) => Stream<A2, E2, R2>) | undefined): <A, R>(self: Stream<A, E, R>) => Stream<A | Exclude<A2, unassigned> | {
|
|
6648
|
+
[RK in ReasonTags<ExtractTag<NoInfer<E>, K>>]+?: (reason: ExtractReason<ExtractTag<NoInfer<E>, K>, RK>, error: NarrowReason<ExtractTag<NoInfer<E>, K>, RK>) => Stream<any, any, any>;
|
|
6649
|
+
}, A2 = unassigned, E2 = never, R2 = never>(errorTag: K, cases: Cases, orElse?: ((reason: ExcludeReason<ExtractTag<NoInfer<E>, K>, Extract<keyof Cases, string>>, error: OmitReason<ExtractTag<NoInfer<E>, K>, Extract<keyof Cases, string>>) => Stream<A2, E2, R2>) | undefined): <A, R>(self: Stream<A, E, R>) => Stream<A | Exclude<A2, unassigned> | {
|
|
6702
6650
|
[RK in keyof Cases]: Cases[RK] extends (...args: Array<any>) => Stream<infer A, any, any> ? A : never;
|
|
6703
6651
|
}[keyof Cases], (A2 extends unassigned ? E : ExcludeTag<E, K>) | E2 | {
|
|
6704
6652
|
[RK in keyof Cases]: Cases[RK] extends (...args: Array<any>) => Stream<any, infer E, any> ? E : never;
|
|
@@ -6747,8 +6695,8 @@ export declare const catchReasons: {
|
|
|
6747
6695
|
* @category Error Handling
|
|
6748
6696
|
*/
|
|
6749
6697
|
<A, E, R, K extends Tags<E>, Cases extends {
|
|
6750
|
-
[RK in ReasonTags<ExtractTag<E, K>>]+?: (reason: ExtractReason<ExtractTag<E, K>, RK>) => Stream<any, any, any>;
|
|
6751
|
-
}, A2 = unassigned, E2 = never, R2 = never>(self: Stream<A, E, R>, errorTag: K, cases: Cases, orElse?: ((reason: ExcludeReason<ExtractTag<NoInfer<E>, K>, Extract<keyof Cases, string>>) => Stream<A2, E2, R2>) | undefined): Stream<A | Exclude<A2, unassigned> | {
|
|
6698
|
+
[RK in ReasonTags<ExtractTag<E, K>>]+?: (reason: ExtractReason<ExtractTag<E, K>, RK>, error: NarrowReason<ExtractTag<E, K>, RK>) => Stream<any, any, any>;
|
|
6699
|
+
}, A2 = unassigned, E2 = never, R2 = never>(self: Stream<A, E, R>, errorTag: K, cases: Cases, orElse?: ((reason: ExcludeReason<ExtractTag<NoInfer<E>, K>, Extract<keyof Cases, string>>, error: OmitReason<ExtractTag<NoInfer<E>, K>, Extract<keyof Cases, string>>) => Stream<A2, E2, R2>) | undefined): Stream<A | Exclude<A2, unassigned> | {
|
|
6752
6700
|
[RK in keyof Cases]: Cases[RK] extends (...args: Array<any>) => Stream<infer A, any, any> ? A : never;
|
|
6753
6701
|
}[keyof Cases], (A2 extends unassigned ? E : ExcludeTag<E, K>) | E2 | {
|
|
6754
6702
|
[RK in keyof Cases]: Cases[RK] extends (...args: Array<any>) => Stream<any, infer E, any> ? E : never;
|
|
@@ -6896,7 +6844,7 @@ export declare const catchCauseIf: {
|
|
|
6896
6844
|
* @since 4.0.0
|
|
6897
6845
|
* @category Error Handling
|
|
6898
6846
|
*/
|
|
6899
|
-
<E,
|
|
6847
|
+
<E, A2, E2, R2>(predicate: Predicate<Cause.Cause<E>>, f: (cause: Cause.Cause<E>) => Stream<A2, E2, R2>): <A, R>(self: Stream<A, E, R>) => Stream<A | A2, E | E2, R2 | R>;
|
|
6900
6848
|
/**
|
|
6901
6849
|
* Recovers from stream failures by filtering the `Cause` and switching to a recovery stream.
|
|
6902
6850
|
* Non-matching causes are re-emitted as failures.
|
|
@@ -6930,7 +6878,32 @@ export declare const catchCauseIf: {
|
|
|
6930
6878
|
* @since 4.0.0
|
|
6931
6879
|
* @category Error Handling
|
|
6932
6880
|
*/
|
|
6933
|
-
<A, E, R, A2, E2, R2
|
|
6881
|
+
<A, E, R, A2, E2, R2>(self: Stream<A, E, R>, predicate: Predicate<Cause.Cause<E>>, f: (cause: Cause.Cause<E>) => Stream<A2, E2, R2>): Stream<A | A2, E | E2, R | R2>;
|
|
6882
|
+
};
|
|
6883
|
+
/**
|
|
6884
|
+
* Recovers from stream failures by filtering the `Cause` and switching to a
|
|
6885
|
+
* recovery stream.
|
|
6886
|
+
*
|
|
6887
|
+
* @since 4.0.0
|
|
6888
|
+
* @category Error Handling
|
|
6889
|
+
*/
|
|
6890
|
+
export declare const catchCauseFilter: {
|
|
6891
|
+
/**
|
|
6892
|
+
* Recovers from stream failures by filtering the `Cause` and switching to a
|
|
6893
|
+
* recovery stream.
|
|
6894
|
+
*
|
|
6895
|
+
* @since 4.0.0
|
|
6896
|
+
* @category Error Handling
|
|
6897
|
+
*/
|
|
6898
|
+
<E, EB, A2, E2, R2, X extends Cause.Cause<any>>(filter: Filter.Filter<Cause.Cause<E>, EB, X>, f: (failure: EB, cause: Cause.Cause<E>) => Stream<A2, E2, R2>): <A, R>(self: Stream<A, E, R>) => Stream<A | A2, Cause.Cause.Error<X> | E2, R2 | R>;
|
|
6899
|
+
/**
|
|
6900
|
+
* Recovers from stream failures by filtering the `Cause` and switching to a
|
|
6901
|
+
* recovery stream.
|
|
6902
|
+
*
|
|
6903
|
+
* @since 4.0.0
|
|
6904
|
+
* @category Error Handling
|
|
6905
|
+
*/
|
|
6906
|
+
<A, E, R, EB, A2, E2, R2, X extends Cause.Cause<any>>(self: Stream<A, E, R>, filter: Filter.Filter<Cause.Cause<E>, EB, X>, f: (failure: EB, cause: Cause.Cause<E>) => Stream<A2, E2, R2>): Stream<A | A2, Cause.Cause.Error<X> | E2, R | R2>;
|
|
6934
6907
|
};
|
|
6935
6908
|
/**
|
|
6936
6909
|
* Switches to a fallback stream if this stream is empty.
|
|
@@ -7134,9 +7107,9 @@ export declare const orDie: <A, E, R>(self: Stream<A, E, R>) => Stream<A, never,
|
|
|
7134
7107
|
* @category Error Handling
|
|
7135
7108
|
*/
|
|
7136
7109
|
export declare const ignore: <Arg extends Stream<any, any, any> | {
|
|
7137
|
-
readonly log?: boolean |
|
|
7110
|
+
readonly log?: boolean | Severity | undefined;
|
|
7138
7111
|
} | undefined>(selfOrOptions: Arg, options?: {
|
|
7139
|
-
readonly log?: boolean |
|
|
7112
|
+
readonly log?: boolean | Severity | undefined;
|
|
7140
7113
|
} | undefined) => [Arg] extends [Stream<infer A, infer _E, infer R>] ? Stream<A, never, R> : <A, E, R>(self: Stream<A, E, R>) => Stream<A, never, R>;
|
|
7141
7114
|
/**
|
|
7142
7115
|
* Ignores the stream's failure cause, including defects, and ends the stream.
|
|
@@ -7159,9 +7132,9 @@ export declare const ignore: <Arg extends Stream<any, any, any> | {
|
|
|
7159
7132
|
* @category Error Handling
|
|
7160
7133
|
*/
|
|
7161
7134
|
export declare const ignoreCause: <Arg extends Stream<any, any, any> | {
|
|
7162
|
-
readonly log?: boolean |
|
|
7135
|
+
readonly log?: boolean | Severity | undefined;
|
|
7163
7136
|
} | undefined>(streamOrOptions: Arg, options?: {
|
|
7164
|
-
readonly log?: boolean |
|
|
7137
|
+
readonly log?: boolean | Severity | undefined;
|
|
7165
7138
|
} | undefined) => [Arg] extends [Stream<infer A, infer _E, infer R>] ? Stream<A, never, R> : <A, E, R>(self: Stream<A, E, R>) => Stream<A, never, R>;
|
|
7166
7139
|
/**
|
|
7167
7140
|
* When the stream fails, retry it according to the given schedule.
|
|
@@ -7270,9 +7243,9 @@ export declare const retry: {
|
|
|
7270
7243
|
*
|
|
7271
7244
|
* @example
|
|
7272
7245
|
* ```ts
|
|
7273
|
-
* import { Console, Effect, ExecutionPlan, Layer,
|
|
7246
|
+
* import { Console, Effect, ExecutionPlan, Layer, Context, Stream } from "effect"
|
|
7274
7247
|
*
|
|
7275
|
-
* class Service extends
|
|
7248
|
+
* class Service extends Context.Service<Service>()("Service", {
|
|
7276
7249
|
* make: Effect.succeed({
|
|
7277
7250
|
* stream: Stream.fail("A") as Stream.Stream<number, string>
|
|
7278
7251
|
* })
|
|
@@ -7312,9 +7285,9 @@ export declare const withExecutionPlan: {
|
|
|
7312
7285
|
*
|
|
7313
7286
|
* @example
|
|
7314
7287
|
* ```ts
|
|
7315
|
-
* import { Console, Effect, ExecutionPlan, Layer,
|
|
7288
|
+
* import { Console, Effect, ExecutionPlan, Layer, Context, Stream } from "effect"
|
|
7316
7289
|
*
|
|
7317
|
-
* class Service extends
|
|
7290
|
+
* class Service extends Context.Service<Service>()("Service", {
|
|
7318
7291
|
* make: Effect.succeed({
|
|
7319
7292
|
* stream: Stream.fail("A") as Stream.Stream<number, string>
|
|
7320
7293
|
* })
|
|
@@ -7361,9 +7334,9 @@ export declare const withExecutionPlan: {
|
|
|
7361
7334
|
*
|
|
7362
7335
|
* @example
|
|
7363
7336
|
* ```ts
|
|
7364
|
-
* import { Console, Effect, ExecutionPlan, Layer,
|
|
7337
|
+
* import { Console, Effect, ExecutionPlan, Layer, Context, Stream } from "effect"
|
|
7365
7338
|
*
|
|
7366
|
-
* class Service extends
|
|
7339
|
+
* class Service extends Context.Service<Service>()("Service", {
|
|
7367
7340
|
* make: Effect.succeed({
|
|
7368
7341
|
* stream: Stream.fail("A") as Stream.Stream<number, string>
|
|
7369
7342
|
* })
|
|
@@ -7811,7 +7784,7 @@ export declare const takeWhile: {
|
|
|
7811
7784
|
* @since 2.0.0
|
|
7812
7785
|
* @category Filtering
|
|
7813
7786
|
*/
|
|
7814
|
-
<A,
|
|
7787
|
+
<A, E, R, B extends A>(self: Stream<A, E, R>, refinement: (a: NoInfer<A>, n: number) => a is B): Stream<B, E, R>;
|
|
7815
7788
|
/**
|
|
7816
7789
|
* Takes the longest initial prefix of elements that satisfy the predicate.
|
|
7817
7790
|
*
|
|
@@ -7835,52 +7808,26 @@ export declare const takeWhile: {
|
|
|
7835
7808
|
* @since 2.0.0
|
|
7836
7809
|
* @category Filtering
|
|
7837
7810
|
*/
|
|
7838
|
-
<A, E, R
|
|
7811
|
+
<A, E, R>(self: Stream<A, E, R>, predicate: (a: NoInfer<A>, n: number) => boolean): Stream<A, E, R>;
|
|
7812
|
+
};
|
|
7813
|
+
/**
|
|
7814
|
+
* Takes the longest initial prefix of elements that satisfy the filter.
|
|
7815
|
+
*
|
|
7816
|
+
* @since 4.0.0
|
|
7817
|
+
* @category Filtering
|
|
7818
|
+
*/
|
|
7819
|
+
export declare const takeWhileFilter: {
|
|
7839
7820
|
/**
|
|
7840
|
-
* Takes the longest initial prefix of elements that satisfy the
|
|
7841
|
-
*
|
|
7842
|
-
* @example
|
|
7843
|
-
* ```ts
|
|
7844
|
-
* import { Console, Effect, Stream } from "effect"
|
|
7845
|
-
*
|
|
7846
|
-
* const stream = Stream.range(1, 5).pipe(
|
|
7847
|
-
* Stream.takeWhile((n) => n % 3 !== 0)
|
|
7848
|
-
* )
|
|
7849
|
-
*
|
|
7850
|
-
* const program = Effect.gen(function*() {
|
|
7851
|
-
* const result = yield* Stream.runCollect(stream)
|
|
7852
|
-
* yield* Console.log(result)
|
|
7853
|
-
* })
|
|
7821
|
+
* Takes the longest initial prefix of elements that satisfy the filter.
|
|
7854
7822
|
*
|
|
7855
|
-
*
|
|
7856
|
-
* // Output: [ 1, 2 ]
|
|
7857
|
-
* ```
|
|
7858
|
-
*
|
|
7859
|
-
* @since 2.0.0
|
|
7823
|
+
* @since 4.0.0
|
|
7860
7824
|
* @category Filtering
|
|
7861
7825
|
*/
|
|
7862
|
-
<A,
|
|
7826
|
+
<A, B, X>(f: Filter.Filter<NoInfer<A>, B, X>): <E, R>(self: Stream<A, E, R>) => Stream<B, E, R>;
|
|
7863
7827
|
/**
|
|
7864
|
-
* Takes the longest initial prefix of elements that satisfy the
|
|
7828
|
+
* Takes the longest initial prefix of elements that satisfy the filter.
|
|
7865
7829
|
*
|
|
7866
|
-
* @
|
|
7867
|
-
* ```ts
|
|
7868
|
-
* import { Console, Effect, Stream } from "effect"
|
|
7869
|
-
*
|
|
7870
|
-
* const stream = Stream.range(1, 5).pipe(
|
|
7871
|
-
* Stream.takeWhile((n) => n % 3 !== 0)
|
|
7872
|
-
* )
|
|
7873
|
-
*
|
|
7874
|
-
* const program = Effect.gen(function*() {
|
|
7875
|
-
* const result = yield* Stream.runCollect(stream)
|
|
7876
|
-
* yield* Console.log(result)
|
|
7877
|
-
* })
|
|
7878
|
-
*
|
|
7879
|
-
* Effect.runPromise(program)
|
|
7880
|
-
* // Output: [ 1, 2 ]
|
|
7881
|
-
* ```
|
|
7882
|
-
*
|
|
7883
|
-
* @since 2.0.0
|
|
7830
|
+
* @since 4.0.0
|
|
7884
7831
|
* @category Filtering
|
|
7885
7832
|
*/
|
|
7886
7833
|
<A, E, R, B, X>(self: Stream<A, E, R>, f: Filter.Filter<NoInfer<A>, B, X>): Stream<B, E, R>;
|
|
@@ -8236,53 +8183,29 @@ export declare const dropWhile: {
|
|
|
8236
8183
|
* @since 2.0.0
|
|
8237
8184
|
* @category Filtering
|
|
8238
8185
|
*/
|
|
8239
|
-
<A,
|
|
8186
|
+
<A, E, R>(self: Stream<A, E, R>, predicate: (a: NoInfer<A>, index: number) => boolean): Stream<A, E, R>;
|
|
8187
|
+
};
|
|
8188
|
+
/**
|
|
8189
|
+
* Drops elements while the filter succeeds.
|
|
8190
|
+
*
|
|
8191
|
+
* @since 4.0.0
|
|
8192
|
+
* @category Filtering
|
|
8193
|
+
*/
|
|
8194
|
+
export declare const dropWhileFilter: {
|
|
8240
8195
|
/**
|
|
8241
|
-
* Drops elements
|
|
8242
|
-
*
|
|
8243
|
-
* @example
|
|
8244
|
-
* ```ts
|
|
8245
|
-
* import { Console, Effect, Stream } from "effect"
|
|
8246
|
-
*
|
|
8247
|
-
* const program = Effect.gen(function*() {
|
|
8248
|
-
* const values = yield* Stream.make(1, 2, 3, 4, 5).pipe(
|
|
8249
|
-
* Stream.dropWhile((n) => n < 3),
|
|
8250
|
-
* Stream.runCollect
|
|
8251
|
-
* )
|
|
8252
|
-
* yield* Console.log(values)
|
|
8253
|
-
* })
|
|
8254
|
-
*
|
|
8255
|
-
* Effect.runPromise(program)
|
|
8256
|
-
* // Output: [ 3, 4, 5 ]
|
|
8257
|
-
* ```
|
|
8196
|
+
* Drops elements while the filter succeeds.
|
|
8258
8197
|
*
|
|
8259
|
-
* @since
|
|
8198
|
+
* @since 4.0.0
|
|
8260
8199
|
* @category Filtering
|
|
8261
8200
|
*/
|
|
8262
|
-
<A,
|
|
8201
|
+
<A, B, X>(filter: Filter.Filter<NoInfer<A>, B, X>): <E, R>(self: Stream<A, E, R>) => Stream<A, E, R>;
|
|
8263
8202
|
/**
|
|
8264
|
-
* Drops elements
|
|
8265
|
-
*
|
|
8266
|
-
* @example
|
|
8267
|
-
* ```ts
|
|
8268
|
-
* import { Console, Effect, Stream } from "effect"
|
|
8269
|
-
*
|
|
8270
|
-
* const program = Effect.gen(function*() {
|
|
8271
|
-
* const values = yield* Stream.make(1, 2, 3, 4, 5).pipe(
|
|
8272
|
-
* Stream.dropWhile((n) => n < 3),
|
|
8273
|
-
* Stream.runCollect
|
|
8274
|
-
* )
|
|
8275
|
-
* yield* Console.log(values)
|
|
8276
|
-
* })
|
|
8277
|
-
*
|
|
8278
|
-
* Effect.runPromise(program)
|
|
8279
|
-
* // Output: [ 3, 4, 5 ]
|
|
8280
|
-
* ```
|
|
8203
|
+
* Drops elements while the filter succeeds.
|
|
8281
8204
|
*
|
|
8282
|
-
* @since
|
|
8205
|
+
* @since 4.0.0
|
|
8283
8206
|
* @category Filtering
|
|
8284
8207
|
*/
|
|
8285
|
-
<A, E, R, B, X>(self: Stream<A, E, R>,
|
|
8208
|
+
<A, E, R, B, X>(self: Stream<A, E, R>, filter: Filter.Filter<NoInfer<A>, B, X>): Stream<A, E, R>;
|
|
8286
8209
|
};
|
|
8287
8210
|
/**
|
|
8288
8211
|
* Drops elements while the specified effectful predicate evaluates to `true`.
|
|
@@ -9557,7 +9480,7 @@ export declare const debounce: {
|
|
|
9557
9480
|
* @since 2.0.0
|
|
9558
9481
|
* @category Rate Limiting
|
|
9559
9482
|
*/
|
|
9560
|
-
(duration: Duration.
|
|
9483
|
+
(duration: Duration.Input): <A, E, R>(self: Stream<A, E, R>) => Stream<A, E, R>;
|
|
9561
9484
|
/**
|
|
9562
9485
|
* Drops earlier elements within the debounce window and emits only the latest element after the pause.
|
|
9563
9486
|
*
|
|
@@ -9581,7 +9504,7 @@ export declare const debounce: {
|
|
|
9581
9504
|
* @since 2.0.0
|
|
9582
9505
|
* @category Rate Limiting
|
|
9583
9506
|
*/
|
|
9584
|
-
<A, E, R>(self: Stream<A, E, R>, duration: Duration.
|
|
9507
|
+
<A, E, R>(self: Stream<A, E, R>, duration: Duration.Input): Stream<A, E, R>;
|
|
9585
9508
|
};
|
|
9586
9509
|
/**
|
|
9587
9510
|
* Delays the arrays of this stream according to the given bandwidth
|
|
@@ -9659,7 +9582,7 @@ export declare const throttleEffect: {
|
|
|
9659
9582
|
<A, E2, R2>(options: {
|
|
9660
9583
|
readonly cost: (arr: Arr.NonEmptyReadonlyArray<A>) => Effect.Effect<number, E2, R2>;
|
|
9661
9584
|
readonly units: number;
|
|
9662
|
-
readonly duration: Duration.
|
|
9585
|
+
readonly duration: Duration.Input;
|
|
9663
9586
|
readonly burst?: number | undefined;
|
|
9664
9587
|
readonly strategy?: "enforce" | "shape" | undefined;
|
|
9665
9588
|
}): <E, R>(self: Stream<A, E, R>) => Stream<A, E2 | E, R2 | R>;
|
|
@@ -9702,7 +9625,7 @@ export declare const throttleEffect: {
|
|
|
9702
9625
|
<A, E, R, E2, R2>(self: Stream<A, E, R>, options: {
|
|
9703
9626
|
readonly cost: (arr: Arr.NonEmptyReadonlyArray<A>) => Effect.Effect<number, E2, R2>;
|
|
9704
9627
|
readonly units: number;
|
|
9705
|
-
readonly duration: Duration.
|
|
9628
|
+
readonly duration: Duration.Input;
|
|
9706
9629
|
readonly burst?: number | undefined;
|
|
9707
9630
|
readonly strategy?: "enforce" | "shape" | undefined;
|
|
9708
9631
|
}): Stream<A, E | E2, R | R2>;
|
|
@@ -9781,7 +9704,7 @@ export declare const throttle: {
|
|
|
9781
9704
|
<A>(options: {
|
|
9782
9705
|
readonly cost: (arr: Arr.NonEmptyReadonlyArray<A>) => number;
|
|
9783
9706
|
readonly units: number;
|
|
9784
|
-
readonly duration: Duration.
|
|
9707
|
+
readonly duration: Duration.Input;
|
|
9785
9708
|
readonly burst?: number | undefined;
|
|
9786
9709
|
readonly strategy?: "enforce" | "shape" | undefined;
|
|
9787
9710
|
}): <E, R>(self: Stream<A, E, R>) => Stream<A, E, R>;
|
|
@@ -9823,7 +9746,7 @@ export declare const throttle: {
|
|
|
9823
9746
|
<A, E, R>(self: Stream<A, E, R>, options: {
|
|
9824
9747
|
readonly cost: (arr: Arr.NonEmptyReadonlyArray<A>) => number;
|
|
9825
9748
|
readonly units: number;
|
|
9826
|
-
readonly duration: Duration.
|
|
9749
|
+
readonly duration: Duration.Input;
|
|
9827
9750
|
readonly burst?: number | undefined;
|
|
9828
9751
|
readonly strategy?: "enforce" | "shape" | undefined;
|
|
9829
9752
|
}): Stream<A, E, R>;
|
|
@@ -9951,7 +9874,7 @@ export declare const groupedWithin: {
|
|
|
9951
9874
|
* @since 2.0.0
|
|
9952
9875
|
* @category Grouping
|
|
9953
9876
|
*/
|
|
9954
|
-
(chunkSize: number, duration: Duration.
|
|
9877
|
+
(chunkSize: number, duration: Duration.Input): <A, E, R>(self: Stream<A, E, R>) => Stream<Array<A>, E, R>;
|
|
9955
9878
|
/**
|
|
9956
9879
|
* Partitions the stream into arrays, emitting when the chunk size is reached
|
|
9957
9880
|
* or the duration passes.
|
|
@@ -9975,7 +9898,7 @@ export declare const groupedWithin: {
|
|
|
9975
9898
|
* @since 2.0.0
|
|
9976
9899
|
* @category Grouping
|
|
9977
9900
|
*/
|
|
9978
|
-
<A, E, R>(self: Stream<A, E, R>, chunkSize: number, duration: Duration.
|
|
9901
|
+
<A, E, R>(self: Stream<A, E, R>, chunkSize: number, duration: Duration.Input): Stream<Array<A>, E, R>;
|
|
9979
9902
|
};
|
|
9980
9903
|
/**
|
|
9981
9904
|
* Groups elements into keyed substreams using an effectful classifier.
|
|
@@ -10042,7 +9965,7 @@ export declare const groupBy: {
|
|
|
10042
9965
|
*/
|
|
10043
9966
|
<A, K, V, E2, R2>(f: (a: NoInfer<A>) => Effect.Effect<readonly [K, V], E2, R2>, options?: {
|
|
10044
9967
|
readonly bufferSize?: number | undefined;
|
|
10045
|
-
readonly idleTimeToLive?: Duration.
|
|
9968
|
+
readonly idleTimeToLive?: Duration.Input | undefined;
|
|
10046
9969
|
}): <E, R>(self: Stream<A, E, R>) => Stream<readonly [K, Stream<V>], E | E2, R | R2>;
|
|
10047
9970
|
/**
|
|
10048
9971
|
* Groups elements into keyed substreams using an effectful classifier.
|
|
@@ -10077,7 +10000,7 @@ export declare const groupBy: {
|
|
|
10077
10000
|
*/
|
|
10078
10001
|
<A, E, R, K, V, E2, R2>(self: Stream<A, E, R>, f: (a: NoInfer<A>) => Effect.Effect<readonly [K, V], E2, R2>, options?: {
|
|
10079
10002
|
readonly bufferSize?: number | undefined;
|
|
10080
|
-
readonly idleTimeToLive?: Duration.
|
|
10003
|
+
readonly idleTimeToLive?: Duration.Input | undefined;
|
|
10081
10004
|
}): Stream<readonly [K, Stream<V>], E | E2, R | R2>;
|
|
10082
10005
|
};
|
|
10083
10006
|
/**
|
|
@@ -10141,7 +10064,7 @@ export declare const groupByKey: {
|
|
|
10141
10064
|
*/
|
|
10142
10065
|
<A, K>(f: (a: NoInfer<A>) => K, options?: {
|
|
10143
10066
|
readonly bufferSize?: number | undefined;
|
|
10144
|
-
readonly idleTimeToLive?: Duration.
|
|
10067
|
+
readonly idleTimeToLive?: Duration.Input | undefined;
|
|
10145
10068
|
}): <E, R>(self: Stream<A, E, R>) => Stream<readonly [K, Stream<A>], E, R>;
|
|
10146
10069
|
/**
|
|
10147
10070
|
* Groups elements by a key and emits a stream per key.
|
|
@@ -10174,7 +10097,7 @@ export declare const groupByKey: {
|
|
|
10174
10097
|
*/
|
|
10175
10098
|
<A, E, R, K>(self: Stream<A, E, R>, f: (a: NoInfer<A>) => K, options?: {
|
|
10176
10099
|
readonly bufferSize?: number | undefined;
|
|
10177
|
-
readonly idleTimeToLive?: Duration.
|
|
10100
|
+
readonly idleTimeToLive?: Duration.Input | undefined;
|
|
10178
10101
|
}): Stream<readonly [K, Stream<A>], E, R>;
|
|
10179
10102
|
};
|
|
10180
10103
|
/**
|
|
@@ -10559,12 +10482,12 @@ export declare const share: {
|
|
|
10559
10482
|
(options: {
|
|
10560
10483
|
readonly capacity: "unbounded";
|
|
10561
10484
|
readonly replay?: number | undefined;
|
|
10562
|
-
readonly idleTimeToLive?: Duration.
|
|
10485
|
+
readonly idleTimeToLive?: Duration.Input | undefined;
|
|
10563
10486
|
} | {
|
|
10564
10487
|
readonly capacity: number;
|
|
10565
10488
|
readonly strategy?: "sliding" | "dropping" | "suspend" | undefined;
|
|
10566
10489
|
readonly replay?: number | undefined;
|
|
10567
|
-
readonly idleTimeToLive?: Duration.
|
|
10490
|
+
readonly idleTimeToLive?: Duration.Input | undefined;
|
|
10568
10491
|
}): <A, E, R>(self: Stream<A, E, R>) => Effect.Effect<Stream<A, E>, never, Scope.Scope | R>;
|
|
10569
10492
|
/**
|
|
10570
10493
|
* Returns a new Stream that multicasts the original stream, subscribing when the first consumer starts.
|
|
@@ -10600,12 +10523,12 @@ export declare const share: {
|
|
|
10600
10523
|
<A, E, R>(self: Stream<A, E, R>, options: {
|
|
10601
10524
|
readonly capacity: "unbounded";
|
|
10602
10525
|
readonly replay?: number | undefined;
|
|
10603
|
-
readonly idleTimeToLive?: Duration.
|
|
10526
|
+
readonly idleTimeToLive?: Duration.Input | undefined;
|
|
10604
10527
|
} | {
|
|
10605
10528
|
readonly capacity: number;
|
|
10606
10529
|
readonly strategy?: "sliding" | "dropping" | "suspend" | undefined;
|
|
10607
10530
|
readonly replay?: number | undefined;
|
|
10608
|
-
readonly idleTimeToLive?: Duration.
|
|
10531
|
+
readonly idleTimeToLive?: Duration.Input | undefined;
|
|
10609
10532
|
}): Effect.Effect<Stream<A, E>, never, Scope.Scope | R>;
|
|
10610
10533
|
};
|
|
10611
10534
|
/**
|
|
@@ -12163,7 +12086,7 @@ export declare const ensuring: {
|
|
|
12163
12086
|
<A, E, R, R2>(self: Stream<A, E, R>, finalizer: Effect.Effect<unknown, never, R2>): Stream<A, E, R | R2>;
|
|
12164
12087
|
};
|
|
12165
12088
|
/**
|
|
12166
|
-
* Provides a layer or
|
|
12089
|
+
* Provides a layer or context to the stream, removing the corresponding
|
|
12167
12090
|
* service requirements. Use `options.local` to build the layer every time; by
|
|
12168
12091
|
* default, layers are shared between provide calls.
|
|
12169
12092
|
*
|
|
@@ -12171,9 +12094,9 @@ export declare const ensuring: {
|
|
|
12171
12094
|
*
|
|
12172
12095
|
* @example
|
|
12173
12096
|
* ```ts
|
|
12174
|
-
* import { Console, Effect, Layer,
|
|
12097
|
+
* import { Console, Effect, Layer, Context, Stream } from "effect"
|
|
12175
12098
|
*
|
|
12176
|
-
* class Env extends
|
|
12099
|
+
* class Env extends Context.Service<Env, { readonly name: string }>()("Env") {}
|
|
12177
12100
|
*
|
|
12178
12101
|
* const layer = Layer.succeed(Env)({ name: "Ada" })
|
|
12179
12102
|
*
|
|
@@ -12200,7 +12123,7 @@ export declare const ensuring: {
|
|
|
12200
12123
|
*/
|
|
12201
12124
|
export declare const provide: {
|
|
12202
12125
|
/**
|
|
12203
|
-
* Provides a layer or
|
|
12126
|
+
* Provides a layer or context to the stream, removing the corresponding
|
|
12204
12127
|
* service requirements. Use `options.local` to build the layer every time; by
|
|
12205
12128
|
* default, layers are shared between provide calls.
|
|
12206
12129
|
*
|
|
@@ -12208,9 +12131,9 @@ export declare const provide: {
|
|
|
12208
12131
|
*
|
|
12209
12132
|
* @example
|
|
12210
12133
|
* ```ts
|
|
12211
|
-
* import { Console, Effect, Layer,
|
|
12134
|
+
* import { Console, Effect, Layer, Context, Stream } from "effect"
|
|
12212
12135
|
*
|
|
12213
|
-
* class Env extends
|
|
12136
|
+
* class Env extends Context.Service<Env, { readonly name: string }>()("Env") {}
|
|
12214
12137
|
*
|
|
12215
12138
|
* const layer = Layer.succeed(Env)({ name: "Ada" })
|
|
12216
12139
|
*
|
|
@@ -12235,11 +12158,11 @@ export declare const provide: {
|
|
|
12235
12158
|
* @since 4.0.0
|
|
12236
12159
|
* @category Services
|
|
12237
12160
|
*/
|
|
12238
|
-
<AL, EL = never, RL = never>(layer: Layer.Layer<AL, EL, RL> |
|
|
12161
|
+
<AL, EL = never, RL = never>(layer: Layer.Layer<AL, EL, RL> | Context.Context<AL>, options?: {
|
|
12239
12162
|
readonly local?: boolean | undefined;
|
|
12240
12163
|
} | undefined): <A, E, R>(self: Stream<A, E, R>) => Stream<A, E | EL, Exclude<R, AL> | RL>;
|
|
12241
12164
|
/**
|
|
12242
|
-
* Provides a layer or
|
|
12165
|
+
* Provides a layer or context to the stream, removing the corresponding
|
|
12243
12166
|
* service requirements. Use `options.local` to build the layer every time; by
|
|
12244
12167
|
* default, layers are shared between provide calls.
|
|
12245
12168
|
*
|
|
@@ -12247,9 +12170,9 @@ export declare const provide: {
|
|
|
12247
12170
|
*
|
|
12248
12171
|
* @example
|
|
12249
12172
|
* ```ts
|
|
12250
|
-
* import { Console, Effect, Layer,
|
|
12173
|
+
* import { Console, Effect, Layer, Context, Stream } from "effect"
|
|
12251
12174
|
*
|
|
12252
|
-
* class Env extends
|
|
12175
|
+
* class Env extends Context.Service<Env, { readonly name: string }>()("Env") {}
|
|
12253
12176
|
*
|
|
12254
12177
|
* const layer = Layer.succeed(Env)({ name: "Ada" })
|
|
12255
12178
|
*
|
|
@@ -12274,22 +12197,22 @@ export declare const provide: {
|
|
|
12274
12197
|
* @since 4.0.0
|
|
12275
12198
|
* @category Services
|
|
12276
12199
|
*/
|
|
12277
|
-
<A, E, R, AL, EL = never, RL = never>(self: Stream<A, E, R>, layer: Layer.Layer<AL, EL, RL> |
|
|
12200
|
+
<A, E, R, AL, EL = never, RL = never>(self: Stream<A, E, R>, layer: Layer.Layer<AL, EL, RL> | Context.Context<AL>, options?: {
|
|
12278
12201
|
readonly local?: boolean | undefined;
|
|
12279
12202
|
} | undefined): Stream<A, E | EL, Exclude<R, AL> | RL>;
|
|
12280
12203
|
};
|
|
12281
12204
|
/**
|
|
12282
|
-
* Provides multiple services to the stream using a
|
|
12205
|
+
* Provides multiple services to the stream using a context.
|
|
12283
12206
|
*
|
|
12284
12207
|
* @example
|
|
12285
12208
|
* ```ts
|
|
12286
|
-
* import { Console, Effect,
|
|
12209
|
+
* import { Console, Effect, Context, Stream } from "effect"
|
|
12287
12210
|
*
|
|
12288
|
-
* class Config extends
|
|
12289
|
-
* class Greeter extends
|
|
12211
|
+
* class Config extends Context.Service<Config, { readonly prefix: string }>()("Config") {}
|
|
12212
|
+
* class Greeter extends Context.Service<Greeter, { greet: (name: string) => string }>()("Greeter") {}
|
|
12290
12213
|
*
|
|
12291
|
-
* const
|
|
12292
|
-
*
|
|
12214
|
+
* const context = Context.make(Config, { prefix: "Hello" }).pipe(
|
|
12215
|
+
* Context.add(Greeter, { greet: (name: string) => `${name}!` })
|
|
12293
12216
|
* )
|
|
12294
12217
|
*
|
|
12295
12218
|
* const stream = Stream.fromEffect(
|
|
@@ -12301,7 +12224,7 @@ export declare const provide: {
|
|
|
12301
12224
|
* )
|
|
12302
12225
|
*
|
|
12303
12226
|
* const program = Effect.gen(function*() {
|
|
12304
|
-
* const result = yield* Stream.runCollect(Stream.
|
|
12227
|
+
* const result = yield* Stream.runCollect(Stream.provideContext(stream, context))
|
|
12305
12228
|
* yield* Console.log(result)
|
|
12306
12229
|
* })
|
|
12307
12230
|
*
|
|
@@ -12312,19 +12235,19 @@ export declare const provide: {
|
|
|
12312
12235
|
* @since 4.0.0
|
|
12313
12236
|
* @category Services
|
|
12314
12237
|
*/
|
|
12315
|
-
export declare const
|
|
12238
|
+
export declare const provideContext: {
|
|
12316
12239
|
/**
|
|
12317
|
-
* Provides multiple services to the stream using a
|
|
12240
|
+
* Provides multiple services to the stream using a context.
|
|
12318
12241
|
*
|
|
12319
12242
|
* @example
|
|
12320
12243
|
* ```ts
|
|
12321
|
-
* import { Console, Effect,
|
|
12244
|
+
* import { Console, Effect, Context, Stream } from "effect"
|
|
12322
12245
|
*
|
|
12323
|
-
* class Config extends
|
|
12324
|
-
* class Greeter extends
|
|
12246
|
+
* class Config extends Context.Service<Config, { readonly prefix: string }>()("Config") {}
|
|
12247
|
+
* class Greeter extends Context.Service<Greeter, { greet: (name: string) => string }>()("Greeter") {}
|
|
12325
12248
|
*
|
|
12326
|
-
* const
|
|
12327
|
-
*
|
|
12249
|
+
* const context = Context.make(Config, { prefix: "Hello" }).pipe(
|
|
12250
|
+
* Context.add(Greeter, { greet: (name: string) => `${name}!` })
|
|
12328
12251
|
* )
|
|
12329
12252
|
*
|
|
12330
12253
|
* const stream = Stream.fromEffect(
|
|
@@ -12336,7 +12259,7 @@ export declare const provideServices: {
|
|
|
12336
12259
|
* )
|
|
12337
12260
|
*
|
|
12338
12261
|
* const program = Effect.gen(function*() {
|
|
12339
|
-
* const result = yield* Stream.runCollect(Stream.
|
|
12262
|
+
* const result = yield* Stream.runCollect(Stream.provideContext(stream, context))
|
|
12340
12263
|
* yield* Console.log(result)
|
|
12341
12264
|
* })
|
|
12342
12265
|
*
|
|
@@ -12347,19 +12270,19 @@ export declare const provideServices: {
|
|
|
12347
12270
|
* @since 4.0.0
|
|
12348
12271
|
* @category Services
|
|
12349
12272
|
*/
|
|
12350
|
-
<R2>(
|
|
12273
|
+
<R2>(context: Context.Context<R2>): <A, E, R>(self: Stream<A, E, R>) => Stream<A, E, Exclude<R, R2>>;
|
|
12351
12274
|
/**
|
|
12352
|
-
* Provides multiple services to the stream using a
|
|
12275
|
+
* Provides multiple services to the stream using a context.
|
|
12353
12276
|
*
|
|
12354
12277
|
* @example
|
|
12355
12278
|
* ```ts
|
|
12356
|
-
* import { Console, Effect,
|
|
12279
|
+
* import { Console, Effect, Context, Stream } from "effect"
|
|
12357
12280
|
*
|
|
12358
|
-
* class Config extends
|
|
12359
|
-
* class Greeter extends
|
|
12281
|
+
* class Config extends Context.Service<Config, { readonly prefix: string }>()("Config") {}
|
|
12282
|
+
* class Greeter extends Context.Service<Greeter, { greet: (name: string) => string }>()("Greeter") {}
|
|
12360
12283
|
*
|
|
12361
|
-
* const
|
|
12362
|
-
*
|
|
12284
|
+
* const context = Context.make(Config, { prefix: "Hello" }).pipe(
|
|
12285
|
+
* Context.add(Greeter, { greet: (name: string) => `${name}!` })
|
|
12363
12286
|
* )
|
|
12364
12287
|
*
|
|
12365
12288
|
* const stream = Stream.fromEffect(
|
|
@@ -12371,7 +12294,7 @@ export declare const provideServices: {
|
|
|
12371
12294
|
* )
|
|
12372
12295
|
*
|
|
12373
12296
|
* const program = Effect.gen(function*() {
|
|
12374
|
-
* const result = yield* Stream.runCollect(Stream.
|
|
12297
|
+
* const result = yield* Stream.runCollect(Stream.provideContext(stream, context))
|
|
12375
12298
|
* yield* Console.log(result)
|
|
12376
12299
|
* })
|
|
12377
12300
|
*
|
|
@@ -12382,7 +12305,7 @@ export declare const provideServices: {
|
|
|
12382
12305
|
* @since 4.0.0
|
|
12383
12306
|
* @category Services
|
|
12384
12307
|
*/
|
|
12385
|
-
<A, E, R, R2>(self: Stream<A, E, R>,
|
|
12308
|
+
<A, E, R, R2>(self: Stream<A, E, R>, context: Context.Context<R2>): Stream<A, E, Exclude<R, R2>>;
|
|
12386
12309
|
};
|
|
12387
12310
|
/**
|
|
12388
12311
|
* Provides the stream with a single required service, eliminating that
|
|
@@ -12390,9 +12313,9 @@ export declare const provideServices: {
|
|
|
12390
12313
|
*
|
|
12391
12314
|
* @example
|
|
12392
12315
|
* ```ts
|
|
12393
|
-
* import { Console, Effect,
|
|
12316
|
+
* import { Console, Effect, Context, Stream } from "effect"
|
|
12394
12317
|
*
|
|
12395
|
-
* class Greeter extends
|
|
12318
|
+
* class Greeter extends Context.Service<Greeter, {
|
|
12396
12319
|
* greet: (name: string) => string
|
|
12397
12320
|
* }>()("Greeter") {}
|
|
12398
12321
|
*
|
|
@@ -12427,9 +12350,9 @@ export declare const provideService: {
|
|
|
12427
12350
|
*
|
|
12428
12351
|
* @example
|
|
12429
12352
|
* ```ts
|
|
12430
|
-
* import { Console, Effect,
|
|
12353
|
+
* import { Console, Effect, Context, Stream } from "effect"
|
|
12431
12354
|
*
|
|
12432
|
-
* class Greeter extends
|
|
12355
|
+
* class Greeter extends Context.Service<Greeter, {
|
|
12433
12356
|
* greet: (name: string) => string
|
|
12434
12357
|
* }>()("Greeter") {}
|
|
12435
12358
|
*
|
|
@@ -12457,16 +12380,16 @@ export declare const provideService: {
|
|
|
12457
12380
|
* @since 4.0.0
|
|
12458
12381
|
* @category Services
|
|
12459
12382
|
*/
|
|
12460
|
-
<I, S>(key:
|
|
12383
|
+
<I, S>(key: Context.Key<I, S>, service: NoInfer<S>): <A, E, R>(self: Stream<A, E, R>) => Stream<A, E, Exclude<R, I>>;
|
|
12461
12384
|
/**
|
|
12462
12385
|
* Provides the stream with a single required service, eliminating that
|
|
12463
12386
|
* requirement from its environment.
|
|
12464
12387
|
*
|
|
12465
12388
|
* @example
|
|
12466
12389
|
* ```ts
|
|
12467
|
-
* import { Console, Effect,
|
|
12390
|
+
* import { Console, Effect, Context, Stream } from "effect"
|
|
12468
12391
|
*
|
|
12469
|
-
* class Greeter extends
|
|
12392
|
+
* class Greeter extends Context.Service<Greeter, {
|
|
12470
12393
|
* greet: (name: string) => string
|
|
12471
12394
|
* }>()("Greeter") {}
|
|
12472
12395
|
*
|
|
@@ -12494,16 +12417,16 @@ export declare const provideService: {
|
|
|
12494
12417
|
* @since 4.0.0
|
|
12495
12418
|
* @category Services
|
|
12496
12419
|
*/
|
|
12497
|
-
<A, E, R, I, S>(self: Stream<A, E, R>, key:
|
|
12420
|
+
<A, E, R, I, S>(self: Stream<A, E, R>, key: Context.Key<I, S>, service: NoInfer<S>): Stream<A, E, Exclude<R, I>>;
|
|
12498
12421
|
};
|
|
12499
12422
|
/**
|
|
12500
12423
|
* Provides a service to the stream using an effect, removing the requirement and adding the effect's error and environment.
|
|
12501
12424
|
*
|
|
12502
12425
|
* @example
|
|
12503
12426
|
* ```ts
|
|
12504
|
-
* import { Console, Effect,
|
|
12427
|
+
* import { Console, Effect, Context, Stream } from "effect"
|
|
12505
12428
|
*
|
|
12506
|
-
* class ApiConfig extends
|
|
12429
|
+
* class ApiConfig extends Context.Service<ApiConfig, { readonly baseUrl: string }>()("ApiConfig") {}
|
|
12507
12430
|
*
|
|
12508
12431
|
* const stream = Stream.fromEffect(
|
|
12509
12432
|
* Effect.gen(function*() {
|
|
@@ -12540,9 +12463,9 @@ export declare const provideServiceEffect: {
|
|
|
12540
12463
|
*
|
|
12541
12464
|
* @example
|
|
12542
12465
|
* ```ts
|
|
12543
|
-
* import { Console, Effect,
|
|
12466
|
+
* import { Console, Effect, Context, Stream } from "effect"
|
|
12544
12467
|
*
|
|
12545
|
-
* class ApiConfig extends
|
|
12468
|
+
* class ApiConfig extends Context.Service<ApiConfig, { readonly baseUrl: string }>()("ApiConfig") {}
|
|
12546
12469
|
*
|
|
12547
12470
|
* const stream = Stream.fromEffect(
|
|
12548
12471
|
* Effect.gen(function*() {
|
|
@@ -12573,15 +12496,15 @@ export declare const provideServiceEffect: {
|
|
|
12573
12496
|
* @since 4.0.0
|
|
12574
12497
|
* @category Services
|
|
12575
12498
|
*/
|
|
12576
|
-
<I, S, ES, RS>(key:
|
|
12499
|
+
<I, S, ES, RS>(key: Context.Key<I, S>, service: Effect.Effect<NoInfer<S>, ES, RS>): <A, E, R>(self: Stream<A, E, R>) => Stream<A, E | ES, Exclude<R, I> | RS>;
|
|
12577
12500
|
/**
|
|
12578
12501
|
* Provides a service to the stream using an effect, removing the requirement and adding the effect's error and environment.
|
|
12579
12502
|
*
|
|
12580
12503
|
* @example
|
|
12581
12504
|
* ```ts
|
|
12582
|
-
* import { Console, Effect,
|
|
12505
|
+
* import { Console, Effect, Context, Stream } from "effect"
|
|
12583
12506
|
*
|
|
12584
|
-
* class ApiConfig extends
|
|
12507
|
+
* class ApiConfig extends Context.Service<ApiConfig, { readonly baseUrl: string }>()("ApiConfig") {}
|
|
12585
12508
|
*
|
|
12586
12509
|
* const stream = Stream.fromEffect(
|
|
12587
12510
|
* Effect.gen(function*() {
|
|
@@ -12612,18 +12535,18 @@ export declare const provideServiceEffect: {
|
|
|
12612
12535
|
* @since 4.0.0
|
|
12613
12536
|
* @category Services
|
|
12614
12537
|
*/
|
|
12615
|
-
<A, E, R, I, S, ES, RS>(self: Stream<A, E, R>, key:
|
|
12538
|
+
<A, E, R, I, S, ES, RS>(self: Stream<A, E, R>, key: Context.Key<I, S>, service: Effect.Effect<NoInfer<S>, ES, RS>): Stream<A, E | ES, Exclude<R, I> | RS>;
|
|
12616
12539
|
};
|
|
12617
12540
|
/**
|
|
12618
|
-
* Transforms the stream's required services by mapping the current
|
|
12541
|
+
* Transforms the stream's required services by mapping the current context
|
|
12619
12542
|
* to a new one.
|
|
12620
12543
|
*
|
|
12621
12544
|
* @example
|
|
12622
12545
|
* ```ts
|
|
12623
|
-
* import { Console, Effect,
|
|
12546
|
+
* import { Console, Effect, Context, Stream } from "effect"
|
|
12624
12547
|
*
|
|
12625
|
-
* class Logger extends
|
|
12626
|
-
* class Config extends
|
|
12548
|
+
* class Logger extends Context.Service<Logger, { prefix: string }>()("Logger") {}
|
|
12549
|
+
* class Config extends Context.Service<Config, { name: string }>()("Config") {}
|
|
12627
12550
|
*
|
|
12628
12551
|
* const stream = Stream.fromEffect(
|
|
12629
12552
|
* Effect.gen(function*() {
|
|
@@ -12634,8 +12557,8 @@ export declare const provideServiceEffect: {
|
|
|
12634
12557
|
* )
|
|
12635
12558
|
*
|
|
12636
12559
|
* const updated = stream.pipe(
|
|
12637
|
-
* Stream.
|
|
12638
|
-
*
|
|
12560
|
+
* Stream.updateContext((context: Context.Context<Logger>) =>
|
|
12561
|
+
* Context.add(context, Config, { name: "World" })
|
|
12639
12562
|
* )
|
|
12640
12563
|
* )
|
|
12641
12564
|
*
|
|
@@ -12653,17 +12576,17 @@ export declare const provideServiceEffect: {
|
|
|
12653
12576
|
* @since 2.0.0
|
|
12654
12577
|
* @category Services
|
|
12655
12578
|
*/
|
|
12656
|
-
export declare const
|
|
12579
|
+
export declare const updateContext: {
|
|
12657
12580
|
/**
|
|
12658
|
-
* Transforms the stream's required services by mapping the current
|
|
12581
|
+
* Transforms the stream's required services by mapping the current context
|
|
12659
12582
|
* to a new one.
|
|
12660
12583
|
*
|
|
12661
12584
|
* @example
|
|
12662
12585
|
* ```ts
|
|
12663
|
-
* import { Console, Effect,
|
|
12586
|
+
* import { Console, Effect, Context, Stream } from "effect"
|
|
12664
12587
|
*
|
|
12665
|
-
* class Logger extends
|
|
12666
|
-
* class Config extends
|
|
12588
|
+
* class Logger extends Context.Service<Logger, { prefix: string }>()("Logger") {}
|
|
12589
|
+
* class Config extends Context.Service<Config, { name: string }>()("Config") {}
|
|
12667
12590
|
*
|
|
12668
12591
|
* const stream = Stream.fromEffect(
|
|
12669
12592
|
* Effect.gen(function*() {
|
|
@@ -12674,8 +12597,8 @@ export declare const updateServices: {
|
|
|
12674
12597
|
* )
|
|
12675
12598
|
*
|
|
12676
12599
|
* const updated = stream.pipe(
|
|
12677
|
-
* Stream.
|
|
12678
|
-
*
|
|
12600
|
+
* Stream.updateContext((context: Context.Context<Logger>) =>
|
|
12601
|
+
* Context.add(context, Config, { name: "World" })
|
|
12679
12602
|
* )
|
|
12680
12603
|
* )
|
|
12681
12604
|
*
|
|
@@ -12693,17 +12616,17 @@ export declare const updateServices: {
|
|
|
12693
12616
|
* @since 2.0.0
|
|
12694
12617
|
* @category Services
|
|
12695
12618
|
*/
|
|
12696
|
-
<R, R2>(f: (
|
|
12619
|
+
<R, R2>(f: (context: Context.Context<R2>) => Context.Context<R>): <A, E>(self: Stream<A, E, R>) => Stream<A, E, R2>;
|
|
12697
12620
|
/**
|
|
12698
|
-
* Transforms the stream's required services by mapping the current
|
|
12621
|
+
* Transforms the stream's required services by mapping the current context
|
|
12699
12622
|
* to a new one.
|
|
12700
12623
|
*
|
|
12701
12624
|
* @example
|
|
12702
12625
|
* ```ts
|
|
12703
|
-
* import { Console, Effect,
|
|
12626
|
+
* import { Console, Effect, Context, Stream } from "effect"
|
|
12704
12627
|
*
|
|
12705
|
-
* class Logger extends
|
|
12706
|
-
* class Config extends
|
|
12628
|
+
* class Logger extends Context.Service<Logger, { prefix: string }>()("Logger") {}
|
|
12629
|
+
* class Config extends Context.Service<Config, { name: string }>()("Config") {}
|
|
12707
12630
|
*
|
|
12708
12631
|
* const stream = Stream.fromEffect(
|
|
12709
12632
|
* Effect.gen(function*() {
|
|
@@ -12714,8 +12637,8 @@ export declare const updateServices: {
|
|
|
12714
12637
|
* )
|
|
12715
12638
|
*
|
|
12716
12639
|
* const updated = stream.pipe(
|
|
12717
|
-
* Stream.
|
|
12718
|
-
*
|
|
12640
|
+
* Stream.updateContext((context: Context.Context<Logger>) =>
|
|
12641
|
+
* Context.add(context, Config, { name: "World" })
|
|
12719
12642
|
* )
|
|
12720
12643
|
* )
|
|
12721
12644
|
*
|
|
@@ -12733,16 +12656,16 @@ export declare const updateServices: {
|
|
|
12733
12656
|
* @since 2.0.0
|
|
12734
12657
|
* @category Services
|
|
12735
12658
|
*/
|
|
12736
|
-
<A, E, R, R2>(self: Stream<A, E, R>, f: (
|
|
12659
|
+
<A, E, R, R2>(self: Stream<A, E, R>, f: (context: Context.Context<R2>) => Context.Context<R>): Stream<A, E, R2>;
|
|
12737
12660
|
};
|
|
12738
12661
|
/**
|
|
12739
12662
|
* Updates a single service in the stream environment by applying a function.
|
|
12740
12663
|
*
|
|
12741
12664
|
* @example
|
|
12742
12665
|
* ```ts
|
|
12743
|
-
* import { Console, Effect,
|
|
12666
|
+
* import { Console, Effect, Context, Stream } from "effect"
|
|
12744
12667
|
*
|
|
12745
|
-
* class Counter extends
|
|
12668
|
+
* class Counter extends Context.Service<Counter, { count: number }>()("Counter") {}
|
|
12746
12669
|
*
|
|
12747
12670
|
* const stream = Stream.fromEffect(Effect.service(Counter)).pipe(
|
|
12748
12671
|
* Stream.updateService(Counter, (counter) => ({ count: counter.count + 1 }))
|
|
@@ -12766,9 +12689,9 @@ export declare const updateService: {
|
|
|
12766
12689
|
*
|
|
12767
12690
|
* @example
|
|
12768
12691
|
* ```ts
|
|
12769
|
-
* import { Console, Effect,
|
|
12692
|
+
* import { Console, Effect, Context, Stream } from "effect"
|
|
12770
12693
|
*
|
|
12771
|
-
* class Counter extends
|
|
12694
|
+
* class Counter extends Context.Service<Counter, { count: number }>()("Counter") {}
|
|
12772
12695
|
*
|
|
12773
12696
|
* const stream = Stream.fromEffect(Effect.service(Counter)).pipe(
|
|
12774
12697
|
* Stream.updateService(Counter, (counter) => ({ count: counter.count + 1 }))
|
|
@@ -12786,15 +12709,15 @@ export declare const updateService: {
|
|
|
12786
12709
|
* @since 2.0.0
|
|
12787
12710
|
* @category Services
|
|
12788
12711
|
*/
|
|
12789
|
-
<I, S>(key:
|
|
12712
|
+
<I, S>(key: Context.Key<I, S>, f: (service: NoInfer<S>) => S): <A, E, R>(self: Stream<A, E, R>) => Stream<A, E, R | I>;
|
|
12790
12713
|
/**
|
|
12791
12714
|
* Updates a single service in the stream environment by applying a function.
|
|
12792
12715
|
*
|
|
12793
12716
|
* @example
|
|
12794
12717
|
* ```ts
|
|
12795
|
-
* import { Console, Effect,
|
|
12718
|
+
* import { Console, Effect, Context, Stream } from "effect"
|
|
12796
12719
|
*
|
|
12797
|
-
* class Counter extends
|
|
12720
|
+
* class Counter extends Context.Service<Counter, { count: number }>()("Counter") {}
|
|
12798
12721
|
*
|
|
12799
12722
|
* const stream = Stream.fromEffect(Effect.service(Counter)).pipe(
|
|
12800
12723
|
* Stream.updateService(Counter, (counter) => ({ count: counter.count + 1 }))
|
|
@@ -12812,7 +12735,7 @@ export declare const updateService: {
|
|
|
12812
12735
|
* @since 2.0.0
|
|
12813
12736
|
* @category Services
|
|
12814
12737
|
*/
|
|
12815
|
-
<A, E, R, I, S>(self: Stream<A, E, R>, key:
|
|
12738
|
+
<A, E, R, I, S>(self: Stream<A, E, R>, key: Context.Key<I, S>, f: (service: NoInfer<S>) => S): Stream<A, E, R | I>;
|
|
12816
12739
|
};
|
|
12817
12740
|
/**
|
|
12818
12741
|
* Wraps the stream with a new span for tracing.
|
|
@@ -13787,18 +13710,18 @@ export declare const mkUint8Array: <E, R>(self: Stream<Uint8Array, E, R>) => Eff
|
|
|
13787
13710
|
*
|
|
13788
13711
|
* @example
|
|
13789
13712
|
* ```ts
|
|
13790
|
-
* import {
|
|
13713
|
+
* import { Context, Stream } from "effect"
|
|
13791
13714
|
*
|
|
13792
13715
|
* const stream = Stream.make(1, 2, 3, 4, 5)
|
|
13793
|
-
* const readableStream = Stream.toReadableStreamWith(stream,
|
|
13716
|
+
* const readableStream = Stream.toReadableStreamWith(stream, Context.empty())
|
|
13794
13717
|
* ```
|
|
13795
13718
|
*
|
|
13796
13719
|
* @since 2.0.0
|
|
13797
13720
|
* @category Destructors
|
|
13798
13721
|
*/
|
|
13799
|
-
export declare const toReadableStreamWith: (<A, XR>(
|
|
13722
|
+
export declare const toReadableStreamWith: (<A, XR>(context: Context.Context<XR>, options?: {
|
|
13800
13723
|
readonly strategy?: QueuingStrategy<A> | undefined;
|
|
13801
|
-
}) => <E, R extends XR>(self: Stream<A, E, R>) => ReadableStream<A>) & (<A, E, XR, R extends XR>(self: Stream<A, E, R>,
|
|
13724
|
+
}) => <E, R extends XR>(self: Stream<A, E, R>) => ReadableStream<A>) & (<A, E, XR, R extends XR>(self: Stream<A, E, R>, context: Context.Context<XR>, options?: {
|
|
13802
13725
|
readonly strategy?: QueuingStrategy<A> | undefined;
|
|
13803
13726
|
}) => ReadableStream<A>);
|
|
13804
13727
|
/**
|
|
@@ -13936,10 +13859,10 @@ export declare const toReadableStreamEffect: {
|
|
|
13936
13859
|
*
|
|
13937
13860
|
* @example
|
|
13938
13861
|
* ```ts
|
|
13939
|
-
* import {
|
|
13862
|
+
* import { Context, Stream } from "effect"
|
|
13940
13863
|
*
|
|
13941
13864
|
* const stream = Stream.make(1, 2, 3)
|
|
13942
|
-
* const iterable = Stream.toAsyncIterableWith(stream,
|
|
13865
|
+
* const iterable = Stream.toAsyncIterableWith(stream, Context.empty())
|
|
13943
13866
|
*
|
|
13944
13867
|
* const collect = async () => {
|
|
13945
13868
|
* const results: Array<number> = []
|
|
@@ -13959,10 +13882,10 @@ export declare const toAsyncIterableWith: {
|
|
|
13959
13882
|
*
|
|
13960
13883
|
* @example
|
|
13961
13884
|
* ```ts
|
|
13962
|
-
* import {
|
|
13885
|
+
* import { Context, Stream } from "effect"
|
|
13963
13886
|
*
|
|
13964
13887
|
* const stream = Stream.make(1, 2, 3)
|
|
13965
|
-
* const iterable = Stream.toAsyncIterableWith(stream,
|
|
13888
|
+
* const iterable = Stream.toAsyncIterableWith(stream, Context.empty())
|
|
13966
13889
|
*
|
|
13967
13890
|
* const collect = async () => {
|
|
13968
13891
|
* const results: Array<number> = []
|
|
@@ -13976,16 +13899,16 @@ export declare const toAsyncIterableWith: {
|
|
|
13976
13899
|
* @since 2.0.0
|
|
13977
13900
|
* @category Destructors
|
|
13978
13901
|
*/
|
|
13979
|
-
<XR>(
|
|
13902
|
+
<XR>(context: Context.Context<XR>): <A, E, R extends XR>(self: Stream<A, E, R>) => AsyncIterable<A>;
|
|
13980
13903
|
/**
|
|
13981
13904
|
* Converts the stream to an `AsyncIterable` using the provided services.
|
|
13982
13905
|
*
|
|
13983
13906
|
* @example
|
|
13984
13907
|
* ```ts
|
|
13985
|
-
* import {
|
|
13908
|
+
* import { Context, Stream } from "effect"
|
|
13986
13909
|
*
|
|
13987
13910
|
* const stream = Stream.make(1, 2, 3)
|
|
13988
|
-
* const iterable = Stream.toAsyncIterableWith(stream,
|
|
13911
|
+
* const iterable = Stream.toAsyncIterableWith(stream, Context.empty())
|
|
13989
13912
|
*
|
|
13990
13913
|
* const collect = async () => {
|
|
13991
13914
|
* const results: Array<number> = []
|
|
@@ -13999,7 +13922,7 @@ export declare const toAsyncIterableWith: {
|
|
|
13999
13922
|
* @since 2.0.0
|
|
14000
13923
|
* @category Destructors
|
|
14001
13924
|
*/
|
|
14002
|
-
<A, E, XR, R extends XR>(self: Stream<A, E, R>,
|
|
13925
|
+
<A, E, XR, R extends XR>(self: Stream<A, E, R>, context: Context.Context<XR>): AsyncIterable<A>;
|
|
14003
13926
|
};
|
|
14004
13927
|
/**
|
|
14005
13928
|
* Creates an effect that yields an `AsyncIterable` using the current services.
|
|
@@ -14345,16 +14268,16 @@ export declare const toPubSubTake: {
|
|
|
14345
14268
|
}): Effect.Effect<PubSub.PubSub<Take.Take<A, E>>, never, R | Scope.Scope>;
|
|
14346
14269
|
};
|
|
14347
14270
|
/**
|
|
14348
|
-
* Converts a stream to a
|
|
14271
|
+
* Converts a stream to a Queue for concurrent consumption.
|
|
14349
14272
|
*
|
|
14350
14273
|
* @example
|
|
14351
14274
|
* ```ts
|
|
14352
|
-
* import { Effect,
|
|
14275
|
+
* import { Effect, Queue, Stream } from "effect"
|
|
14353
14276
|
*
|
|
14354
14277
|
* const program = Effect.gen(function* () {
|
|
14355
|
-
* const
|
|
14356
|
-
* const
|
|
14357
|
-
* return
|
|
14278
|
+
* const queue = yield* Stream.toQueue(Stream.fromIterable([1, 2, 3]), { capacity: 8 })
|
|
14279
|
+
* const chunk = yield* Queue.takeBetween(queue, 1, 3)
|
|
14280
|
+
* return chunk
|
|
14358
14281
|
* })
|
|
14359
14282
|
* ```
|
|
14360
14283
|
*
|
|
@@ -14363,16 +14286,16 @@ export declare const toPubSubTake: {
|
|
|
14363
14286
|
*/
|
|
14364
14287
|
export declare const toQueue: {
|
|
14365
14288
|
/**
|
|
14366
|
-
* Converts a stream to a
|
|
14289
|
+
* Converts a stream to a Queue for concurrent consumption.
|
|
14367
14290
|
*
|
|
14368
14291
|
* @example
|
|
14369
14292
|
* ```ts
|
|
14370
|
-
* import { Effect,
|
|
14293
|
+
* import { Effect, Queue, Stream } from "effect"
|
|
14371
14294
|
*
|
|
14372
14295
|
* const program = Effect.gen(function* () {
|
|
14373
|
-
* const
|
|
14374
|
-
* const
|
|
14375
|
-
* return
|
|
14296
|
+
* const queue = yield* Stream.toQueue(Stream.fromIterable([1, 2, 3]), { capacity: 8 })
|
|
14297
|
+
* const chunk = yield* Queue.takeBetween(queue, 1, 3)
|
|
14298
|
+
* return chunk
|
|
14376
14299
|
* })
|
|
14377
14300
|
* ```
|
|
14378
14301
|
*
|
|
@@ -14386,16 +14309,16 @@ export declare const toQueue: {
|
|
|
14386
14309
|
readonly strategy?: "dropping" | "sliding" | "suspend" | undefined;
|
|
14387
14310
|
}): <A, E, R>(self: Stream<A, E, R>) => Effect.Effect<Queue.Dequeue<A, E | Cause.Done>, never, R | Scope.Scope>;
|
|
14388
14311
|
/**
|
|
14389
|
-
* Converts a stream to a
|
|
14312
|
+
* Converts a stream to a Queue for concurrent consumption.
|
|
14390
14313
|
*
|
|
14391
14314
|
* @example
|
|
14392
14315
|
* ```ts
|
|
14393
|
-
* import { Effect,
|
|
14316
|
+
* import { Effect, Queue, Stream } from "effect"
|
|
14394
14317
|
*
|
|
14395
14318
|
* const program = Effect.gen(function* () {
|
|
14396
|
-
* const
|
|
14397
|
-
* const
|
|
14398
|
-
* return
|
|
14319
|
+
* const queue = yield* Stream.toQueue(Stream.fromIterable([1, 2, 3]), { capacity: 8 })
|
|
14320
|
+
* const chunk = yield* Queue.takeBetween(queue, 1, 3)
|
|
14321
|
+
* return chunk
|
|
14399
14322
|
* })
|
|
14400
14323
|
* ```
|
|
14401
14324
|
*
|
|
@@ -14407,7 +14330,7 @@ export declare const toQueue: {
|
|
|
14407
14330
|
} | {
|
|
14408
14331
|
readonly capacity: number;
|
|
14409
14332
|
readonly strategy?: "dropping" | "sliding" | "suspend" | undefined;
|
|
14410
|
-
}): Effect.Effect<
|
|
14333
|
+
}): Effect.Effect<Queue.Dequeue<A, E | Cause.Done>, never, R | Scope.Scope>;
|
|
14411
14334
|
};
|
|
14412
14335
|
/**
|
|
14413
14336
|
* Runs the stream, offering each element to the provided queue and ending it
|