effect 4.0.0-beta.69 → 4.0.0-beta.70
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 +454 -0
- package/dist/Array.d.ts.map +1 -1
- package/dist/Array.js +152 -0
- package/dist/Array.js.map +1 -1
- package/dist/BigDecimal.d.ts +87 -33
- package/dist/BigDecimal.d.ts.map +1 -1
- package/dist/BigDecimal.js +37 -11
- package/dist/BigDecimal.js.map +1 -1
- package/dist/BigInt.d.ts +71 -14
- package/dist/BigInt.d.ts.map +1 -1
- package/dist/BigInt.js +35 -10
- package/dist/BigInt.js.map +1 -1
- package/dist/Boolean.d.ts +4 -0
- package/dist/Boolean.d.ts.map +1 -1
- package/dist/Boolean.js +4 -0
- package/dist/Boolean.js.map +1 -1
- package/dist/Brand.d.ts +16 -11
- package/dist/Brand.d.ts.map +1 -1
- package/dist/Brand.js +16 -11
- package/dist/Brand.js.map +1 -1
- package/dist/Cache.d.ts +13 -1
- package/dist/Cache.d.ts.map +1 -1
- package/dist/Cache.js +8 -0
- package/dist/Cache.js.map +1 -1
- package/dist/Cause.d.ts +95 -3
- package/dist/Cause.d.ts.map +1 -1
- package/dist/Cause.js +56 -2
- package/dist/Cause.js.map +1 -1
- package/dist/Channel.d.ts +312 -0
- package/dist/Channel.d.ts.map +1 -1
- package/dist/Channel.js +126 -0
- package/dist/Channel.js.map +1 -1
- package/dist/ChannelSchema.d.ts +20 -0
- package/dist/ChannelSchema.d.ts.map +1 -1
- package/dist/ChannelSchema.js +12 -0
- package/dist/ChannelSchema.js.map +1 -1
- package/dist/Chunk.d.ts +59 -22
- package/dist/Chunk.d.ts.map +1 -1
- package/dist/Chunk.js +29 -10
- package/dist/Chunk.js.map +1 -1
- package/dist/Combiner.d.ts +75 -71
- package/dist/Combiner.d.ts.map +1 -1
- package/dist/Combiner.js +67 -62
- package/dist/Combiner.js.map +1 -1
- package/dist/Config.d.ts +167 -46
- package/dist/Config.d.ts.map +1 -1
- package/dist/Config.js +108 -28
- package/dist/Config.js.map +1 -1
- package/dist/ConfigProvider.d.ts +235 -158
- package/dist/ConfigProvider.d.ts.map +1 -1
- package/dist/ConfigProvider.js +144 -93
- package/dist/ConfigProvider.js.map +1 -1
- package/dist/Console.d.ts +21 -79
- package/dist/Console.d.ts.map +1 -1
- package/dist/Console.js +20 -75
- package/dist/Console.js.map +1 -1
- package/dist/Context.d.ts +4 -4
- package/dist/Context.js +2 -2
- package/dist/Cron.d.ts +42 -16
- package/dist/Cron.d.ts.map +1 -1
- package/dist/Cron.js +33 -13
- package/dist/Cron.js.map +1 -1
- package/dist/Crypto.d.ts +6 -0
- package/dist/Crypto.d.ts.map +1 -1
- package/dist/Crypto.js.map +1 -1
- package/dist/Data.d.ts +132 -70
- package/dist/Data.d.ts.map +1 -1
- package/dist/Data.js +44 -29
- package/dist/Data.js.map +1 -1
- package/dist/DateTime.d.ts +227 -14
- package/dist/DateTime.d.ts.map +1 -1
- package/dist/DateTime.js +115 -6
- package/dist/DateTime.js.map +1 -1
- package/dist/Deferred.d.ts +94 -27
- package/dist/Deferred.d.ts.map +1 -1
- package/dist/Deferred.js +33 -8
- package/dist/Deferred.js.map +1 -1
- package/dist/Differ.d.ts +2 -0
- package/dist/Differ.d.ts.map +1 -1
- package/dist/Duration.d.ts +64 -6
- package/dist/Duration.d.ts.map +1 -1
- package/dist/Duration.js +26 -2
- package/dist/Duration.js.map +1 -1
- package/dist/Effect.d.ts +907 -603
- package/dist/Effect.d.ts.map +1 -1
- package/dist/Effect.js +360 -233
- package/dist/Effect.js.map +1 -1
- package/dist/Effectable.d.ts +3 -1
- package/dist/Effectable.d.ts.map +1 -1
- package/dist/Effectable.js +3 -1
- package/dist/Effectable.js.map +1 -1
- package/dist/Encoding.d.ts +16 -0
- package/dist/Encoding.d.ts.map +1 -1
- package/dist/Encoding.js +16 -0
- package/dist/Encoding.js.map +1 -1
- package/dist/Equal.d.ts +52 -40
- package/dist/Equal.d.ts.map +1 -1
- package/dist/Equal.js +32 -26
- package/dist/Equal.js.map +1 -1
- package/dist/Equivalence.d.ts +190 -153
- package/dist/Equivalence.d.ts.map +1 -1
- package/dist/Equivalence.js +129 -104
- package/dist/Equivalence.js.map +1 -1
- package/dist/ErrorReporter.d.ts +35 -14
- package/dist/ErrorReporter.d.ts.map +1 -1
- package/dist/ErrorReporter.js +18 -6
- package/dist/ErrorReporter.js.map +1 -1
- package/dist/ExecutionPlan.d.ts +10 -3
- package/dist/ExecutionPlan.d.ts.map +1 -1
- package/dist/ExecutionPlan.js +4 -3
- package/dist/ExecutionPlan.js.map +1 -1
- package/dist/Exit.d.ts +212 -6
- package/dist/Exit.d.ts.map +1 -1
- package/dist/Exit.js +139 -2
- package/dist/Exit.js.map +1 -1
- package/dist/Fiber.d.ts +8 -0
- package/dist/Fiber.d.ts.map +1 -1
- package/dist/Fiber.js +4 -0
- package/dist/Fiber.js.map +1 -1
- package/dist/FiberHandle.d.ts +46 -23
- package/dist/FiberHandle.d.ts.map +1 -1
- package/dist/FiberHandle.js +27 -11
- package/dist/FiberHandle.js.map +1 -1
- package/dist/FiberMap.d.ts +43 -4
- package/dist/FiberMap.d.ts.map +1 -1
- package/dist/FiberMap.js +27 -4
- package/dist/FiberMap.js.map +1 -1
- package/dist/FiberSet.d.ts +21 -6
- package/dist/FiberSet.d.ts.map +1 -1
- package/dist/FiberSet.js +17 -6
- package/dist/FiberSet.js.map +1 -1
- package/dist/FileSystem.d.ts +64 -0
- package/dist/FileSystem.d.ts.map +1 -1
- package/dist/FileSystem.js +26 -0
- package/dist/FileSystem.js.map +1 -1
- package/dist/Filter.d.ts +53 -21
- package/dist/Filter.d.ts.map +1 -1
- package/dist/Filter.js +20 -9
- package/dist/Filter.js.map +1 -1
- package/dist/Formatter.d.ts +21 -22
- package/dist/Formatter.d.ts.map +1 -1
- package/dist/Formatter.js +12 -12
- package/dist/Formatter.js.map +1 -1
- package/dist/Function.d.ts +67 -75
- package/dist/Function.d.ts.map +1 -1
- package/dist/Function.js +29 -19
- package/dist/Function.js.map +1 -1
- package/dist/Graph.d.ts +51 -13
- package/dist/Graph.d.ts.map +1 -1
- package/dist/Graph.js +19 -3
- package/dist/Graph.js.map +1 -1
- package/dist/HKT.d.ts +22 -21
- package/dist/HKT.d.ts.map +1 -1
- package/dist/Hash.d.ts +33 -10
- package/dist/Hash.d.ts.map +1 -1
- package/dist/Hash.js +27 -10
- package/dist/Hash.js.map +1 -1
- package/dist/HashMap.d.ts +50 -9
- package/dist/HashMap.d.ts.map +1 -1
- package/dist/HashMap.js +17 -3
- package/dist/HashMap.js.map +1 -1
- package/dist/HashRing.d.ts +4 -0
- package/dist/HashRing.d.ts.map +1 -1
- package/dist/HashRing.js +2 -0
- package/dist/HashRing.js.map +1 -1
- package/dist/HashSet.d.ts +2 -0
- package/dist/HashSet.d.ts.map +1 -1
- package/dist/HashSet.js.map +1 -1
- package/dist/Inspectable.d.ts +15 -2
- package/dist/Inspectable.d.ts.map +1 -1
- package/dist/Inspectable.js +11 -2
- package/dist/Inspectable.js.map +1 -1
- package/dist/Iterable.d.ts +104 -22
- package/dist/Iterable.d.ts.map +1 -1
- package/dist/Iterable.js +46 -12
- package/dist/Iterable.js.map +1 -1
- package/dist/JsonPatch.d.ts +61 -80
- package/dist/JsonPatch.d.ts.map +1 -1
- package/dist/JsonPatch.js +35 -42
- package/dist/JsonPatch.js.map +1 -1
- package/dist/JsonPointer.d.ts +16 -20
- package/dist/JsonPointer.d.ts.map +1 -1
- package/dist/JsonPointer.js +16 -20
- package/dist/JsonPointer.js.map +1 -1
- package/dist/JsonSchema.d.ts +123 -73
- package/dist/JsonSchema.d.ts.map +1 -1
- package/dist/JsonSchema.js +95 -53
- package/dist/JsonSchema.js.map +1 -1
- package/dist/Latch.d.ts +28 -2
- package/dist/Latch.d.ts.map +1 -1
- package/dist/Latch.js +22 -2
- package/dist/Latch.js.map +1 -1
- package/dist/Layer.d.ts +781 -335
- package/dist/Layer.d.ts.map +1 -1
- package/dist/Layer.js +324 -129
- package/dist/Layer.js.map +1 -1
- package/dist/LogLevel.d.ts +86 -13
- package/dist/LogLevel.d.ts.map +1 -1
- package/dist/LogLevel.js +30 -4
- package/dist/LogLevel.js.map +1 -1
- package/dist/Logger.d.ts +63 -51
- package/dist/Logger.d.ts.map +1 -1
- package/dist/Logger.js +61 -51
- package/dist/Logger.js.map +1 -1
- package/dist/ManagedRuntime.d.ts +12 -0
- package/dist/ManagedRuntime.d.ts.map +1 -1
- package/dist/ManagedRuntime.js +1 -0
- package/dist/ManagedRuntime.js.map +1 -1
- package/dist/Match.d.ts +83 -1
- package/dist/Match.d.ts.map +1 -1
- package/dist/Match.js +31 -1
- package/dist/Match.js.map +1 -1
- package/dist/Metric.d.ts +89 -12
- package/dist/Metric.d.ts.map +1 -1
- package/dist/Metric.js +53 -8
- package/dist/Metric.js.map +1 -1
- package/dist/MutableHashMap.d.ts +14 -0
- package/dist/MutableHashMap.d.ts.map +1 -1
- package/dist/MutableHashMap.js +4 -0
- package/dist/MutableHashMap.js.map +1 -1
- package/dist/MutableHashSet.d.ts +2 -0
- package/dist/MutableHashSet.d.ts.map +1 -1
- package/dist/MutableHashSet.js.map +1 -1
- package/dist/MutableList.d.ts +24 -6
- package/dist/MutableList.d.ts.map +1 -1
- package/dist/MutableList.js +22 -6
- package/dist/MutableList.js.map +1 -1
- package/dist/MutableRef.d.ts +2 -0
- package/dist/MutableRef.d.ts.map +1 -1
- package/dist/MutableRef.js.map +1 -1
- package/dist/Newtype.d.ts +69 -30
- package/dist/Newtype.d.ts.map +1 -1
- package/dist/Newtype.js +52 -22
- package/dist/Newtype.js.map +1 -1
- package/dist/NonEmptyIterable.d.ts +6 -0
- package/dist/NonEmptyIterable.d.ts.map +1 -1
- package/dist/NonEmptyIterable.js +2 -0
- package/dist/NonEmptyIterable.js.map +1 -1
- package/dist/Number.d.ts +16 -30
- package/dist/Number.d.ts.map +1 -1
- package/dist/Number.js +6 -12
- package/dist/Number.js.map +1 -1
- package/dist/Optic.d.ts +90 -40
- package/dist/Optic.d.ts.map +1 -1
- package/dist/Optic.js +48 -24
- package/dist/Optic.js.map +1 -1
- package/dist/Option.d.ts +121 -111
- package/dist/Option.d.ts.map +1 -1
- package/dist/Option.js +56 -54
- package/dist/Option.js.map +1 -1
- package/dist/Order.d.ts +169 -167
- package/dist/Order.d.ts.map +1 -1
- package/dist/Order.js +135 -135
- package/dist/Order.js.map +1 -1
- package/dist/Ordering.d.ts +4 -0
- package/dist/Ordering.d.ts.map +1 -1
- package/dist/Ordering.js +2 -0
- package/dist/Ordering.js.map +1 -1
- package/dist/PartitionedSemaphore.d.ts +7 -5
- package/dist/PartitionedSemaphore.d.ts.map +1 -1
- package/dist/PartitionedSemaphore.js +5 -5
- package/dist/PartitionedSemaphore.js.map +1 -1
- package/dist/Path.d.ts +8 -0
- package/dist/Path.d.ts.map +1 -1
- package/dist/Path.js +4 -0
- package/dist/Path.js.map +1 -1
- package/dist/Pipeable.d.ts +10 -0
- package/dist/Pipeable.d.ts.map +1 -1
- package/dist/Pipeable.js +8 -0
- package/dist/Pipeable.js.map +1 -1
- package/dist/PlatformError.d.ts +12 -0
- package/dist/PlatformError.d.ts.map +1 -1
- package/dist/PlatformError.js +10 -0
- package/dist/PlatformError.js.map +1 -1
- package/dist/Pool.d.ts +30 -16
- package/dist/Pool.d.ts.map +1 -1
- package/dist/Pool.js +30 -16
- package/dist/Pool.js.map +1 -1
- package/dist/Predicate.d.ts +520 -352
- package/dist/Predicate.d.ts.map +1 -1
- package/dist/Predicate.js +271 -184
- package/dist/Predicate.js.map +1 -1
- package/dist/PrimaryKey.d.ts +4 -0
- package/dist/PrimaryKey.d.ts.map +1 -1
- package/dist/PrimaryKey.js +2 -0
- package/dist/PrimaryKey.js.map +1 -1
- package/dist/PubSub.d.ts +22 -4
- package/dist/PubSub.d.ts.map +1 -1
- package/dist/PubSub.js +17 -3
- package/dist/PubSub.js.map +1 -1
- package/dist/Pull.d.ts +16 -0
- package/dist/Pull.d.ts.map +1 -1
- package/dist/Pull.js +10 -0
- package/dist/Pull.js.map +1 -1
- package/dist/Queue.d.ts +44 -0
- package/dist/Queue.d.ts.map +1 -1
- package/dist/Queue.js +28 -0
- package/dist/Queue.js.map +1 -1
- package/dist/Random.d.ts +25 -6
- package/dist/Random.d.ts.map +1 -1
- package/dist/Random.js +11 -2
- package/dist/Random.js.map +1 -1
- package/dist/RcMap.d.ts +10 -6
- package/dist/RcMap.d.ts.map +1 -1
- package/dist/RcMap.js +2 -2
- package/dist/RcMap.js.map +1 -1
- package/dist/RcRef.d.ts +3 -1
- package/dist/RcRef.d.ts.map +1 -1
- package/dist/RcRef.js.map +1 -1
- package/dist/Record.d.ts +24 -3
- package/dist/Record.d.ts.map +1 -1
- package/dist/Record.js +12 -3
- package/dist/Record.js.map +1 -1
- package/dist/Redactable.d.ts +54 -41
- package/dist/Redactable.d.ts.map +1 -1
- package/dist/Redactable.js +42 -32
- package/dist/Redactable.js.map +1 -1
- package/dist/Redacted.d.ts +10 -0
- package/dist/Redacted.d.ts.map +1 -1
- package/dist/Redacted.js +6 -0
- package/dist/Redacted.js.map +1 -1
- package/dist/Reducer.d.ts +20 -11
- package/dist/Reducer.d.ts.map +1 -1
- package/dist/Reducer.js +10 -6
- package/dist/Reducer.js.map +1 -1
- package/dist/Ref.d.ts +45 -24
- package/dist/Ref.d.ts.map +1 -1
- package/dist/Ref.js +41 -21
- package/dist/Ref.js.map +1 -1
- package/dist/References.d.ts +18 -1
- package/dist/References.d.ts.map +1 -1
- package/dist/References.js +17 -1
- package/dist/References.js.map +1 -1
- package/dist/Request.d.ts +3 -3
- package/dist/Request.js +2 -2
- package/dist/RequestResolver.d.ts +7 -17
- package/dist/RequestResolver.d.ts.map +1 -1
- package/dist/RequestResolver.js +3 -5
- package/dist/RequestResolver.js.map +1 -1
- package/dist/Resource.d.ts +2 -0
- package/dist/Resource.d.ts.map +1 -1
- package/dist/Resource.js +2 -0
- package/dist/Resource.js.map +1 -1
- package/dist/Result.d.ts +188 -6
- package/dist/Result.d.ts.map +1 -1
- package/dist/Result.js +84 -2
- package/dist/Result.js.map +1 -1
- package/dist/Runtime.d.ts +14 -11
- package/dist/Runtime.d.ts.map +1 -1
- package/dist/Runtime.js +11 -9
- package/dist/Runtime.js.map +1 -1
- package/dist/Schedule.d.ts +27 -3
- package/dist/Schedule.d.ts.map +1 -1
- package/dist/Schedule.js +21 -2
- package/dist/Schedule.js.map +1 -1
- package/dist/Scheduler.d.ts +22 -19
- package/dist/Scheduler.d.ts.map +1 -1
- package/dist/Scheduler.js +14 -12
- package/dist/Scheduler.js.map +1 -1
- package/dist/Schema.d.ts +547 -130
- package/dist/Schema.d.ts.map +1 -1
- package/dist/Schema.js +409 -121
- package/dist/Schema.js.map +1 -1
- package/dist/SchemaAST.d.ts +123 -65
- package/dist/SchemaAST.d.ts.map +1 -1
- package/dist/SchemaAST.js +90 -39
- package/dist/SchemaAST.js.map +1 -1
- package/dist/SchemaGetter.d.ts +269 -234
- package/dist/SchemaGetter.d.ts.map +1 -1
- package/dist/SchemaGetter.js +245 -215
- package/dist/SchemaGetter.js.map +1 -1
- package/dist/SchemaIssue.d.ts +48 -46
- package/dist/SchemaIssue.d.ts.map +1 -1
- package/dist/SchemaIssue.js +34 -34
- package/dist/SchemaIssue.js.map +1 -1
- package/dist/SchemaParser.d.ts +58 -0
- package/dist/SchemaParser.d.ts.map +1 -1
- package/dist/SchemaParser.js +58 -0
- package/dist/SchemaParser.js.map +1 -1
- package/dist/SchemaRepresentation.d.ts +198 -96
- package/dist/SchemaRepresentation.d.ts.map +1 -1
- package/dist/SchemaRepresentation.js +107 -45
- package/dist/SchemaRepresentation.js.map +1 -1
- package/dist/SchemaTransformation.d.ts +272 -203
- package/dist/SchemaTransformation.d.ts.map +1 -1
- package/dist/SchemaTransformation.js +249 -187
- package/dist/SchemaTransformation.js.map +1 -1
- package/dist/SchemaUtils.d.ts +2 -0
- package/dist/SchemaUtils.d.ts.map +1 -1
- package/dist/SchemaUtils.js +2 -0
- package/dist/SchemaUtils.js.map +1 -1
- package/dist/Scope.d.ts +18 -0
- package/dist/Scope.d.ts.map +1 -1
- package/dist/Scope.js +12 -0
- package/dist/Scope.js.map +1 -1
- package/dist/ScopedCache.d.ts +44 -0
- package/dist/ScopedCache.d.ts.map +1 -1
- package/dist/ScopedCache.js +18 -0
- package/dist/ScopedCache.js.map +1 -1
- package/dist/ScopedRef.d.ts +9 -3
- package/dist/ScopedRef.d.ts.map +1 -1
- package/dist/ScopedRef.js +3 -1
- package/dist/ScopedRef.js.map +1 -1
- package/dist/Semaphore.d.ts +6 -0
- package/dist/Semaphore.d.ts.map +1 -1
- package/dist/Semaphore.js +4 -0
- package/dist/Semaphore.js.map +1 -1
- package/dist/Sink.d.ts +108 -0
- package/dist/Sink.d.ts.map +1 -1
- package/dist/Sink.js +54 -0
- package/dist/Sink.js.map +1 -1
- package/dist/Stdio.d.ts +7 -3
- package/dist/Stdio.d.ts.map +1 -1
- package/dist/Stdio.js +2 -0
- package/dist/Stdio.js.map +1 -1
- package/dist/Stream.d.ts +416 -16
- package/dist/Stream.d.ts.map +1 -1
- package/dist/Stream.js +164 -8
- package/dist/Stream.js.map +1 -1
- package/dist/String.d.ts +14 -0
- package/dist/String.d.ts.map +1 -1
- package/dist/String.js +6 -0
- package/dist/String.js.map +1 -1
- package/dist/Struct.d.ts +371 -191
- package/dist/Struct.d.ts.map +1 -1
- package/dist/Struct.js +144 -77
- package/dist/Struct.js.map +1 -1
- package/dist/SubscriptionRef.d.ts +7 -1
- package/dist/SubscriptionRef.d.ts.map +1 -1
- package/dist/SubscriptionRef.js +5 -1
- package/dist/SubscriptionRef.js.map +1 -1
- package/dist/SynchronizedRef.d.ts +2 -0
- package/dist/SynchronizedRef.d.ts.map +1 -1
- package/dist/SynchronizedRef.js +2 -0
- package/dist/SynchronizedRef.js.map +1 -1
- package/dist/Tracer.d.ts +17 -27
- package/dist/Tracer.d.ts.map +1 -1
- package/dist/Tracer.js +8 -12
- package/dist/Tracer.js.map +1 -1
- package/dist/Trie.d.ts +23 -9
- package/dist/Trie.d.ts.map +1 -1
- package/dist/Trie.js +13 -3
- package/dist/Trie.js.map +1 -1
- package/dist/Tuple.d.ts +287 -144
- package/dist/Tuple.d.ts.map +1 -1
- package/dist/Tuple.js +135 -66
- package/dist/Tuple.js.map +1 -1
- package/dist/TxChunk.d.ts +182 -93
- package/dist/TxChunk.d.ts.map +1 -1
- package/dist/TxChunk.js +68 -35
- package/dist/TxChunk.js.map +1 -1
- package/dist/TxDeferred.d.ts +3 -4
- package/dist/TxDeferred.d.ts.map +1 -1
- package/dist/TxDeferred.js.map +1 -1
- package/dist/TxHashMap.d.ts +163 -86
- package/dist/TxHashMap.d.ts.map +1 -1
- package/dist/TxHashMap.js +57 -30
- package/dist/TxHashMap.js.map +1 -1
- package/dist/TxHashSet.d.ts +24 -27
- package/dist/TxHashSet.d.ts.map +1 -1
- package/dist/TxHashSet.js +9 -6
- package/dist/TxHashSet.js.map +1 -1
- package/dist/TxPriorityQueue.d.ts +2 -0
- package/dist/TxPriorityQueue.d.ts.map +1 -1
- package/dist/TxPriorityQueue.js.map +1 -1
- package/dist/TxPubSub.d.ts +36 -35
- package/dist/TxPubSub.d.ts.map +1 -1
- package/dist/TxPubSub.js +22 -21
- package/dist/TxPubSub.js.map +1 -1
- package/dist/TxQueue.d.ts +77 -114
- package/dist/TxQueue.d.ts.map +1 -1
- package/dist/TxQueue.js +45 -62
- package/dist/TxQueue.js.map +1 -1
- package/dist/TxRef.d.ts +4 -0
- package/dist/TxRef.d.ts.map +1 -1
- package/dist/TxRef.js +2 -0
- package/dist/TxRef.js.map +1 -1
- package/dist/TxSemaphore.d.ts +66 -27
- package/dist/TxSemaphore.d.ts.map +1 -1
- package/dist/TxSemaphore.js +38 -15
- package/dist/TxSemaphore.js.map +1 -1
- package/dist/Types.d.ts +202 -75
- package/dist/Types.d.ts.map +1 -1
- package/dist/UndefinedOr.d.ts +31 -29
- package/dist/UndefinedOr.d.ts.map +1 -1
- package/dist/UndefinedOr.js +27 -21
- package/dist/UndefinedOr.js.map +1 -1
- package/dist/Unify.d.ts +28 -0
- package/dist/Unify.d.ts.map +1 -1
- package/dist/Unify.js +2 -0
- package/dist/Unify.js.map +1 -1
- package/dist/Utils.d.ts +29 -35
- package/dist/Utils.d.ts.map +1 -1
- package/dist/Utils.js +11 -13
- package/dist/Utils.js.map +1 -1
- package/dist/index.d.ts +18 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +18 -7
- package/dist/index.js.map +1 -1
- package/dist/testing/TestClock.d.ts +17 -17
- package/dist/testing/TestClock.js +1 -1
- package/dist/testing/TestClock.js.map +1 -1
- package/dist/testing/TestConsole.d.ts +2 -0
- package/dist/testing/TestConsole.d.ts.map +1 -1
- package/dist/testing/TestConsole.js.map +1 -1
- package/dist/testing/TestSchema.d.ts +43 -55
- package/dist/testing/TestSchema.d.ts.map +1 -1
- package/dist/testing/TestSchema.js +43 -55
- package/dist/testing/TestSchema.js.map +1 -1
- package/dist/unstable/ai/AiError.d.ts +62 -11
- package/dist/unstable/ai/AiError.d.ts.map +1 -1
- package/dist/unstable/ai/AiError.js +58 -11
- package/dist/unstable/ai/AiError.js.map +1 -1
- package/dist/unstable/ai/AnthropicStructuredOutput.d.ts +4 -4
- package/dist/unstable/ai/AnthropicStructuredOutput.js +4 -4
- package/dist/unstable/ai/Chat.d.ts +29 -1
- package/dist/unstable/ai/Chat.d.ts.map +1 -1
- package/dist/unstable/ai/Chat.js +15 -1
- package/dist/unstable/ai/Chat.js.map +1 -1
- package/dist/unstable/ai/IdGenerator.d.ts +10 -0
- package/dist/unstable/ai/IdGenerator.d.ts.map +1 -1
- package/dist/unstable/ai/IdGenerator.js +8 -0
- package/dist/unstable/ai/IdGenerator.js.map +1 -1
- package/dist/unstable/ai/LanguageModel.d.ts +32 -46
- package/dist/unstable/ai/LanguageModel.d.ts.map +1 -1
- package/dist/unstable/ai/LanguageModel.js +5 -14
- package/dist/unstable/ai/LanguageModel.js.map +1 -1
- package/dist/unstable/ai/McpSchema.d.ts +84 -32
- package/dist/unstable/ai/McpSchema.d.ts.map +1 -1
- package/dist/unstable/ai/McpSchema.js +73 -28
- package/dist/unstable/ai/McpSchema.js.map +1 -1
- package/dist/unstable/ai/McpServer.d.ts +8 -0
- package/dist/unstable/ai/McpServer.d.ts.map +1 -1
- package/dist/unstable/ai/McpServer.js +6 -0
- package/dist/unstable/ai/McpServer.js.map +1 -1
- package/dist/unstable/ai/Model.d.ts +9 -5
- package/dist/unstable/ai/Model.d.ts.map +1 -1
- package/dist/unstable/ai/Model.js +4 -0
- package/dist/unstable/ai/Model.js.map +1 -1
- package/dist/unstable/ai/OpenAiStructuredOutput.d.ts +3 -2
- package/dist/unstable/ai/OpenAiStructuredOutput.d.ts.map +1 -1
- package/dist/unstable/ai/OpenAiStructuredOutput.js +3 -2
- package/dist/unstable/ai/OpenAiStructuredOutput.js.map +1 -1
- package/dist/unstable/ai/Prompt.d.ts +62 -35
- package/dist/unstable/ai/Prompt.d.ts.map +1 -1
- package/dist/unstable/ai/Prompt.js +16 -15
- package/dist/unstable/ai/Prompt.js.map +1 -1
- package/dist/unstable/ai/Response.d.ts +40 -21
- package/dist/unstable/ai/Response.d.ts.map +1 -1
- package/dist/unstable/ai/Response.js +10 -0
- package/dist/unstable/ai/Response.js.map +1 -1
- package/dist/unstable/ai/ResponseIdTracker.d.ts +8 -0
- package/dist/unstable/ai/ResponseIdTracker.d.ts.map +1 -1
- package/dist/unstable/ai/ResponseIdTracker.js +4 -0
- package/dist/unstable/ai/ResponseIdTracker.js.map +1 -1
- package/dist/unstable/ai/Telemetry.d.ts +30 -5
- package/dist/unstable/ai/Telemetry.d.ts.map +1 -1
- package/dist/unstable/ai/Telemetry.js +7 -1
- package/dist/unstable/ai/Telemetry.js.map +1 -1
- package/dist/unstable/ai/Tokenizer.d.ts +6 -0
- package/dist/unstable/ai/Tokenizer.d.ts.map +1 -1
- package/dist/unstable/ai/Tokenizer.js +4 -0
- package/dist/unstable/ai/Tokenizer.js.map +1 -1
- package/dist/unstable/ai/Tool.d.ts +68 -0
- package/dist/unstable/ai/Tool.d.ts.map +1 -1
- package/dist/unstable/ai/Tool.js +36 -0
- package/dist/unstable/ai/Tool.js.map +1 -1
- package/dist/unstable/ai/Toolkit.d.ts +12 -0
- package/dist/unstable/ai/Toolkit.d.ts.map +1 -1
- package/dist/unstable/ai/Toolkit.js +6 -0
- package/dist/unstable/ai/Toolkit.js.map +1 -1
- package/dist/unstable/cli/Argument.d.ts +14 -4
- package/dist/unstable/cli/Argument.d.ts.map +1 -1
- package/dist/unstable/cli/Argument.js +4 -0
- package/dist/unstable/cli/Argument.js.map +1 -1
- package/dist/unstable/cli/CliError.d.ts +6 -0
- package/dist/unstable/cli/CliError.d.ts.map +1 -1
- package/dist/unstable/cli/CliError.js +4 -0
- package/dist/unstable/cli/CliError.js.map +1 -1
- package/dist/unstable/cli/Command.d.ts +123 -12
- package/dist/unstable/cli/Command.d.ts.map +1 -1
- package/dist/unstable/cli/Command.js +57 -4
- package/dist/unstable/cli/Command.js.map +1 -1
- package/dist/unstable/cli/Flag.d.ts +31 -14
- package/dist/unstable/cli/Flag.d.ts.map +1 -1
- package/dist/unstable/cli/Flag.js +23 -10
- package/dist/unstable/cli/Flag.js.map +1 -1
- package/dist/unstable/cli/Param.d.ts +10 -0
- package/dist/unstable/cli/Param.d.ts.map +1 -1
- package/dist/unstable/cli/Param.js +46 -5
- package/dist/unstable/cli/Param.js.map +1 -1
- package/dist/unstable/cli/Primitive.d.ts +10 -0
- package/dist/unstable/cli/Primitive.d.ts.map +1 -1
- package/dist/unstable/cli/Primitive.js +10 -0
- package/dist/unstable/cli/Primitive.js.map +1 -1
- package/dist/unstable/cli/Prompt.d.ts +47 -40
- package/dist/unstable/cli/Prompt.d.ts.map +1 -1
- package/dist/unstable/cli/Prompt.js +25 -20
- package/dist/unstable/cli/Prompt.js.map +1 -1
- package/dist/unstable/cli/internal/command.d.ts +1 -0
- package/dist/unstable/cli/internal/command.d.ts.map +1 -1
- package/dist/unstable/cli/internal/command.js +10 -2
- package/dist/unstable/cli/internal/command.js.map +1 -1
- package/dist/unstable/cli/internal/completions/descriptor.js +3 -0
- package/dist/unstable/cli/internal/completions/descriptor.js.map +1 -1
- package/dist/unstable/cli/internal/parser.js +8 -1
- package/dist/unstable/cli/internal/parser.js.map +1 -1
- package/dist/unstable/cluster/ClusterCron.d.ts +10 -1
- package/dist/unstable/cluster/ClusterCron.d.ts.map +1 -1
- package/dist/unstable/cluster/ClusterCron.js +2 -0
- package/dist/unstable/cluster/ClusterCron.js.map +1 -1
- package/dist/unstable/cluster/ClusterSchema.d.ts +8 -0
- package/dist/unstable/cluster/ClusterSchema.d.ts.map +1 -1
- package/dist/unstable/cluster/ClusterSchema.js +8 -0
- package/dist/unstable/cluster/ClusterSchema.js.map +1 -1
- package/dist/unstable/cluster/ClusterWorkflowEngine.d.ts +4 -0
- package/dist/unstable/cluster/ClusterWorkflowEngine.d.ts.map +1 -1
- package/dist/unstable/cluster/ClusterWorkflowEngine.js +4 -0
- package/dist/unstable/cluster/ClusterWorkflowEngine.js.map +1 -1
- package/dist/unstable/cluster/DeliverAt.d.ts +3 -4
- package/dist/unstable/cluster/DeliverAt.d.ts.map +1 -1
- package/dist/unstable/cluster/DeliverAt.js.map +1 -1
- package/dist/unstable/cluster/Entity.d.ts +24 -0
- package/dist/unstable/cluster/Entity.d.ts.map +1 -1
- package/dist/unstable/cluster/Entity.js +12 -0
- package/dist/unstable/cluster/Entity.js.map +1 -1
- package/dist/unstable/cluster/EntityProxy.d.ts +10 -4
- package/dist/unstable/cluster/EntityProxy.d.ts.map +1 -1
- package/dist/unstable/cluster/EntityProxy.js.map +1 -1
- package/dist/unstable/cluster/EntityProxyServer.d.ts +6 -0
- package/dist/unstable/cluster/EntityProxyServer.d.ts.map +1 -1
- package/dist/unstable/cluster/EntityProxyServer.js +4 -0
- package/dist/unstable/cluster/EntityProxyServer.js.map +1 -1
- package/dist/unstable/cluster/EntityResource.d.ts +10 -0
- package/dist/unstable/cluster/EntityResource.d.ts.map +1 -1
- package/dist/unstable/cluster/EntityResource.js +8 -0
- package/dist/unstable/cluster/EntityResource.js.map +1 -1
- package/dist/unstable/cluster/Envelope.d.ts +16 -0
- package/dist/unstable/cluster/Envelope.d.ts.map +1 -1
- package/dist/unstable/cluster/Envelope.js +10 -0
- package/dist/unstable/cluster/Envelope.js.map +1 -1
- package/dist/unstable/cluster/HttpRunner.d.ts +16 -0
- package/dist/unstable/cluster/HttpRunner.d.ts.map +1 -1
- package/dist/unstable/cluster/HttpRunner.js +16 -0
- package/dist/unstable/cluster/HttpRunner.js.map +1 -1
- package/dist/unstable/cluster/K8sHttpClient.d.ts +8 -0
- package/dist/unstable/cluster/K8sHttpClient.d.ts.map +1 -1
- package/dist/unstable/cluster/K8sHttpClient.js +8 -0
- package/dist/unstable/cluster/K8sHttpClient.js.map +1 -1
- package/dist/unstable/cluster/Message.d.ts +24 -0
- package/dist/unstable/cluster/Message.d.ts.map +1 -1
- package/dist/unstable/cluster/Message.js +18 -0
- package/dist/unstable/cluster/Message.js.map +1 -1
- package/dist/unstable/cluster/MessageStorage.d.ts +64 -20
- package/dist/unstable/cluster/MessageStorage.d.ts.map +1 -1
- package/dist/unstable/cluster/MessageStorage.js +8 -0
- package/dist/unstable/cluster/MessageStorage.js.map +1 -1
- package/dist/unstable/cluster/Reply.d.ts +6 -6
- package/dist/unstable/cluster/Reply.d.ts.map +1 -1
- package/dist/unstable/cluster/Reply.js +4 -3
- package/dist/unstable/cluster/Reply.js.map +1 -1
- package/dist/unstable/cluster/Runner.d.ts +2 -0
- package/dist/unstable/cluster/Runner.d.ts.map +1 -1
- package/dist/unstable/cluster/Runner.js +2 -0
- package/dist/unstable/cluster/Runner.js.map +1 -1
- package/dist/unstable/cluster/RunnerHealth.d.ts +13 -2
- package/dist/unstable/cluster/RunnerHealth.d.ts.map +1 -1
- package/dist/unstable/cluster/RunnerHealth.js +13 -2
- package/dist/unstable/cluster/RunnerHealth.js.map +1 -1
- package/dist/unstable/cluster/RunnerServer.d.ts +8 -8
- package/dist/unstable/cluster/RunnerServer.d.ts.map +1 -1
- package/dist/unstable/cluster/RunnerServer.js +8 -8
- package/dist/unstable/cluster/RunnerServer.js.map +1 -1
- package/dist/unstable/cluster/RunnerStorage.d.ts +2 -0
- package/dist/unstable/cluster/RunnerStorage.d.ts.map +1 -1
- package/dist/unstable/cluster/RunnerStorage.js +2 -0
- package/dist/unstable/cluster/RunnerStorage.js.map +1 -1
- package/dist/unstable/cluster/ShardId.d.ts +4 -0
- package/dist/unstable/cluster/ShardId.d.ts.map +1 -1
- package/dist/unstable/cluster/ShardId.js +4 -0
- package/dist/unstable/cluster/ShardId.js.map +1 -1
- package/dist/unstable/cluster/Snowflake.d.ts +2 -0
- package/dist/unstable/cluster/Snowflake.d.ts.map +1 -1
- package/dist/unstable/cluster/Snowflake.js +2 -0
- package/dist/unstable/cluster/Snowflake.js.map +1 -1
- package/dist/unstable/cluster/TestRunner.d.ts +3 -2
- package/dist/unstable/cluster/TestRunner.d.ts.map +1 -1
- package/dist/unstable/cluster/TestRunner.js +3 -2
- package/dist/unstable/cluster/TestRunner.js.map +1 -1
- package/dist/unstable/devtools/DevToolsSchema.d.ts +34 -2
- package/dist/unstable/devtools/DevToolsSchema.d.ts.map +1 -1
- package/dist/unstable/devtools/DevToolsSchema.js +14 -0
- package/dist/unstable/devtools/DevToolsSchema.js.map +1 -1
- package/dist/unstable/devtools/DevToolsServer.d.ts +4 -0
- package/dist/unstable/devtools/DevToolsServer.d.ts.map +1 -1
- package/dist/unstable/devtools/DevToolsServer.js +2 -0
- package/dist/unstable/devtools/DevToolsServer.js.map +1 -1
- package/dist/unstable/encoding/Msgpack.d.ts +24 -0
- package/dist/unstable/encoding/Msgpack.d.ts.map +1 -1
- package/dist/unstable/encoding/Msgpack.js +18 -0
- package/dist/unstable/encoding/Msgpack.js.map +1 -1
- package/dist/unstable/encoding/Ndjson.d.ts +46 -2
- package/dist/unstable/encoding/Ndjson.d.ts.map +1 -1
- package/dist/unstable/encoding/Ndjson.js +30 -2
- package/dist/unstable/encoding/Ndjson.js.map +1 -1
- package/dist/unstable/encoding/Sse.d.ts +24 -17
- package/dist/unstable/encoding/Sse.d.ts.map +1 -1
- package/dist/unstable/encoding/Sse.js +20 -11
- package/dist/unstable/encoding/Sse.js.map +1 -1
- package/dist/unstable/eventlog/Event.d.ts +16 -0
- package/dist/unstable/eventlog/Event.d.ts.map +1 -1
- package/dist/unstable/eventlog/Event.js.map +1 -1
- package/dist/unstable/eventlog/EventGroup.d.ts +4 -0
- package/dist/unstable/eventlog/EventGroup.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventGroup.js +2 -0
- package/dist/unstable/eventlog/EventGroup.js.map +1 -1
- package/dist/unstable/eventlog/EventJournal.d.ts +20 -0
- package/dist/unstable/eventlog/EventJournal.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventJournal.js +18 -0
- package/dist/unstable/eventlog/EventJournal.js.map +1 -1
- package/dist/unstable/eventlog/EventLog.d.ts +22 -0
- package/dist/unstable/eventlog/EventLog.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLog.js +18 -0
- package/dist/unstable/eventlog/EventLog.js.map +1 -1
- package/dist/unstable/eventlog/EventLogMessage.d.ts +10 -0
- package/dist/unstable/eventlog/EventLogMessage.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogMessage.js +10 -0
- package/dist/unstable/eventlog/EventLogMessage.js.map +1 -1
- package/dist/unstable/eventlog/EventLogRemote.d.ts +4 -0
- package/dist/unstable/eventlog/EventLogRemote.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogRemote.js +4 -0
- package/dist/unstable/eventlog/EventLogRemote.js.map +1 -1
- package/dist/unstable/eventlog/EventLogServer.d.ts +4 -0
- package/dist/unstable/eventlog/EventLogServer.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogServer.js +4 -0
- package/dist/unstable/eventlog/EventLogServer.js.map +1 -1
- package/dist/unstable/eventlog/EventLogServerEncrypted.d.ts +6 -0
- package/dist/unstable/eventlog/EventLogServerEncrypted.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogServerEncrypted.js +6 -0
- package/dist/unstable/eventlog/EventLogServerEncrypted.js.map +1 -1
- package/dist/unstable/eventlog/EventLogServerUnencrypted.d.ts +8 -0
- package/dist/unstable/eventlog/EventLogServerUnencrypted.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogServerUnencrypted.js +8 -0
- package/dist/unstable/eventlog/EventLogServerUnencrypted.js.map +1 -1
- package/dist/unstable/eventlog/EventLogSessionAuth.d.ts +11 -1
- package/dist/unstable/eventlog/EventLogSessionAuth.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogSessionAuth.js +11 -1
- package/dist/unstable/eventlog/EventLogSessionAuth.js.map +1 -1
- package/dist/unstable/eventlog/SqlEventJournal.d.ts +2 -0
- package/dist/unstable/eventlog/SqlEventJournal.d.ts.map +1 -1
- package/dist/unstable/eventlog/SqlEventJournal.js +2 -0
- package/dist/unstable/eventlog/SqlEventJournal.js.map +1 -1
- package/dist/unstable/eventlog/SqlEventLogServerEncrypted.d.ts +2 -0
- package/dist/unstable/eventlog/SqlEventLogServerEncrypted.d.ts.map +1 -1
- package/dist/unstable/eventlog/SqlEventLogServerEncrypted.js +2 -0
- package/dist/unstable/eventlog/SqlEventLogServerEncrypted.js.map +1 -1
- package/dist/unstable/eventlog/SqlEventLogServerUnencrypted.d.ts +2 -0
- package/dist/unstable/eventlog/SqlEventLogServerUnencrypted.d.ts.map +1 -1
- package/dist/unstable/eventlog/SqlEventLogServerUnencrypted.js +2 -0
- package/dist/unstable/eventlog/SqlEventLogServerUnencrypted.js.map +1 -1
- package/dist/unstable/http/Cookies.d.ts +34 -0
- package/dist/unstable/http/Cookies.d.ts.map +1 -1
- package/dist/unstable/http/Cookies.js +18 -0
- package/dist/unstable/http/Cookies.js.map +1 -1
- package/dist/unstable/http/Etag.d.ts +4 -0
- package/dist/unstable/http/Etag.d.ts.map +1 -1
- package/dist/unstable/http/Etag.js.map +1 -1
- package/dist/unstable/http/FetchHttpClient.d.ts +4 -0
- package/dist/unstable/http/FetchHttpClient.d.ts.map +1 -1
- package/dist/unstable/http/FetchHttpClient.js +4 -0
- package/dist/unstable/http/FetchHttpClient.js.map +1 -1
- package/dist/unstable/http/Headers.d.ts +60 -0
- package/dist/unstable/http/Headers.d.ts.map +1 -1
- package/dist/unstable/http/Headers.js +24 -0
- package/dist/unstable/http/Headers.js.map +1 -1
- package/dist/unstable/http/HttpBody.d.ts +32 -0
- package/dist/unstable/http/HttpBody.d.ts.map +1 -1
- package/dist/unstable/http/HttpBody.js +22 -0
- package/dist/unstable/http/HttpBody.js.map +1 -1
- package/dist/unstable/http/HttpClient.d.ts +44 -0
- package/dist/unstable/http/HttpClient.d.ts.map +1 -1
- package/dist/unstable/http/HttpClient.js +14 -0
- package/dist/unstable/http/HttpClient.js.map +1 -1
- package/dist/unstable/http/HttpClientRequest.d.ts +2 -0
- package/dist/unstable/http/HttpClientRequest.d.ts.map +1 -1
- package/dist/unstable/http/HttpClientRequest.js +2 -0
- package/dist/unstable/http/HttpClientRequest.js.map +1 -1
- package/dist/unstable/http/HttpClientResponse.d.ts +6 -0
- package/dist/unstable/http/HttpClientResponse.d.ts.map +1 -1
- package/dist/unstable/http/HttpClientResponse.js +6 -0
- package/dist/unstable/http/HttpClientResponse.js.map +1 -1
- package/dist/unstable/http/HttpEffect.d.ts +4 -0
- package/dist/unstable/http/HttpEffect.d.ts.map +1 -1
- package/dist/unstable/http/HttpEffect.js +4 -0
- package/dist/unstable/http/HttpEffect.js.map +1 -1
- package/dist/unstable/http/HttpPlatform.d.ts +2 -0
- package/dist/unstable/http/HttpPlatform.d.ts.map +1 -1
- package/dist/unstable/http/HttpPlatform.js +2 -0
- package/dist/unstable/http/HttpPlatform.js.map +1 -1
- package/dist/unstable/http/HttpRouter.d.ts +54 -16
- package/dist/unstable/http/HttpRouter.d.ts.map +1 -1
- package/dist/unstable/http/HttpRouter.js +26 -1
- package/dist/unstable/http/HttpRouter.js.map +1 -1
- package/dist/unstable/http/HttpServer.d.ts +35 -1
- package/dist/unstable/http/HttpServer.d.ts.map +1 -1
- package/dist/unstable/http/HttpServer.js +17 -1
- package/dist/unstable/http/HttpServer.js.map +1 -1
- package/dist/unstable/http/HttpServerError.d.ts +17 -3
- package/dist/unstable/http/HttpServerError.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerError.js +16 -0
- package/dist/unstable/http/HttpServerError.js.map +1 -1
- package/dist/unstable/http/HttpServerRequest.d.ts +30 -0
- package/dist/unstable/http/HttpServerRequest.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerRequest.js +28 -0
- package/dist/unstable/http/HttpServerRequest.js.map +1 -1
- package/dist/unstable/http/HttpServerRespondable.d.ts +8 -0
- package/dist/unstable/http/HttpServerRespondable.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerRespondable.js +6 -0
- package/dist/unstable/http/HttpServerRespondable.js.map +1 -1
- package/dist/unstable/http/HttpServerResponse.d.ts +96 -0
- package/dist/unstable/http/HttpServerResponse.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerResponse.js +50 -0
- package/dist/unstable/http/HttpServerResponse.js.map +1 -1
- package/dist/unstable/http/HttpTraceContext.d.ts +12 -0
- package/dist/unstable/http/HttpTraceContext.d.ts.map +1 -1
- package/dist/unstable/http/HttpTraceContext.js +10 -0
- package/dist/unstable/http/HttpTraceContext.js.map +1 -1
- package/dist/unstable/http/Multipart.d.ts +49 -2
- package/dist/unstable/http/Multipart.d.ts.map +1 -1
- package/dist/unstable/http/Multipart.js +35 -2
- package/dist/unstable/http/Multipart.js.map +1 -1
- package/dist/unstable/http/Template.d.ts +14 -0
- package/dist/unstable/http/Template.d.ts.map +1 -1
- package/dist/unstable/http/Template.js +4 -0
- package/dist/unstable/http/Template.js.map +1 -1
- package/dist/unstable/http/UrlParams.d.ts +64 -0
- package/dist/unstable/http/UrlParams.d.ts.map +1 -1
- package/dist/unstable/http/UrlParams.js +28 -0
- package/dist/unstable/http/UrlParams.js.map +1 -1
- package/dist/unstable/httpapi/HttpApi.d.ts +10 -4
- package/dist/unstable/httpapi/HttpApi.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApi.js +4 -0
- package/dist/unstable/httpapi/HttpApi.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiBuilder.d.ts +9 -4
- package/dist/unstable/httpapi/HttpApiBuilder.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiBuilder.js +5 -4
- package/dist/unstable/httpapi/HttpApiBuilder.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiEndpoint.d.ts +2 -0
- package/dist/unstable/httpapi/HttpApiEndpoint.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiEndpoint.js +2 -0
- package/dist/unstable/httpapi/HttpApiEndpoint.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiGroup.d.ts +23 -14
- package/dist/unstable/httpapi/HttpApiGroup.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiGroup.js +6 -3
- package/dist/unstable/httpapi/HttpApiGroup.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiMiddleware.d.ts +14 -0
- package/dist/unstable/httpapi/HttpApiMiddleware.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiMiddleware.js +6 -0
- package/dist/unstable/httpapi/HttpApiMiddleware.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiScalar.d.ts +38 -15
- package/dist/unstable/httpapi/HttpApiScalar.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiScalar.js +4 -0
- package/dist/unstable/httpapi/HttpApiScalar.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiSchema.d.ts +14 -3
- package/dist/unstable/httpapi/HttpApiSchema.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiSchema.js +10 -0
- package/dist/unstable/httpapi/HttpApiSchema.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiSecurity.d.ts +17 -11
- package/dist/unstable/httpapi/HttpApiSecurity.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiSecurity.js +17 -11
- package/dist/unstable/httpapi/HttpApiSecurity.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiSwagger.d.ts +2 -4
- package/dist/unstable/httpapi/HttpApiSwagger.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiSwagger.js +2 -4
- package/dist/unstable/httpapi/HttpApiSwagger.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiTest.d.ts +2 -0
- package/dist/unstable/httpapi/HttpApiTest.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiTest.js +2 -0
- package/dist/unstable/httpapi/HttpApiTest.js.map +1 -1
- package/dist/unstable/httpapi/OpenApi.d.ts +2 -0
- package/dist/unstable/httpapi/OpenApi.d.ts.map +1 -1
- package/dist/unstable/httpapi/OpenApi.js +2 -0
- package/dist/unstable/httpapi/OpenApi.js.map +1 -1
- package/dist/unstable/observability/Otlp.d.ts +2 -0
- package/dist/unstable/observability/Otlp.d.ts.map +1 -1
- package/dist/unstable/observability/Otlp.js +2 -0
- package/dist/unstable/observability/Otlp.js.map +1 -1
- package/dist/unstable/observability/OtlpExporter.d.ts +2 -0
- package/dist/unstable/observability/OtlpExporter.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpExporter.js +2 -0
- package/dist/unstable/observability/OtlpExporter.js.map +1 -1
- package/dist/unstable/observability/OtlpLogger.d.ts +4 -0
- package/dist/unstable/observability/OtlpLogger.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpLogger.js +4 -0
- package/dist/unstable/observability/OtlpLogger.js.map +1 -1
- package/dist/unstable/observability/OtlpMetrics.d.ts +8 -9
- package/dist/unstable/observability/OtlpMetrics.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpMetrics.js +3 -3
- package/dist/unstable/observability/OtlpMetrics.js.map +1 -1
- package/dist/unstable/observability/OtlpResource.d.ts +8 -0
- package/dist/unstable/observability/OtlpResource.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpResource.js +8 -0
- package/dist/unstable/observability/OtlpResource.js.map +1 -1
- package/dist/unstable/observability/OtlpTracer.d.ts +3 -2
- package/dist/unstable/observability/OtlpTracer.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpTracer.js +3 -2
- package/dist/unstable/observability/OtlpTracer.js.map +1 -1
- package/dist/unstable/observability/PrometheusMetrics.d.ts +6 -2
- package/dist/unstable/observability/PrometheusMetrics.d.ts.map +1 -1
- package/dist/unstable/observability/PrometheusMetrics.js +6 -2
- package/dist/unstable/observability/PrometheusMetrics.js.map +1 -1
- package/dist/unstable/persistence/KeyValueStore.d.ts +10 -0
- package/dist/unstable/persistence/KeyValueStore.d.ts.map +1 -1
- package/dist/unstable/persistence/KeyValueStore.js +8 -0
- package/dist/unstable/persistence/KeyValueStore.js.map +1 -1
- package/dist/unstable/persistence/Persistable.d.ts +2 -0
- package/dist/unstable/persistence/Persistable.d.ts.map +1 -1
- package/dist/unstable/persistence/Persistable.js +2 -0
- package/dist/unstable/persistence/Persistable.js.map +1 -1
- package/dist/unstable/persistence/PersistedCache.d.ts +2 -0
- package/dist/unstable/persistence/PersistedCache.d.ts.map +1 -1
- package/dist/unstable/persistence/PersistedCache.js +2 -0
- package/dist/unstable/persistence/PersistedCache.js.map +1 -1
- package/dist/unstable/persistence/PersistedQueue.d.ts +21 -6
- package/dist/unstable/persistence/PersistedQueue.d.ts.map +1 -1
- package/dist/unstable/persistence/PersistedQueue.js +10 -0
- package/dist/unstable/persistence/PersistedQueue.js.map +1 -1
- package/dist/unstable/persistence/Persistence.d.ts +14 -0
- package/dist/unstable/persistence/Persistence.d.ts.map +1 -1
- package/dist/unstable/persistence/Persistence.js +14 -0
- package/dist/unstable/persistence/Persistence.js.map +1 -1
- package/dist/unstable/persistence/RateLimiter.d.ts +6 -3
- package/dist/unstable/persistence/RateLimiter.d.ts.map +1 -1
- package/dist/unstable/persistence/RateLimiter.js +4 -0
- package/dist/unstable/persistence/RateLimiter.js.map +1 -1
- package/dist/unstable/persistence/Redis.d.ts +6 -0
- package/dist/unstable/persistence/Redis.d.ts.map +1 -1
- package/dist/unstable/persistence/Redis.js +4 -0
- package/dist/unstable/persistence/Redis.js.map +1 -1
- package/dist/unstable/process/ChildProcess.d.ts +70 -19
- package/dist/unstable/process/ChildProcess.d.ts.map +1 -1
- package/dist/unstable/process/ChildProcess.js +10 -0
- package/dist/unstable/process/ChildProcess.js.map +1 -1
- package/dist/unstable/process/ChildProcessSpawner.d.ts +20 -4
- package/dist/unstable/process/ChildProcessSpawner.d.ts.map +1 -1
- package/dist/unstable/process/ChildProcessSpawner.js.map +1 -1
- package/dist/unstable/reactivity/Atom.d.ts +105 -14
- package/dist/unstable/reactivity/Atom.d.ts.map +1 -1
- package/dist/unstable/reactivity/Atom.js +53 -8
- package/dist/unstable/reactivity/Atom.js.map +1 -1
- package/dist/unstable/reactivity/AtomHttpApi.d.ts +4 -0
- package/dist/unstable/reactivity/AtomHttpApi.d.ts.map +1 -1
- package/dist/unstable/reactivity/AtomHttpApi.js +2 -0
- package/dist/unstable/reactivity/AtomHttpApi.js.map +1 -1
- package/dist/unstable/reactivity/AtomRef.d.ts +8 -0
- package/dist/unstable/reactivity/AtomRef.d.ts.map +1 -1
- package/dist/unstable/reactivity/AtomRef.js +2 -0
- package/dist/unstable/reactivity/AtomRef.js.map +1 -1
- package/dist/unstable/reactivity/AtomRegistry.d.ts +32 -0
- package/dist/unstable/reactivity/AtomRegistry.d.ts.map +1 -1
- package/dist/unstable/reactivity/AtomRegistry.js +12 -0
- package/dist/unstable/reactivity/AtomRegistry.js.map +1 -1
- package/dist/unstable/reactivity/AtomRpc.d.ts +8 -6
- package/dist/unstable/reactivity/AtomRpc.d.ts.map +1 -1
- package/dist/unstable/reactivity/AtomRpc.js +4 -3
- package/dist/unstable/reactivity/AtomRpc.js.map +1 -1
- package/dist/unstable/reactivity/Hydration.d.ts +6 -0
- package/dist/unstable/reactivity/Hydration.d.ts.map +1 -1
- package/dist/unstable/reactivity/Hydration.js +4 -0
- package/dist/unstable/reactivity/Hydration.js.map +1 -1
- package/dist/unstable/reactivity/Reactivity.d.ts +27 -3
- package/dist/unstable/reactivity/Reactivity.d.ts.map +1 -1
- package/dist/unstable/reactivity/Reactivity.js +15 -3
- package/dist/unstable/reactivity/Reactivity.js.map +1 -1
- package/dist/unstable/rpc/Rpc.d.ts +38 -2
- package/dist/unstable/rpc/Rpc.d.ts.map +1 -1
- package/dist/unstable/rpc/Rpc.js +12 -2
- package/dist/unstable/rpc/Rpc.js.map +1 -1
- package/dist/unstable/rpc/RpcSerialization.d.ts +6 -0
- package/dist/unstable/rpc/RpcSerialization.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcSerialization.js +6 -0
- package/dist/unstable/rpc/RpcSerialization.js.map +1 -1
- package/dist/unstable/rpc/RpcServer.d.ts +5 -3
- package/dist/unstable/rpc/RpcServer.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcServer.js +5 -3
- package/dist/unstable/rpc/RpcServer.js.map +1 -1
- package/dist/unstable/schema/Model.d.ts +43 -12
- package/dist/unstable/schema/Model.d.ts.map +1 -1
- package/dist/unstable/schema/Model.js +41 -12
- package/dist/unstable/schema/Model.js.map +1 -1
- package/dist/unstable/sql/SqlClient.d.ts.map +1 -1
- package/dist/unstable/sql/SqlResolver.d.ts +6 -4
- package/dist/unstable/sql/SqlResolver.d.ts.map +1 -1
- package/dist/unstable/sql/SqlResolver.js +6 -4
- package/dist/unstable/sql/SqlResolver.js.map +1 -1
- package/dist/unstable/sql/Statement.d.ts +8 -4
- package/dist/unstable/sql/Statement.d.ts.map +1 -1
- package/dist/unstable/sql/Statement.js.map +1 -1
- package/dist/unstable/workflow/DurableClock.d.ts +1 -1
- package/dist/unstable/workflow/DurableDeferred.d.ts +3 -0
- package/dist/unstable/workflow/DurableDeferred.d.ts.map +1 -1
- package/dist/unstable/workflow/DurableDeferred.js +3 -0
- package/dist/unstable/workflow/DurableDeferred.js.map +1 -1
- package/dist/unstable/workflow/Workflow.d.ts +42 -34
- package/dist/unstable/workflow/Workflow.d.ts.map +1 -1
- package/dist/unstable/workflow/Workflow.js +18 -19
- package/dist/unstable/workflow/Workflow.js.map +1 -1
- package/package.json +1 -1
- package/src/Array.ts +454 -0
- package/src/BigDecimal.ts +87 -33
- package/src/BigInt.ts +71 -14
- package/src/Boolean.ts +4 -0
- package/src/Brand.ts +16 -11
- package/src/Cache.ts +17 -1
- package/src/Cause.ts +95 -3
- package/src/Channel.ts +326 -0
- package/src/ChannelSchema.ts +24 -0
- package/src/Chunk.ts +59 -22
- package/src/Combiner.ts +75 -71
- package/src/Config.ts +167 -46
- package/src/ConfigProvider.ts +235 -158
- package/src/Console.ts +25 -99
- package/src/Context.ts +4 -4
- package/src/Cron.ts +42 -16
- package/src/Crypto.ts +6 -0
- package/src/Data.ts +132 -70
- package/src/DateTime.ts +227 -14
- package/src/Deferred.ts +94 -27
- package/src/Differ.ts +2 -0
- package/src/Duration.ts +64 -6
- package/src/Effect.ts +909 -605
- package/src/Effectable.ts +3 -1
- package/src/Encoding.ts +16 -0
- package/src/Equal.ts +52 -40
- package/src/Equivalence.ts +190 -153
- package/src/ErrorReporter.ts +35 -14
- package/src/ExecutionPlan.ts +10 -3
- package/src/Exit.ts +212 -6
- package/src/Fiber.ts +8 -0
- package/src/FiberHandle.ts +46 -23
- package/src/FiberMap.ts +43 -4
- package/src/FiberSet.ts +21 -6
- package/src/FileSystem.ts +64 -0
- package/src/Filter.ts +53 -21
- package/src/Formatter.ts +21 -22
- package/src/Function.ts +67 -75
- package/src/Graph.ts +51 -13
- package/src/HKT.ts +22 -21
- package/src/Hash.ts +33 -10
- package/src/HashMap.ts +50 -9
- package/src/HashRing.ts +4 -0
- package/src/HashSet.ts +2 -0
- package/src/Inspectable.ts +15 -2
- package/src/Iterable.ts +104 -22
- package/src/JsonPatch.ts +61 -80
- package/src/JsonPointer.ts +16 -20
- package/src/JsonSchema.ts +123 -73
- package/src/Latch.ts +28 -2
- package/src/Layer.ts +781 -335
- package/src/LogLevel.ts +86 -13
- package/src/Logger.ts +71 -51
- package/src/ManagedRuntime.ts +12 -0
- package/src/Match.ts +83 -1
- package/src/Metric.ts +105 -12
- package/src/MutableHashMap.ts +18 -0
- package/src/MutableHashSet.ts +2 -0
- package/src/MutableList.ts +24 -6
- package/src/MutableRef.ts +2 -0
- package/src/Newtype.ts +69 -30
- package/src/NonEmptyIterable.ts +6 -0
- package/src/Number.ts +16 -30
- package/src/Optic.ts +90 -40
- package/src/Option.ts +121 -111
- package/src/Order.ts +169 -167
- package/src/Ordering.ts +4 -0
- package/src/PartitionedSemaphore.ts +7 -5
- package/src/Path.ts +8 -0
- package/src/Pipeable.ts +10 -0
- package/src/PlatformError.ts +12 -0
- package/src/Pool.ts +30 -16
- package/src/Predicate.ts +520 -352
- package/src/PrimaryKey.ts +4 -0
- package/src/PubSub.ts +23 -5
- package/src/Pull.ts +16 -0
- package/src/Queue.ts +44 -0
- package/src/Random.ts +25 -6
- package/src/RcMap.ts +10 -6
- package/src/RcRef.ts +3 -1
- package/src/Record.ts +24 -3
- package/src/Redactable.ts +54 -41
- package/src/Redacted.ts +10 -0
- package/src/Reducer.ts +20 -11
- package/src/Ref.ts +95 -58
- package/src/References.ts +18 -1
- package/src/Request.ts +3 -3
- package/src/RequestResolver.ts +8 -22
- package/src/Resource.ts +2 -0
- package/src/Result.ts +192 -6
- package/src/Runtime.ts +14 -11
- package/src/Schedule.ts +35 -3
- package/src/Scheduler.ts +22 -19
- package/src/Schema.ts +547 -130
- package/src/SchemaAST.ts +123 -65
- package/src/SchemaGetter.ts +269 -234
- package/src/SchemaIssue.ts +48 -46
- package/src/SchemaParser.ts +58 -0
- package/src/SchemaRepresentation.ts +198 -96
- package/src/SchemaTransformation.ts +272 -203
- package/src/SchemaUtils.ts +2 -0
- package/src/Scope.ts +19 -1
- package/src/ScopedCache.ts +56 -0
- package/src/ScopedRef.ts +9 -3
- package/src/Semaphore.ts +6 -0
- package/src/Sink.ts +108 -0
- package/src/Stdio.ts +7 -3
- package/src/Stream.ts +464 -16
- package/src/String.ts +14 -0
- package/src/Struct.ts +371 -191
- package/src/SubscriptionRef.ts +7 -1
- package/src/SynchronizedRef.ts +2 -0
- package/src/Tracer.ts +17 -27
- package/src/Trie.ts +23 -9
- package/src/Tuple.ts +287 -144
- package/src/TxChunk.ts +182 -93
- package/src/TxDeferred.ts +3 -4
- package/src/TxHashMap.ts +171 -90
- package/src/TxHashSet.ts +36 -35
- package/src/TxPriorityQueue.ts +2 -0
- package/src/TxPubSub.ts +36 -35
- package/src/TxQueue.ts +77 -114
- package/src/TxRef.ts +4 -0
- package/src/TxSemaphore.ts +66 -27
- package/src/Types.ts +202 -75
- package/src/UndefinedOr.ts +31 -29
- package/src/Unify.ts +28 -0
- package/src/Utils.ts +29 -35
- package/src/index.ts +18 -7
- package/src/testing/TestClock.ts +16 -16
- package/src/testing/TestConsole.ts +2 -0
- package/src/testing/TestSchema.ts +43 -55
- package/src/unstable/ai/AiError.ts +62 -11
- package/src/unstable/ai/AnthropicStructuredOutput.ts +4 -4
- package/src/unstable/ai/Chat.ts +29 -1
- package/src/unstable/ai/IdGenerator.ts +10 -0
- package/src/unstable/ai/LanguageModel.ts +32 -46
- package/src/unstable/ai/McpSchema.ts +84 -32
- package/src/unstable/ai/McpServer.ts +8 -0
- package/src/unstable/ai/Model.ts +9 -5
- package/src/unstable/ai/OpenAiStructuredOutput.ts +3 -2
- package/src/unstable/ai/Prompt.ts +62 -35
- package/src/unstable/ai/Response.ts +40 -21
- package/src/unstable/ai/ResponseIdTracker.ts +8 -0
- package/src/unstable/ai/Telemetry.ts +30 -5
- package/src/unstable/ai/Tokenizer.ts +6 -0
- package/src/unstable/ai/Tool.ts +68 -0
- package/src/unstable/ai/Toolkit.ts +12 -0
- package/src/unstable/cli/Argument.ts +14 -4
- package/src/unstable/cli/CliError.ts +6 -0
- package/src/unstable/cli/Command.ts +128 -12
- package/src/unstable/cli/Flag.ts +31 -14
- package/src/unstable/cli/Param.ts +96 -9
- package/src/unstable/cli/Primitive.ts +10 -0
- package/src/unstable/cli/Prompt.ts +47 -40
- package/src/unstable/cli/internal/command.ts +11 -2
- package/src/unstable/cli/internal/completions/descriptor.ts +3 -0
- package/src/unstable/cli/internal/parser.ts +8 -1
- package/src/unstable/cluster/ClusterCron.ts +10 -1
- package/src/unstable/cluster/ClusterSchema.ts +8 -0
- package/src/unstable/cluster/ClusterWorkflowEngine.ts +4 -0
- package/src/unstable/cluster/DeliverAt.ts +3 -4
- package/src/unstable/cluster/Entity.ts +24 -0
- package/src/unstable/cluster/EntityProxy.ts +10 -4
- package/src/unstable/cluster/EntityProxyServer.ts +6 -0
- package/src/unstable/cluster/EntityResource.ts +10 -0
- package/src/unstable/cluster/Envelope.ts +16 -0
- package/src/unstable/cluster/HttpRunner.ts +16 -0
- package/src/unstable/cluster/K8sHttpClient.ts +8 -0
- package/src/unstable/cluster/Message.ts +24 -0
- package/src/unstable/cluster/MessageStorage.ts +44 -10
- package/src/unstable/cluster/Reply.ts +6 -6
- package/src/unstable/cluster/Runner.ts +2 -0
- package/src/unstable/cluster/RunnerHealth.ts +13 -2
- package/src/unstable/cluster/RunnerServer.ts +8 -8
- package/src/unstable/cluster/RunnerStorage.ts +2 -0
- package/src/unstable/cluster/ShardId.ts +4 -0
- package/src/unstable/cluster/Snowflake.ts +2 -0
- package/src/unstable/cluster/TestRunner.ts +3 -2
- package/src/unstable/devtools/DevToolsSchema.ts +34 -2
- package/src/unstable/devtools/DevToolsServer.ts +4 -0
- package/src/unstable/encoding/Msgpack.ts +24 -0
- package/src/unstable/encoding/Ndjson.ts +46 -2
- package/src/unstable/encoding/Sse.ts +24 -17
- package/src/unstable/eventlog/Event.ts +16 -0
- package/src/unstable/eventlog/EventGroup.ts +4 -0
- package/src/unstable/eventlog/EventJournal.ts +20 -0
- package/src/unstable/eventlog/EventLog.ts +22 -0
- package/src/unstable/eventlog/EventLogMessage.ts +10 -0
- package/src/unstable/eventlog/EventLogRemote.ts +4 -0
- package/src/unstable/eventlog/EventLogServer.ts +4 -0
- package/src/unstable/eventlog/EventLogServerEncrypted.ts +6 -0
- package/src/unstable/eventlog/EventLogServerUnencrypted.ts +8 -0
- package/src/unstable/eventlog/EventLogSessionAuth.ts +11 -1
- package/src/unstable/eventlog/SqlEventJournal.ts +2 -0
- package/src/unstable/eventlog/SqlEventLogServerEncrypted.ts +2 -0
- package/src/unstable/eventlog/SqlEventLogServerUnencrypted.ts +2 -0
- package/src/unstable/http/Cookies.ts +34 -0
- package/src/unstable/http/Etag.ts +4 -0
- package/src/unstable/http/FetchHttpClient.ts +4 -0
- package/src/unstable/http/Headers.ts +88 -0
- package/src/unstable/http/HttpBody.ts +32 -0
- package/src/unstable/http/HttpClient.ts +44 -0
- package/src/unstable/http/HttpClientRequest.ts +2 -0
- package/src/unstable/http/HttpClientResponse.ts +6 -0
- package/src/unstable/http/HttpEffect.ts +4 -0
- package/src/unstable/http/HttpPlatform.ts +2 -0
- package/src/unstable/http/HttpRouter.ts +54 -16
- package/src/unstable/http/HttpServer.ts +35 -1
- package/src/unstable/http/HttpServerError.ts +17 -3
- package/src/unstable/http/HttpServerRequest.ts +30 -0
- package/src/unstable/http/HttpServerRespondable.ts +8 -0
- package/src/unstable/http/HttpServerResponse.ts +96 -0
- package/src/unstable/http/HttpTraceContext.ts +12 -0
- package/src/unstable/http/Multipart.ts +49 -2
- package/src/unstable/http/Template.ts +14 -0
- package/src/unstable/http/UrlParams.ts +64 -0
- package/src/unstable/httpapi/HttpApi.ts +10 -4
- package/src/unstable/httpapi/HttpApiBuilder.ts +9 -4
- package/src/unstable/httpapi/HttpApiEndpoint.ts +2 -0
- package/src/unstable/httpapi/HttpApiGroup.ts +23 -14
- package/src/unstable/httpapi/HttpApiMiddleware.ts +14 -0
- package/src/unstable/httpapi/HttpApiScalar.ts +38 -15
- package/src/unstable/httpapi/HttpApiSchema.ts +14 -3
- package/src/unstable/httpapi/HttpApiSecurity.ts +17 -11
- package/src/unstable/httpapi/HttpApiSwagger.ts +2 -4
- package/src/unstable/httpapi/HttpApiTest.ts +2 -0
- package/src/unstable/httpapi/OpenApi.ts +2 -0
- package/src/unstable/observability/Otlp.ts +2 -0
- package/src/unstable/observability/OtlpExporter.ts +2 -0
- package/src/unstable/observability/OtlpLogger.ts +4 -0
- package/src/unstable/observability/OtlpMetrics.ts +8 -9
- package/src/unstable/observability/OtlpResource.ts +8 -0
- package/src/unstable/observability/OtlpTracer.ts +3 -2
- package/src/unstable/observability/PrometheusMetrics.ts +6 -2
- package/src/unstable/persistence/KeyValueStore.ts +10 -0
- package/src/unstable/persistence/Persistable.ts +2 -0
- package/src/unstable/persistence/PersistedCache.ts +2 -0
- package/src/unstable/persistence/PersistedQueue.ts +21 -6
- package/src/unstable/persistence/Persistence.ts +14 -0
- package/src/unstable/persistence/RateLimiter.ts +6 -3
- package/src/unstable/persistence/Redis.ts +6 -0
- package/src/unstable/process/ChildProcess.ts +70 -19
- package/src/unstable/process/ChildProcessSpawner.ts +20 -4
- package/src/unstable/reactivity/Atom.ts +119 -14
- package/src/unstable/reactivity/AtomHttpApi.ts +4 -0
- package/src/unstable/reactivity/AtomRef.ts +8 -0
- package/src/unstable/reactivity/AtomRegistry.ts +34 -0
- package/src/unstable/reactivity/AtomRpc.ts +8 -6
- package/src/unstable/reactivity/Hydration.ts +6 -0
- package/src/unstable/reactivity/Reactivity.ts +27 -3
- package/src/unstable/rpc/Rpc.ts +38 -2
- package/src/unstable/rpc/RpcSerialization.ts +6 -0
- package/src/unstable/rpc/RpcServer.ts +5 -3
- package/src/unstable/schema/Model.ts +43 -12
- package/src/unstable/sql/SqlClient.ts +1 -1
- package/src/unstable/sql/SqlResolver.ts +6 -4
- package/src/unstable/sql/Statement.ts +8 -4
- package/src/unstable/workflow/DurableClock.ts +1 -1
- package/src/unstable/workflow/DurableDeferred.ts +3 -0
- package/src/unstable/workflow/Workflow.ts +42 -34
package/dist/Effect.d.ts
CHANGED
|
@@ -118,6 +118,8 @@ export declare const TypeId: TypeId;
|
|
|
118
118
|
* job. The workflow requires some context `R`, and may fail with an error of
|
|
119
119
|
* type `E`, or succeed with a value of type `A`.
|
|
120
120
|
*
|
|
121
|
+
* **Details**
|
|
122
|
+
*
|
|
121
123
|
* `Effect` values model resourceful interaction with the outside world,
|
|
122
124
|
* including synchronous, asynchronous, concurrent, and parallel interaction.
|
|
123
125
|
* They use a fiber-based concurrency model, with built-in support for
|
|
@@ -300,7 +302,7 @@ export declare namespace All {
|
|
|
300
302
|
* first failure; with concurrent execution, effects that have already started
|
|
301
303
|
* may be interrupted, while effects not yet started are skipped.
|
|
302
304
|
*
|
|
303
|
-
*
|
|
305
|
+
* Options:
|
|
304
306
|
*
|
|
305
307
|
* Use `concurrency` to control sequential or concurrent execution. Use
|
|
306
308
|
* `mode: "result"` to run every effect and collect each success or failure as a
|
|
@@ -414,7 +416,6 @@ export declare namespace All {
|
|
|
414
416
|
* ```
|
|
415
417
|
*
|
|
416
418
|
* @see {@link forEach} for iterating over elements and applying an effect.
|
|
417
|
-
*
|
|
418
419
|
* @category Collecting
|
|
419
420
|
* @since 2.0.0
|
|
420
421
|
*/
|
|
@@ -427,6 +428,8 @@ export declare const all: <const Arg extends Iterable<Effect<any, any, any>> | R
|
|
|
427
428
|
* Applies an effectful function to each element and partitions failures and
|
|
428
429
|
* successes.
|
|
429
430
|
*
|
|
431
|
+
* **Details**
|
|
432
|
+
*
|
|
430
433
|
* The returned tuple is `[excluded, satisfying]`, where:
|
|
431
434
|
*
|
|
432
435
|
* - `excluded` contains all failures.
|
|
@@ -456,6 +459,8 @@ export declare const partition: {
|
|
|
456
459
|
* Applies an effectful function to each element and partitions failures and
|
|
457
460
|
* successes.
|
|
458
461
|
*
|
|
462
|
+
* **Details**
|
|
463
|
+
*
|
|
459
464
|
* The returned tuple is `[excluded, satisfying]`, where:
|
|
460
465
|
*
|
|
461
466
|
* - `excluded` contains all failures.
|
|
@@ -487,6 +492,8 @@ export declare const partition: {
|
|
|
487
492
|
* Applies an effectful function to each element and partitions failures and
|
|
488
493
|
* successes.
|
|
489
494
|
*
|
|
495
|
+
* **Details**
|
|
496
|
+
*
|
|
490
497
|
* The returned tuple is `[excluded, satisfying]`, where:
|
|
491
498
|
*
|
|
492
499
|
* - `excluded` contains all failures.
|
|
@@ -518,6 +525,8 @@ export declare const partition: {
|
|
|
518
525
|
/**
|
|
519
526
|
* Applies an effectful function to each element and accumulates all failures.
|
|
520
527
|
*
|
|
528
|
+
* **Details**
|
|
529
|
+
*
|
|
521
530
|
* This function always evaluates every element. If at least one effect fails,
|
|
522
531
|
* all failures are returned as a non-empty array and successes are discarded.
|
|
523
532
|
* If all effects succeed, it returns all collected successes.
|
|
@@ -555,6 +564,8 @@ export declare const validate: {
|
|
|
555
564
|
/**
|
|
556
565
|
* Applies an effectful function to each element and accumulates all failures.
|
|
557
566
|
*
|
|
567
|
+
* **Details**
|
|
568
|
+
*
|
|
558
569
|
* This function always evaluates every element. If at least one effect fails,
|
|
559
570
|
* all failures are returned as a non-empty array and successes are discarded.
|
|
560
571
|
* If all effects succeed, it returns all collected successes.
|
|
@@ -595,6 +606,8 @@ export declare const validate: {
|
|
|
595
606
|
/**
|
|
596
607
|
* Applies an effectful function to each element and accumulates all failures.
|
|
597
608
|
*
|
|
609
|
+
* **Details**
|
|
610
|
+
*
|
|
598
611
|
* This function always evaluates every element. If at least one effect fails,
|
|
599
612
|
* all failures are returned as a non-empty array and successes are discarded.
|
|
600
613
|
* If all effects succeed, it returns all collected successes.
|
|
@@ -635,6 +648,8 @@ export declare const validate: {
|
|
|
635
648
|
/**
|
|
636
649
|
* Applies an effectful function to each element and accumulates all failures.
|
|
637
650
|
*
|
|
651
|
+
* **Details**
|
|
652
|
+
*
|
|
638
653
|
* This function always evaluates every element. If at least one effect fails,
|
|
639
654
|
* all failures are returned as a non-empty array and successes are discarded.
|
|
640
655
|
* If all effects succeed, it returns all collected successes.
|
|
@@ -675,6 +690,8 @@ export declare const validate: {
|
|
|
675
690
|
/**
|
|
676
691
|
* Applies an effectful function to each element and accumulates all failures.
|
|
677
692
|
*
|
|
693
|
+
* **Details**
|
|
694
|
+
*
|
|
678
695
|
* This function always evaluates every element. If at least one effect fails,
|
|
679
696
|
* all failures are returned as a non-empty array and successes are discarded.
|
|
680
697
|
* If all effects succeed, it returns all collected successes.
|
|
@@ -716,6 +733,8 @@ export declare const validate: {
|
|
|
716
733
|
/**
|
|
717
734
|
* Returns the first element that satisfies an effectful predicate.
|
|
718
735
|
*
|
|
736
|
+
* **Details**
|
|
737
|
+
*
|
|
719
738
|
* The predicate receives the element and its index. Evaluation short-circuits
|
|
720
739
|
* as soon as an element matches.
|
|
721
740
|
*
|
|
@@ -737,6 +756,8 @@ export declare const findFirst: {
|
|
|
737
756
|
/**
|
|
738
757
|
* Returns the first element that satisfies an effectful predicate.
|
|
739
758
|
*
|
|
759
|
+
* **Details**
|
|
760
|
+
*
|
|
740
761
|
* The predicate receives the element and its index. Evaluation short-circuits
|
|
741
762
|
* as soon as an element matches.
|
|
742
763
|
*
|
|
@@ -758,6 +779,8 @@ export declare const findFirst: {
|
|
|
758
779
|
/**
|
|
759
780
|
* Returns the first element that satisfies an effectful predicate.
|
|
760
781
|
*
|
|
782
|
+
* **Details**
|
|
783
|
+
*
|
|
761
784
|
* The predicate receives the element and its index. Evaluation short-circuits
|
|
762
785
|
* as soon as an element matches.
|
|
763
786
|
*
|
|
@@ -780,6 +803,8 @@ export declare const findFirst: {
|
|
|
780
803
|
/**
|
|
781
804
|
* Returns the first value that passes an effectful `FilterEffect`.
|
|
782
805
|
*
|
|
806
|
+
* **Details**
|
|
807
|
+
*
|
|
783
808
|
* The filter receives the element and index. Evaluation short-circuits on the
|
|
784
809
|
* first `Result.succeed` and returns the transformed value in `Option.some`.
|
|
785
810
|
*
|
|
@@ -790,6 +815,8 @@ export declare const findFirstFilter: {
|
|
|
790
815
|
/**
|
|
791
816
|
* Returns the first value that passes an effectful `FilterEffect`.
|
|
792
817
|
*
|
|
818
|
+
* **Details**
|
|
819
|
+
*
|
|
793
820
|
* The filter receives the element and index. Evaluation short-circuits on the
|
|
794
821
|
* first `Result.succeed` and returns the transformed value in `Option.some`.
|
|
795
822
|
*
|
|
@@ -800,6 +827,8 @@ export declare const findFirstFilter: {
|
|
|
800
827
|
/**
|
|
801
828
|
* Returns the first value that passes an effectful `FilterEffect`.
|
|
802
829
|
*
|
|
830
|
+
* **Details**
|
|
831
|
+
*
|
|
803
832
|
* The filter receives the element and index. Evaluation short-circuits on the
|
|
804
833
|
* first `Result.succeed` and returns the transformed value in `Option.some`.
|
|
805
834
|
*
|
|
@@ -819,18 +848,16 @@ export declare const findFirstFilter: {
|
|
|
819
848
|
* If any effect fails, the iteration stops immediately (short-circuiting), and
|
|
820
849
|
* the error is propagated.
|
|
821
850
|
*
|
|
822
|
-
*
|
|
851
|
+
* Concurrency:
|
|
823
852
|
*
|
|
824
853
|
* The `concurrency` option controls how many operations are performed
|
|
825
854
|
* concurrently. By default, the operations are performed sequentially.
|
|
826
855
|
*
|
|
827
|
-
*
|
|
856
|
+
* Discarding Results:
|
|
828
857
|
*
|
|
829
858
|
* If the `discard` option is set to `true`, the intermediate results are not
|
|
830
859
|
* collected, and the final result of the operation is `void`.
|
|
831
860
|
*
|
|
832
|
-
* @see {@link all} for combining multiple effects into one.
|
|
833
|
-
*
|
|
834
861
|
* **Example** (Mapping over an iterable with effects)
|
|
835
862
|
*
|
|
836
863
|
* ```ts
|
|
@@ -875,6 +902,7 @@ export declare const findFirstFilter: {
|
|
|
875
902
|
* // undefined
|
|
876
903
|
* ```
|
|
877
904
|
*
|
|
905
|
+
* @see {@link all} for combining multiple effects into one.
|
|
878
906
|
* @category Collecting
|
|
879
907
|
* @since 2.0.0
|
|
880
908
|
*/
|
|
@@ -890,18 +918,16 @@ export declare const forEach: {
|
|
|
890
918
|
* If any effect fails, the iteration stops immediately (short-circuiting), and
|
|
891
919
|
* the error is propagated.
|
|
892
920
|
*
|
|
893
|
-
*
|
|
921
|
+
* Concurrency:
|
|
894
922
|
*
|
|
895
923
|
* The `concurrency` option controls how many operations are performed
|
|
896
924
|
* concurrently. By default, the operations are performed sequentially.
|
|
897
925
|
*
|
|
898
|
-
*
|
|
926
|
+
* Discarding Results:
|
|
899
927
|
*
|
|
900
928
|
* If the `discard` option is set to `true`, the intermediate results are not
|
|
901
929
|
* collected, and the final result of the operation is `void`.
|
|
902
930
|
*
|
|
903
|
-
* @see {@link all} for combining multiple effects into one.
|
|
904
|
-
*
|
|
905
931
|
* **Example** (Mapping over an iterable with effects)
|
|
906
932
|
*
|
|
907
933
|
* ```ts
|
|
@@ -946,6 +972,7 @@ export declare const forEach: {
|
|
|
946
972
|
* // undefined
|
|
947
973
|
* ```
|
|
948
974
|
*
|
|
975
|
+
* @see {@link all} for combining multiple effects into one.
|
|
949
976
|
* @category Collecting
|
|
950
977
|
* @since 2.0.0
|
|
951
978
|
*/
|
|
@@ -964,18 +991,16 @@ export declare const forEach: {
|
|
|
964
991
|
* If any effect fails, the iteration stops immediately (short-circuiting), and
|
|
965
992
|
* the error is propagated.
|
|
966
993
|
*
|
|
967
|
-
*
|
|
994
|
+
* Concurrency:
|
|
968
995
|
*
|
|
969
996
|
* The `concurrency` option controls how many operations are performed
|
|
970
997
|
* concurrently. By default, the operations are performed sequentially.
|
|
971
998
|
*
|
|
972
|
-
*
|
|
999
|
+
* Discarding Results:
|
|
973
1000
|
*
|
|
974
1001
|
* If the `discard` option is set to `true`, the intermediate results are not
|
|
975
1002
|
* collected, and the final result of the operation is `void`.
|
|
976
1003
|
*
|
|
977
|
-
* @see {@link all} for combining multiple effects into one.
|
|
978
|
-
*
|
|
979
1004
|
* **Example** (Mapping over an iterable with effects)
|
|
980
1005
|
*
|
|
981
1006
|
* ```ts
|
|
@@ -1020,6 +1045,7 @@ export declare const forEach: {
|
|
|
1020
1045
|
* // undefined
|
|
1021
1046
|
* ```
|
|
1022
1047
|
*
|
|
1048
|
+
* @see {@link all} for combining multiple effects into one.
|
|
1023
1049
|
* @category Collecting
|
|
1024
1050
|
* @since 2.0.0
|
|
1025
1051
|
*/
|
|
@@ -1065,7 +1091,7 @@ export declare const whileLoop: <A, E, R>(options: {
|
|
|
1065
1091
|
* Creates an `Effect` that represents an asynchronous computation guaranteed to
|
|
1066
1092
|
* succeed.
|
|
1067
1093
|
*
|
|
1068
|
-
* **When to
|
|
1094
|
+
* **When to use**
|
|
1069
1095
|
*
|
|
1070
1096
|
* Use `promise` when you are sure the operation will not reject.
|
|
1071
1097
|
*
|
|
@@ -1079,13 +1105,11 @@ export declare const whileLoop: <A, E, R>(options: {
|
|
|
1079
1105
|
* crash in the program, which can be further managed or logged using tools like
|
|
1080
1106
|
* {@link catchDefect}.
|
|
1081
1107
|
*
|
|
1082
|
-
*
|
|
1108
|
+
* Interruptions:
|
|
1083
1109
|
*
|
|
1084
1110
|
* An optional `AbortSignal` can be provided to allow for interruption of the
|
|
1085
1111
|
* wrapped `Promise` API.
|
|
1086
1112
|
*
|
|
1087
|
-
* @see {@link tryPromise} for a version that can handle failures.
|
|
1088
|
-
*
|
|
1089
1113
|
* **Example** (Wrapping a non-rejecting Promise)
|
|
1090
1114
|
*
|
|
1091
1115
|
* ```ts
|
|
@@ -1106,6 +1130,7 @@ export declare const whileLoop: <A, E, R>(options: {
|
|
|
1106
1130
|
* const program = delay("Async operation completed successfully!")
|
|
1107
1131
|
* ```
|
|
1108
1132
|
*
|
|
1133
|
+
* @see {@link tryPromise} for a version that can handle failures.
|
|
1109
1134
|
* @category Creating Effects
|
|
1110
1135
|
* @since 2.0.0
|
|
1111
1136
|
*/
|
|
@@ -1114,7 +1139,7 @@ export declare const promise: <A>(evaluate: (signal: AbortSignal) => PromiseLike
|
|
|
1114
1139
|
* Creates an `Effect` that represents an asynchronous computation that might
|
|
1115
1140
|
* fail.
|
|
1116
1141
|
*
|
|
1117
|
-
* **When to
|
|
1142
|
+
* **When to use**
|
|
1118
1143
|
*
|
|
1119
1144
|
* In situations where you need to perform asynchronous operations that might
|
|
1120
1145
|
* fail, such as fetching data from an API, you can use the `tryPromise`
|
|
@@ -1122,7 +1147,9 @@ export declare const promise: <A>(evaluate: (signal: AbortSignal) => PromiseLike
|
|
|
1122
1147
|
* throw exceptions by capturing those exceptions and transforming them into
|
|
1123
1148
|
* manageable errors.
|
|
1124
1149
|
*
|
|
1125
|
-
* **
|
|
1150
|
+
* **Details**
|
|
1151
|
+
*
|
|
1152
|
+
* Error Handling:
|
|
1126
1153
|
*
|
|
1127
1154
|
* There are two ways to handle errors with `tryPromise`:
|
|
1128
1155
|
*
|
|
@@ -1131,7 +1158,7 @@ export declare const promise: <A>(evaluate: (signal: AbortSignal) => PromiseLike
|
|
|
1131
1158
|
* 2. If you provide a `catch` function, the error is caught and the `catch`
|
|
1132
1159
|
* function maps it to an error of type `E`.
|
|
1133
1160
|
*
|
|
1134
|
-
*
|
|
1161
|
+
* Interruptions:
|
|
1135
1162
|
*
|
|
1136
1163
|
* An optional `AbortSignal` can be provided to allow for interruption of the
|
|
1137
1164
|
* wrapped `Promise` API.
|
|
@@ -1172,7 +1199,6 @@ export declare const promise: <A>(evaluate: (signal: AbortSignal) => PromiseLike
|
|
|
1172
1199
|
* ```
|
|
1173
1200
|
*
|
|
1174
1201
|
* @see {@link promise} if the effectful computation is asynchronous and does not throw errors.
|
|
1175
|
-
*
|
|
1176
1202
|
* @category Creating Effects
|
|
1177
1203
|
* @since 2.0.0
|
|
1178
1204
|
*/
|
|
@@ -1183,13 +1209,11 @@ export declare const tryPromise: <A, E = Cause.UnknownError>(options: {
|
|
|
1183
1209
|
/**
|
|
1184
1210
|
* Creates an `Effect` that always succeeds with a given value.
|
|
1185
1211
|
*
|
|
1186
|
-
* **When to
|
|
1212
|
+
* **When to use**
|
|
1187
1213
|
*
|
|
1188
1214
|
* Use this function when you need an effect that completes successfully with a
|
|
1189
1215
|
* specific value without any errors or external dependencies.
|
|
1190
1216
|
*
|
|
1191
|
-
* @see {@link fail} to create an effect that represents a failure.
|
|
1192
|
-
*
|
|
1193
1217
|
* **Example** (Creating a successful effect)
|
|
1194
1218
|
*
|
|
1195
1219
|
* ```ts
|
|
@@ -1202,6 +1226,7 @@ export declare const tryPromise: <A, E = Cause.UnknownError>(options: {
|
|
|
1202
1226
|
* const success = Effect.succeed(42)
|
|
1203
1227
|
* ```
|
|
1204
1228
|
*
|
|
1229
|
+
* @see {@link fail} to create an effect that represents a failure.
|
|
1205
1230
|
* @category Creating Effects
|
|
1206
1231
|
* @since 2.0.0
|
|
1207
1232
|
*/
|
|
@@ -1245,7 +1270,7 @@ export declare const succeedSome: <A>(value: A) => Effect<Option<A>>;
|
|
|
1245
1270
|
/**
|
|
1246
1271
|
* Delays the creation of an `Effect` until it is actually needed.
|
|
1247
1272
|
*
|
|
1248
|
-
* **When to
|
|
1273
|
+
* **When to use**
|
|
1249
1274
|
*
|
|
1250
1275
|
* Use `suspend` when you need to defer the evaluation of an effect until it is required. This is particularly useful for optimizing expensive computations, managing circular dependencies, or resolving type inference issues.
|
|
1251
1276
|
*
|
|
@@ -1332,7 +1357,7 @@ export declare const suspend: <A, E, R>(effect: LazyArg<Effect<A, E, R>>) => Eff
|
|
|
1332
1357
|
/**
|
|
1333
1358
|
* Creates an `Effect` that represents a synchronous side-effectful computation.
|
|
1334
1359
|
*
|
|
1335
|
-
* **When to
|
|
1360
|
+
* **When to use**
|
|
1336
1361
|
*
|
|
1337
1362
|
* Use `sync` when you are sure the operation will not fail.
|
|
1338
1363
|
*
|
|
@@ -1346,8 +1371,6 @@ export declare const suspend: <A, E, R>(effect: LazyArg<Effect<A, E, R>>) => Eff
|
|
|
1346
1371
|
* crash in the program, which can be further managed or logged using tools like
|
|
1347
1372
|
* {@link catchDefect}.
|
|
1348
1373
|
*
|
|
1349
|
-
* @see {@link try_ | try} for a version that can handle failures.
|
|
1350
|
-
*
|
|
1351
1374
|
* **Example** (Capturing synchronous logging in an Effect)
|
|
1352
1375
|
*
|
|
1353
1376
|
* ```ts
|
|
@@ -1363,6 +1386,7 @@ export declare const suspend: <A, E, R>(effect: LazyArg<Effect<A, E, R>>) => Eff
|
|
|
1363
1386
|
* const program = log("Hello, World!")
|
|
1364
1387
|
* ```
|
|
1365
1388
|
*
|
|
1389
|
+
* @see {@link try_ | try} for a version that can handle failures.
|
|
1366
1390
|
* @category Creating Effects
|
|
1367
1391
|
* @since 2.0.0
|
|
1368
1392
|
*/
|
|
@@ -1370,6 +1394,8 @@ export declare const sync: <A>(thunk: LazyArg<A>) => Effect<A>;
|
|
|
1370
1394
|
declare const void_: Effect<void>;
|
|
1371
1395
|
export {
|
|
1372
1396
|
/**
|
|
1397
|
+
* Returns an effect that succeeds with `void`.
|
|
1398
|
+
*
|
|
1373
1399
|
* @category Creating Effects
|
|
1374
1400
|
* @since 2.0.0
|
|
1375
1401
|
*/
|
|
@@ -1377,6 +1403,8 @@ void_ as void };
|
|
|
1377
1403
|
declare const undefined_: Effect<undefined>;
|
|
1378
1404
|
export {
|
|
1379
1405
|
/**
|
|
1406
|
+
* Returns an effect that succeeds with `undefined`.
|
|
1407
|
+
*
|
|
1380
1408
|
* @category Creating Effects
|
|
1381
1409
|
* @since 4.0.0
|
|
1382
1410
|
*/
|
|
@@ -1384,6 +1412,11 @@ undefined_ as undefined };
|
|
|
1384
1412
|
/**
|
|
1385
1413
|
* Creates an `Effect` from a callback-based asynchronous API.
|
|
1386
1414
|
*
|
|
1415
|
+
* **When to use**
|
|
1416
|
+
*
|
|
1417
|
+
* Use `Effect.callback` when integrating APIs that complete through callbacks
|
|
1418
|
+
* instead of returning a `Promise`.
|
|
1419
|
+
*
|
|
1387
1420
|
* **Details**
|
|
1388
1421
|
*
|
|
1389
1422
|
* The registration function receives a `resume` callback and, when requested,
|
|
@@ -1391,11 +1424,6 @@ undefined_ as undefined };
|
|
|
1391
1424
|
* complete the fiber; later calls are ignored. Return an optional cleanup
|
|
1392
1425
|
* effect from the registration function to run if the fiber is interrupted.
|
|
1393
1426
|
*
|
|
1394
|
-
* **When to Use**
|
|
1395
|
-
*
|
|
1396
|
-
* Use `Effect.callback` when integrating APIs that complete through callbacks
|
|
1397
|
-
* instead of returning a `Promise`.
|
|
1398
|
-
*
|
|
1399
1427
|
* **Example** (Integrating callback APIs)
|
|
1400
1428
|
*
|
|
1401
1429
|
* ```ts
|
|
@@ -1528,7 +1556,7 @@ export declare const bind: {
|
|
|
1528
1556
|
* Provides a way to write effectful code using generator functions, simplifying
|
|
1529
1557
|
* control flow and error handling.
|
|
1530
1558
|
*
|
|
1531
|
-
* **When to
|
|
1559
|
+
* **When to use**
|
|
1532
1560
|
*
|
|
1533
1561
|
* `gen` allows you to write code that looks and behaves like synchronous
|
|
1534
1562
|
* code, but it can handle asynchronous tasks, errors, and complex control flow
|
|
@@ -1580,7 +1608,7 @@ export declare const gen: {
|
|
|
1580
1608
|
* Provides a way to write effectful code using generator functions, simplifying
|
|
1581
1609
|
* control flow and error handling.
|
|
1582
1610
|
*
|
|
1583
|
-
* **When to
|
|
1611
|
+
* **When to use**
|
|
1584
1612
|
*
|
|
1585
1613
|
* `gen` allows you to write code that looks and behaves like synchronous
|
|
1586
1614
|
* code, but it can handle asynchronous tasks, errors, and complex control flow
|
|
@@ -1636,7 +1664,7 @@ export declare const gen: {
|
|
|
1636
1664
|
* Provides a way to write effectful code using generator functions, simplifying
|
|
1637
1665
|
* control flow and error handling.
|
|
1638
1666
|
*
|
|
1639
|
-
* **When to
|
|
1667
|
+
* **When to use**
|
|
1640
1668
|
*
|
|
1641
1669
|
* `gen` allows you to write code that looks and behaves like synchronous
|
|
1642
1670
|
* code, but it can handle asynchronous tasks, errors, and complex control flow
|
|
@@ -1708,14 +1736,12 @@ export declare namespace gen {
|
|
|
1708
1736
|
/**
|
|
1709
1737
|
* Creates an `Effect` that represents a recoverable error.
|
|
1710
1738
|
*
|
|
1711
|
-
* **When to
|
|
1739
|
+
* **When to use**
|
|
1712
1740
|
*
|
|
1713
1741
|
* Use this function to explicitly signal an error in an `Effect`. The error
|
|
1714
1742
|
* will keep propagating unless it is handled. You can handle the error with
|
|
1715
1743
|
* functions like {@link catchTag} or {@link catchTags}.
|
|
1716
1744
|
*
|
|
1717
|
-
* @see {@link succeed} to create an effect that represents a successful value.
|
|
1718
|
-
*
|
|
1719
1745
|
* **Example** (Creating a failed effect)
|
|
1720
1746
|
*
|
|
1721
1747
|
* ```ts
|
|
@@ -1730,6 +1756,7 @@ export declare namespace gen {
|
|
|
1730
1756
|
* )
|
|
1731
1757
|
* ```
|
|
1732
1758
|
*
|
|
1759
|
+
* @see {@link succeed} to create an effect that represents a successful value.
|
|
1733
1760
|
* @category Creating Effects
|
|
1734
1761
|
* @since 2.0.0
|
|
1735
1762
|
*/
|
|
@@ -1737,6 +1764,8 @@ export declare const fail: <E>(error: E) => Effect<never, E>;
|
|
|
1737
1764
|
/**
|
|
1738
1765
|
* Creates an `Effect` that represents a recoverable error using a lazy evaluation.
|
|
1739
1766
|
*
|
|
1767
|
+
* **Details**
|
|
1768
|
+
*
|
|
1740
1769
|
* This function is useful when you need to create an error effect but want to
|
|
1741
1770
|
* defer the computation of the error value until the effect is actually run.
|
|
1742
1771
|
*
|
|
@@ -1760,6 +1789,8 @@ export declare const failSync: <E>(evaluate: LazyArg<E>) => Effect<never, E>;
|
|
|
1760
1789
|
/**
|
|
1761
1790
|
* Creates an `Effect` that represents a failure with a specific `Cause`.
|
|
1762
1791
|
*
|
|
1792
|
+
* **Details**
|
|
1793
|
+
*
|
|
1763
1794
|
* This function allows you to create effects that fail with complex error
|
|
1764
1795
|
* structures, including multiple errors, defects, interruptions, and more.
|
|
1765
1796
|
*
|
|
@@ -1783,6 +1814,8 @@ export declare const failCause: <E>(cause: Cause.Cause<E>) => Effect<never, E>;
|
|
|
1783
1814
|
/**
|
|
1784
1815
|
* Creates an `Effect` that represents a failure with a `Cause` computed lazily.
|
|
1785
1816
|
*
|
|
1817
|
+
* **Details**
|
|
1818
|
+
*
|
|
1786
1819
|
* This function is useful when you need to create a failure effect with a
|
|
1787
1820
|
* complex cause but want to defer the computation until the effect is run.
|
|
1788
1821
|
*
|
|
@@ -1806,7 +1839,7 @@ export declare const failCauseSync: <E>(evaluate: LazyArg<Cause.Cause<E>>) => Ef
|
|
|
1806
1839
|
/**
|
|
1807
1840
|
* Creates an effect that terminates a fiber with a specified error.
|
|
1808
1841
|
*
|
|
1809
|
-
* **When to
|
|
1842
|
+
* **When to use**
|
|
1810
1843
|
*
|
|
1811
1844
|
* Use `die` when encountering unexpected conditions in your code that should
|
|
1812
1845
|
* not be handled as regular errors but instead represent unrecoverable defects.
|
|
@@ -1820,8 +1853,6 @@ export declare const failCauseSync: <E>(evaluate: LazyArg<Cause.Cause<E>>) => Ef
|
|
|
1820
1853
|
* The error channel of the resulting effect is of type `never`, indicating that
|
|
1821
1854
|
* it cannot recover from this failure.
|
|
1822
1855
|
*
|
|
1823
|
-
* @see {@link die} for a variant that dies with an already computed defect.
|
|
1824
|
-
*
|
|
1825
1856
|
* **Example** (Failing when division by zero)
|
|
1826
1857
|
*
|
|
1827
1858
|
* ```ts
|
|
@@ -1842,6 +1873,7 @@ export declare const failCauseSync: <E>(evaluate: LazyArg<Cause.Cause<E>>) => Ef
|
|
|
1842
1873
|
* // ...stack trace...
|
|
1843
1874
|
* ```
|
|
1844
1875
|
*
|
|
1876
|
+
* @see {@link die} for a variant that dies with an already computed defect.
|
|
1845
1877
|
* @category Creating Effects
|
|
1846
1878
|
* @since 2.0.0
|
|
1847
1879
|
*/
|
|
@@ -1855,14 +1887,16 @@ export {
|
|
|
1855
1887
|
* Creates an `Effect` that represents a synchronous computation that might
|
|
1856
1888
|
* fail.
|
|
1857
1889
|
*
|
|
1858
|
-
* **When to
|
|
1890
|
+
* **When to use**
|
|
1859
1891
|
*
|
|
1860
1892
|
* In situations where you need to perform synchronous operations that might
|
|
1861
1893
|
* fail, such as parsing JSON, you can use the `try` constructor. This
|
|
1862
1894
|
* constructor is designed to handle operations that could throw exceptions by
|
|
1863
1895
|
* capturing those exceptions and transforming them into manageable errors.
|
|
1864
1896
|
*
|
|
1865
|
-
* **
|
|
1897
|
+
* **Details**
|
|
1898
|
+
*
|
|
1899
|
+
* Error Handling:
|
|
1866
1900
|
*
|
|
1867
1901
|
* There are two ways to handle errors with `try`:
|
|
1868
1902
|
*
|
|
@@ -1871,9 +1905,6 @@ export {
|
|
|
1871
1905
|
* 2. If you provide a `catch` function, the error is caught and the `catch`
|
|
1872
1906
|
* function maps it to an error of type `E`.
|
|
1873
1907
|
*
|
|
1874
|
-
* @see {@link sync} if the effectful computation is synchronous and does not
|
|
1875
|
-
* throw errors.
|
|
1876
|
-
*
|
|
1877
1908
|
* **Example** (Parsing JSON with typed error mapping)
|
|
1878
1909
|
*
|
|
1879
1910
|
* ```ts
|
|
@@ -1911,6 +1942,8 @@ export {
|
|
|
1911
1942
|
* // Output: Exit.failure with custom Error message
|
|
1912
1943
|
* ```
|
|
1913
1944
|
*
|
|
1945
|
+
* @see {@link sync} if the effectful computation is synchronous and does not
|
|
1946
|
+
* throw errors.
|
|
1914
1947
|
* @category Creating Effects
|
|
1915
1948
|
* @since 2.0.0
|
|
1916
1949
|
*/
|
|
@@ -2003,6 +2036,8 @@ export declare const fromResult: <A, E>(result: Result.Result<A, E>) => Effect<A
|
|
|
2003
2036
|
/**
|
|
2004
2037
|
* Converts an `Option` into an `Effect`.
|
|
2005
2038
|
*
|
|
2039
|
+
* **Details**
|
|
2040
|
+
*
|
|
2006
2041
|
* `Option.some` becomes a successful effect with the contained value, while
|
|
2007
2042
|
* `Option.none` becomes a failed effect with `NoSuchElementError`.
|
|
2008
2043
|
*
|
|
@@ -2056,15 +2091,11 @@ export declare const fromNullishOr: <A>(value: A) => Effect<NonNullable<A>, Caus
|
|
|
2056
2091
|
* Chains effects to produce new `Effect` instances, useful for combining
|
|
2057
2092
|
* operations that depend on previous results.
|
|
2058
2093
|
*
|
|
2059
|
-
* **
|
|
2094
|
+
* **When to use**
|
|
2060
2095
|
*
|
|
2061
|
-
*
|
|
2062
|
-
*
|
|
2063
|
-
*
|
|
2064
|
-
* const flatMappedEffect = Effect.flatMap(myEffect, transformation)
|
|
2065
|
-
* // or
|
|
2066
|
-
* const flatMappedEffect = myEffect.pipe(Effect.flatMap(transformation))
|
|
2067
|
-
* ```
|
|
2096
|
+
* Use `flatMap` when you need to chain multiple effects, ensuring that each
|
|
2097
|
+
* step produces a new `Effect` while flattening any nested effects that may
|
|
2098
|
+
* occur.
|
|
2068
2099
|
*
|
|
2069
2100
|
* **Details**
|
|
2070
2101
|
*
|
|
@@ -2076,11 +2107,18 @@ export declare const fromNullishOr: <A>(value: A) => Effect<NonNullable<A>, Caus
|
|
|
2076
2107
|
* Since effects are immutable, `flatMap` always returns a new effect instead of
|
|
2077
2108
|
* changing the original one.
|
|
2078
2109
|
*
|
|
2079
|
-
* **
|
|
2110
|
+
* **Example** (Syntax)
|
|
2080
2111
|
*
|
|
2081
|
-
*
|
|
2082
|
-
*
|
|
2083
|
-
*
|
|
2112
|
+
* ```ts
|
|
2113
|
+
* import { Effect, pipe } from "effect"
|
|
2114
|
+
*
|
|
2115
|
+
* const myEffect = Effect.succeed(1)
|
|
2116
|
+
* const transformation = (n: number) => Effect.succeed(n + 1)
|
|
2117
|
+
*
|
|
2118
|
+
* const flatMappedWithPipe = pipe(myEffect, Effect.flatMap(transformation))
|
|
2119
|
+
* const flatMappedWithDataFirst = Effect.flatMap(myEffect, transformation)
|
|
2120
|
+
* const flatMappedWithMethod = myEffect.pipe(Effect.flatMap(transformation))
|
|
2121
|
+
* ```
|
|
2084
2122
|
*
|
|
2085
2123
|
* **Example** (Sequencing dependent effects)
|
|
2086
2124
|
*
|
|
@@ -2112,7 +2150,6 @@ export declare const fromNullishOr: <A>(value: A) => Effect<NonNullable<A>, Caus
|
|
|
2112
2150
|
* ```
|
|
2113
2151
|
*
|
|
2114
2152
|
* @see {@link tap} for a version that ignores the result of the effect.
|
|
2115
|
-
*
|
|
2116
2153
|
* @category sequencing
|
|
2117
2154
|
* @since 2.0.0
|
|
2118
2155
|
*/
|
|
@@ -2121,15 +2158,11 @@ export declare const flatMap: {
|
|
|
2121
2158
|
* Chains effects to produce new `Effect` instances, useful for combining
|
|
2122
2159
|
* operations that depend on previous results.
|
|
2123
2160
|
*
|
|
2124
|
-
* **
|
|
2161
|
+
* **When to use**
|
|
2125
2162
|
*
|
|
2126
|
-
*
|
|
2127
|
-
*
|
|
2128
|
-
*
|
|
2129
|
-
* const flatMappedEffect = Effect.flatMap(myEffect, transformation)
|
|
2130
|
-
* // or
|
|
2131
|
-
* const flatMappedEffect = myEffect.pipe(Effect.flatMap(transformation))
|
|
2132
|
-
* ```
|
|
2163
|
+
* Use `flatMap` when you need to chain multiple effects, ensuring that each
|
|
2164
|
+
* step produces a new `Effect` while flattening any nested effects that may
|
|
2165
|
+
* occur.
|
|
2133
2166
|
*
|
|
2134
2167
|
* **Details**
|
|
2135
2168
|
*
|
|
@@ -2141,11 +2174,18 @@ export declare const flatMap: {
|
|
|
2141
2174
|
* Since effects are immutable, `flatMap` always returns a new effect instead of
|
|
2142
2175
|
* changing the original one.
|
|
2143
2176
|
*
|
|
2144
|
-
* **
|
|
2177
|
+
* **Example** (Syntax)
|
|
2145
2178
|
*
|
|
2146
|
-
*
|
|
2147
|
-
*
|
|
2148
|
-
*
|
|
2179
|
+
* ```ts
|
|
2180
|
+
* import { Effect, pipe } from "effect"
|
|
2181
|
+
*
|
|
2182
|
+
* const myEffect = Effect.succeed(1)
|
|
2183
|
+
* const transformation = (n: number) => Effect.succeed(n + 1)
|
|
2184
|
+
*
|
|
2185
|
+
* const flatMappedWithPipe = pipe(myEffect, Effect.flatMap(transformation))
|
|
2186
|
+
* const flatMappedWithDataFirst = Effect.flatMap(myEffect, transformation)
|
|
2187
|
+
* const flatMappedWithMethod = myEffect.pipe(Effect.flatMap(transformation))
|
|
2188
|
+
* ```
|
|
2149
2189
|
*
|
|
2150
2190
|
* **Example** (Sequencing dependent effects)
|
|
2151
2191
|
*
|
|
@@ -2177,7 +2217,6 @@ export declare const flatMap: {
|
|
|
2177
2217
|
* ```
|
|
2178
2218
|
*
|
|
2179
2219
|
* @see {@link tap} for a version that ignores the result of the effect.
|
|
2180
|
-
*
|
|
2181
2220
|
* @category sequencing
|
|
2182
2221
|
* @since 2.0.0
|
|
2183
2222
|
*/
|
|
@@ -2186,15 +2225,11 @@ export declare const flatMap: {
|
|
|
2186
2225
|
* Chains effects to produce new `Effect` instances, useful for combining
|
|
2187
2226
|
* operations that depend on previous results.
|
|
2188
2227
|
*
|
|
2189
|
-
* **
|
|
2228
|
+
* **When to use**
|
|
2190
2229
|
*
|
|
2191
|
-
*
|
|
2192
|
-
*
|
|
2193
|
-
*
|
|
2194
|
-
* const flatMappedEffect = Effect.flatMap(myEffect, transformation)
|
|
2195
|
-
* // or
|
|
2196
|
-
* const flatMappedEffect = myEffect.pipe(Effect.flatMap(transformation))
|
|
2197
|
-
* ```
|
|
2230
|
+
* Use `flatMap` when you need to chain multiple effects, ensuring that each
|
|
2231
|
+
* step produces a new `Effect` while flattening any nested effects that may
|
|
2232
|
+
* occur.
|
|
2198
2233
|
*
|
|
2199
2234
|
* **Details**
|
|
2200
2235
|
*
|
|
@@ -2206,11 +2241,18 @@ export declare const flatMap: {
|
|
|
2206
2241
|
* Since effects are immutable, `flatMap` always returns a new effect instead of
|
|
2207
2242
|
* changing the original one.
|
|
2208
2243
|
*
|
|
2209
|
-
* **
|
|
2244
|
+
* **Example** (Syntax)
|
|
2210
2245
|
*
|
|
2211
|
-
*
|
|
2212
|
-
*
|
|
2213
|
-
*
|
|
2246
|
+
* ```ts
|
|
2247
|
+
* import { Effect, pipe } from "effect"
|
|
2248
|
+
*
|
|
2249
|
+
* const myEffect = Effect.succeed(1)
|
|
2250
|
+
* const transformation = (n: number) => Effect.succeed(n + 1)
|
|
2251
|
+
*
|
|
2252
|
+
* const flatMappedWithPipe = pipe(myEffect, Effect.flatMap(transformation))
|
|
2253
|
+
* const flatMappedWithDataFirst = Effect.flatMap(myEffect, transformation)
|
|
2254
|
+
* const flatMappedWithMethod = myEffect.pipe(Effect.flatMap(transformation))
|
|
2255
|
+
* ```
|
|
2214
2256
|
*
|
|
2215
2257
|
* **Example** (Sequencing dependent effects)
|
|
2216
2258
|
*
|
|
@@ -2242,7 +2284,6 @@ export declare const flatMap: {
|
|
|
2242
2284
|
* ```
|
|
2243
2285
|
*
|
|
2244
2286
|
* @see {@link tap} for a version that ignores the result of the effect.
|
|
2245
|
-
*
|
|
2246
2287
|
* @category sequencing
|
|
2247
2288
|
* @since 2.0.0
|
|
2248
2289
|
*/
|
|
@@ -2273,17 +2314,7 @@ export declare const flatten: <A, E, R, E2, R2>(self: Effect<Effect<A, E, R>, E2
|
|
|
2273
2314
|
* Runs this effect and then runs another effect, optionally using the first
|
|
2274
2315
|
* effect's success value to choose the next effect.
|
|
2275
2316
|
*
|
|
2276
|
-
* **
|
|
2277
|
-
*
|
|
2278
|
-
* ```ts skip-type-checking
|
|
2279
|
-
* const transformedEffect = pipe(myEffect, Effect.andThen(anotherEffect))
|
|
2280
|
-
* // or
|
|
2281
|
-
* const transformedEffect = Effect.andThen(myEffect, anotherEffect)
|
|
2282
|
-
* // or
|
|
2283
|
-
* const transformedEffect = myEffect.pipe(Effect.andThen(anotherEffect))
|
|
2284
|
-
* ```
|
|
2285
|
-
*
|
|
2286
|
-
* **When to Use**
|
|
2317
|
+
* **When to use**
|
|
2287
2318
|
*
|
|
2288
2319
|
* Use `andThen` when one effect must run after another and the second effect
|
|
2289
2320
|
* may depend on the first effect's success value.
|
|
@@ -2298,6 +2329,19 @@ export declare const flatten: <A, E, R, E2, R2>(self: Effect<Effect<A, E, R>, E2
|
|
|
2298
2329
|
* Failures or requirements from either effect are preserved in the returned
|
|
2299
2330
|
* effect.
|
|
2300
2331
|
*
|
|
2332
|
+
* **Example** (Syntax)
|
|
2333
|
+
*
|
|
2334
|
+
* ```ts
|
|
2335
|
+
* import { Effect, pipe } from "effect"
|
|
2336
|
+
*
|
|
2337
|
+
* const myEffect = Effect.succeed(1)
|
|
2338
|
+
* const anotherEffect = Effect.succeed("done")
|
|
2339
|
+
*
|
|
2340
|
+
* const transformedWithPipe = pipe(myEffect, Effect.andThen(anotherEffect))
|
|
2341
|
+
* const transformedWithDataFirst = Effect.andThen(myEffect, anotherEffect)
|
|
2342
|
+
* const transformedWithMethod = myEffect.pipe(Effect.andThen(anotherEffect))
|
|
2343
|
+
* ```
|
|
2344
|
+
*
|
|
2301
2345
|
* **Example** (Sequencing a discount calculation after fetching a total)
|
|
2302
2346
|
*
|
|
2303
2347
|
* ```ts
|
|
@@ -2346,17 +2390,7 @@ export declare const andThen: {
|
|
|
2346
2390
|
* Runs this effect and then runs another effect, optionally using the first
|
|
2347
2391
|
* effect's success value to choose the next effect.
|
|
2348
2392
|
*
|
|
2349
|
-
* **
|
|
2350
|
-
*
|
|
2351
|
-
* ```ts skip-type-checking
|
|
2352
|
-
* const transformedEffect = pipe(myEffect, Effect.andThen(anotherEffect))
|
|
2353
|
-
* // or
|
|
2354
|
-
* const transformedEffect = Effect.andThen(myEffect, anotherEffect)
|
|
2355
|
-
* // or
|
|
2356
|
-
* const transformedEffect = myEffect.pipe(Effect.andThen(anotherEffect))
|
|
2357
|
-
* ```
|
|
2358
|
-
*
|
|
2359
|
-
* **When to Use**
|
|
2393
|
+
* **When to use**
|
|
2360
2394
|
*
|
|
2361
2395
|
* Use `andThen` when one effect must run after another and the second effect
|
|
2362
2396
|
* may depend on the first effect's success value.
|
|
@@ -2371,6 +2405,19 @@ export declare const andThen: {
|
|
|
2371
2405
|
* Failures or requirements from either effect are preserved in the returned
|
|
2372
2406
|
* effect.
|
|
2373
2407
|
*
|
|
2408
|
+
* **Example** (Syntax)
|
|
2409
|
+
*
|
|
2410
|
+
* ```ts
|
|
2411
|
+
* import { Effect, pipe } from "effect"
|
|
2412
|
+
*
|
|
2413
|
+
* const myEffect = Effect.succeed(1)
|
|
2414
|
+
* const anotherEffect = Effect.succeed("done")
|
|
2415
|
+
*
|
|
2416
|
+
* const transformedWithPipe = pipe(myEffect, Effect.andThen(anotherEffect))
|
|
2417
|
+
* const transformedWithDataFirst = Effect.andThen(myEffect, anotherEffect)
|
|
2418
|
+
* const transformedWithMethod = myEffect.pipe(Effect.andThen(anotherEffect))
|
|
2419
|
+
* ```
|
|
2420
|
+
*
|
|
2374
2421
|
* **Example** (Sequencing a discount calculation after fetching a total)
|
|
2375
2422
|
*
|
|
2376
2423
|
* ```ts
|
|
@@ -2419,17 +2466,7 @@ export declare const andThen: {
|
|
|
2419
2466
|
* Runs this effect and then runs another effect, optionally using the first
|
|
2420
2467
|
* effect's success value to choose the next effect.
|
|
2421
2468
|
*
|
|
2422
|
-
* **
|
|
2423
|
-
*
|
|
2424
|
-
* ```ts skip-type-checking
|
|
2425
|
-
* const transformedEffect = pipe(myEffect, Effect.andThen(anotherEffect))
|
|
2426
|
-
* // or
|
|
2427
|
-
* const transformedEffect = Effect.andThen(myEffect, anotherEffect)
|
|
2428
|
-
* // or
|
|
2429
|
-
* const transformedEffect = myEffect.pipe(Effect.andThen(anotherEffect))
|
|
2430
|
-
* ```
|
|
2431
|
-
*
|
|
2432
|
-
* **When to Use**
|
|
2469
|
+
* **When to use**
|
|
2433
2470
|
*
|
|
2434
2471
|
* Use `andThen` when one effect must run after another and the second effect
|
|
2435
2472
|
* may depend on the first effect's success value.
|
|
@@ -2444,6 +2481,19 @@ export declare const andThen: {
|
|
|
2444
2481
|
* Failures or requirements from either effect are preserved in the returned
|
|
2445
2482
|
* effect.
|
|
2446
2483
|
*
|
|
2484
|
+
* **Example** (Syntax)
|
|
2485
|
+
*
|
|
2486
|
+
* ```ts
|
|
2487
|
+
* import { Effect, pipe } from "effect"
|
|
2488
|
+
*
|
|
2489
|
+
* const myEffect = Effect.succeed(1)
|
|
2490
|
+
* const anotherEffect = Effect.succeed("done")
|
|
2491
|
+
*
|
|
2492
|
+
* const transformedWithPipe = pipe(myEffect, Effect.andThen(anotherEffect))
|
|
2493
|
+
* const transformedWithDataFirst = Effect.andThen(myEffect, anotherEffect)
|
|
2494
|
+
* const transformedWithMethod = myEffect.pipe(Effect.andThen(anotherEffect))
|
|
2495
|
+
* ```
|
|
2496
|
+
*
|
|
2447
2497
|
* **Example** (Sequencing a discount calculation after fetching a total)
|
|
2448
2498
|
*
|
|
2449
2499
|
* ```ts
|
|
@@ -2492,17 +2542,7 @@ export declare const andThen: {
|
|
|
2492
2542
|
* Runs this effect and then runs another effect, optionally using the first
|
|
2493
2543
|
* effect's success value to choose the next effect.
|
|
2494
2544
|
*
|
|
2495
|
-
* **
|
|
2496
|
-
*
|
|
2497
|
-
* ```ts skip-type-checking
|
|
2498
|
-
* const transformedEffect = pipe(myEffect, Effect.andThen(anotherEffect))
|
|
2499
|
-
* // or
|
|
2500
|
-
* const transformedEffect = Effect.andThen(myEffect, anotherEffect)
|
|
2501
|
-
* // or
|
|
2502
|
-
* const transformedEffect = myEffect.pipe(Effect.andThen(anotherEffect))
|
|
2503
|
-
* ```
|
|
2504
|
-
*
|
|
2505
|
-
* **When to Use**
|
|
2545
|
+
* **When to use**
|
|
2506
2546
|
*
|
|
2507
2547
|
* Use `andThen` when one effect must run after another and the second effect
|
|
2508
2548
|
* may depend on the first effect's success value.
|
|
@@ -2517,6 +2557,19 @@ export declare const andThen: {
|
|
|
2517
2557
|
* Failures or requirements from either effect are preserved in the returned
|
|
2518
2558
|
* effect.
|
|
2519
2559
|
*
|
|
2560
|
+
* **Example** (Syntax)
|
|
2561
|
+
*
|
|
2562
|
+
* ```ts
|
|
2563
|
+
* import { Effect, pipe } from "effect"
|
|
2564
|
+
*
|
|
2565
|
+
* const myEffect = Effect.succeed(1)
|
|
2566
|
+
* const anotherEffect = Effect.succeed("done")
|
|
2567
|
+
*
|
|
2568
|
+
* const transformedWithPipe = pipe(myEffect, Effect.andThen(anotherEffect))
|
|
2569
|
+
* const transformedWithDataFirst = Effect.andThen(myEffect, anotherEffect)
|
|
2570
|
+
* const transformedWithMethod = myEffect.pipe(Effect.andThen(anotherEffect))
|
|
2571
|
+
* ```
|
|
2572
|
+
*
|
|
2520
2573
|
* **Example** (Sequencing a discount calculation after fetching a total)
|
|
2521
2574
|
*
|
|
2522
2575
|
* ```ts
|
|
@@ -2565,17 +2618,7 @@ export declare const andThen: {
|
|
|
2565
2618
|
* Runs this effect and then runs another effect, optionally using the first
|
|
2566
2619
|
* effect's success value to choose the next effect.
|
|
2567
2620
|
*
|
|
2568
|
-
* **
|
|
2569
|
-
*
|
|
2570
|
-
* ```ts skip-type-checking
|
|
2571
|
-
* const transformedEffect = pipe(myEffect, Effect.andThen(anotherEffect))
|
|
2572
|
-
* // or
|
|
2573
|
-
* const transformedEffect = Effect.andThen(myEffect, anotherEffect)
|
|
2574
|
-
* // or
|
|
2575
|
-
* const transformedEffect = myEffect.pipe(Effect.andThen(anotherEffect))
|
|
2576
|
-
* ```
|
|
2577
|
-
*
|
|
2578
|
-
* **When to Use**
|
|
2621
|
+
* **When to use**
|
|
2579
2622
|
*
|
|
2580
2623
|
* Use `andThen` when one effect must run after another and the second effect
|
|
2581
2624
|
* may depend on the first effect's success value.
|
|
@@ -2590,6 +2633,19 @@ export declare const andThen: {
|
|
|
2590
2633
|
* Failures or requirements from either effect are preserved in the returned
|
|
2591
2634
|
* effect.
|
|
2592
2635
|
*
|
|
2636
|
+
* **Example** (Syntax)
|
|
2637
|
+
*
|
|
2638
|
+
* ```ts
|
|
2639
|
+
* import { Effect, pipe } from "effect"
|
|
2640
|
+
*
|
|
2641
|
+
* const myEffect = Effect.succeed(1)
|
|
2642
|
+
* const anotherEffect = Effect.succeed("done")
|
|
2643
|
+
*
|
|
2644
|
+
* const transformedWithPipe = pipe(myEffect, Effect.andThen(anotherEffect))
|
|
2645
|
+
* const transformedWithDataFirst = Effect.andThen(myEffect, anotherEffect)
|
|
2646
|
+
* const transformedWithMethod = myEffect.pipe(Effect.andThen(anotherEffect))
|
|
2647
|
+
* ```
|
|
2648
|
+
*
|
|
2593
2649
|
* **Example** (Sequencing a discount calculation after fetching a total)
|
|
2594
2650
|
*
|
|
2595
2651
|
* ```ts
|
|
@@ -2639,7 +2695,7 @@ export declare const andThen: {
|
|
|
2639
2695
|
* Runs a side effect with the result of an effect without changing the original
|
|
2640
2696
|
* value.
|
|
2641
2697
|
*
|
|
2642
|
-
* **When to
|
|
2698
|
+
* **When to use**
|
|
2643
2699
|
*
|
|
2644
2700
|
* Use `tap` when you want to perform a side effect, like logging or tracking,
|
|
2645
2701
|
* without modifying the main value. This is useful when you need to observe or
|
|
@@ -2693,7 +2749,7 @@ export declare const tap: {
|
|
|
2693
2749
|
* Runs a side effect with the result of an effect without changing the original
|
|
2694
2750
|
* value.
|
|
2695
2751
|
*
|
|
2696
|
-
* **When to
|
|
2752
|
+
* **When to use**
|
|
2697
2753
|
*
|
|
2698
2754
|
* Use `tap` when you want to perform a side effect, like logging or tracking,
|
|
2699
2755
|
* without modifying the main value. This is useful when you need to observe or
|
|
@@ -2747,7 +2803,7 @@ export declare const tap: {
|
|
|
2747
2803
|
* Runs a side effect with the result of an effect without changing the original
|
|
2748
2804
|
* value.
|
|
2749
2805
|
*
|
|
2750
|
-
* **When to
|
|
2806
|
+
* **When to use**
|
|
2751
2807
|
*
|
|
2752
2808
|
* Use `tap` when you want to perform a side effect, like logging or tracking,
|
|
2753
2809
|
* without modifying the main value. This is useful when you need to observe or
|
|
@@ -2801,7 +2857,7 @@ export declare const tap: {
|
|
|
2801
2857
|
* Runs a side effect with the result of an effect without changing the original
|
|
2802
2858
|
* value.
|
|
2803
2859
|
*
|
|
2804
|
-
* **When to
|
|
2860
|
+
* **When to use**
|
|
2805
2861
|
*
|
|
2806
2862
|
* Use `tap` when you want to perform a side effect, like logging or tracking,
|
|
2807
2863
|
* without modifying the main value. This is useful when you need to observe or
|
|
@@ -2855,7 +2911,7 @@ export declare const tap: {
|
|
|
2855
2911
|
* Runs a side effect with the result of an effect without changing the original
|
|
2856
2912
|
* value.
|
|
2857
2913
|
*
|
|
2858
|
-
* **When to
|
|
2914
|
+
* **When to use**
|
|
2859
2915
|
*
|
|
2860
2916
|
* Use `tap` when you want to perform a side effect, like logging or tracking,
|
|
2861
2917
|
* without modifying the main value. This is useful when you need to observe or
|
|
@@ -3028,16 +3084,6 @@ export declare const exit: <A, E, R>(self: Effect<A, E, R>) => Effect<Exit.Exit<
|
|
|
3028
3084
|
/**
|
|
3029
3085
|
* Transforms the value inside an effect by applying a function to it.
|
|
3030
3086
|
*
|
|
3031
|
-
* **Syntax**
|
|
3032
|
-
*
|
|
3033
|
-
* ```ts skip-type-checking
|
|
3034
|
-
* const mappedEffect = pipe(myEffect, Effect.map(transformation))
|
|
3035
|
-
* // or
|
|
3036
|
-
* const mappedEffect = Effect.map(myEffect, transformation)
|
|
3037
|
-
* // or
|
|
3038
|
-
* const mappedEffect = myEffect.pipe(Effect.map(transformation))
|
|
3039
|
-
* ```
|
|
3040
|
-
*
|
|
3041
3087
|
* **Details**
|
|
3042
3088
|
*
|
|
3043
3089
|
* `map` takes a function and applies it to the value contained within an
|
|
@@ -3047,6 +3093,19 @@ export declare const exit: <A, E, R>(self: Effect<A, E, R>) => Effect<Exit.Exit<
|
|
|
3047
3093
|
* effect is not modified. Instead, a new effect is returned with the updated
|
|
3048
3094
|
* value.
|
|
3049
3095
|
*
|
|
3096
|
+
* **Example** (Syntax)
|
|
3097
|
+
*
|
|
3098
|
+
* ```ts
|
|
3099
|
+
* import { Effect, pipe } from "effect"
|
|
3100
|
+
*
|
|
3101
|
+
* const myEffect = Effect.succeed(1)
|
|
3102
|
+
* const transformation = (n: number) => n + 1
|
|
3103
|
+
*
|
|
3104
|
+
* const mappedWithPipe = pipe(myEffect, Effect.map(transformation))
|
|
3105
|
+
* const mappedWithDataFirst = Effect.map(myEffect, transformation)
|
|
3106
|
+
* const mappedWithMethod = myEffect.pipe(Effect.map(transformation))
|
|
3107
|
+
* ```
|
|
3108
|
+
*
|
|
3050
3109
|
* **Example** (Adding a service charge)
|
|
3051
3110
|
*
|
|
3052
3111
|
* ```ts
|
|
@@ -3068,7 +3127,6 @@ export declare const exit: <A, E, R>(self: Effect<A, E, R>) => Effect<Exit.Exit<
|
|
|
3068
3127
|
* @see {@link mapError} for a version that operates on the error channel.
|
|
3069
3128
|
* @see {@link mapBoth} for a version that operates on both channels.
|
|
3070
3129
|
* @see {@link flatMap} or {@link andThen} for a version that can return a new effect.
|
|
3071
|
-
*
|
|
3072
3130
|
* @category mapping
|
|
3073
3131
|
* @since 2.0.0
|
|
3074
3132
|
*/
|
|
@@ -3076,16 +3134,6 @@ export declare const map: {
|
|
|
3076
3134
|
/**
|
|
3077
3135
|
* Transforms the value inside an effect by applying a function to it.
|
|
3078
3136
|
*
|
|
3079
|
-
* **Syntax**
|
|
3080
|
-
*
|
|
3081
|
-
* ```ts skip-type-checking
|
|
3082
|
-
* const mappedEffect = pipe(myEffect, Effect.map(transformation))
|
|
3083
|
-
* // or
|
|
3084
|
-
* const mappedEffect = Effect.map(myEffect, transformation)
|
|
3085
|
-
* // or
|
|
3086
|
-
* const mappedEffect = myEffect.pipe(Effect.map(transformation))
|
|
3087
|
-
* ```
|
|
3088
|
-
*
|
|
3089
3137
|
* **Details**
|
|
3090
3138
|
*
|
|
3091
3139
|
* `map` takes a function and applies it to the value contained within an
|
|
@@ -3095,6 +3143,19 @@ export declare const map: {
|
|
|
3095
3143
|
* effect is not modified. Instead, a new effect is returned with the updated
|
|
3096
3144
|
* value.
|
|
3097
3145
|
*
|
|
3146
|
+
* **Example** (Syntax)
|
|
3147
|
+
*
|
|
3148
|
+
* ```ts
|
|
3149
|
+
* import { Effect, pipe } from "effect"
|
|
3150
|
+
*
|
|
3151
|
+
* const myEffect = Effect.succeed(1)
|
|
3152
|
+
* const transformation = (n: number) => n + 1
|
|
3153
|
+
*
|
|
3154
|
+
* const mappedWithPipe = pipe(myEffect, Effect.map(transformation))
|
|
3155
|
+
* const mappedWithDataFirst = Effect.map(myEffect, transformation)
|
|
3156
|
+
* const mappedWithMethod = myEffect.pipe(Effect.map(transformation))
|
|
3157
|
+
* ```
|
|
3158
|
+
*
|
|
3098
3159
|
* **Example** (Adding a service charge)
|
|
3099
3160
|
*
|
|
3100
3161
|
* ```ts
|
|
@@ -3116,7 +3177,6 @@ export declare const map: {
|
|
|
3116
3177
|
* @see {@link mapError} for a version that operates on the error channel.
|
|
3117
3178
|
* @see {@link mapBoth} for a version that operates on both channels.
|
|
3118
3179
|
* @see {@link flatMap} or {@link andThen} for a version that can return a new effect.
|
|
3119
|
-
*
|
|
3120
3180
|
* @category mapping
|
|
3121
3181
|
* @since 2.0.0
|
|
3122
3182
|
*/
|
|
@@ -3124,16 +3184,6 @@ export declare const map: {
|
|
|
3124
3184
|
/**
|
|
3125
3185
|
* Transforms the value inside an effect by applying a function to it.
|
|
3126
3186
|
*
|
|
3127
|
-
* **Syntax**
|
|
3128
|
-
*
|
|
3129
|
-
* ```ts skip-type-checking
|
|
3130
|
-
* const mappedEffect = pipe(myEffect, Effect.map(transformation))
|
|
3131
|
-
* // or
|
|
3132
|
-
* const mappedEffect = Effect.map(myEffect, transformation)
|
|
3133
|
-
* // or
|
|
3134
|
-
* const mappedEffect = myEffect.pipe(Effect.map(transformation))
|
|
3135
|
-
* ```
|
|
3136
|
-
*
|
|
3137
3187
|
* **Details**
|
|
3138
3188
|
*
|
|
3139
3189
|
* `map` takes a function and applies it to the value contained within an
|
|
@@ -3143,6 +3193,19 @@ export declare const map: {
|
|
|
3143
3193
|
* effect is not modified. Instead, a new effect is returned with the updated
|
|
3144
3194
|
* value.
|
|
3145
3195
|
*
|
|
3196
|
+
* **Example** (Syntax)
|
|
3197
|
+
*
|
|
3198
|
+
* ```ts
|
|
3199
|
+
* import { Effect, pipe } from "effect"
|
|
3200
|
+
*
|
|
3201
|
+
* const myEffect = Effect.succeed(1)
|
|
3202
|
+
* const transformation = (n: number) => n + 1
|
|
3203
|
+
*
|
|
3204
|
+
* const mappedWithPipe = pipe(myEffect, Effect.map(transformation))
|
|
3205
|
+
* const mappedWithDataFirst = Effect.map(myEffect, transformation)
|
|
3206
|
+
* const mappedWithMethod = myEffect.pipe(Effect.map(transformation))
|
|
3207
|
+
* ```
|
|
3208
|
+
*
|
|
3146
3209
|
* **Example** (Adding a service charge)
|
|
3147
3210
|
*
|
|
3148
3211
|
* ```ts
|
|
@@ -3164,7 +3227,6 @@ export declare const map: {
|
|
|
3164
3227
|
* @see {@link mapError} for a version that operates on the error channel.
|
|
3165
3228
|
* @see {@link mapBoth} for a version that operates on both channels.
|
|
3166
3229
|
* @see {@link flatMap} or {@link andThen} for a version that can return a new effect.
|
|
3167
|
-
*
|
|
3168
3230
|
* @category mapping
|
|
3169
3231
|
* @since 2.0.0
|
|
3170
3232
|
*/
|
|
@@ -3173,6 +3235,8 @@ export declare const map: {
|
|
|
3173
3235
|
/**
|
|
3174
3236
|
* Replaces the value inside an effect with a constant value.
|
|
3175
3237
|
*
|
|
3238
|
+
* **Details**
|
|
3239
|
+
*
|
|
3176
3240
|
* `as` allows you to ignore the original value inside an effect and
|
|
3177
3241
|
* replace it with a new constant value.
|
|
3178
3242
|
*
|
|
@@ -3195,6 +3259,8 @@ export declare const as: {
|
|
|
3195
3259
|
/**
|
|
3196
3260
|
* Replaces the value inside an effect with a constant value.
|
|
3197
3261
|
*
|
|
3262
|
+
* **Details**
|
|
3263
|
+
*
|
|
3198
3264
|
* `as` allows you to ignore the original value inside an effect and
|
|
3199
3265
|
* replace it with a new constant value.
|
|
3200
3266
|
*
|
|
@@ -3217,6 +3283,8 @@ export declare const as: {
|
|
|
3217
3283
|
/**
|
|
3218
3284
|
* Replaces the value inside an effect with a constant value.
|
|
3219
3285
|
*
|
|
3286
|
+
* **Details**
|
|
3287
|
+
*
|
|
3220
3288
|
* `as` allows you to ignore the original value inside an effect and
|
|
3221
3289
|
* replace it with a new constant value.
|
|
3222
3290
|
*
|
|
@@ -3282,6 +3350,8 @@ export declare const asVoid: <A, E, R>(self: Effect<A, E, R>) => Effect<void, E,
|
|
|
3282
3350
|
* The `flip` function swaps the success and error channels of an effect,
|
|
3283
3351
|
* so that the success becomes the error, and the error becomes the success.
|
|
3284
3352
|
*
|
|
3353
|
+
* **Details**
|
|
3354
|
+
*
|
|
3285
3355
|
* This function is useful when you need to reverse the flow of an effect,
|
|
3286
3356
|
* treating the previously successful values as errors and vice versa. This can
|
|
3287
3357
|
* be helpful in scenarios where you want to handle a success as a failure or
|
|
@@ -3308,17 +3378,16 @@ export declare const flip: <A, E, R>(self: Effect<A, E, R>) => Effect<E, A, R>;
|
|
|
3308
3378
|
/**
|
|
3309
3379
|
* Combines two effects into a single effect, producing a tuple with the results of both effects.
|
|
3310
3380
|
*
|
|
3381
|
+
* **Details**
|
|
3382
|
+
*
|
|
3311
3383
|
* The `zip` function executes the first effect (left) and then the second effect (right).
|
|
3312
3384
|
* Once both effects succeed, their results are combined into a tuple.
|
|
3313
3385
|
*
|
|
3314
|
-
*
|
|
3386
|
+
* Concurrency:
|
|
3315
3387
|
*
|
|
3316
3388
|
* By default, `zip` processes the effects sequentially. To execute the effects concurrently,
|
|
3317
3389
|
* use the `{ concurrent: true }` option.
|
|
3318
3390
|
*
|
|
3319
|
-
* @see {@link zipWith} for a version that combines the results with a custom function.
|
|
3320
|
-
* @see {@link validate} for a version that accumulates errors.
|
|
3321
|
-
*
|
|
3322
3391
|
* **Example** (Combining two effects sequentially)
|
|
3323
3392
|
*
|
|
3324
3393
|
* ```ts
|
|
@@ -3370,6 +3439,8 @@ export declare const flip: <A, E, R>(self: Effect<A, E, R>) => Effect<E, A, R>;
|
|
|
3370
3439
|
* // [ 1, 'hello' ]
|
|
3371
3440
|
* ```
|
|
3372
3441
|
*
|
|
3442
|
+
* @see {@link zipWith} for a version that combines the results with a custom function.
|
|
3443
|
+
* @see {@link validate} for a version that accumulates errors.
|
|
3373
3444
|
* @category zipping
|
|
3374
3445
|
* @since 2.0.0
|
|
3375
3446
|
*/
|
|
@@ -3377,17 +3448,16 @@ export declare const zip: {
|
|
|
3377
3448
|
/**
|
|
3378
3449
|
* Combines two effects into a single effect, producing a tuple with the results of both effects.
|
|
3379
3450
|
*
|
|
3451
|
+
* **Details**
|
|
3452
|
+
*
|
|
3380
3453
|
* The `zip` function executes the first effect (left) and then the second effect (right).
|
|
3381
3454
|
* Once both effects succeed, their results are combined into a tuple.
|
|
3382
3455
|
*
|
|
3383
|
-
*
|
|
3456
|
+
* Concurrency:
|
|
3384
3457
|
*
|
|
3385
3458
|
* By default, `zip` processes the effects sequentially. To execute the effects concurrently,
|
|
3386
3459
|
* use the `{ concurrent: true }` option.
|
|
3387
3460
|
*
|
|
3388
|
-
* @see {@link zipWith} for a version that combines the results with a custom function.
|
|
3389
|
-
* @see {@link validate} for a version that accumulates errors.
|
|
3390
|
-
*
|
|
3391
3461
|
* **Example** (Combining two effects sequentially)
|
|
3392
3462
|
*
|
|
3393
3463
|
* ```ts
|
|
@@ -3439,6 +3509,8 @@ export declare const zip: {
|
|
|
3439
3509
|
* // [ 1, 'hello' ]
|
|
3440
3510
|
* ```
|
|
3441
3511
|
*
|
|
3512
|
+
* @see {@link zipWith} for a version that combines the results with a custom function.
|
|
3513
|
+
* @see {@link validate} for a version that accumulates errors.
|
|
3442
3514
|
* @category zipping
|
|
3443
3515
|
* @since 2.0.0
|
|
3444
3516
|
*/
|
|
@@ -3448,17 +3520,16 @@ export declare const zip: {
|
|
|
3448
3520
|
/**
|
|
3449
3521
|
* Combines two effects into a single effect, producing a tuple with the results of both effects.
|
|
3450
3522
|
*
|
|
3523
|
+
* **Details**
|
|
3524
|
+
*
|
|
3451
3525
|
* The `zip` function executes the first effect (left) and then the second effect (right).
|
|
3452
3526
|
* Once both effects succeed, their results are combined into a tuple.
|
|
3453
3527
|
*
|
|
3454
|
-
*
|
|
3528
|
+
* Concurrency:
|
|
3455
3529
|
*
|
|
3456
3530
|
* By default, `zip` processes the effects sequentially. To execute the effects concurrently,
|
|
3457
3531
|
* use the `{ concurrent: true }` option.
|
|
3458
3532
|
*
|
|
3459
|
-
* @see {@link zipWith} for a version that combines the results with a custom function.
|
|
3460
|
-
* @see {@link validate} for a version that accumulates errors.
|
|
3461
|
-
*
|
|
3462
3533
|
* **Example** (Combining two effects sequentially)
|
|
3463
3534
|
*
|
|
3464
3535
|
* ```ts
|
|
@@ -3510,6 +3581,8 @@ export declare const zip: {
|
|
|
3510
3581
|
* // [ 1, 'hello' ]
|
|
3511
3582
|
* ```
|
|
3512
3583
|
*
|
|
3584
|
+
* @see {@link zipWith} for a version that combines the results with a custom function.
|
|
3585
|
+
* @see {@link validate} for a version that accumulates errors.
|
|
3513
3586
|
* @category zipping
|
|
3514
3587
|
* @since 2.0.0
|
|
3515
3588
|
*/
|
|
@@ -3521,13 +3594,15 @@ export declare const zip: {
|
|
|
3521
3594
|
* Combines two effects sequentially and applies a function to their results to
|
|
3522
3595
|
* produce a single value.
|
|
3523
3596
|
*
|
|
3524
|
-
* **When to
|
|
3597
|
+
* **When to use**
|
|
3525
3598
|
*
|
|
3526
3599
|
* The `zipWith` function is similar to {@link zip}, but instead of returning a
|
|
3527
3600
|
* tuple of results, it applies a provided function to the results of the two
|
|
3528
3601
|
* effects, combining them into a single value.
|
|
3529
3602
|
*
|
|
3530
|
-
* **
|
|
3603
|
+
* **Details**
|
|
3604
|
+
*
|
|
3605
|
+
* Concurrency:
|
|
3531
3606
|
*
|
|
3532
3607
|
* By default, the effects are run sequentially. To execute them concurrently,
|
|
3533
3608
|
* use the `{ concurrent: true }` option.
|
|
@@ -3568,13 +3643,15 @@ export declare const zipWith: {
|
|
|
3568
3643
|
* Combines two effects sequentially and applies a function to their results to
|
|
3569
3644
|
* produce a single value.
|
|
3570
3645
|
*
|
|
3571
|
-
* **When to
|
|
3646
|
+
* **When to use**
|
|
3572
3647
|
*
|
|
3573
3648
|
* The `zipWith` function is similar to {@link zip}, but instead of returning a
|
|
3574
3649
|
* tuple of results, it applies a provided function to the results of the two
|
|
3575
3650
|
* effects, combining them into a single value.
|
|
3576
3651
|
*
|
|
3577
|
-
* **
|
|
3652
|
+
* **Details**
|
|
3653
|
+
*
|
|
3654
|
+
* Concurrency:
|
|
3578
3655
|
*
|
|
3579
3656
|
* By default, the effects are run sequentially. To execute them concurrently,
|
|
3580
3657
|
* use the `{ concurrent: true }` option.
|
|
@@ -3617,13 +3694,15 @@ export declare const zipWith: {
|
|
|
3617
3694
|
* Combines two effects sequentially and applies a function to their results to
|
|
3618
3695
|
* produce a single value.
|
|
3619
3696
|
*
|
|
3620
|
-
* **When to
|
|
3697
|
+
* **When to use**
|
|
3621
3698
|
*
|
|
3622
3699
|
* The `zipWith` function is similar to {@link zip}, but instead of returning a
|
|
3623
3700
|
* tuple of results, it applies a provided function to the results of the two
|
|
3624
3701
|
* effects, combining them into a single value.
|
|
3625
3702
|
*
|
|
3626
|
-
* **
|
|
3703
|
+
* **Details**
|
|
3704
|
+
*
|
|
3705
|
+
* Concurrency:
|
|
3627
3706
|
*
|
|
3628
3707
|
* By default, the effects are run sequentially. To execute them concurrently,
|
|
3629
3708
|
* use the `{ concurrent: true }` option.
|
|
@@ -3691,7 +3770,7 @@ catch_ as catch };
|
|
|
3691
3770
|
* Catches and handles specific errors by their `_tag` field, which is used as a
|
|
3692
3771
|
* discriminator.
|
|
3693
3772
|
*
|
|
3694
|
-
* **When to
|
|
3773
|
+
* **When to use**
|
|
3695
3774
|
*
|
|
3696
3775
|
* `catchTag` is useful when your errors are tagged with a readonly `_tag` field
|
|
3697
3776
|
* that identifies the error type. You can use this function to handle specific
|
|
@@ -3733,7 +3812,7 @@ export declare const catchTag: {
|
|
|
3733
3812
|
* Catches and handles specific errors by their `_tag` field, which is used as a
|
|
3734
3813
|
* discriminator.
|
|
3735
3814
|
*
|
|
3736
|
-
* **When to
|
|
3815
|
+
* **When to use**
|
|
3737
3816
|
*
|
|
3738
3817
|
* `catchTag` is useful when your errors are tagged with a readonly `_tag` field
|
|
3739
3818
|
* that identifies the error type. You can use this function to handle specific
|
|
@@ -3775,7 +3854,7 @@ export declare const catchTag: {
|
|
|
3775
3854
|
* Catches and handles specific errors by their `_tag` field, which is used as a
|
|
3776
3855
|
* discriminator.
|
|
3777
3856
|
*
|
|
3778
|
-
* **When to
|
|
3857
|
+
* **When to use**
|
|
3779
3858
|
*
|
|
3780
3859
|
* `catchTag` is useful when your errors are tagged with a readonly `_tag` field
|
|
3781
3860
|
* that identifies the error type. You can use this function to handle specific
|
|
@@ -3817,7 +3896,7 @@ export declare const catchTag: {
|
|
|
3817
3896
|
/**
|
|
3818
3897
|
* Handles multiple errors in a single block of code using their `_tag` field.
|
|
3819
3898
|
*
|
|
3820
|
-
* **When to
|
|
3899
|
+
* **When to use**
|
|
3821
3900
|
*
|
|
3822
3901
|
* `catchTags` is a convenient way to handle multiple error types at
|
|
3823
3902
|
* once. Instead of using {@link catchTag} multiple times, you can pass an
|
|
@@ -3861,7 +3940,7 @@ export declare const catchTags: {
|
|
|
3861
3940
|
/**
|
|
3862
3941
|
* Handles multiple errors in a single block of code using their `_tag` field.
|
|
3863
3942
|
*
|
|
3864
|
-
* **When to
|
|
3943
|
+
* **When to use**
|
|
3865
3944
|
*
|
|
3866
3945
|
* `catchTags` is a convenient way to handle multiple error types at
|
|
3867
3946
|
* once. Instead of using {@link catchTag} multiple times, you can pass an
|
|
@@ -3925,7 +4004,7 @@ export declare const catchTags: {
|
|
|
3925
4004
|
/**
|
|
3926
4005
|
* Handles multiple errors in a single block of code using their `_tag` field.
|
|
3927
4006
|
*
|
|
3928
|
-
* **When to
|
|
4007
|
+
* **When to use**
|
|
3929
4008
|
*
|
|
3930
4009
|
* `catchTags` is a convenient way to handle multiple error types at
|
|
3931
4010
|
* once. Instead of using {@link catchTag} multiple times, you can pass an
|
|
@@ -3990,6 +4069,8 @@ export declare const catchTags: {
|
|
|
3990
4069
|
/**
|
|
3991
4070
|
* Catches a specific reason within a tagged error.
|
|
3992
4071
|
*
|
|
4072
|
+
* **Details**
|
|
4073
|
+
*
|
|
3993
4074
|
* Use this to handle nested error causes without removing the parent error
|
|
3994
4075
|
* from the error channel. The handler receives the unwrapped reason.
|
|
3995
4076
|
*
|
|
@@ -4027,6 +4108,8 @@ export declare const catchReason: {
|
|
|
4027
4108
|
/**
|
|
4028
4109
|
* Catches a specific reason within a tagged error.
|
|
4029
4110
|
*
|
|
4111
|
+
* **Details**
|
|
4112
|
+
*
|
|
4030
4113
|
* Use this to handle nested error causes without removing the parent error
|
|
4031
4114
|
* from the error channel. The handler receives the unwrapped reason.
|
|
4032
4115
|
*
|
|
@@ -4064,6 +4147,8 @@ export declare const catchReason: {
|
|
|
4064
4147
|
/**
|
|
4065
4148
|
* Catches a specific reason within a tagged error.
|
|
4066
4149
|
*
|
|
4150
|
+
* **Details**
|
|
4151
|
+
*
|
|
4067
4152
|
* Use this to handle nested error causes without removing the parent error
|
|
4068
4153
|
* from the error channel. The handler receives the unwrapped reason.
|
|
4069
4154
|
*
|
|
@@ -4227,6 +4312,8 @@ export declare const catchReasons: {
|
|
|
4227
4312
|
/**
|
|
4228
4313
|
* Type helper that keeps only error tags whose tagged error contains a tagged `reason` field.
|
|
4229
4314
|
*
|
|
4315
|
+
* **Details**
|
|
4316
|
+
*
|
|
4230
4317
|
* Used by `catchReasons` and `unwrapReason` to constrain the parent error tag to reason-bearing errors.
|
|
4231
4318
|
*
|
|
4232
4319
|
* @category error handling
|
|
@@ -4336,14 +4423,16 @@ export declare const unwrapReason: {
|
|
|
4336
4423
|
* Handles both recoverable and unrecoverable errors by providing a recovery
|
|
4337
4424
|
* effect.
|
|
4338
4425
|
*
|
|
4339
|
-
* **When to
|
|
4426
|
+
* **When to use**
|
|
4340
4427
|
*
|
|
4341
4428
|
* The `catchCause` function allows you to handle all errors, including
|
|
4342
4429
|
* unrecoverable defects, by providing a recovery effect. The recovery logic is
|
|
4343
4430
|
* based on the `Cause` of the error, which provides detailed information about
|
|
4344
4431
|
* the failure.
|
|
4345
4432
|
*
|
|
4346
|
-
* **
|
|
4433
|
+
* **Details**
|
|
4434
|
+
*
|
|
4435
|
+
* When to Recover from Defects:
|
|
4347
4436
|
*
|
|
4348
4437
|
* Defects are unexpected errors that typically shouldn't be recovered from, as
|
|
4349
4438
|
* they often indicate serious issues. However, in some cases, such as
|
|
@@ -4376,14 +4465,16 @@ export declare const catchCause: {
|
|
|
4376
4465
|
* Handles both recoverable and unrecoverable errors by providing a recovery
|
|
4377
4466
|
* effect.
|
|
4378
4467
|
*
|
|
4379
|
-
* **When to
|
|
4468
|
+
* **When to use**
|
|
4380
4469
|
*
|
|
4381
4470
|
* The `catchCause` function allows you to handle all errors, including
|
|
4382
4471
|
* unrecoverable defects, by providing a recovery effect. The recovery logic is
|
|
4383
4472
|
* based on the `Cause` of the error, which provides detailed information about
|
|
4384
4473
|
* the failure.
|
|
4385
4474
|
*
|
|
4386
|
-
* **
|
|
4475
|
+
* **Details**
|
|
4476
|
+
*
|
|
4477
|
+
* When to Recover from Defects:
|
|
4387
4478
|
*
|
|
4388
4479
|
* Defects are unexpected errors that typically shouldn't be recovered from, as
|
|
4389
4480
|
* they often indicate serious issues. However, in some cases, such as
|
|
@@ -4416,14 +4507,16 @@ export declare const catchCause: {
|
|
|
4416
4507
|
* Handles both recoverable and unrecoverable errors by providing a recovery
|
|
4417
4508
|
* effect.
|
|
4418
4509
|
*
|
|
4419
|
-
* **When to
|
|
4510
|
+
* **When to use**
|
|
4420
4511
|
*
|
|
4421
4512
|
* The `catchCause` function allows you to handle all errors, including
|
|
4422
4513
|
* unrecoverable defects, by providing a recovery effect. The recovery logic is
|
|
4423
4514
|
* based on the `Cause` of the error, which provides detailed information about
|
|
4424
4515
|
* the failure.
|
|
4425
4516
|
*
|
|
4426
|
-
* **
|
|
4517
|
+
* **Details**
|
|
4518
|
+
*
|
|
4519
|
+
* When to Recover from Defects:
|
|
4427
4520
|
*
|
|
4428
4521
|
* Defects are unexpected errors that typically shouldn't be recovered from, as
|
|
4429
4522
|
* they often indicate serious issues. However, in some cases, such as
|
|
@@ -4456,7 +4549,7 @@ export declare const catchCause: {
|
|
|
4456
4549
|
/**
|
|
4457
4550
|
* Recovers from defects using a provided recovery function.
|
|
4458
4551
|
*
|
|
4459
|
-
* **When to
|
|
4552
|
+
* **When to use**
|
|
4460
4553
|
*
|
|
4461
4554
|
* Use this sparingly, usually at integration boundaries where defects must be
|
|
4462
4555
|
* reported or translated for an external system.
|
|
@@ -4466,7 +4559,7 @@ export declare const catchCause: {
|
|
|
4466
4559
|
* `catchDefect` handles unexpected defects, such as thrown exceptions or
|
|
4467
4560
|
* values passed to `die`, without catching typed failures or interruptions.
|
|
4468
4561
|
*
|
|
4469
|
-
*
|
|
4562
|
+
* When to Recover from Defects:
|
|
4470
4563
|
*
|
|
4471
4564
|
* Defects are unexpected errors that typically should not be recovered from, as
|
|
4472
4565
|
* they often indicate serious issues. In some cases, such as dynamically loaded
|
|
@@ -4497,7 +4590,7 @@ export declare const catchDefect: {
|
|
|
4497
4590
|
/**
|
|
4498
4591
|
* Recovers from defects using a provided recovery function.
|
|
4499
4592
|
*
|
|
4500
|
-
* **When to
|
|
4593
|
+
* **When to use**
|
|
4501
4594
|
*
|
|
4502
4595
|
* Use this sparingly, usually at integration boundaries where defects must be
|
|
4503
4596
|
* reported or translated for an external system.
|
|
@@ -4507,7 +4600,7 @@ export declare const catchDefect: {
|
|
|
4507
4600
|
* `catchDefect` handles unexpected defects, such as thrown exceptions or
|
|
4508
4601
|
* values passed to `die`, without catching typed failures or interruptions.
|
|
4509
4602
|
*
|
|
4510
|
-
*
|
|
4603
|
+
* When to Recover from Defects:
|
|
4511
4604
|
*
|
|
4512
4605
|
* Defects are unexpected errors that typically should not be recovered from, as
|
|
4513
4606
|
* they often indicate serious issues. In some cases, such as dynamically loaded
|
|
@@ -4538,7 +4631,7 @@ export declare const catchDefect: {
|
|
|
4538
4631
|
/**
|
|
4539
4632
|
* Recovers from defects using a provided recovery function.
|
|
4540
4633
|
*
|
|
4541
|
-
* **When to
|
|
4634
|
+
* **When to use**
|
|
4542
4635
|
*
|
|
4543
4636
|
* Use this sparingly, usually at integration boundaries where defects must be
|
|
4544
4637
|
* reported or translated for an external system.
|
|
@@ -4548,7 +4641,7 @@ export declare const catchDefect: {
|
|
|
4548
4641
|
* `catchDefect` handles unexpected defects, such as thrown exceptions or
|
|
4549
4642
|
* values passed to `die`, without catching typed failures or interruptions.
|
|
4550
4643
|
*
|
|
4551
|
-
*
|
|
4644
|
+
* When to Recover from Defects:
|
|
4552
4645
|
*
|
|
4553
4646
|
* Defects are unexpected errors that typically should not be recovered from, as
|
|
4554
4647
|
* they often indicate serious issues. In some cases, such as dynamically loaded
|
|
@@ -4580,7 +4673,7 @@ export declare const catchDefect: {
|
|
|
4580
4673
|
/**
|
|
4581
4674
|
* Recovers from specific errors using a `Predicate` or `Refinement`.
|
|
4582
4675
|
*
|
|
4583
|
-
* **When to
|
|
4676
|
+
* **When to use**
|
|
4584
4677
|
*
|
|
4585
4678
|
* `catchIf` lets you recover from errors that match a condition. Use a
|
|
4586
4679
|
* `Refinement` for type narrowing or a `Predicate` for simple boolean
|
|
@@ -4620,7 +4713,7 @@ export declare const catchIf: {
|
|
|
4620
4713
|
/**
|
|
4621
4714
|
* Recovers from specific errors using a `Predicate` or `Refinement`.
|
|
4622
4715
|
*
|
|
4623
|
-
* **When to
|
|
4716
|
+
* **When to use**
|
|
4624
4717
|
*
|
|
4625
4718
|
* `catchIf` lets you recover from errors that match a condition. Use a
|
|
4626
4719
|
* `Refinement` for type narrowing or a `Predicate` for simple boolean
|
|
@@ -4660,7 +4753,7 @@ export declare const catchIf: {
|
|
|
4660
4753
|
/**
|
|
4661
4754
|
* Recovers from specific errors using a `Predicate` or `Refinement`.
|
|
4662
4755
|
*
|
|
4663
|
-
* **When to
|
|
4756
|
+
* **When to use**
|
|
4664
4757
|
*
|
|
4665
4758
|
* `catchIf` lets you recover from errors that match a condition. Use a
|
|
4666
4759
|
* `Refinement` for type narrowing or a `Predicate` for simple boolean
|
|
@@ -4700,7 +4793,7 @@ export declare const catchIf: {
|
|
|
4700
4793
|
/**
|
|
4701
4794
|
* Recovers from specific errors using a `Predicate` or `Refinement`.
|
|
4702
4795
|
*
|
|
4703
|
-
* **When to
|
|
4796
|
+
* **When to use**
|
|
4704
4797
|
*
|
|
4705
4798
|
* `catchIf` lets you recover from errors that match a condition. Use a
|
|
4706
4799
|
* `Refinement` for type narrowing or a `Predicate` for simple boolean
|
|
@@ -4740,7 +4833,7 @@ export declare const catchIf: {
|
|
|
4740
4833
|
/**
|
|
4741
4834
|
* Recovers from specific errors using a `Predicate` or `Refinement`.
|
|
4742
4835
|
*
|
|
4743
|
-
* **When to
|
|
4836
|
+
* **When to use**
|
|
4744
4837
|
*
|
|
4745
4838
|
* `catchIf` lets you recover from errors that match a condition. Use a
|
|
4746
4839
|
* `Refinement` for type narrowing or a `Predicate` for simple boolean
|
|
@@ -4803,6 +4896,8 @@ export declare const catchFilter: {
|
|
|
4803
4896
|
/**
|
|
4804
4897
|
* Catches `NoSuchElementError` failures and converts them to `Option.none`.
|
|
4805
4898
|
*
|
|
4899
|
+
* **Details**
|
|
4900
|
+
*
|
|
4806
4901
|
* Success values become `Option.some`, `NoSuchElementError` becomes
|
|
4807
4902
|
* `Option.none`, and all other errors are preserved.
|
|
4808
4903
|
*
|
|
@@ -4825,6 +4920,8 @@ export declare const catchNoSuchElement: <A, E, R>(self: Effect<A, E, R>) => Eff
|
|
|
4825
4920
|
/**
|
|
4826
4921
|
* Recovers from specific failures based on a predicate.
|
|
4827
4922
|
*
|
|
4923
|
+
* **Details**
|
|
4924
|
+
*
|
|
4828
4925
|
* This function allows you to conditionally catch and recover from failures
|
|
4829
4926
|
* that match a specific predicate. This is useful when you want to handle
|
|
4830
4927
|
* only certain types of errors while letting others propagate.
|
|
@@ -4859,6 +4956,8 @@ export declare const catchCauseIf: {
|
|
|
4859
4956
|
/**
|
|
4860
4957
|
* Recovers from specific failures based on a predicate.
|
|
4861
4958
|
*
|
|
4959
|
+
* **Details**
|
|
4960
|
+
*
|
|
4862
4961
|
* This function allows you to conditionally catch and recover from failures
|
|
4863
4962
|
* that match a specific predicate. This is useful when you want to handle
|
|
4864
4963
|
* only certain types of errors while letting others propagate.
|
|
@@ -4893,6 +4992,8 @@ export declare const catchCauseIf: {
|
|
|
4893
4992
|
/**
|
|
4894
4993
|
* Recovers from specific failures based on a predicate.
|
|
4895
4994
|
*
|
|
4995
|
+
* **Details**
|
|
4996
|
+
*
|
|
4896
4997
|
* This function allows you to conditionally catch and recover from failures
|
|
4897
4998
|
* that match a specific predicate. This is useful when you want to handle
|
|
4898
4999
|
* only certain types of errors while letting others propagate.
|
|
@@ -4951,15 +5052,13 @@ export declare const catchCauseFilter: {
|
|
|
4951
5052
|
* The `mapError` function is used to transform or modify the error
|
|
4952
5053
|
* produced by an effect, without affecting its success value.
|
|
4953
5054
|
*
|
|
5055
|
+
* **Details**
|
|
5056
|
+
*
|
|
4954
5057
|
* This function is helpful when you want to enhance the error with additional
|
|
4955
5058
|
* information, change the error type, or apply custom error handling while
|
|
4956
5059
|
* keeping the original behavior of the effect's success values intact. It only
|
|
4957
5060
|
* operates on the error channel and leaves the success channel unchanged.
|
|
4958
5061
|
*
|
|
4959
|
-
* @see {@link map} for a version that operates on the success channel.
|
|
4960
|
-
* @see {@link mapBoth} for a version that operates on both channels.
|
|
4961
|
-
* @see {@link mapError} if you want to replace the error with a new one.
|
|
4962
|
-
*
|
|
4963
5062
|
* **Example** (Transforming the error channel)
|
|
4964
5063
|
*
|
|
4965
5064
|
* ```ts
|
|
@@ -4979,6 +5078,9 @@ export declare const catchCauseFilter: {
|
|
|
4979
5078
|
* )
|
|
4980
5079
|
* ```
|
|
4981
5080
|
*
|
|
5081
|
+
* @see {@link map} for a version that operates on the success channel.
|
|
5082
|
+
* @see {@link mapBoth} for a version that operates on both channels.
|
|
5083
|
+
* @see {@link mapError} if you want to replace the error with a new one.
|
|
4982
5084
|
* @category error handling
|
|
4983
5085
|
* @since 2.0.0
|
|
4984
5086
|
*/
|
|
@@ -4987,15 +5089,13 @@ export declare const mapError: {
|
|
|
4987
5089
|
* The `mapError` function is used to transform or modify the error
|
|
4988
5090
|
* produced by an effect, without affecting its success value.
|
|
4989
5091
|
*
|
|
5092
|
+
* **Details**
|
|
5093
|
+
*
|
|
4990
5094
|
* This function is helpful when you want to enhance the error with additional
|
|
4991
5095
|
* information, change the error type, or apply custom error handling while
|
|
4992
5096
|
* keeping the original behavior of the effect's success values intact. It only
|
|
4993
5097
|
* operates on the error channel and leaves the success channel unchanged.
|
|
4994
5098
|
*
|
|
4995
|
-
* @see {@link map} for a version that operates on the success channel.
|
|
4996
|
-
* @see {@link mapBoth} for a version that operates on both channels.
|
|
4997
|
-
* @see {@link mapError} if you want to replace the error with a new one.
|
|
4998
|
-
*
|
|
4999
5099
|
* **Example** (Transforming the error channel)
|
|
5000
5100
|
*
|
|
5001
5101
|
* ```ts
|
|
@@ -5015,6 +5115,9 @@ export declare const mapError: {
|
|
|
5015
5115
|
* )
|
|
5016
5116
|
* ```
|
|
5017
5117
|
*
|
|
5118
|
+
* @see {@link map} for a version that operates on the success channel.
|
|
5119
|
+
* @see {@link mapBoth} for a version that operates on both channels.
|
|
5120
|
+
* @see {@link mapError} if you want to replace the error with a new one.
|
|
5018
5121
|
* @category error handling
|
|
5019
5122
|
* @since 2.0.0
|
|
5020
5123
|
*/
|
|
@@ -5023,15 +5126,13 @@ export declare const mapError: {
|
|
|
5023
5126
|
* The `mapError` function is used to transform or modify the error
|
|
5024
5127
|
* produced by an effect, without affecting its success value.
|
|
5025
5128
|
*
|
|
5129
|
+
* **Details**
|
|
5130
|
+
*
|
|
5026
5131
|
* This function is helpful when you want to enhance the error with additional
|
|
5027
5132
|
* information, change the error type, or apply custom error handling while
|
|
5028
5133
|
* keeping the original behavior of the effect's success values intact. It only
|
|
5029
5134
|
* operates on the error channel and leaves the success channel unchanged.
|
|
5030
5135
|
*
|
|
5031
|
-
* @see {@link map} for a version that operates on the success channel.
|
|
5032
|
-
* @see {@link mapBoth} for a version that operates on both channels.
|
|
5033
|
-
* @see {@link mapError} if you want to replace the error with a new one.
|
|
5034
|
-
*
|
|
5035
5136
|
* **Example** (Transforming the error channel)
|
|
5036
5137
|
*
|
|
5037
5138
|
* ```ts
|
|
@@ -5051,6 +5152,9 @@ export declare const mapError: {
|
|
|
5051
5152
|
* )
|
|
5052
5153
|
* ```
|
|
5053
5154
|
*
|
|
5155
|
+
* @see {@link map} for a version that operates on the success channel.
|
|
5156
|
+
* @see {@link mapBoth} for a version that operates on both channels.
|
|
5157
|
+
* @see {@link mapError} if you want to replace the error with a new one.
|
|
5054
5158
|
* @category error handling
|
|
5055
5159
|
* @since 2.0.0
|
|
5056
5160
|
*/
|
|
@@ -5175,13 +5279,11 @@ export declare const mapBoth: {
|
|
|
5175
5279
|
* Converts typed failures from the error channel into defects, removing the
|
|
5176
5280
|
* error type from the returned effect.
|
|
5177
5281
|
*
|
|
5178
|
-
* **When to
|
|
5282
|
+
* **When to use**
|
|
5179
5283
|
*
|
|
5180
5284
|
* Use `orDie` when a typed failure represents an unrecoverable bug or invalid
|
|
5181
5285
|
* state and should not be handled as a recoverable error.
|
|
5182
5286
|
*
|
|
5183
|
-
* @see {@link mapError} to transform the error before converting it into a defect with {@link orDie}.
|
|
5184
|
-
*
|
|
5185
5287
|
* **Example** (Converting typed failures into defects)
|
|
5186
5288
|
*
|
|
5187
5289
|
* ```ts
|
|
@@ -5204,6 +5306,7 @@ export declare const mapBoth: {
|
|
|
5204
5306
|
* // ...stack trace...
|
|
5205
5307
|
* ```
|
|
5206
5308
|
*
|
|
5309
|
+
* @see {@link mapError} to transform the error before converting it into a defect with {@link orDie}.
|
|
5207
5310
|
* @category Converting Failures to Defects
|
|
5208
5311
|
* @since 2.0.0
|
|
5209
5312
|
*/
|
|
@@ -5311,6 +5414,8 @@ export declare const tapError: {
|
|
|
5311
5414
|
/**
|
|
5312
5415
|
* Runs an effectful handler when a failure's `_tag` matches.
|
|
5313
5416
|
*
|
|
5417
|
+
* **Details**
|
|
5418
|
+
*
|
|
5314
5419
|
* Use this with tagged-union errors to perform side effects for one tag or a
|
|
5315
5420
|
* list of tags. When the handler succeeds, the original failure is preserved;
|
|
5316
5421
|
* if the handler fails, its error is also included in the returned effect.
|
|
@@ -5347,6 +5452,8 @@ export declare const tapErrorTag: {
|
|
|
5347
5452
|
/**
|
|
5348
5453
|
* Runs an effectful handler when a failure's `_tag` matches.
|
|
5349
5454
|
*
|
|
5455
|
+
* **Details**
|
|
5456
|
+
*
|
|
5350
5457
|
* Use this with tagged-union errors to perform side effects for one tag or a
|
|
5351
5458
|
* list of tags. When the handler succeeds, the original failure is preserved;
|
|
5352
5459
|
* if the handler fails, its error is also included in the returned effect.
|
|
@@ -5383,6 +5490,8 @@ export declare const tapErrorTag: {
|
|
|
5383
5490
|
/**
|
|
5384
5491
|
* Runs an effectful handler when a failure's `_tag` matches.
|
|
5385
5492
|
*
|
|
5493
|
+
* **Details**
|
|
5494
|
+
*
|
|
5386
5495
|
* Use this with tagged-union errors to perform side effects for one tag or a
|
|
5387
5496
|
* list of tags. When the handler succeeds, the original failure is preserved;
|
|
5388
5497
|
* if the handler fails, its error is also included in the returned effect.
|
|
@@ -5514,6 +5623,8 @@ export declare const tapCause: {
|
|
|
5514
5623
|
/**
|
|
5515
5624
|
* Conditionally executes a side effect based on the cause of a failed effect.
|
|
5516
5625
|
*
|
|
5626
|
+
* **Details**
|
|
5627
|
+
*
|
|
5517
5628
|
* This function allows you to tap into the cause of an effect's failure only when
|
|
5518
5629
|
* the cause matches a specific predicate. This is useful for conditional logging,
|
|
5519
5630
|
* monitoring, or other side effects based on the type of failure.
|
|
@@ -5544,6 +5655,8 @@ export declare const tapCauseIf: {
|
|
|
5544
5655
|
/**
|
|
5545
5656
|
* Conditionally executes a side effect based on the cause of a failed effect.
|
|
5546
5657
|
*
|
|
5658
|
+
* **Details**
|
|
5659
|
+
*
|
|
5547
5660
|
* This function allows you to tap into the cause of an effect's failure only when
|
|
5548
5661
|
* the cause matches a specific predicate. This is useful for conditional logging,
|
|
5549
5662
|
* monitoring, or other side effects based on the type of failure.
|
|
@@ -5574,6 +5687,8 @@ export declare const tapCauseIf: {
|
|
|
5574
5687
|
/**
|
|
5575
5688
|
* Conditionally executes a side effect based on the cause of a failed effect.
|
|
5576
5689
|
*
|
|
5690
|
+
* **Details**
|
|
5691
|
+
*
|
|
5577
5692
|
* This function allows you to tap into the cause of an effect's failure only when
|
|
5578
5693
|
* the cause matches a specific predicate. This is useful for conditional logging,
|
|
5579
5694
|
* monitoring, or other side effects based on the type of failure.
|
|
@@ -5772,6 +5887,8 @@ export declare const tapDefect: {
|
|
|
5772
5887
|
/**
|
|
5773
5888
|
* Retries an effect until it succeeds, discarding failures.
|
|
5774
5889
|
*
|
|
5890
|
+
* **Details**
|
|
5891
|
+
*
|
|
5775
5892
|
* Yields between attempts so other fibers can run.
|
|
5776
5893
|
*
|
|
5777
5894
|
* **Example** (Retrying until success)
|
|
@@ -5853,6 +5970,11 @@ export declare namespace Retry {
|
|
|
5853
5970
|
/**
|
|
5854
5971
|
* Retries typed failures from an effect according to a retry policy.
|
|
5855
5972
|
*
|
|
5973
|
+
* **When to use**
|
|
5974
|
+
*
|
|
5975
|
+
* Use `retry` when typed failures may be transient, such as network issues or
|
|
5976
|
+
* temporary resource unavailability.
|
|
5977
|
+
*
|
|
5856
5978
|
* **Details**
|
|
5857
5979
|
*
|
|
5858
5980
|
* The policy can be a `Schedule`, a schedule builder, or a `Retry.Options`
|
|
@@ -5862,11 +5984,6 @@ export declare namespace Retry {
|
|
|
5862
5984
|
*
|
|
5863
5985
|
* Defects and interruptions are not retried as typed failures.
|
|
5864
5986
|
*
|
|
5865
|
-
* **When to Use**
|
|
5866
|
-
*
|
|
5867
|
-
* Use `retry` when typed failures may be transient, such as network issues or
|
|
5868
|
-
* temporary resource unavailability.
|
|
5869
|
-
*
|
|
5870
5987
|
* **Example** (Retrying with a schedule)
|
|
5871
5988
|
*
|
|
5872
5989
|
* ```ts
|
|
@@ -5893,7 +6010,6 @@ export declare namespace Retry {
|
|
|
5893
6010
|
*
|
|
5894
6011
|
* @see {@link retryOrElse} for a version that allows you to run a fallback.
|
|
5895
6012
|
* @see {@link repeat} if your retry condition is based on successful outcomes rather than errors.
|
|
5896
|
-
*
|
|
5897
6013
|
* @category error handling
|
|
5898
6014
|
* @since 2.0.0
|
|
5899
6015
|
*/
|
|
@@ -5901,6 +6017,11 @@ export declare const retry: {
|
|
|
5901
6017
|
/**
|
|
5902
6018
|
* Retries typed failures from an effect according to a retry policy.
|
|
5903
6019
|
*
|
|
6020
|
+
* **When to use**
|
|
6021
|
+
*
|
|
6022
|
+
* Use `retry` when typed failures may be transient, such as network issues or
|
|
6023
|
+
* temporary resource unavailability.
|
|
6024
|
+
*
|
|
5904
6025
|
* **Details**
|
|
5905
6026
|
*
|
|
5906
6027
|
* The policy can be a `Schedule`, a schedule builder, or a `Retry.Options`
|
|
@@ -5910,11 +6031,6 @@ export declare const retry: {
|
|
|
5910
6031
|
*
|
|
5911
6032
|
* Defects and interruptions are not retried as typed failures.
|
|
5912
6033
|
*
|
|
5913
|
-
* **When to Use**
|
|
5914
|
-
*
|
|
5915
|
-
* Use `retry` when typed failures may be transient, such as network issues or
|
|
5916
|
-
* temporary resource unavailability.
|
|
5917
|
-
*
|
|
5918
6034
|
* **Example** (Retrying with a schedule)
|
|
5919
6035
|
*
|
|
5920
6036
|
* ```ts
|
|
@@ -5941,7 +6057,6 @@ export declare const retry: {
|
|
|
5941
6057
|
*
|
|
5942
6058
|
* @see {@link retryOrElse} for a version that allows you to run a fallback.
|
|
5943
6059
|
* @see {@link repeat} if your retry condition is based on successful outcomes rather than errors.
|
|
5944
|
-
*
|
|
5945
6060
|
* @category error handling
|
|
5946
6061
|
* @since 2.0.0
|
|
5947
6062
|
*/
|
|
@@ -5949,6 +6064,11 @@ export declare const retry: {
|
|
|
5949
6064
|
/**
|
|
5950
6065
|
* Retries typed failures from an effect according to a retry policy.
|
|
5951
6066
|
*
|
|
6067
|
+
* **When to use**
|
|
6068
|
+
*
|
|
6069
|
+
* Use `retry` when typed failures may be transient, such as network issues or
|
|
6070
|
+
* temporary resource unavailability.
|
|
6071
|
+
*
|
|
5952
6072
|
* **Details**
|
|
5953
6073
|
*
|
|
5954
6074
|
* The policy can be a `Schedule`, a schedule builder, or a `Retry.Options`
|
|
@@ -5958,11 +6078,6 @@ export declare const retry: {
|
|
|
5958
6078
|
*
|
|
5959
6079
|
* Defects and interruptions are not retried as typed failures.
|
|
5960
6080
|
*
|
|
5961
|
-
* **When to Use**
|
|
5962
|
-
*
|
|
5963
|
-
* Use `retry` when typed failures may be transient, such as network issues or
|
|
5964
|
-
* temporary resource unavailability.
|
|
5965
|
-
*
|
|
5966
6081
|
* **Example** (Retrying with a schedule)
|
|
5967
6082
|
*
|
|
5968
6083
|
* ```ts
|
|
@@ -5989,7 +6104,6 @@ export declare const retry: {
|
|
|
5989
6104
|
*
|
|
5990
6105
|
* @see {@link retryOrElse} for a version that allows you to run a fallback.
|
|
5991
6106
|
* @see {@link repeat} if your retry condition is based on successful outcomes rather than errors.
|
|
5992
|
-
*
|
|
5993
6107
|
* @category error handling
|
|
5994
6108
|
* @since 2.0.0
|
|
5995
6109
|
*/
|
|
@@ -5997,6 +6111,11 @@ export declare const retry: {
|
|
|
5997
6111
|
/**
|
|
5998
6112
|
* Retries typed failures from an effect according to a retry policy.
|
|
5999
6113
|
*
|
|
6114
|
+
* **When to use**
|
|
6115
|
+
*
|
|
6116
|
+
* Use `retry` when typed failures may be transient, such as network issues or
|
|
6117
|
+
* temporary resource unavailability.
|
|
6118
|
+
*
|
|
6000
6119
|
* **Details**
|
|
6001
6120
|
*
|
|
6002
6121
|
* The policy can be a `Schedule`, a schedule builder, or a `Retry.Options`
|
|
@@ -6006,11 +6125,6 @@ export declare const retry: {
|
|
|
6006
6125
|
*
|
|
6007
6126
|
* Defects and interruptions are not retried as typed failures.
|
|
6008
6127
|
*
|
|
6009
|
-
* **When to Use**
|
|
6010
|
-
*
|
|
6011
|
-
* Use `retry` when typed failures may be transient, such as network issues or
|
|
6012
|
-
* temporary resource unavailability.
|
|
6013
|
-
*
|
|
6014
6128
|
* **Example** (Retrying with a schedule)
|
|
6015
6129
|
*
|
|
6016
6130
|
* ```ts
|
|
@@ -6037,7 +6151,6 @@ export declare const retry: {
|
|
|
6037
6151
|
*
|
|
6038
6152
|
* @see {@link retryOrElse} for a version that allows you to run a fallback.
|
|
6039
6153
|
* @see {@link repeat} if your retry condition is based on successful outcomes rather than errors.
|
|
6040
|
-
*
|
|
6041
6154
|
* @category error handling
|
|
6042
6155
|
* @since 2.0.0
|
|
6043
6156
|
*/
|
|
@@ -6045,6 +6158,11 @@ export declare const retry: {
|
|
|
6045
6158
|
/**
|
|
6046
6159
|
* Retries typed failures from an effect according to a retry policy.
|
|
6047
6160
|
*
|
|
6161
|
+
* **When to use**
|
|
6162
|
+
*
|
|
6163
|
+
* Use `retry` when typed failures may be transient, such as network issues or
|
|
6164
|
+
* temporary resource unavailability.
|
|
6165
|
+
*
|
|
6048
6166
|
* **Details**
|
|
6049
6167
|
*
|
|
6050
6168
|
* The policy can be a `Schedule`, a schedule builder, or a `Retry.Options`
|
|
@@ -6054,11 +6172,6 @@ export declare const retry: {
|
|
|
6054
6172
|
*
|
|
6055
6173
|
* Defects and interruptions are not retried as typed failures.
|
|
6056
6174
|
*
|
|
6057
|
-
* **When to Use**
|
|
6058
|
-
*
|
|
6059
|
-
* Use `retry` when typed failures may be transient, such as network issues or
|
|
6060
|
-
* temporary resource unavailability.
|
|
6061
|
-
*
|
|
6062
6175
|
* **Example** (Retrying with a schedule)
|
|
6063
6176
|
*
|
|
6064
6177
|
* ```ts
|
|
@@ -6085,7 +6198,6 @@ export declare const retry: {
|
|
|
6085
6198
|
*
|
|
6086
6199
|
* @see {@link retryOrElse} for a version that allows you to run a fallback.
|
|
6087
6200
|
* @see {@link repeat} if your retry condition is based on successful outcomes rather than errors.
|
|
6088
|
-
*
|
|
6089
6201
|
* @category error handling
|
|
6090
6202
|
* @since 2.0.0
|
|
6091
6203
|
*/
|
|
@@ -6093,6 +6205,11 @@ export declare const retry: {
|
|
|
6093
6205
|
/**
|
|
6094
6206
|
* Retries typed failures from an effect according to a retry policy.
|
|
6095
6207
|
*
|
|
6208
|
+
* **When to use**
|
|
6209
|
+
*
|
|
6210
|
+
* Use `retry` when typed failures may be transient, such as network issues or
|
|
6211
|
+
* temporary resource unavailability.
|
|
6212
|
+
*
|
|
6096
6213
|
* **Details**
|
|
6097
6214
|
*
|
|
6098
6215
|
* The policy can be a `Schedule`, a schedule builder, or a `Retry.Options`
|
|
@@ -6102,11 +6219,6 @@ export declare const retry: {
|
|
|
6102
6219
|
*
|
|
6103
6220
|
* Defects and interruptions are not retried as typed failures.
|
|
6104
6221
|
*
|
|
6105
|
-
* **When to Use**
|
|
6106
|
-
*
|
|
6107
|
-
* Use `retry` when typed failures may be transient, such as network issues or
|
|
6108
|
-
* temporary resource unavailability.
|
|
6109
|
-
*
|
|
6110
6222
|
* **Example** (Retrying with a schedule)
|
|
6111
6223
|
*
|
|
6112
6224
|
* ```ts
|
|
@@ -6133,7 +6245,6 @@ export declare const retry: {
|
|
|
6133
6245
|
*
|
|
6134
6246
|
* @see {@link retryOrElse} for a version that allows you to run a fallback.
|
|
6135
6247
|
* @see {@link repeat} if your retry condition is based on successful outcomes rather than errors.
|
|
6136
|
-
*
|
|
6137
6248
|
* @category error handling
|
|
6138
6249
|
* @since 2.0.0
|
|
6139
6250
|
*/
|
|
@@ -6141,6 +6252,11 @@ export declare const retry: {
|
|
|
6141
6252
|
/**
|
|
6142
6253
|
* Retries typed failures from an effect according to a retry policy.
|
|
6143
6254
|
*
|
|
6255
|
+
* **When to use**
|
|
6256
|
+
*
|
|
6257
|
+
* Use `retry` when typed failures may be transient, such as network issues or
|
|
6258
|
+
* temporary resource unavailability.
|
|
6259
|
+
*
|
|
6144
6260
|
* **Details**
|
|
6145
6261
|
*
|
|
6146
6262
|
* The policy can be a `Schedule`, a schedule builder, or a `Retry.Options`
|
|
@@ -6150,11 +6266,6 @@ export declare const retry: {
|
|
|
6150
6266
|
*
|
|
6151
6267
|
* Defects and interruptions are not retried as typed failures.
|
|
6152
6268
|
*
|
|
6153
|
-
* **When to Use**
|
|
6154
|
-
*
|
|
6155
|
-
* Use `retry` when typed failures may be transient, such as network issues or
|
|
6156
|
-
* temporary resource unavailability.
|
|
6157
|
-
*
|
|
6158
6269
|
* **Example** (Retrying with a schedule)
|
|
6159
6270
|
*
|
|
6160
6271
|
* ```ts
|
|
@@ -6181,7 +6292,6 @@ export declare const retry: {
|
|
|
6181
6292
|
*
|
|
6182
6293
|
* @see {@link retryOrElse} for a version that allows you to run a fallback.
|
|
6183
6294
|
* @see {@link repeat} if your retry condition is based on successful outcomes rather than errors.
|
|
6184
|
-
*
|
|
6185
6295
|
* @category error handling
|
|
6186
6296
|
* @since 2.0.0
|
|
6187
6297
|
*/
|
|
@@ -6190,6 +6300,11 @@ export declare const retry: {
|
|
|
6190
6300
|
/**
|
|
6191
6301
|
* Retries a failing effect and runs a fallback effect if retries are exhausted.
|
|
6192
6302
|
*
|
|
6303
|
+
* **When to use**
|
|
6304
|
+
*
|
|
6305
|
+
* This function is useful when you want to handle failures gracefully by
|
|
6306
|
+
* specifying an alternative action after repeated failures.
|
|
6307
|
+
*
|
|
6193
6308
|
* **Details**
|
|
6194
6309
|
*
|
|
6195
6310
|
* The `Effect.retryOrElse` function attempts to retry a failing effect multiple
|
|
@@ -6198,13 +6313,6 @@ export declare const retry: {
|
|
|
6198
6313
|
* If the retries are exhausted and the effect still fails, it runs a fallback
|
|
6199
6314
|
* effect instead.
|
|
6200
6315
|
*
|
|
6201
|
-
* **When to Use**
|
|
6202
|
-
*
|
|
6203
|
-
* This function is useful when you want to handle failures gracefully by
|
|
6204
|
-
* specifying an alternative action after repeated failures.
|
|
6205
|
-
*
|
|
6206
|
-
* @see {@link retry} for a version that does not run a fallback effect.
|
|
6207
|
-
*
|
|
6208
6316
|
* **Example** (Falling back after retries are exhausted)
|
|
6209
6317
|
*
|
|
6210
6318
|
* ```ts
|
|
@@ -6241,6 +6349,7 @@ export declare const retry: {
|
|
|
6241
6349
|
* // Network data
|
|
6242
6350
|
* ```
|
|
6243
6351
|
*
|
|
6352
|
+
* @see {@link retry} for a version that does not run a fallback effect.
|
|
6244
6353
|
* @category error handling
|
|
6245
6354
|
* @since 2.0.0
|
|
6246
6355
|
*/
|
|
@@ -6248,6 +6357,11 @@ export declare const retryOrElse: {
|
|
|
6248
6357
|
/**
|
|
6249
6358
|
* Retries a failing effect and runs a fallback effect if retries are exhausted.
|
|
6250
6359
|
*
|
|
6360
|
+
* **When to use**
|
|
6361
|
+
*
|
|
6362
|
+
* This function is useful when you want to handle failures gracefully by
|
|
6363
|
+
* specifying an alternative action after repeated failures.
|
|
6364
|
+
*
|
|
6251
6365
|
* **Details**
|
|
6252
6366
|
*
|
|
6253
6367
|
* The `Effect.retryOrElse` function attempts to retry a failing effect multiple
|
|
@@ -6256,13 +6370,6 @@ export declare const retryOrElse: {
|
|
|
6256
6370
|
* If the retries are exhausted and the effect still fails, it runs a fallback
|
|
6257
6371
|
* effect instead.
|
|
6258
6372
|
*
|
|
6259
|
-
* **When to Use**
|
|
6260
|
-
*
|
|
6261
|
-
* This function is useful when you want to handle failures gracefully by
|
|
6262
|
-
* specifying an alternative action after repeated failures.
|
|
6263
|
-
*
|
|
6264
|
-
* @see {@link retry} for a version that does not run a fallback effect.
|
|
6265
|
-
*
|
|
6266
6373
|
* **Example** (Falling back after retries are exhausted)
|
|
6267
6374
|
*
|
|
6268
6375
|
* ```ts
|
|
@@ -6299,6 +6406,7 @@ export declare const retryOrElse: {
|
|
|
6299
6406
|
* // Network data
|
|
6300
6407
|
* ```
|
|
6301
6408
|
*
|
|
6409
|
+
* @see {@link retry} for a version that does not run a fallback effect.
|
|
6302
6410
|
* @category error handling
|
|
6303
6411
|
* @since 2.0.0
|
|
6304
6412
|
*/
|
|
@@ -6306,6 +6414,11 @@ export declare const retryOrElse: {
|
|
|
6306
6414
|
/**
|
|
6307
6415
|
* Retries a failing effect and runs a fallback effect if retries are exhausted.
|
|
6308
6416
|
*
|
|
6417
|
+
* **When to use**
|
|
6418
|
+
*
|
|
6419
|
+
* This function is useful when you want to handle failures gracefully by
|
|
6420
|
+
* specifying an alternative action after repeated failures.
|
|
6421
|
+
*
|
|
6309
6422
|
* **Details**
|
|
6310
6423
|
*
|
|
6311
6424
|
* The `Effect.retryOrElse` function attempts to retry a failing effect multiple
|
|
@@ -6314,13 +6427,6 @@ export declare const retryOrElse: {
|
|
|
6314
6427
|
* If the retries are exhausted and the effect still fails, it runs a fallback
|
|
6315
6428
|
* effect instead.
|
|
6316
6429
|
*
|
|
6317
|
-
* **When to Use**
|
|
6318
|
-
*
|
|
6319
|
-
* This function is useful when you want to handle failures gracefully by
|
|
6320
|
-
* specifying an alternative action after repeated failures.
|
|
6321
|
-
*
|
|
6322
|
-
* @see {@link retry} for a version that does not run a fallback effect.
|
|
6323
|
-
*
|
|
6324
6430
|
* **Example** (Falling back after retries are exhausted)
|
|
6325
6431
|
*
|
|
6326
6432
|
* ```ts
|
|
@@ -6357,6 +6463,7 @@ export declare const retryOrElse: {
|
|
|
6357
6463
|
* // Network data
|
|
6358
6464
|
* ```
|
|
6359
6465
|
*
|
|
6466
|
+
* @see {@link retry} for a version that does not run a fallback effect.
|
|
6360
6467
|
* @category error handling
|
|
6361
6468
|
* @since 2.0.0
|
|
6362
6469
|
*/
|
|
@@ -6397,7 +6504,7 @@ export declare const sandbox: <A, E, R>(self: Effect<A, E, R>) => Effect<A, Caus
|
|
|
6397
6504
|
/**
|
|
6398
6505
|
* Discards both the success and failure values of an effect.
|
|
6399
6506
|
*
|
|
6400
|
-
* **When to
|
|
6507
|
+
* **When to use**
|
|
6401
6508
|
*
|
|
6402
6509
|
* `ignore` allows you to run an effect without caring about its result, whether
|
|
6403
6510
|
* it succeeds or fails. This is useful when you only care about the side
|
|
@@ -6447,6 +6554,8 @@ export declare const ignore: <Arg extends Effect<any, any, any> | {
|
|
|
6447
6554
|
/**
|
|
6448
6555
|
* Ignores the effect's failure cause, including defects and interruptions.
|
|
6449
6556
|
*
|
|
6557
|
+
* **Details**
|
|
6558
|
+
*
|
|
6450
6559
|
* Use the `log` option to emit the full {@link Cause} when the effect fails,
|
|
6451
6560
|
* and `message` to prepend a custom log message.
|
|
6452
6561
|
*
|
|
@@ -6478,6 +6587,8 @@ export declare const ignoreCause: <Arg extends Effect<any, any, any> | {
|
|
|
6478
6587
|
* Apply an `ExecutionPlan` to an effect, retrying with step-provided resources
|
|
6479
6588
|
* until it succeeds or the plan is exhausted.
|
|
6480
6589
|
*
|
|
6590
|
+
* **Details**
|
|
6591
|
+
*
|
|
6481
6592
|
* Each attempt updates `ExecutionPlan.CurrentMetadata` (attempt and step index),
|
|
6482
6593
|
* and retry timing is derived per step (the first attempt uses the remaining
|
|
6483
6594
|
* attempts schedule; later retries apply the step schedule at least once).
|
|
@@ -6513,6 +6624,8 @@ export declare const withExecutionPlan: {
|
|
|
6513
6624
|
* Apply an `ExecutionPlan` to an effect, retrying with step-provided resources
|
|
6514
6625
|
* until it succeeds or the plan is exhausted.
|
|
6515
6626
|
*
|
|
6627
|
+
* **Details**
|
|
6628
|
+
*
|
|
6516
6629
|
* Each attempt updates `ExecutionPlan.CurrentMetadata` (attempt and step index),
|
|
6517
6630
|
* and retry timing is derived per step (the first attempt uses the remaining
|
|
6518
6631
|
* attempts schedule; later retries apply the step schedule at least once).
|
|
@@ -6553,6 +6666,8 @@ export declare const withExecutionPlan: {
|
|
|
6553
6666
|
* Apply an `ExecutionPlan` to an effect, retrying with step-provided resources
|
|
6554
6667
|
* until it succeeds or the plan is exhausted.
|
|
6555
6668
|
*
|
|
6669
|
+
* **Details**
|
|
6670
|
+
*
|
|
6556
6671
|
* Each attempt updates `ExecutionPlan.CurrentMetadata` (attempt and step index),
|
|
6557
6672
|
* and retry timing is derived per step (the first attempt uses the remaining
|
|
6558
6673
|
* attempts schedule; later retries apply the step schedule at least once).
|
|
@@ -6593,6 +6708,8 @@ export declare const withExecutionPlan: {
|
|
|
6593
6708
|
/**
|
|
6594
6709
|
* Runs an effect and reports any errors to the configured `ErrorReporter`s.
|
|
6595
6710
|
*
|
|
6711
|
+
* **Details**
|
|
6712
|
+
*
|
|
6596
6713
|
* If the `defectsOnly` option is set to `true`, only defects (unrecoverable
|
|
6597
6714
|
* errors) will be reported, while regular failures will be ignored.
|
|
6598
6715
|
*
|
|
@@ -6722,6 +6839,12 @@ export declare const orElseSucceed: {
|
|
|
6722
6839
|
* Runs a sequence of effects and returns the result of the first successful
|
|
6723
6840
|
* one.
|
|
6724
6841
|
*
|
|
6842
|
+
* **When to use**
|
|
6843
|
+
*
|
|
6844
|
+
* Use `firstSuccessOf` when you have prioritized fallback strategies, such as
|
|
6845
|
+
* attempting multiple APIs, reading configuration from several sources, or
|
|
6846
|
+
* trying alternative resource locations in order.
|
|
6847
|
+
*
|
|
6725
6848
|
* **Details**
|
|
6726
6849
|
*
|
|
6727
6850
|
* This function executes the provided effects in sequence, stopping at the
|
|
@@ -6732,12 +6855,6 @@ export declare const orElseSucceed: {
|
|
|
6732
6855
|
* effect. If the collection is empty, the returned effect defects with an
|
|
6733
6856
|
* `Error` whose message is `"Received an empty collection of effects"`.
|
|
6734
6857
|
*
|
|
6735
|
-
* **When to Use**
|
|
6736
|
-
*
|
|
6737
|
-
* Use `firstSuccessOf` when you have prioritized fallback strategies, such as
|
|
6738
|
-
* attempting multiple APIs, reading configuration from several sources, or
|
|
6739
|
-
* trying alternative resource locations in order.
|
|
6740
|
-
*
|
|
6741
6858
|
* **Example** (Trying alternatives until one succeeds)
|
|
6742
6859
|
*
|
|
6743
6860
|
* ```ts
|
|
@@ -6767,14 +6884,14 @@ export declare const firstSuccessOf: <Eff extends Effect<any, any, any>>(effects
|
|
|
6767
6884
|
* Adds a time limit to an effect, triggering a timeout if the effect exceeds
|
|
6768
6885
|
* the duration.
|
|
6769
6886
|
*
|
|
6887
|
+
* **Details**
|
|
6888
|
+
*
|
|
6770
6889
|
* The `timeout` function allows you to specify a time limit for an
|
|
6771
6890
|
* effect's execution. If the effect does not complete within the given time, a
|
|
6772
6891
|
* `TimeoutException` is raised. This can be useful for controlling how long
|
|
6773
6892
|
* your program waits for a task to finish, ensuring that it doesn't hang
|
|
6774
6893
|
* indefinitely if the task takes too long.
|
|
6775
6894
|
*
|
|
6776
|
-
* @see {@link timeoutOrElse} for a version that allows specifying both success and timeout handlers.
|
|
6777
|
-
*
|
|
6778
6895
|
* **Example** (Failing when work takes too long)
|
|
6779
6896
|
*
|
|
6780
6897
|
* ```ts
|
|
@@ -6805,6 +6922,7 @@ export declare const firstSuccessOf: <Eff extends Effect<any, any, any>>(effects
|
|
|
6805
6922
|
* // }
|
|
6806
6923
|
* ```
|
|
6807
6924
|
*
|
|
6925
|
+
* @see {@link timeoutOrElse} for a version that allows specifying both success and timeout handlers.
|
|
6808
6926
|
* @category Delays & Timeouts
|
|
6809
6927
|
* @since 2.0.0
|
|
6810
6928
|
*/
|
|
@@ -6813,14 +6931,14 @@ export declare const timeout: {
|
|
|
6813
6931
|
* Adds a time limit to an effect, triggering a timeout if the effect exceeds
|
|
6814
6932
|
* the duration.
|
|
6815
6933
|
*
|
|
6934
|
+
* **Details**
|
|
6935
|
+
*
|
|
6816
6936
|
* The `timeout` function allows you to specify a time limit for an
|
|
6817
6937
|
* effect's execution. If the effect does not complete within the given time, a
|
|
6818
6938
|
* `TimeoutException` is raised. This can be useful for controlling how long
|
|
6819
6939
|
* your program waits for a task to finish, ensuring that it doesn't hang
|
|
6820
6940
|
* indefinitely if the task takes too long.
|
|
6821
6941
|
*
|
|
6822
|
-
* @see {@link timeoutOrElse} for a version that allows specifying both success and timeout handlers.
|
|
6823
|
-
*
|
|
6824
6942
|
* **Example** (Failing when work takes too long)
|
|
6825
6943
|
*
|
|
6826
6944
|
* ```ts
|
|
@@ -6851,6 +6969,7 @@ export declare const timeout: {
|
|
|
6851
6969
|
* // }
|
|
6852
6970
|
* ```
|
|
6853
6971
|
*
|
|
6972
|
+
* @see {@link timeoutOrElse} for a version that allows specifying both success and timeout handlers.
|
|
6854
6973
|
* @category Delays & Timeouts
|
|
6855
6974
|
* @since 2.0.0
|
|
6856
6975
|
*/
|
|
@@ -6859,14 +6978,14 @@ export declare const timeout: {
|
|
|
6859
6978
|
* Adds a time limit to an effect, triggering a timeout if the effect exceeds
|
|
6860
6979
|
* the duration.
|
|
6861
6980
|
*
|
|
6981
|
+
* **Details**
|
|
6982
|
+
*
|
|
6862
6983
|
* The `timeout` function allows you to specify a time limit for an
|
|
6863
6984
|
* effect's execution. If the effect does not complete within the given time, a
|
|
6864
6985
|
* `TimeoutException` is raised. This can be useful for controlling how long
|
|
6865
6986
|
* your program waits for a task to finish, ensuring that it doesn't hang
|
|
6866
6987
|
* indefinitely if the task takes too long.
|
|
6867
6988
|
*
|
|
6868
|
-
* @see {@link timeoutOrElse} for a version that allows specifying both success and timeout handlers.
|
|
6869
|
-
*
|
|
6870
6989
|
* **Example** (Failing when work takes too long)
|
|
6871
6990
|
*
|
|
6872
6991
|
* ```ts
|
|
@@ -6897,6 +7016,7 @@ export declare const timeout: {
|
|
|
6897
7016
|
* // }
|
|
6898
7017
|
* ```
|
|
6899
7018
|
*
|
|
7019
|
+
* @see {@link timeoutOrElse} for a version that allows specifying both success and timeout handlers.
|
|
6900
7020
|
* @category Delays & Timeouts
|
|
6901
7021
|
* @since 2.0.0
|
|
6902
7022
|
*/
|
|
@@ -7044,6 +7164,8 @@ export declare const timeoutOption: {
|
|
|
7044
7164
|
/**
|
|
7045
7165
|
* Applies a timeout to an effect, with a fallback effect executed if the timeout is reached.
|
|
7046
7166
|
*
|
|
7167
|
+
* **Details**
|
|
7168
|
+
*
|
|
7047
7169
|
* This function is useful when you want to set a maximum duration for an operation
|
|
7048
7170
|
* and provide an alternative action if the timeout is exceeded.
|
|
7049
7171
|
*
|
|
@@ -7082,6 +7204,8 @@ export declare const timeoutOrElse: {
|
|
|
7082
7204
|
/**
|
|
7083
7205
|
* Applies a timeout to an effect, with a fallback effect executed if the timeout is reached.
|
|
7084
7206
|
*
|
|
7207
|
+
* **Details**
|
|
7208
|
+
*
|
|
7085
7209
|
* This function is useful when you want to set a maximum duration for an operation
|
|
7086
7210
|
* and provide an alternative action if the timeout is exceeded.
|
|
7087
7211
|
*
|
|
@@ -7123,6 +7247,8 @@ export declare const timeoutOrElse: {
|
|
|
7123
7247
|
/**
|
|
7124
7248
|
* Applies a timeout to an effect, with a fallback effect executed if the timeout is reached.
|
|
7125
7249
|
*
|
|
7250
|
+
* **Details**
|
|
7251
|
+
*
|
|
7126
7252
|
* This function is useful when you want to set a maximum duration for an operation
|
|
7127
7253
|
* and provide an alternative action if the timeout is exceeded.
|
|
7128
7254
|
*
|
|
@@ -7256,6 +7382,8 @@ export declare const sleep: (duration: Duration.Input) => Effect<void>;
|
|
|
7256
7382
|
/**
|
|
7257
7383
|
* Measures the runtime of an effect and returns the duration with its result.
|
|
7258
7384
|
*
|
|
7385
|
+
* **Details**
|
|
7386
|
+
*
|
|
7259
7387
|
* The original success, failure, or interruption is preserved; only the success
|
|
7260
7388
|
* value is paired with the duration.
|
|
7261
7389
|
*
|
|
@@ -7277,6 +7405,11 @@ export declare const timed: <A, E, R>(self: Effect<A, E, R>) => Effect<[duration
|
|
|
7277
7405
|
/**
|
|
7278
7406
|
* Runs multiple effects concurrently and returns the first successful result.
|
|
7279
7407
|
*
|
|
7408
|
+
* **When to use**
|
|
7409
|
+
*
|
|
7410
|
+
* Use `raceAll` when early failures should be ignored until a success occurs
|
|
7411
|
+
* or all effects fail.
|
|
7412
|
+
*
|
|
7280
7413
|
* **Details**
|
|
7281
7414
|
*
|
|
7282
7415
|
* Early failures do not finish the race; `raceAll` keeps waiting until one
|
|
@@ -7284,13 +7417,6 @@ export declare const timed: <A, E, R>(self: Effect<A, E, R>) => Effect<[duration
|
|
|
7284
7417
|
* remaining effects are interrupted. If every effect fails, the returned effect
|
|
7285
7418
|
* fails with a cause containing the collected failure reasons.
|
|
7286
7419
|
*
|
|
7287
|
-
* **When to Use**
|
|
7288
|
-
*
|
|
7289
|
-
* Use `raceAll` when early failures should be ignored until a success occurs
|
|
7290
|
-
* or all effects fail.
|
|
7291
|
-
*
|
|
7292
|
-
* @see {@link race} for a version that handles only two effects.
|
|
7293
|
-
*
|
|
7294
7420
|
* **Example** (Racing many effects)
|
|
7295
7421
|
*
|
|
7296
7422
|
* ```ts
|
|
@@ -7307,6 +7433,7 @@ export declare const timed: <A, E, R>(self: Effect<A, E, R>) => Effect<[duration
|
|
|
7307
7433
|
* // Result: "Fast" (after ~100ms)
|
|
7308
7434
|
* ```
|
|
7309
7435
|
*
|
|
7436
|
+
* @see {@link race} for a version that handles only two effects.
|
|
7310
7437
|
* @category Racing
|
|
7311
7438
|
* @since 2.0.0
|
|
7312
7439
|
*/
|
|
@@ -7356,6 +7483,8 @@ export declare const raceAllFirst: <Eff extends Effect<any, any, any>>(all: Iter
|
|
|
7356
7483
|
/**
|
|
7357
7484
|
* Races two effects and returns the first successful result.
|
|
7358
7485
|
*
|
|
7486
|
+
* **Details**
|
|
7487
|
+
*
|
|
7359
7488
|
* If one effect succeeds, the other is interrupted and `onWinner` can observe the
|
|
7360
7489
|
* winning fiber. If both fail, the race fails.
|
|
7361
7490
|
*
|
|
@@ -7383,6 +7512,8 @@ export declare const race: {
|
|
|
7383
7512
|
/**
|
|
7384
7513
|
* Races two effects and returns the first successful result.
|
|
7385
7514
|
*
|
|
7515
|
+
* **Details**
|
|
7516
|
+
*
|
|
7386
7517
|
* If one effect succeeds, the other is interrupted and `onWinner` can observe the
|
|
7387
7518
|
* winning fiber. If both fail, the race fails.
|
|
7388
7519
|
*
|
|
@@ -7416,6 +7547,8 @@ export declare const race: {
|
|
|
7416
7547
|
/**
|
|
7417
7548
|
* Races two effects and returns the first successful result.
|
|
7418
7549
|
*
|
|
7550
|
+
* **Details**
|
|
7551
|
+
*
|
|
7419
7552
|
* If one effect succeeds, the other is interrupted and `onWinner` can observe the
|
|
7420
7553
|
* winning fiber. If both fail, the race fails.
|
|
7421
7554
|
*
|
|
@@ -7451,6 +7584,8 @@ export declare const race: {
|
|
|
7451
7584
|
* Races two effects and returns the result of the first one to complete, whether
|
|
7452
7585
|
* it succeeds or fails.
|
|
7453
7586
|
*
|
|
7587
|
+
* **Details**
|
|
7588
|
+
*
|
|
7454
7589
|
* The losing effect is interrupted, and `onWinner` can observe the winning fiber.
|
|
7455
7590
|
*
|
|
7456
7591
|
* **Example** (Observing the winning fiber)
|
|
@@ -7481,6 +7616,8 @@ export declare const raceFirst: {
|
|
|
7481
7616
|
* Races two effects and returns the result of the first one to complete, whether
|
|
7482
7617
|
* it succeeds or fails.
|
|
7483
7618
|
*
|
|
7619
|
+
* **Details**
|
|
7620
|
+
*
|
|
7484
7621
|
* The losing effect is interrupted, and `onWinner` can observe the winning fiber.
|
|
7485
7622
|
*
|
|
7486
7623
|
* **Example** (Observing the winning fiber)
|
|
@@ -7517,6 +7654,8 @@ export declare const raceFirst: {
|
|
|
7517
7654
|
* Races two effects and returns the result of the first one to complete, whether
|
|
7518
7655
|
* it succeeds or fails.
|
|
7519
7656
|
*
|
|
7657
|
+
* **Details**
|
|
7658
|
+
*
|
|
7520
7659
|
* The losing effect is interrupted, and `onWinner` can observe the winning fiber.
|
|
7521
7660
|
*
|
|
7522
7661
|
* **Example** (Observing the winning fiber)
|
|
@@ -8260,6 +8399,11 @@ export declare const filterMapOrFail: {
|
|
|
8260
8399
|
* Conditionally runs an effect based on the result of an effectful boolean
|
|
8261
8400
|
* condition.
|
|
8262
8401
|
*
|
|
8402
|
+
* **When to use**
|
|
8403
|
+
*
|
|
8404
|
+
* Use this when an effectful check decides whether to run another effect while
|
|
8405
|
+
* representing the skipped case explicitly.
|
|
8406
|
+
*
|
|
8263
8407
|
* **Details**
|
|
8264
8408
|
*
|
|
8265
8409
|
* The condition effect is evaluated first. If it succeeds with `true`, the
|
|
@@ -8267,11 +8411,6 @@ export declare const filterMapOrFail: {
|
|
|
8267
8411
|
* succeeds with `false`, the source effect is skipped and the result is
|
|
8268
8412
|
* `Option.none`. If the condition effect fails, that failure is preserved.
|
|
8269
8413
|
*
|
|
8270
|
-
* **When to Use**
|
|
8271
|
-
*
|
|
8272
|
-
* Use this when an effectful check decides whether to run another effect while
|
|
8273
|
-
* representing the skipped case explicitly.
|
|
8274
|
-
*
|
|
8275
8414
|
* **Example** (Conditionally running an effect)
|
|
8276
8415
|
*
|
|
8277
8416
|
* ```ts
|
|
@@ -8290,7 +8429,6 @@ export declare const filterMapOrFail: {
|
|
|
8290
8429
|
* ```
|
|
8291
8430
|
*
|
|
8292
8431
|
* @see {@link when} for conditional execution with a boolean condition.
|
|
8293
|
-
*
|
|
8294
8432
|
* @category Conditional Operators
|
|
8295
8433
|
* @since 2.0.0
|
|
8296
8434
|
*/
|
|
@@ -8299,6 +8437,11 @@ export declare const when: {
|
|
|
8299
8437
|
* Conditionally runs an effect based on the result of an effectful boolean
|
|
8300
8438
|
* condition.
|
|
8301
8439
|
*
|
|
8440
|
+
* **When to use**
|
|
8441
|
+
*
|
|
8442
|
+
* Use this when an effectful check decides whether to run another effect while
|
|
8443
|
+
* representing the skipped case explicitly.
|
|
8444
|
+
*
|
|
8302
8445
|
* **Details**
|
|
8303
8446
|
*
|
|
8304
8447
|
* The condition effect is evaluated first. If it succeeds with `true`, the
|
|
@@ -8306,11 +8449,6 @@ export declare const when: {
|
|
|
8306
8449
|
* succeeds with `false`, the source effect is skipped and the result is
|
|
8307
8450
|
* `Option.none`. If the condition effect fails, that failure is preserved.
|
|
8308
8451
|
*
|
|
8309
|
-
* **When to Use**
|
|
8310
|
-
*
|
|
8311
|
-
* Use this when an effectful check decides whether to run another effect while
|
|
8312
|
-
* representing the skipped case explicitly.
|
|
8313
|
-
*
|
|
8314
8452
|
* **Example** (Conditionally running an effect)
|
|
8315
8453
|
*
|
|
8316
8454
|
* ```ts
|
|
@@ -8329,7 +8467,6 @@ export declare const when: {
|
|
|
8329
8467
|
* ```
|
|
8330
8468
|
*
|
|
8331
8469
|
* @see {@link when} for conditional execution with a boolean condition.
|
|
8332
|
-
*
|
|
8333
8470
|
* @category Conditional Operators
|
|
8334
8471
|
* @since 2.0.0
|
|
8335
8472
|
*/
|
|
@@ -8338,6 +8475,11 @@ export declare const when: {
|
|
|
8338
8475
|
* Conditionally runs an effect based on the result of an effectful boolean
|
|
8339
8476
|
* condition.
|
|
8340
8477
|
*
|
|
8478
|
+
* **When to use**
|
|
8479
|
+
*
|
|
8480
|
+
* Use this when an effectful check decides whether to run another effect while
|
|
8481
|
+
* representing the skipped case explicitly.
|
|
8482
|
+
*
|
|
8341
8483
|
* **Details**
|
|
8342
8484
|
*
|
|
8343
8485
|
* The condition effect is evaluated first. If it succeeds with `true`, the
|
|
@@ -8345,11 +8487,6 @@ export declare const when: {
|
|
|
8345
8487
|
* succeeds with `false`, the source effect is skipped and the result is
|
|
8346
8488
|
* `Option.none`. If the condition effect fails, that failure is preserved.
|
|
8347
8489
|
*
|
|
8348
|
-
* **When to Use**
|
|
8349
|
-
*
|
|
8350
|
-
* Use this when an effectful check decides whether to run another effect while
|
|
8351
|
-
* representing the skipped case explicitly.
|
|
8352
|
-
*
|
|
8353
8490
|
* **Example** (Conditionally running an effect)
|
|
8354
8491
|
*
|
|
8355
8492
|
* ```ts
|
|
@@ -8368,7 +8505,6 @@ export declare const when: {
|
|
|
8368
8505
|
* ```
|
|
8369
8506
|
*
|
|
8370
8507
|
* @see {@link when} for conditional execution with a boolean condition.
|
|
8371
|
-
*
|
|
8372
8508
|
* @category Conditional Operators
|
|
8373
8509
|
* @since 2.0.0
|
|
8374
8510
|
*/
|
|
@@ -8378,6 +8514,11 @@ export declare const when: {
|
|
|
8378
8514
|
* Handles both success and failure cases of an effect without performing side
|
|
8379
8515
|
* effects.
|
|
8380
8516
|
*
|
|
8517
|
+
* **When to use**
|
|
8518
|
+
*
|
|
8519
|
+
* This is useful for structuring your code to respond differently to success or
|
|
8520
|
+
* failure without triggering side effects.
|
|
8521
|
+
*
|
|
8381
8522
|
* **Details**
|
|
8382
8523
|
*
|
|
8383
8524
|
* `match` lets you define custom handlers for both success and failure
|
|
@@ -8385,13 +8526,6 @@ export declare const when: {
|
|
|
8385
8526
|
* to process the result if the effect succeeds, or handle the error if the
|
|
8386
8527
|
* effect fails.
|
|
8387
8528
|
*
|
|
8388
|
-
* **When to Use**
|
|
8389
|
-
*
|
|
8390
|
-
* This is useful for structuring your code to respond differently to success or
|
|
8391
|
-
* failure without triggering side effects.
|
|
8392
|
-
*
|
|
8393
|
-
* @see {@link matchEffect} if you need to perform side effects in the handlers.
|
|
8394
|
-
*
|
|
8395
8529
|
* **Example** (Matching success and failure values)
|
|
8396
8530
|
*
|
|
8397
8531
|
* ```ts
|
|
@@ -8424,6 +8558,7 @@ export declare const when: {
|
|
|
8424
8558
|
* // Output: "failure: Uh oh!"
|
|
8425
8559
|
* ```
|
|
8426
8560
|
*
|
|
8561
|
+
* @see {@link matchEffect} if you need to perform side effects in the handlers.
|
|
8427
8562
|
* @category Pattern Matching
|
|
8428
8563
|
* @since 2.0.0
|
|
8429
8564
|
*/
|
|
@@ -8432,6 +8567,11 @@ export declare const match: {
|
|
|
8432
8567
|
* Handles both success and failure cases of an effect without performing side
|
|
8433
8568
|
* effects.
|
|
8434
8569
|
*
|
|
8570
|
+
* **When to use**
|
|
8571
|
+
*
|
|
8572
|
+
* This is useful for structuring your code to respond differently to success or
|
|
8573
|
+
* failure without triggering side effects.
|
|
8574
|
+
*
|
|
8435
8575
|
* **Details**
|
|
8436
8576
|
*
|
|
8437
8577
|
* `match` lets you define custom handlers for both success and failure
|
|
@@ -8439,14 +8579,7 @@ export declare const match: {
|
|
|
8439
8579
|
* to process the result if the effect succeeds, or handle the error if the
|
|
8440
8580
|
* effect fails.
|
|
8441
8581
|
*
|
|
8442
|
-
* **
|
|
8443
|
-
*
|
|
8444
|
-
* This is useful for structuring your code to respond differently to success or
|
|
8445
|
-
* failure without triggering side effects.
|
|
8446
|
-
*
|
|
8447
|
-
* @see {@link matchEffect} if you need to perform side effects in the handlers.
|
|
8448
|
-
*
|
|
8449
|
-
* **Example** (Matching success and failure values)
|
|
8582
|
+
* **Example** (Matching success and failure values)
|
|
8450
8583
|
*
|
|
8451
8584
|
* ```ts
|
|
8452
8585
|
* import { Data, Effect } from "effect"
|
|
@@ -8478,6 +8611,7 @@ export declare const match: {
|
|
|
8478
8611
|
* // Output: "failure: Uh oh!"
|
|
8479
8612
|
* ```
|
|
8480
8613
|
*
|
|
8614
|
+
* @see {@link matchEffect} if you need to perform side effects in the handlers.
|
|
8481
8615
|
* @category Pattern Matching
|
|
8482
8616
|
* @since 2.0.0
|
|
8483
8617
|
*/
|
|
@@ -8489,6 +8623,11 @@ export declare const match: {
|
|
|
8489
8623
|
* Handles both success and failure cases of an effect without performing side
|
|
8490
8624
|
* effects.
|
|
8491
8625
|
*
|
|
8626
|
+
* **When to use**
|
|
8627
|
+
*
|
|
8628
|
+
* This is useful for structuring your code to respond differently to success or
|
|
8629
|
+
* failure without triggering side effects.
|
|
8630
|
+
*
|
|
8492
8631
|
* **Details**
|
|
8493
8632
|
*
|
|
8494
8633
|
* `match` lets you define custom handlers for both success and failure
|
|
@@ -8496,13 +8635,6 @@ export declare const match: {
|
|
|
8496
8635
|
* to process the result if the effect succeeds, or handle the error if the
|
|
8497
8636
|
* effect fails.
|
|
8498
8637
|
*
|
|
8499
|
-
* **When to Use**
|
|
8500
|
-
*
|
|
8501
|
-
* This is useful for structuring your code to respond differently to success or
|
|
8502
|
-
* failure without triggering side effects.
|
|
8503
|
-
*
|
|
8504
|
-
* @see {@link matchEffect} if you need to perform side effects in the handlers.
|
|
8505
|
-
*
|
|
8506
8638
|
* **Example** (Matching success and failure values)
|
|
8507
8639
|
*
|
|
8508
8640
|
* ```ts
|
|
@@ -8535,6 +8667,7 @@ export declare const match: {
|
|
|
8535
8667
|
* // Output: "failure: Uh oh!"
|
|
8536
8668
|
* ```
|
|
8537
8669
|
*
|
|
8670
|
+
* @see {@link matchEffect} if you need to perform side effects in the handlers.
|
|
8538
8671
|
* @category Pattern Matching
|
|
8539
8672
|
* @since 2.0.0
|
|
8540
8673
|
*/
|
|
@@ -8547,6 +8680,12 @@ export declare const match: {
|
|
|
8547
8680
|
* Handles both success and failure cases of an effect without performing side
|
|
8548
8681
|
* effects, with eager evaluation for resolved effects.
|
|
8549
8682
|
*
|
|
8683
|
+
* **When to use**
|
|
8684
|
+
*
|
|
8685
|
+
* Use this when you need to handle both success and failure cases and want
|
|
8686
|
+
* optimal performance for resolved effects. This is particularly useful in
|
|
8687
|
+
* scenarios where you frequently work with already computed values.
|
|
8688
|
+
*
|
|
8550
8689
|
* **Details**
|
|
8551
8690
|
*
|
|
8552
8691
|
* `matchEager` works like `match` but provides better performance for resolved
|
|
@@ -8554,12 +8693,6 @@ export declare const match: {
|
|
|
8554
8693
|
* the handlers immediately without fiber scheduling. For unresolved effects,
|
|
8555
8694
|
* it falls back to the regular `match` behavior.
|
|
8556
8695
|
*
|
|
8557
|
-
* **When to Use**
|
|
8558
|
-
*
|
|
8559
|
-
* Use this when you need to handle both success and failure cases and want
|
|
8560
|
-
* optimal performance for resolved effects. This is particularly useful in
|
|
8561
|
-
* scenarios where you frequently work with already computed values.
|
|
8562
|
-
*
|
|
8563
8696
|
* **Example** (Pattern matching eagerly when possible)
|
|
8564
8697
|
*
|
|
8565
8698
|
* ```ts
|
|
@@ -8576,7 +8709,6 @@ export declare const match: {
|
|
|
8576
8709
|
*
|
|
8577
8710
|
* @see {@link match} for the non-eager version.
|
|
8578
8711
|
* @see {@link matchEffect} if you need to perform side effects in the handlers.
|
|
8579
|
-
*
|
|
8580
8712
|
* @category Pattern Matching
|
|
8581
8713
|
* @since 4.0.0
|
|
8582
8714
|
*/
|
|
@@ -8585,6 +8717,12 @@ export declare const matchEager: {
|
|
|
8585
8717
|
* Handles both success and failure cases of an effect without performing side
|
|
8586
8718
|
* effects, with eager evaluation for resolved effects.
|
|
8587
8719
|
*
|
|
8720
|
+
* **When to use**
|
|
8721
|
+
*
|
|
8722
|
+
* Use this when you need to handle both success and failure cases and want
|
|
8723
|
+
* optimal performance for resolved effects. This is particularly useful in
|
|
8724
|
+
* scenarios where you frequently work with already computed values.
|
|
8725
|
+
*
|
|
8588
8726
|
* **Details**
|
|
8589
8727
|
*
|
|
8590
8728
|
* `matchEager` works like `match` but provides better performance for resolved
|
|
@@ -8592,12 +8730,6 @@ export declare const matchEager: {
|
|
|
8592
8730
|
* the handlers immediately without fiber scheduling. For unresolved effects,
|
|
8593
8731
|
* it falls back to the regular `match` behavior.
|
|
8594
8732
|
*
|
|
8595
|
-
* **When to Use**
|
|
8596
|
-
*
|
|
8597
|
-
* Use this when you need to handle both success and failure cases and want
|
|
8598
|
-
* optimal performance for resolved effects. This is particularly useful in
|
|
8599
|
-
* scenarios where you frequently work with already computed values.
|
|
8600
|
-
*
|
|
8601
8733
|
* **Example** (Pattern matching eagerly when possible)
|
|
8602
8734
|
*
|
|
8603
8735
|
* ```ts
|
|
@@ -8614,7 +8746,6 @@ export declare const matchEager: {
|
|
|
8614
8746
|
*
|
|
8615
8747
|
* @see {@link match} for the non-eager version.
|
|
8616
8748
|
* @see {@link matchEffect} if you need to perform side effects in the handlers.
|
|
8617
|
-
*
|
|
8618
8749
|
* @category Pattern Matching
|
|
8619
8750
|
* @since 4.0.0
|
|
8620
8751
|
*/
|
|
@@ -8626,6 +8757,12 @@ export declare const matchEager: {
|
|
|
8626
8757
|
* Handles both success and failure cases of an effect without performing side
|
|
8627
8758
|
* effects, with eager evaluation for resolved effects.
|
|
8628
8759
|
*
|
|
8760
|
+
* **When to use**
|
|
8761
|
+
*
|
|
8762
|
+
* Use this when you need to handle both success and failure cases and want
|
|
8763
|
+
* optimal performance for resolved effects. This is particularly useful in
|
|
8764
|
+
* scenarios where you frequently work with already computed values.
|
|
8765
|
+
*
|
|
8629
8766
|
* **Details**
|
|
8630
8767
|
*
|
|
8631
8768
|
* `matchEager` works like `match` but provides better performance for resolved
|
|
@@ -8633,12 +8770,6 @@ export declare const matchEager: {
|
|
|
8633
8770
|
* the handlers immediately without fiber scheduling. For unresolved effects,
|
|
8634
8771
|
* it falls back to the regular `match` behavior.
|
|
8635
8772
|
*
|
|
8636
|
-
* **When to Use**
|
|
8637
|
-
*
|
|
8638
|
-
* Use this when you need to handle both success and failure cases and want
|
|
8639
|
-
* optimal performance for resolved effects. This is particularly useful in
|
|
8640
|
-
* scenarios where you frequently work with already computed values.
|
|
8641
|
-
*
|
|
8642
8773
|
* **Example** (Pattern matching eagerly when possible)
|
|
8643
8774
|
*
|
|
8644
8775
|
* ```ts
|
|
@@ -8655,7 +8786,6 @@ export declare const matchEager: {
|
|
|
8655
8786
|
*
|
|
8656
8787
|
* @see {@link match} for the non-eager version.
|
|
8657
8788
|
* @see {@link matchEffect} if you need to perform side effects in the handlers.
|
|
8658
|
-
*
|
|
8659
8789
|
* @category Pattern Matching
|
|
8660
8790
|
* @since 4.0.0
|
|
8661
8791
|
*/
|
|
@@ -8667,17 +8797,17 @@ export declare const matchEager: {
|
|
|
8667
8797
|
/**
|
|
8668
8798
|
* Handles failures by matching the cause of failure.
|
|
8669
8799
|
*
|
|
8670
|
-
* **
|
|
8671
|
-
*
|
|
8672
|
-
* The `matchCause` function allows you to handle failures with access to the
|
|
8673
|
-
* full cause of the failure within a fiber.
|
|
8674
|
-
*
|
|
8675
|
-
* **When to Use**
|
|
8800
|
+
* **When to use**
|
|
8676
8801
|
*
|
|
8677
8802
|
* This is useful for differentiating between different types of errors, such as
|
|
8678
8803
|
* regular failures, defects, or interruptions. You can provide specific
|
|
8679
8804
|
* handling logic for each failure type based on the cause.
|
|
8680
8805
|
*
|
|
8806
|
+
* **Details**
|
|
8807
|
+
*
|
|
8808
|
+
* The `matchCause` function allows you to handle failures with access to the
|
|
8809
|
+
* full cause of the failure within a fiber.
|
|
8810
|
+
*
|
|
8681
8811
|
* **Example** (Matching on success or failure causes)
|
|
8682
8812
|
*
|
|
8683
8813
|
* ```ts
|
|
@@ -8697,7 +8827,6 @@ export declare const matchEager: {
|
|
|
8697
8827
|
* @see {@link matchCauseEffect} if you need to perform side effects in the
|
|
8698
8828
|
* handlers.
|
|
8699
8829
|
* @see {@link match} if you don't need to handle the cause of the failure.
|
|
8700
|
-
*
|
|
8701
8830
|
* @category Pattern Matching
|
|
8702
8831
|
* @since 2.0.0
|
|
8703
8832
|
*/
|
|
@@ -8705,17 +8834,17 @@ export declare const matchCause: {
|
|
|
8705
8834
|
/**
|
|
8706
8835
|
* Handles failures by matching the cause of failure.
|
|
8707
8836
|
*
|
|
8708
|
-
* **
|
|
8709
|
-
*
|
|
8710
|
-
* The `matchCause` function allows you to handle failures with access to the
|
|
8711
|
-
* full cause of the failure within a fiber.
|
|
8712
|
-
*
|
|
8713
|
-
* **When to Use**
|
|
8837
|
+
* **When to use**
|
|
8714
8838
|
*
|
|
8715
8839
|
* This is useful for differentiating between different types of errors, such as
|
|
8716
8840
|
* regular failures, defects, or interruptions. You can provide specific
|
|
8717
8841
|
* handling logic for each failure type based on the cause.
|
|
8718
8842
|
*
|
|
8843
|
+
* **Details**
|
|
8844
|
+
*
|
|
8845
|
+
* The `matchCause` function allows you to handle failures with access to the
|
|
8846
|
+
* full cause of the failure within a fiber.
|
|
8847
|
+
*
|
|
8719
8848
|
* **Example** (Matching on success or failure causes)
|
|
8720
8849
|
*
|
|
8721
8850
|
* ```ts
|
|
@@ -8735,7 +8864,6 @@ export declare const matchCause: {
|
|
|
8735
8864
|
* @see {@link matchCauseEffect} if you need to perform side effects in the
|
|
8736
8865
|
* handlers.
|
|
8737
8866
|
* @see {@link match} if you don't need to handle the cause of the failure.
|
|
8738
|
-
*
|
|
8739
8867
|
* @category Pattern Matching
|
|
8740
8868
|
* @since 2.0.0
|
|
8741
8869
|
*/
|
|
@@ -8746,17 +8874,17 @@ export declare const matchCause: {
|
|
|
8746
8874
|
/**
|
|
8747
8875
|
* Handles failures by matching the cause of failure.
|
|
8748
8876
|
*
|
|
8749
|
-
* **
|
|
8750
|
-
*
|
|
8751
|
-
* The `matchCause` function allows you to handle failures with access to the
|
|
8752
|
-
* full cause of the failure within a fiber.
|
|
8753
|
-
*
|
|
8754
|
-
* **When to Use**
|
|
8877
|
+
* **When to use**
|
|
8755
8878
|
*
|
|
8756
8879
|
* This is useful for differentiating between different types of errors, such as
|
|
8757
8880
|
* regular failures, defects, or interruptions. You can provide specific
|
|
8758
8881
|
* handling logic for each failure type based on the cause.
|
|
8759
8882
|
*
|
|
8883
|
+
* **Details**
|
|
8884
|
+
*
|
|
8885
|
+
* The `matchCause` function allows you to handle failures with access to the
|
|
8886
|
+
* full cause of the failure within a fiber.
|
|
8887
|
+
*
|
|
8760
8888
|
* **Example** (Matching on success or failure causes)
|
|
8761
8889
|
*
|
|
8762
8890
|
* ```ts
|
|
@@ -8776,7 +8904,6 @@ export declare const matchCause: {
|
|
|
8776
8904
|
* @see {@link matchCauseEffect} if you need to perform side effects in the
|
|
8777
8905
|
* handlers.
|
|
8778
8906
|
* @see {@link match} if you don't need to handle the cause of the failure.
|
|
8779
|
-
*
|
|
8780
8907
|
* @category Pattern Matching
|
|
8781
8908
|
* @since 2.0.0
|
|
8782
8909
|
*/
|
|
@@ -8788,18 +8915,18 @@ export declare const matchCause: {
|
|
|
8788
8915
|
/**
|
|
8789
8916
|
* Handles failures by matching the cause of failure with eager evaluation.
|
|
8790
8917
|
*
|
|
8918
|
+
* **When to use**
|
|
8919
|
+
*
|
|
8920
|
+
* This is useful when you have effects that are likely to be already resolved
|
|
8921
|
+
* and you want to avoid the overhead of the effect pipeline. For pending effects,
|
|
8922
|
+
* it automatically falls back to the regular `matchCause` behavior.
|
|
8923
|
+
*
|
|
8791
8924
|
* **Details**
|
|
8792
8925
|
*
|
|
8793
8926
|
* `matchCauseEager` works like `matchCause` but provides better performance for resolved
|
|
8794
8927
|
* effects by immediately applying the matching function instead of deferring it
|
|
8795
8928
|
* through the effect pipeline.
|
|
8796
8929
|
*
|
|
8797
|
-
* **When to Use**
|
|
8798
|
-
*
|
|
8799
|
-
* This is useful when you have effects that are likely to be already resolved
|
|
8800
|
-
* and you want to avoid the overhead of the effect pipeline. For pending effects,
|
|
8801
|
-
* it automatically falls back to the regular `matchCause` behavior.
|
|
8802
|
-
*
|
|
8803
8930
|
* **Example** (Eagerly matching already completed effects)
|
|
8804
8931
|
*
|
|
8805
8932
|
* ```ts
|
|
@@ -8818,18 +8945,18 @@ export declare const matchCauseEager: {
|
|
|
8818
8945
|
/**
|
|
8819
8946
|
* Handles failures by matching the cause of failure with eager evaluation.
|
|
8820
8947
|
*
|
|
8948
|
+
* **When to use**
|
|
8949
|
+
*
|
|
8950
|
+
* This is useful when you have effects that are likely to be already resolved
|
|
8951
|
+
* and you want to avoid the overhead of the effect pipeline. For pending effects,
|
|
8952
|
+
* it automatically falls back to the regular `matchCause` behavior.
|
|
8953
|
+
*
|
|
8821
8954
|
* **Details**
|
|
8822
8955
|
*
|
|
8823
8956
|
* `matchCauseEager` works like `matchCause` but provides better performance for resolved
|
|
8824
8957
|
* effects by immediately applying the matching function instead of deferring it
|
|
8825
8958
|
* through the effect pipeline.
|
|
8826
8959
|
*
|
|
8827
|
-
* **When to Use**
|
|
8828
|
-
*
|
|
8829
|
-
* This is useful when you have effects that are likely to be already resolved
|
|
8830
|
-
* and you want to avoid the overhead of the effect pipeline. For pending effects,
|
|
8831
|
-
* it automatically falls back to the regular `matchCause` behavior.
|
|
8832
|
-
*
|
|
8833
8960
|
* **Example** (Eagerly matching already completed effects)
|
|
8834
8961
|
*
|
|
8835
8962
|
* ```ts
|
|
@@ -8851,18 +8978,18 @@ export declare const matchCauseEager: {
|
|
|
8851
8978
|
/**
|
|
8852
8979
|
* Handles failures by matching the cause of failure with eager evaluation.
|
|
8853
8980
|
*
|
|
8981
|
+
* **When to use**
|
|
8982
|
+
*
|
|
8983
|
+
* This is useful when you have effects that are likely to be already resolved
|
|
8984
|
+
* and you want to avoid the overhead of the effect pipeline. For pending effects,
|
|
8985
|
+
* it automatically falls back to the regular `matchCause` behavior.
|
|
8986
|
+
*
|
|
8854
8987
|
* **Details**
|
|
8855
8988
|
*
|
|
8856
8989
|
* `matchCauseEager` works like `matchCause` but provides better performance for resolved
|
|
8857
8990
|
* effects by immediately applying the matching function instead of deferring it
|
|
8858
8991
|
* through the effect pipeline.
|
|
8859
8992
|
*
|
|
8860
|
-
* **When to Use**
|
|
8861
|
-
*
|
|
8862
|
-
* This is useful when you have effects that are likely to be already resolved
|
|
8863
|
-
* and you want to avoid the overhead of the effect pipeline. For pending effects,
|
|
8864
|
-
* it automatically falls back to the regular `matchCause` behavior.
|
|
8865
|
-
*
|
|
8866
8993
|
* **Example** (Eagerly matching already completed effects)
|
|
8867
8994
|
*
|
|
8868
8995
|
* ```ts
|
|
@@ -8885,6 +9012,8 @@ export declare const matchCauseEager: {
|
|
|
8885
9012
|
/**
|
|
8886
9013
|
* Eagerly handles success or failure with effectful handlers when the effect is already resolved.
|
|
8887
9014
|
*
|
|
9015
|
+
* **Details**
|
|
9016
|
+
*
|
|
8888
9017
|
* If the effect is an `Exit`, the matching handler runs immediately; otherwise it behaves like
|
|
8889
9018
|
* {@link matchCauseEffect}.
|
|
8890
9019
|
*
|
|
@@ -8895,6 +9024,8 @@ export declare const matchCauseEffectEager: {
|
|
|
8895
9024
|
/**
|
|
8896
9025
|
* Eagerly handles success or failure with effectful handlers when the effect is already resolved.
|
|
8897
9026
|
*
|
|
9027
|
+
* **Details**
|
|
9028
|
+
*
|
|
8898
9029
|
* If the effect is an `Exit`, the matching handler runs immediately; otherwise it behaves like
|
|
8899
9030
|
* {@link matchCauseEffect}.
|
|
8900
9031
|
*
|
|
@@ -8908,6 +9039,8 @@ export declare const matchCauseEffectEager: {
|
|
|
8908
9039
|
/**
|
|
8909
9040
|
* Eagerly handles success or failure with effectful handlers when the effect is already resolved.
|
|
8910
9041
|
*
|
|
9042
|
+
* **Details**
|
|
9043
|
+
*
|
|
8911
9044
|
* If the effect is an `Exit`, the matching handler runs immediately; otherwise it behaves like
|
|
8912
9045
|
* {@link matchCauseEffect}.
|
|
8913
9046
|
*
|
|
@@ -9094,19 +9227,16 @@ export declare const matchCauseEffect: {
|
|
|
9094
9227
|
/**
|
|
9095
9228
|
* Handles both success and failure by running effectful handlers.
|
|
9096
9229
|
*
|
|
9230
|
+
* **When to use**
|
|
9231
|
+
*
|
|
9232
|
+
* Use this when the failure or success branch must run additional effects.
|
|
9233
|
+
*
|
|
9097
9234
|
* **Details**
|
|
9098
9235
|
*
|
|
9099
9236
|
* Use `matchEffect` when either branch needs to return an `Effect`, such as
|
|
9100
9237
|
* performing logging, recovery, notification, or other effectful work. The
|
|
9101
9238
|
* returned effect succeeds or fails according to the handler that is run.
|
|
9102
9239
|
*
|
|
9103
|
-
* **When to Use**
|
|
9104
|
-
*
|
|
9105
|
-
* Use this when the failure or success branch must run additional effects.
|
|
9106
|
-
*
|
|
9107
|
-
* @see {@link match} if you don't need side effects and only want to handle the
|
|
9108
|
-
* result or failure.
|
|
9109
|
-
*
|
|
9110
9240
|
* **Example** (Matching success and failure with effectful handlers)
|
|
9111
9241
|
*
|
|
9112
9242
|
* ```ts
|
|
@@ -9148,6 +9278,8 @@ export declare const matchCauseEffect: {
|
|
|
9148
9278
|
* // failure: Uh oh!
|
|
9149
9279
|
* ```
|
|
9150
9280
|
*
|
|
9281
|
+
* @see {@link match} if you don't need side effects and only want to handle the
|
|
9282
|
+
* result or failure.
|
|
9151
9283
|
* @category Pattern Matching
|
|
9152
9284
|
* @since 2.0.0
|
|
9153
9285
|
*/
|
|
@@ -9155,19 +9287,16 @@ export declare const matchEffect: {
|
|
|
9155
9287
|
/**
|
|
9156
9288
|
* Handles both success and failure by running effectful handlers.
|
|
9157
9289
|
*
|
|
9290
|
+
* **When to use**
|
|
9291
|
+
*
|
|
9292
|
+
* Use this when the failure or success branch must run additional effects.
|
|
9293
|
+
*
|
|
9158
9294
|
* **Details**
|
|
9159
9295
|
*
|
|
9160
9296
|
* Use `matchEffect` when either branch needs to return an `Effect`, such as
|
|
9161
9297
|
* performing logging, recovery, notification, or other effectful work. The
|
|
9162
9298
|
* returned effect succeeds or fails according to the handler that is run.
|
|
9163
9299
|
*
|
|
9164
|
-
* **When to Use**
|
|
9165
|
-
*
|
|
9166
|
-
* Use this when the failure or success branch must run additional effects.
|
|
9167
|
-
*
|
|
9168
|
-
* @see {@link match} if you don't need side effects and only want to handle the
|
|
9169
|
-
* result or failure.
|
|
9170
|
-
*
|
|
9171
9300
|
* **Example** (Matching success and failure with effectful handlers)
|
|
9172
9301
|
*
|
|
9173
9302
|
* ```ts
|
|
@@ -9209,6 +9338,8 @@ export declare const matchEffect: {
|
|
|
9209
9338
|
* // failure: Uh oh!
|
|
9210
9339
|
* ```
|
|
9211
9340
|
*
|
|
9341
|
+
* @see {@link match} if you don't need side effects and only want to handle the
|
|
9342
|
+
* result or failure.
|
|
9212
9343
|
* @category Pattern Matching
|
|
9213
9344
|
* @since 2.0.0
|
|
9214
9345
|
*/
|
|
@@ -9219,19 +9350,16 @@ export declare const matchEffect: {
|
|
|
9219
9350
|
/**
|
|
9220
9351
|
* Handles both success and failure by running effectful handlers.
|
|
9221
9352
|
*
|
|
9353
|
+
* **When to use**
|
|
9354
|
+
*
|
|
9355
|
+
* Use this when the failure or success branch must run additional effects.
|
|
9356
|
+
*
|
|
9222
9357
|
* **Details**
|
|
9223
9358
|
*
|
|
9224
9359
|
* Use `matchEffect` when either branch needs to return an `Effect`, such as
|
|
9225
9360
|
* performing logging, recovery, notification, or other effectful work. The
|
|
9226
9361
|
* returned effect succeeds or fails according to the handler that is run.
|
|
9227
9362
|
*
|
|
9228
|
-
* **When to Use**
|
|
9229
|
-
*
|
|
9230
|
-
* Use this when the failure or success branch must run additional effects.
|
|
9231
|
-
*
|
|
9232
|
-
* @see {@link match} if you don't need side effects and only want to handle the
|
|
9233
|
-
* result or failure.
|
|
9234
|
-
*
|
|
9235
9363
|
* **Example** (Matching success and failure with effectful handlers)
|
|
9236
9364
|
*
|
|
9237
9365
|
* ```ts
|
|
@@ -9273,6 +9401,8 @@ export declare const matchEffect: {
|
|
|
9273
9401
|
* // failure: Uh oh!
|
|
9274
9402
|
* ```
|
|
9275
9403
|
*
|
|
9404
|
+
* @see {@link match} if you don't need side effects and only want to handle the
|
|
9405
|
+
* result or failure.
|
|
9276
9406
|
* @category Pattern Matching
|
|
9277
9407
|
* @since 2.0.0
|
|
9278
9408
|
*/
|
|
@@ -9284,6 +9414,8 @@ export declare const matchEffect: {
|
|
|
9284
9414
|
/**
|
|
9285
9415
|
* Determines whether an effect fails.
|
|
9286
9416
|
*
|
|
9417
|
+
* **Details**
|
|
9418
|
+
*
|
|
9287
9419
|
* Defects are not converted; if the effect dies, the resulting effect dies too.
|
|
9288
9420
|
*
|
|
9289
9421
|
* **Example** (Checking whether an effect fails)
|
|
@@ -9307,6 +9439,8 @@ export declare const isFailure: <A, E, R>(self: Effect<A, E, R>) => Effect<boole
|
|
|
9307
9439
|
/**
|
|
9308
9440
|
* Returns whether an effect completes successfully.
|
|
9309
9441
|
*
|
|
9442
|
+
* **Details**
|
|
9443
|
+
*
|
|
9310
9444
|
* Returns `false` for failures in the error channel, but defects still fail the
|
|
9311
9445
|
* effect.
|
|
9312
9446
|
*
|
|
@@ -9335,6 +9469,8 @@ export declare const isSuccess: <A, E, R>(self: Effect<A, E, R>) => Effect<boole
|
|
|
9335
9469
|
/**
|
|
9336
9470
|
* Returns the complete context.
|
|
9337
9471
|
*
|
|
9472
|
+
* **Details**
|
|
9473
|
+
*
|
|
9338
9474
|
* This function allows you to access all services that are currently available
|
|
9339
9475
|
* in the effect's environment. This can be useful for debugging, introspection,
|
|
9340
9476
|
* or when you need to pass the entire context to another function.
|
|
@@ -9375,6 +9511,8 @@ export declare const context: <R = never>() => Effect<Context.Context<R>, never,
|
|
|
9375
9511
|
/**
|
|
9376
9512
|
* Transforms the current context using the provided function.
|
|
9377
9513
|
*
|
|
9514
|
+
* **Details**
|
|
9515
|
+
*
|
|
9378
9516
|
* This function allows you to access the complete context and perform
|
|
9379
9517
|
* computations based on all available services. This is useful when you need
|
|
9380
9518
|
* to conditionally execute logic based on what services are available.
|
|
@@ -9987,6 +10125,8 @@ export declare const updateContext: {
|
|
|
9987
10125
|
* Runs an effect with a service implementation transformed by the provided
|
|
9988
10126
|
* function.
|
|
9989
10127
|
*
|
|
10128
|
+
* **Details**
|
|
10129
|
+
*
|
|
9990
10130
|
* The service must be available in the effect's context; `updateService`
|
|
9991
10131
|
* replaces it for the wrapped effect with the value returned by the updater.
|
|
9992
10132
|
*
|
|
@@ -10021,6 +10161,8 @@ export declare const updateService: {
|
|
|
10021
10161
|
* Runs an effect with a service implementation transformed by the provided
|
|
10022
10162
|
* function.
|
|
10023
10163
|
*
|
|
10164
|
+
* **Details**
|
|
10165
|
+
*
|
|
10024
10166
|
* The service must be available in the effect's context; `updateService`
|
|
10025
10167
|
* replaces it for the wrapped effect with the value returned by the updater.
|
|
10026
10168
|
*
|
|
@@ -10055,6 +10197,8 @@ export declare const updateService: {
|
|
|
10055
10197
|
* Runs an effect with a service implementation transformed by the provided
|
|
10056
10198
|
* function.
|
|
10057
10199
|
*
|
|
10200
|
+
* **Details**
|
|
10201
|
+
*
|
|
10058
10202
|
* The service must be available in the effect's context; `updateService`
|
|
10059
10203
|
* replaces it for the wrapped effect with the value returned by the updater.
|
|
10060
10204
|
*
|
|
@@ -10090,14 +10234,14 @@ export declare const updateService: {
|
|
|
10090
10234
|
* The `provideService` function is used to provide an actual
|
|
10091
10235
|
* implementation for a service in the context of an effect.
|
|
10092
10236
|
*
|
|
10237
|
+
* **Details**
|
|
10238
|
+
*
|
|
10093
10239
|
* This function allows you to associate a service with its implementation so
|
|
10094
10240
|
* that it can be used in your program. You define the service (e.g., a random
|
|
10095
10241
|
* number generator), and then you use `provideService` to link that
|
|
10096
10242
|
* service to its implementation. Once the implementation is provided, the
|
|
10097
10243
|
* effect can be run successfully without further requirements.
|
|
10098
10244
|
*
|
|
10099
|
-
* @see {@link provide} for providing multiple layers to an effect.
|
|
10100
|
-
*
|
|
10101
10245
|
* **Example** (Providing a service value)
|
|
10102
10246
|
*
|
|
10103
10247
|
* ```ts
|
|
@@ -10129,6 +10273,7 @@ export declare const updateService: {
|
|
|
10129
10273
|
* // data
|
|
10130
10274
|
* ```
|
|
10131
10275
|
*
|
|
10276
|
+
* @see {@link provide} for providing multiple layers to an effect.
|
|
10132
10277
|
* @category Context
|
|
10133
10278
|
* @since 2.0.0
|
|
10134
10279
|
*/
|
|
@@ -10137,14 +10282,14 @@ export declare const provideService: {
|
|
|
10137
10282
|
* The `provideService` function is used to provide an actual
|
|
10138
10283
|
* implementation for a service in the context of an effect.
|
|
10139
10284
|
*
|
|
10285
|
+
* **Details**
|
|
10286
|
+
*
|
|
10140
10287
|
* This function allows you to associate a service with its implementation so
|
|
10141
10288
|
* that it can be used in your program. You define the service (e.g., a random
|
|
10142
10289
|
* number generator), and then you use `provideService` to link that
|
|
10143
10290
|
* service to its implementation. Once the implementation is provided, the
|
|
10144
10291
|
* effect can be run successfully without further requirements.
|
|
10145
10292
|
*
|
|
10146
|
-
* @see {@link provide} for providing multiple layers to an effect.
|
|
10147
|
-
*
|
|
10148
10293
|
* **Example** (Providing a service value)
|
|
10149
10294
|
*
|
|
10150
10295
|
* ```ts
|
|
@@ -10176,6 +10321,7 @@ export declare const provideService: {
|
|
|
10176
10321
|
* // data
|
|
10177
10322
|
* ```
|
|
10178
10323
|
*
|
|
10324
|
+
* @see {@link provide} for providing multiple layers to an effect.
|
|
10179
10325
|
* @category Context
|
|
10180
10326
|
* @since 2.0.0
|
|
10181
10327
|
*/
|
|
@@ -10184,14 +10330,14 @@ export declare const provideService: {
|
|
|
10184
10330
|
* The `provideService` function is used to provide an actual
|
|
10185
10331
|
* implementation for a service in the context of an effect.
|
|
10186
10332
|
*
|
|
10333
|
+
* **Details**
|
|
10334
|
+
*
|
|
10187
10335
|
* This function allows you to associate a service with its implementation so
|
|
10188
10336
|
* that it can be used in your program. You define the service (e.g., a random
|
|
10189
10337
|
* number generator), and then you use `provideService` to link that
|
|
10190
10338
|
* service to its implementation. Once the implementation is provided, the
|
|
10191
10339
|
* effect can be run successfully without further requirements.
|
|
10192
10340
|
*
|
|
10193
|
-
* @see {@link provide} for providing multiple layers to an effect.
|
|
10194
|
-
*
|
|
10195
10341
|
* **Example** (Providing a service value)
|
|
10196
10342
|
*
|
|
10197
10343
|
* ```ts
|
|
@@ -10223,6 +10369,7 @@ export declare const provideService: {
|
|
|
10223
10369
|
* // data
|
|
10224
10370
|
* ```
|
|
10225
10371
|
*
|
|
10372
|
+
* @see {@link provide} for providing multiple layers to an effect.
|
|
10226
10373
|
* @category Context
|
|
10227
10374
|
* @since 2.0.0
|
|
10228
10375
|
*/
|
|
@@ -10231,14 +10378,14 @@ export declare const provideService: {
|
|
|
10231
10378
|
* The `provideService` function is used to provide an actual
|
|
10232
10379
|
* implementation for a service in the context of an effect.
|
|
10233
10380
|
*
|
|
10381
|
+
* **Details**
|
|
10382
|
+
*
|
|
10234
10383
|
* This function allows you to associate a service with its implementation so
|
|
10235
10384
|
* that it can be used in your program. You define the service (e.g., a random
|
|
10236
10385
|
* number generator), and then you use `provideService` to link that
|
|
10237
10386
|
* service to its implementation. Once the implementation is provided, the
|
|
10238
10387
|
* effect can be run successfully without further requirements.
|
|
10239
10388
|
*
|
|
10240
|
-
* @see {@link provide} for providing multiple layers to an effect.
|
|
10241
|
-
*
|
|
10242
10389
|
* **Example** (Providing a service value)
|
|
10243
10390
|
*
|
|
10244
10391
|
* ```ts
|
|
@@ -10270,6 +10417,7 @@ export declare const provideService: {
|
|
|
10270
10417
|
* // data
|
|
10271
10418
|
* ```
|
|
10272
10419
|
*
|
|
10420
|
+
* @see {@link provide} for providing multiple layers to an effect.
|
|
10273
10421
|
* @category Context
|
|
10274
10422
|
* @since 2.0.0
|
|
10275
10423
|
*/
|
|
@@ -10279,14 +10427,14 @@ export declare const provideService: {
|
|
|
10279
10427
|
* The `provideService` function is used to provide an actual
|
|
10280
10428
|
* implementation for a service in the context of an effect.
|
|
10281
10429
|
*
|
|
10430
|
+
* **Details**
|
|
10431
|
+
*
|
|
10282
10432
|
* This function allows you to associate a service with its implementation so
|
|
10283
10433
|
* that it can be used in your program. You define the service (e.g., a random
|
|
10284
10434
|
* number generator), and then you use `provideService` to link that
|
|
10285
10435
|
* service to its implementation. Once the implementation is provided, the
|
|
10286
10436
|
* effect can be run successfully without further requirements.
|
|
10287
10437
|
*
|
|
10288
|
-
* @see {@link provide} for providing multiple layers to an effect.
|
|
10289
|
-
*
|
|
10290
10438
|
* **Example** (Providing a service value)
|
|
10291
10439
|
*
|
|
10292
10440
|
* ```ts
|
|
@@ -10318,6 +10466,7 @@ export declare const provideService: {
|
|
|
10318
10466
|
* // data
|
|
10319
10467
|
* ```
|
|
10320
10468
|
*
|
|
10469
|
+
* @see {@link provide} for providing multiple layers to an effect.
|
|
10321
10470
|
* @category Context
|
|
10322
10471
|
* @since 2.0.0
|
|
10323
10472
|
*/
|
|
@@ -10326,14 +10475,14 @@ export declare const provideService: {
|
|
|
10326
10475
|
* The `provideService` function is used to provide an actual
|
|
10327
10476
|
* implementation for a service in the context of an effect.
|
|
10328
10477
|
*
|
|
10478
|
+
* **Details**
|
|
10479
|
+
*
|
|
10329
10480
|
* This function allows you to associate a service with its implementation so
|
|
10330
10481
|
* that it can be used in your program. You define the service (e.g., a random
|
|
10331
10482
|
* number generator), and then you use `provideService` to link that
|
|
10332
10483
|
* service to its implementation. Once the implementation is provided, the
|
|
10333
10484
|
* effect can be run successfully without further requirements.
|
|
10334
10485
|
*
|
|
10335
|
-
* @see {@link provide} for providing multiple layers to an effect.
|
|
10336
|
-
*
|
|
10337
10486
|
* **Example** (Providing a service value)
|
|
10338
10487
|
*
|
|
10339
10488
|
* ```ts
|
|
@@ -10365,6 +10514,7 @@ export declare const provideService: {
|
|
|
10365
10514
|
* // data
|
|
10366
10515
|
* ```
|
|
10367
10516
|
*
|
|
10517
|
+
* @see {@link provide} for providing multiple layers to an effect.
|
|
10368
10518
|
* @category Context
|
|
10369
10519
|
* @since 2.0.0
|
|
10370
10520
|
*/
|
|
@@ -10800,6 +10950,8 @@ export declare const acquireRelease: <A, E, R, R2>(acquire: Effect<A, E, R>, rel
|
|
|
10800
10950
|
* This function constructs a scoped resource from an Effect that acquires a
|
|
10801
10951
|
* disposable value.
|
|
10802
10952
|
*
|
|
10953
|
+
* **Details**
|
|
10954
|
+
*
|
|
10803
10955
|
* The resource is automatically disposed when the surrounding
|
|
10804
10956
|
* {@link Scope} is closed, using {@link Symbol.dispose} for
|
|
10805
10957
|
* synchronous disposables or {@link Symbol.asyncDispose} for asynchronous
|
|
@@ -10809,8 +10961,6 @@ export declare const acquireRelease: <A, E, R, R2>(acquire: Effect<A, E, R>, rel
|
|
|
10809
10961
|
* JavaScript disposal protocal instead of requiring an explicit release
|
|
10810
10962
|
* function.
|
|
10811
10963
|
*
|
|
10812
|
-
* @see [JavaScript `using` declarations](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/using)
|
|
10813
|
-
*
|
|
10814
10964
|
* **Example** (Acquiring a disposable resource)
|
|
10815
10965
|
*
|
|
10816
10966
|
* ```ts
|
|
@@ -10831,6 +10981,7 @@ export declare const acquireRelease: <A, E, R, R2>(acquire: Effect<A, E, R>, rel
|
|
|
10831
10981
|
* )
|
|
10832
10982
|
* ```
|
|
10833
10983
|
*
|
|
10984
|
+
* @see [JavaScript `using` declarations](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/using)
|
|
10834
10985
|
* @category resource management
|
|
10835
10986
|
* @since 4.0.0
|
|
10836
10987
|
*/
|
|
@@ -10841,6 +10992,8 @@ export declare const acquireDisposable: <A extends AsyncDisposable | Disposable,
|
|
|
10841
10992
|
* etc.) will not be interrupted, and that the resource will always be released
|
|
10842
10993
|
* when the `Effect` value completes execution.
|
|
10843
10994
|
*
|
|
10995
|
+
* **Details**
|
|
10996
|
+
*
|
|
10844
10997
|
* `acquireUseRelease` does the following:
|
|
10845
10998
|
*
|
|
10846
10999
|
* 1. Ensures that the `Effect` value that acquires the resource will not be
|
|
@@ -10913,6 +11066,8 @@ export declare const acquireUseRelease: <Resource, E, R, A, E2, R2, E3, R3>(acqu
|
|
|
10913
11066
|
* The finalizer is guaranteed to be run when the scope is closed, and it may
|
|
10914
11067
|
* depend on the `Exit` value that the scope is closed with.
|
|
10915
11068
|
*
|
|
11069
|
+
* **Details**
|
|
11070
|
+
*
|
|
10916
11071
|
* Finalizers are useful for cleanup operations that must run regardless of
|
|
10917
11072
|
* whether the effect succeeds or fails. They're commonly used for resource
|
|
10918
11073
|
* cleanup, logging, or other side effects that should always occur.
|
|
@@ -10956,6 +11111,8 @@ export declare const addFinalizer: <R>(finalizer: (exit: Exit.Exit<unknown, unkn
|
|
|
10956
11111
|
* specified `finalizer` is guaranteed to be executed, whether this effect
|
|
10957
11112
|
* succeeds, fails, or is interrupted.
|
|
10958
11113
|
*
|
|
11114
|
+
* **Details**
|
|
11115
|
+
*
|
|
10959
11116
|
* For use cases that need access to the effect's result, see `onExit`.
|
|
10960
11117
|
*
|
|
10961
11118
|
* Finalizers offer very powerful guarantees, but they are low-level, and
|
|
@@ -10997,6 +11154,8 @@ export declare const ensuring: {
|
|
|
10997
11154
|
* specified `finalizer` is guaranteed to be executed, whether this effect
|
|
10998
11155
|
* succeeds, fails, or is interrupted.
|
|
10999
11156
|
*
|
|
11157
|
+
* **Details**
|
|
11158
|
+
*
|
|
11000
11159
|
* For use cases that need access to the effect's result, see `onExit`.
|
|
11001
11160
|
*
|
|
11002
11161
|
* Finalizers offer very powerful guarantees, but they are low-level, and
|
|
@@ -11038,6 +11197,8 @@ export declare const ensuring: {
|
|
|
11038
11197
|
* specified `finalizer` is guaranteed to be executed, whether this effect
|
|
11039
11198
|
* succeeds, fails, or is interrupted.
|
|
11040
11199
|
*
|
|
11200
|
+
* **Details**
|
|
11201
|
+
*
|
|
11041
11202
|
* For use cases that need access to the effect's result, see `onExit`.
|
|
11042
11203
|
*
|
|
11043
11204
|
* Finalizers offer very powerful guarantees, but they are low-level, and
|
|
@@ -11452,24 +11613,19 @@ export declare const onExitFilter: {
|
|
|
11452
11613
|
* Returns an effect that lazily computes a result and caches it for subsequent
|
|
11453
11614
|
* evaluations.
|
|
11454
11615
|
*
|
|
11455
|
-
* **
|
|
11456
|
-
*
|
|
11457
|
-
* This function wraps an effect and ensures that its result is computed only
|
|
11458
|
-
* once. Once the result is computed, it is cached, meaning that subsequent
|
|
11459
|
-
* evaluations of the same effect will return the cached result without
|
|
11460
|
-
* re-executing the logic.
|
|
11461
|
-
*
|
|
11462
|
-
* **When to Use**
|
|
11616
|
+
* **When to use**
|
|
11463
11617
|
*
|
|
11464
11618
|
* Use this function when you have an expensive or time-consuming operation that
|
|
11465
11619
|
* you want to avoid repeating. The first evaluation will compute the result,
|
|
11466
11620
|
* and all following evaluations will immediately return the cached value,
|
|
11467
11621
|
* improving performance and reducing unnecessary work.
|
|
11468
11622
|
*
|
|
11469
|
-
*
|
|
11470
|
-
*
|
|
11471
|
-
*
|
|
11472
|
-
*
|
|
11623
|
+
* **Details**
|
|
11624
|
+
*
|
|
11625
|
+
* This function wraps an effect and ensures that its result is computed only
|
|
11626
|
+
* once. Once the result is computed, it is cached, meaning that subsequent
|
|
11627
|
+
* evaluations of the same effect will return the cached result without
|
|
11628
|
+
* re-executing the logic.
|
|
11473
11629
|
*
|
|
11474
11630
|
* **Example** (Memoizing an effect until invalidated)
|
|
11475
11631
|
*
|
|
@@ -11509,6 +11665,10 @@ export declare const onExitFilter: {
|
|
|
11509
11665
|
* // result 3
|
|
11510
11666
|
* ```
|
|
11511
11667
|
*
|
|
11668
|
+
* @see {@link cachedWithTTL} for a similar function that includes a
|
|
11669
|
+
* time-to-live duration for the cached value.
|
|
11670
|
+
* @see {@link cachedInvalidateWithTTL} for a similar function that includes an
|
|
11671
|
+
* additional effect for manually invalidating the cached value.
|
|
11512
11672
|
* @category Caching
|
|
11513
11673
|
* @since 2.0.0
|
|
11514
11674
|
*/
|
|
@@ -11517,6 +11677,17 @@ export declare const cached: <A, E, R>(self: Effect<A, E, R>) => Effect<Effect<A
|
|
|
11517
11677
|
* Returns an effect that caches its result for a specified `Duration`,
|
|
11518
11678
|
* known as "timeToLive" (TTL).
|
|
11519
11679
|
*
|
|
11680
|
+
* **When to use**
|
|
11681
|
+
*
|
|
11682
|
+
* Use this function when you have an effect that involves costly operations or
|
|
11683
|
+
* computations, and you want to avoid repeating them within a short time frame.
|
|
11684
|
+
*
|
|
11685
|
+
* It's ideal for scenarios where the result of an effect doesn't change
|
|
11686
|
+
* frequently and can be reused for a specified duration.
|
|
11687
|
+
*
|
|
11688
|
+
* By caching the result, you can improve efficiency and reduce unnecessary
|
|
11689
|
+
* computations, especially in performance-critical applications.
|
|
11690
|
+
*
|
|
11520
11691
|
* **Details**
|
|
11521
11692
|
*
|
|
11522
11693
|
* This function is used to cache the result of an effect for a specified amount
|
|
@@ -11529,22 +11700,6 @@ export declare const cached: <A, E, R>(self: Effect<A, E, R>) => Effect<Effect<A
|
|
|
11529
11700
|
* After the specified duration has passed, the cache expires, and the effect
|
|
11530
11701
|
* will be recomputed upon the next evaluation.
|
|
11531
11702
|
*
|
|
11532
|
-
* **When to Use**
|
|
11533
|
-
*
|
|
11534
|
-
* Use this function when you have an effect that involves costly operations or
|
|
11535
|
-
* computations, and you want to avoid repeating them within a short time frame.
|
|
11536
|
-
*
|
|
11537
|
-
* It's ideal for scenarios where the result of an effect doesn't change
|
|
11538
|
-
* frequently and can be reused for a specified duration.
|
|
11539
|
-
*
|
|
11540
|
-
* By caching the result, you can improve efficiency and reduce unnecessary
|
|
11541
|
-
* computations, especially in performance-critical applications.
|
|
11542
|
-
*
|
|
11543
|
-
* @see {@link cached} for a similar function that caches the result
|
|
11544
|
-
* indefinitely.
|
|
11545
|
-
* @see {@link cachedInvalidateWithTTL} for a similar function that includes an
|
|
11546
|
-
* additional effect for manually invalidating the cached value.
|
|
11547
|
-
*
|
|
11548
11703
|
* **Example** (Memoizing an effect with TTL)
|
|
11549
11704
|
*
|
|
11550
11705
|
* ```ts
|
|
@@ -11577,6 +11732,10 @@ export declare const cached: <A, E, R>(self: Effect<A, E, R>) => Effect<Effect<A
|
|
|
11577
11732
|
* // result 2
|
|
11578
11733
|
* ```
|
|
11579
11734
|
*
|
|
11735
|
+
* @see {@link cached} for a similar function that caches the result
|
|
11736
|
+
* indefinitely.
|
|
11737
|
+
* @see {@link cachedInvalidateWithTTL} for a similar function that includes an
|
|
11738
|
+
* additional effect for manually invalidating the cached value.
|
|
11580
11739
|
* @category Caching
|
|
11581
11740
|
* @since 2.0.0
|
|
11582
11741
|
*/
|
|
@@ -11585,6 +11744,17 @@ export declare const cachedWithTTL: {
|
|
|
11585
11744
|
* Returns an effect that caches its result for a specified `Duration`,
|
|
11586
11745
|
* known as "timeToLive" (TTL).
|
|
11587
11746
|
*
|
|
11747
|
+
* **When to use**
|
|
11748
|
+
*
|
|
11749
|
+
* Use this function when you have an effect that involves costly operations or
|
|
11750
|
+
* computations, and you want to avoid repeating them within a short time frame.
|
|
11751
|
+
*
|
|
11752
|
+
* It's ideal for scenarios where the result of an effect doesn't change
|
|
11753
|
+
* frequently and can be reused for a specified duration.
|
|
11754
|
+
*
|
|
11755
|
+
* By caching the result, you can improve efficiency and reduce unnecessary
|
|
11756
|
+
* computations, especially in performance-critical applications.
|
|
11757
|
+
*
|
|
11588
11758
|
* **Details**
|
|
11589
11759
|
*
|
|
11590
11760
|
* This function is used to cache the result of an effect for a specified amount
|
|
@@ -11597,22 +11767,6 @@ export declare const cachedWithTTL: {
|
|
|
11597
11767
|
* After the specified duration has passed, the cache expires, and the effect
|
|
11598
11768
|
* will be recomputed upon the next evaluation.
|
|
11599
11769
|
*
|
|
11600
|
-
* **When to Use**
|
|
11601
|
-
*
|
|
11602
|
-
* Use this function when you have an effect that involves costly operations or
|
|
11603
|
-
* computations, and you want to avoid repeating them within a short time frame.
|
|
11604
|
-
*
|
|
11605
|
-
* It's ideal for scenarios where the result of an effect doesn't change
|
|
11606
|
-
* frequently and can be reused for a specified duration.
|
|
11607
|
-
*
|
|
11608
|
-
* By caching the result, you can improve efficiency and reduce unnecessary
|
|
11609
|
-
* computations, especially in performance-critical applications.
|
|
11610
|
-
*
|
|
11611
|
-
* @see {@link cached} for a similar function that caches the result
|
|
11612
|
-
* indefinitely.
|
|
11613
|
-
* @see {@link cachedInvalidateWithTTL} for a similar function that includes an
|
|
11614
|
-
* additional effect for manually invalidating the cached value.
|
|
11615
|
-
*
|
|
11616
11770
|
* **Example** (Memoizing an effect with TTL)
|
|
11617
11771
|
*
|
|
11618
11772
|
* ```ts
|
|
@@ -11645,6 +11799,10 @@ export declare const cachedWithTTL: {
|
|
|
11645
11799
|
* // result 2
|
|
11646
11800
|
* ```
|
|
11647
11801
|
*
|
|
11802
|
+
* @see {@link cached} for a similar function that caches the result
|
|
11803
|
+
* indefinitely.
|
|
11804
|
+
* @see {@link cachedInvalidateWithTTL} for a similar function that includes an
|
|
11805
|
+
* additional effect for manually invalidating the cached value.
|
|
11648
11806
|
* @category Caching
|
|
11649
11807
|
* @since 2.0.0
|
|
11650
11808
|
*/
|
|
@@ -11653,19 +11811,7 @@ export declare const cachedWithTTL: {
|
|
|
11653
11811
|
* Returns an effect that caches its result for a specified `Duration`,
|
|
11654
11812
|
* known as "timeToLive" (TTL).
|
|
11655
11813
|
*
|
|
11656
|
-
* **
|
|
11657
|
-
*
|
|
11658
|
-
* This function is used to cache the result of an effect for a specified amount
|
|
11659
|
-
* of time. This means that the first time the effect is evaluated, its result
|
|
11660
|
-
* is computed and stored.
|
|
11661
|
-
*
|
|
11662
|
-
* If the effect is evaluated again within the specified `timeToLive`, the
|
|
11663
|
-
* cached result will be used, avoiding recomputation.
|
|
11664
|
-
*
|
|
11665
|
-
* After the specified duration has passed, the cache expires, and the effect
|
|
11666
|
-
* will be recomputed upon the next evaluation.
|
|
11667
|
-
*
|
|
11668
|
-
* **When to Use**
|
|
11814
|
+
* **When to use**
|
|
11669
11815
|
*
|
|
11670
11816
|
* Use this function when you have an effect that involves costly operations or
|
|
11671
11817
|
* computations, and you want to avoid repeating them within a short time frame.
|
|
@@ -11676,10 +11822,17 @@ export declare const cachedWithTTL: {
|
|
|
11676
11822
|
* By caching the result, you can improve efficiency and reduce unnecessary
|
|
11677
11823
|
* computations, especially in performance-critical applications.
|
|
11678
11824
|
*
|
|
11679
|
-
*
|
|
11680
|
-
*
|
|
11681
|
-
*
|
|
11682
|
-
*
|
|
11825
|
+
* **Details**
|
|
11826
|
+
*
|
|
11827
|
+
* This function is used to cache the result of an effect for a specified amount
|
|
11828
|
+
* of time. This means that the first time the effect is evaluated, its result
|
|
11829
|
+
* is computed and stored.
|
|
11830
|
+
*
|
|
11831
|
+
* If the effect is evaluated again within the specified `timeToLive`, the
|
|
11832
|
+
* cached result will be used, avoiding recomputation.
|
|
11833
|
+
*
|
|
11834
|
+
* After the specified duration has passed, the cache expires, and the effect
|
|
11835
|
+
* will be recomputed upon the next evaluation.
|
|
11683
11836
|
*
|
|
11684
11837
|
* **Example** (Memoizing an effect with TTL)
|
|
11685
11838
|
*
|
|
@@ -11713,6 +11866,10 @@ export declare const cachedWithTTL: {
|
|
|
11713
11866
|
* // result 2
|
|
11714
11867
|
* ```
|
|
11715
11868
|
*
|
|
11869
|
+
* @see {@link cached} for a similar function that caches the result
|
|
11870
|
+
* indefinitely.
|
|
11871
|
+
* @see {@link cachedInvalidateWithTTL} for a similar function that includes an
|
|
11872
|
+
* additional effect for manually invalidating the cached value.
|
|
11716
11873
|
* @category Caching
|
|
11717
11874
|
* @since 2.0.0
|
|
11718
11875
|
*/
|
|
@@ -11722,6 +11879,16 @@ export declare const cachedWithTTL: {
|
|
|
11722
11879
|
* Caches an effect's result for a specified duration and allows manual
|
|
11723
11880
|
* invalidation before expiration.
|
|
11724
11881
|
*
|
|
11882
|
+
* **When to use**
|
|
11883
|
+
*
|
|
11884
|
+
* Use this function when you have an effect whose result needs to be cached for
|
|
11885
|
+
* a certain period, but you also want the option to refresh the cache manually
|
|
11886
|
+
* before the expiration time.
|
|
11887
|
+
*
|
|
11888
|
+
* This is useful when you need to ensure that the cached data remains valid for
|
|
11889
|
+
* a certain period but still want to invalidate it if the underlying data
|
|
11890
|
+
* changes or if you want to force a recomputation.
|
|
11891
|
+
*
|
|
11725
11892
|
* **Details**
|
|
11726
11893
|
*
|
|
11727
11894
|
* This function behaves similarly to {@link cachedWithTTL} by caching the
|
|
@@ -11735,21 +11902,6 @@ export declare const cachedWithTTL: {
|
|
|
11735
11902
|
* Once the cache is invalidated, the next time the effect is evaluated, the
|
|
11736
11903
|
* result will be recomputed, and the cache will be refreshed.
|
|
11737
11904
|
*
|
|
11738
|
-
* **When to Use**
|
|
11739
|
-
*
|
|
11740
|
-
* Use this function when you have an effect whose result needs to be cached for
|
|
11741
|
-
* a certain period, but you also want the option to refresh the cache manually
|
|
11742
|
-
* before the expiration time.
|
|
11743
|
-
*
|
|
11744
|
-
* This is useful when you need to ensure that the cached data remains valid for
|
|
11745
|
-
* a certain period but still want to invalidate it if the underlying data
|
|
11746
|
-
* changes or if you want to force a recomputation.
|
|
11747
|
-
*
|
|
11748
|
-
* @see {@link cached} for a similar function that caches the result
|
|
11749
|
-
* indefinitely.
|
|
11750
|
-
* @see {@link cachedWithTTL} for a similar function that caches the result for
|
|
11751
|
-
* a specified duration but does not include an effect for manual invalidation.
|
|
11752
|
-
*
|
|
11753
11905
|
* **Example** (Memoizing with TTL and invalidation)
|
|
11754
11906
|
*
|
|
11755
11907
|
* ```ts
|
|
@@ -11785,6 +11937,10 @@ export declare const cachedWithTTL: {
|
|
|
11785
11937
|
* // result 2
|
|
11786
11938
|
* ```
|
|
11787
11939
|
*
|
|
11940
|
+
* @see {@link cached} for a similar function that caches the result
|
|
11941
|
+
* indefinitely.
|
|
11942
|
+
* @see {@link cachedWithTTL} for a similar function that caches the result for
|
|
11943
|
+
* a specified duration but does not include an effect for manual invalidation.
|
|
11788
11944
|
* @category Caching
|
|
11789
11945
|
* @since 2.0.0
|
|
11790
11946
|
*/
|
|
@@ -11793,6 +11949,16 @@ export declare const cachedInvalidateWithTTL: {
|
|
|
11793
11949
|
* Caches an effect's result for a specified duration and allows manual
|
|
11794
11950
|
* invalidation before expiration.
|
|
11795
11951
|
*
|
|
11952
|
+
* **When to use**
|
|
11953
|
+
*
|
|
11954
|
+
* Use this function when you have an effect whose result needs to be cached for
|
|
11955
|
+
* a certain period, but you also want the option to refresh the cache manually
|
|
11956
|
+
* before the expiration time.
|
|
11957
|
+
*
|
|
11958
|
+
* This is useful when you need to ensure that the cached data remains valid for
|
|
11959
|
+
* a certain period but still want to invalidate it if the underlying data
|
|
11960
|
+
* changes or if you want to force a recomputation.
|
|
11961
|
+
*
|
|
11796
11962
|
* **Details**
|
|
11797
11963
|
*
|
|
11798
11964
|
* This function behaves similarly to {@link cachedWithTTL} by caching the
|
|
@@ -11806,21 +11972,6 @@ export declare const cachedInvalidateWithTTL: {
|
|
|
11806
11972
|
* Once the cache is invalidated, the next time the effect is evaluated, the
|
|
11807
11973
|
* result will be recomputed, and the cache will be refreshed.
|
|
11808
11974
|
*
|
|
11809
|
-
* **When to Use**
|
|
11810
|
-
*
|
|
11811
|
-
* Use this function when you have an effect whose result needs to be cached for
|
|
11812
|
-
* a certain period, but you also want the option to refresh the cache manually
|
|
11813
|
-
* before the expiration time.
|
|
11814
|
-
*
|
|
11815
|
-
* This is useful when you need to ensure that the cached data remains valid for
|
|
11816
|
-
* a certain period but still want to invalidate it if the underlying data
|
|
11817
|
-
* changes or if you want to force a recomputation.
|
|
11818
|
-
*
|
|
11819
|
-
* @see {@link cached} for a similar function that caches the result
|
|
11820
|
-
* indefinitely.
|
|
11821
|
-
* @see {@link cachedWithTTL} for a similar function that caches the result for
|
|
11822
|
-
* a specified duration but does not include an effect for manual invalidation.
|
|
11823
|
-
*
|
|
11824
11975
|
* **Example** (Memoizing with TTL and invalidation)
|
|
11825
11976
|
*
|
|
11826
11977
|
* ```ts
|
|
@@ -11856,6 +12007,10 @@ export declare const cachedInvalidateWithTTL: {
|
|
|
11856
12007
|
* // result 2
|
|
11857
12008
|
* ```
|
|
11858
12009
|
*
|
|
12010
|
+
* @see {@link cached} for a similar function that caches the result
|
|
12011
|
+
* indefinitely.
|
|
12012
|
+
* @see {@link cachedWithTTL} for a similar function that caches the result for
|
|
12013
|
+
* a specified duration but does not include an effect for manual invalidation.
|
|
11859
12014
|
* @category Caching
|
|
11860
12015
|
* @since 2.0.0
|
|
11861
12016
|
*/
|
|
@@ -11864,6 +12019,16 @@ export declare const cachedInvalidateWithTTL: {
|
|
|
11864
12019
|
* Caches an effect's result for a specified duration and allows manual
|
|
11865
12020
|
* invalidation before expiration.
|
|
11866
12021
|
*
|
|
12022
|
+
* **When to use**
|
|
12023
|
+
*
|
|
12024
|
+
* Use this function when you have an effect whose result needs to be cached for
|
|
12025
|
+
* a certain period, but you also want the option to refresh the cache manually
|
|
12026
|
+
* before the expiration time.
|
|
12027
|
+
*
|
|
12028
|
+
* This is useful when you need to ensure that the cached data remains valid for
|
|
12029
|
+
* a certain period but still want to invalidate it if the underlying data
|
|
12030
|
+
* changes or if you want to force a recomputation.
|
|
12031
|
+
*
|
|
11867
12032
|
* **Details**
|
|
11868
12033
|
*
|
|
11869
12034
|
* This function behaves similarly to {@link cachedWithTTL} by caching the
|
|
@@ -11877,21 +12042,6 @@ export declare const cachedInvalidateWithTTL: {
|
|
|
11877
12042
|
* Once the cache is invalidated, the next time the effect is evaluated, the
|
|
11878
12043
|
* result will be recomputed, and the cache will be refreshed.
|
|
11879
12044
|
*
|
|
11880
|
-
* **When to Use**
|
|
11881
|
-
*
|
|
11882
|
-
* Use this function when you have an effect whose result needs to be cached for
|
|
11883
|
-
* a certain period, but you also want the option to refresh the cache manually
|
|
11884
|
-
* before the expiration time.
|
|
11885
|
-
*
|
|
11886
|
-
* This is useful when you need to ensure that the cached data remains valid for
|
|
11887
|
-
* a certain period but still want to invalidate it if the underlying data
|
|
11888
|
-
* changes or if you want to force a recomputation.
|
|
11889
|
-
*
|
|
11890
|
-
* @see {@link cached} for a similar function that caches the result
|
|
11891
|
-
* indefinitely.
|
|
11892
|
-
* @see {@link cachedWithTTL} for a similar function that caches the result for
|
|
11893
|
-
* a specified duration but does not include an effect for manual invalidation.
|
|
11894
|
-
*
|
|
11895
12045
|
* **Example** (Memoizing with TTL and invalidation)
|
|
11896
12046
|
*
|
|
11897
12047
|
* ```ts
|
|
@@ -11927,6 +12077,10 @@ export declare const cachedInvalidateWithTTL: {
|
|
|
11927
12077
|
* // result 2
|
|
11928
12078
|
* ```
|
|
11929
12079
|
*
|
|
12080
|
+
* @see {@link cached} for a similar function that caches the result
|
|
12081
|
+
* indefinitely.
|
|
12082
|
+
* @see {@link cachedWithTTL} for a similar function that caches the result for
|
|
12083
|
+
* a specified duration but does not include an effect for manual invalidation.
|
|
11930
12084
|
* @category Caching
|
|
11931
12085
|
* @since 2.0.0
|
|
11932
12086
|
*/
|
|
@@ -12813,6 +12967,8 @@ export declare const repeatOrElse: {
|
|
|
12813
12967
|
/**
|
|
12814
12968
|
* Returns an array of `n` identical effects.
|
|
12815
12969
|
*
|
|
12970
|
+
* **Details**
|
|
12971
|
+
*
|
|
12816
12972
|
* Use with `Effect.all` to run the replicated effects and collect results.
|
|
12817
12973
|
*
|
|
12818
12974
|
* @category Collecting
|
|
@@ -12822,6 +12978,8 @@ export declare const replicate: {
|
|
|
12822
12978
|
/**
|
|
12823
12979
|
* Returns an array of `n` identical effects.
|
|
12824
12980
|
*
|
|
12981
|
+
* **Details**
|
|
12982
|
+
*
|
|
12825
12983
|
* Use with `Effect.all` to run the replicated effects and collect results.
|
|
12826
12984
|
*
|
|
12827
12985
|
* @category Collecting
|
|
@@ -12831,6 +12989,8 @@ export declare const replicate: {
|
|
|
12831
12989
|
/**
|
|
12832
12990
|
* Returns an array of `n` identical effects.
|
|
12833
12991
|
*
|
|
12992
|
+
* **Details**
|
|
12993
|
+
*
|
|
12834
12994
|
* Use with `Effect.all` to run the replicated effects and collect results.
|
|
12835
12995
|
*
|
|
12836
12996
|
* @category Collecting
|
|
@@ -12841,6 +13001,8 @@ export declare const replicate: {
|
|
|
12841
13001
|
/**
|
|
12842
13002
|
* Performs this effect `n` times and collects results with `Effect.all` semantics.
|
|
12843
13003
|
*
|
|
13004
|
+
* **Details**
|
|
13005
|
+
*
|
|
12844
13006
|
* Use `concurrency` to control parallelism and `discard: true` to ignore results.
|
|
12845
13007
|
*
|
|
12846
13008
|
* **Example** (Replicating an effect)
|
|
@@ -12861,6 +13023,8 @@ export declare const replicateEffect: {
|
|
|
12861
13023
|
/**
|
|
12862
13024
|
* Performs this effect `n` times and collects results with `Effect.all` semantics.
|
|
12863
13025
|
*
|
|
13026
|
+
* **Details**
|
|
13027
|
+
*
|
|
12864
13028
|
* Use `concurrency` to control parallelism and `discard: true` to ignore results.
|
|
12865
13029
|
*
|
|
12866
13030
|
* **Example** (Replicating an effect)
|
|
@@ -12884,6 +13048,8 @@ export declare const replicateEffect: {
|
|
|
12884
13048
|
/**
|
|
12885
13049
|
* Performs this effect `n` times and collects results with `Effect.all` semantics.
|
|
12886
13050
|
*
|
|
13051
|
+
* **Details**
|
|
13052
|
+
*
|
|
12887
13053
|
* Use `concurrency` to control parallelism and `discard: true` to ignore results.
|
|
12888
13054
|
*
|
|
12889
13055
|
* **Example** (Replicating an effect)
|
|
@@ -12907,6 +13073,8 @@ export declare const replicateEffect: {
|
|
|
12907
13073
|
/**
|
|
12908
13074
|
* Performs this effect `n` times and collects results with `Effect.all` semantics.
|
|
12909
13075
|
*
|
|
13076
|
+
* **Details**
|
|
13077
|
+
*
|
|
12910
13078
|
* Use `concurrency` to control parallelism and `discard: true` to ignore results.
|
|
12911
13079
|
*
|
|
12912
13080
|
* **Example** (Replicating an effect)
|
|
@@ -12930,6 +13098,8 @@ export declare const replicateEffect: {
|
|
|
12930
13098
|
/**
|
|
12931
13099
|
* Performs this effect `n` times and collects results with `Effect.all` semantics.
|
|
12932
13100
|
*
|
|
13101
|
+
* **Details**
|
|
13102
|
+
*
|
|
12933
13103
|
* Use `concurrency` to control parallelism and `discard: true` to ignore results.
|
|
12934
13104
|
*
|
|
12935
13105
|
* **Example** (Replicating an effect)
|
|
@@ -13746,6 +13916,8 @@ export declare const spanLinks: Effect<ReadonlyArray<SpanLink>>;
|
|
|
13746
13916
|
/**
|
|
13747
13917
|
* For all spans in this effect, add a link with the provided span.
|
|
13748
13918
|
*
|
|
13919
|
+
* **Details**
|
|
13920
|
+
*
|
|
13749
13921
|
* This is useful for connecting spans that are related but not in a direct
|
|
13750
13922
|
* parent-child relationship. For example, you might want to link spans from
|
|
13751
13923
|
* parallel operations or connect spans across different traces.
|
|
@@ -13799,6 +13971,8 @@ export declare const linkSpans: {
|
|
|
13799
13971
|
/**
|
|
13800
13972
|
* For all spans in this effect, add a link with the provided span.
|
|
13801
13973
|
*
|
|
13974
|
+
* **Details**
|
|
13975
|
+
*
|
|
13802
13976
|
* This is useful for connecting spans that are related but not in a direct
|
|
13803
13977
|
* parent-child relationship. For example, you might want to link spans from
|
|
13804
13978
|
* parallel operations or connect spans across different traces.
|
|
@@ -13852,6 +14026,8 @@ export declare const linkSpans: {
|
|
|
13852
14026
|
/**
|
|
13853
14027
|
* For all spans in this effect, add a link with the provided span.
|
|
13854
14028
|
*
|
|
14029
|
+
* **Details**
|
|
14030
|
+
*
|
|
13855
14031
|
* This is useful for connecting spans that are related but not in a direct
|
|
13856
14032
|
* parent-child relationship. For example, you might want to link spans from
|
|
13857
14033
|
* parallel operations or connect spans across different traces.
|
|
@@ -13932,6 +14108,8 @@ export declare const makeSpan: (name: string, options?: SpanOptionsNoTrace) => E
|
|
|
13932
14108
|
* Create a new span for tracing, and automatically close it when the Scope
|
|
13933
14109
|
* finalizes.
|
|
13934
14110
|
*
|
|
14111
|
+
* **Details**
|
|
14112
|
+
*
|
|
13935
14113
|
* The span is not added to the current span stack, so no child spans will be
|
|
13936
14114
|
* created for it.
|
|
13937
14115
|
*
|
|
@@ -13958,6 +14136,8 @@ export declare const makeSpanScoped: (name: string, options?: SpanOptionsNoTrace
|
|
|
13958
14136
|
* Create a new span for tracing, and automatically close it when the effect
|
|
13959
14137
|
* completes.
|
|
13960
14138
|
*
|
|
14139
|
+
* **Details**
|
|
14140
|
+
*
|
|
13961
14141
|
* The span is not added to the current span stack, so no child spans will be
|
|
13962
14142
|
* created for it.
|
|
13963
14143
|
*
|
|
@@ -13984,6 +14164,8 @@ export declare const useSpan: {
|
|
|
13984
14164
|
* Create a new span for tracing, and automatically close it when the effect
|
|
13985
14165
|
* completes.
|
|
13986
14166
|
*
|
|
14167
|
+
* **Details**
|
|
14168
|
+
*
|
|
13987
14169
|
* The span is not added to the current span stack, so no child spans will be
|
|
13988
14170
|
* created for it.
|
|
13989
14171
|
*
|
|
@@ -14010,6 +14192,8 @@ export declare const useSpan: {
|
|
|
14010
14192
|
* Create a new span for tracing, and automatically close it when the effect
|
|
14011
14193
|
* completes.
|
|
14012
14194
|
*
|
|
14195
|
+
* **Details**
|
|
14196
|
+
*
|
|
14013
14197
|
* The span is not added to the current span stack, so no child spans will be
|
|
14014
14198
|
* created for it.
|
|
14015
14199
|
*
|
|
@@ -14103,6 +14287,8 @@ export declare const withSpan: {
|
|
|
14103
14287
|
/**
|
|
14104
14288
|
* Wraps the effect with a new span for tracing.
|
|
14105
14289
|
*
|
|
14290
|
+
* **Details**
|
|
14291
|
+
*
|
|
14106
14292
|
* The span is ended when the Scope is finalized.
|
|
14107
14293
|
*
|
|
14108
14294
|
* **Example** (Creating a scoped child span)
|
|
@@ -14126,6 +14312,8 @@ export declare const withSpanScoped: {
|
|
|
14126
14312
|
/**
|
|
14127
14313
|
* Wraps the effect with a new span for tracing.
|
|
14128
14314
|
*
|
|
14315
|
+
* **Details**
|
|
14316
|
+
*
|
|
14129
14317
|
* The span is ended when the Scope is finalized.
|
|
14130
14318
|
*
|
|
14131
14319
|
* **Example** (Creating a scoped child span)
|
|
@@ -14149,6 +14337,8 @@ export declare const withSpanScoped: {
|
|
|
14149
14337
|
/**
|
|
14150
14338
|
* Wraps the effect with a new span for tracing.
|
|
14151
14339
|
*
|
|
14340
|
+
* **Details**
|
|
14341
|
+
*
|
|
14152
14342
|
* The span is ended when the Scope is finalized.
|
|
14153
14343
|
*
|
|
14154
14344
|
* **Example** (Creating a scoped child span)
|
|
@@ -14332,6 +14522,8 @@ export declare const request: {
|
|
|
14332
14522
|
* Low-level entry point that registers a request with a resolver and delivers the exit value via `onExit`.
|
|
14333
14523
|
* Use this when you already have a `Context` and need to enqueue a request outside an `Effect`.
|
|
14334
14524
|
*
|
|
14525
|
+
* **Details**
|
|
14526
|
+
*
|
|
14335
14527
|
* It returns a canceler that removes the pending request entry.
|
|
14336
14528
|
*
|
|
14337
14529
|
* @category Requests & Batching
|
|
@@ -14347,6 +14539,8 @@ export declare const requestUnsafe: <A extends Request.Any>(self: A, options: {
|
|
|
14347
14539
|
* returning the fiber immediately, without waiting for it to begin executing
|
|
14348
14540
|
* the effect.
|
|
14349
14541
|
*
|
|
14542
|
+
* **Details**
|
|
14543
|
+
*
|
|
14350
14544
|
* You can use the `forkChild` method whenever you want to execute an effect in a
|
|
14351
14545
|
* new fiber, concurrently and without "blocking" the fiber executing other
|
|
14352
14546
|
* effects. Using fibers can be tricky, so instead of using this method
|
|
@@ -14645,7 +14839,7 @@ export interface RunOptions {
|
|
|
14645
14839
|
* The foundational function for running effects, returning a "fiber" that can
|
|
14646
14840
|
* be observed or interrupted.
|
|
14647
14841
|
*
|
|
14648
|
-
* **When to
|
|
14842
|
+
* **When to use**
|
|
14649
14843
|
*
|
|
14650
14844
|
* `runFork` is used to run an effect in the background by creating a
|
|
14651
14845
|
* fiber. It is the base function for all other run functions. It starts a fiber
|
|
@@ -14713,6 +14907,8 @@ export declare const runForkWith: <R>(context: Context.Context<R>) => <A, E>(eff
|
|
|
14713
14907
|
/**
|
|
14714
14908
|
* Forks an effect with the provided services, registers `onExit` as a fiber observer, and returns an interruptor.
|
|
14715
14909
|
*
|
|
14910
|
+
* **Details**
|
|
14911
|
+
*
|
|
14716
14912
|
* The returned interruptor calls `fiber.interruptUnsafe`, optionally with an interruptor id.
|
|
14717
14913
|
*
|
|
14718
14914
|
* **Example** (Running with services and a callback)
|
|
@@ -14758,6 +14954,8 @@ export declare const runCallbackWith: <R>(context: Context.Context<R>) => <A, E>
|
|
|
14758
14954
|
* Runs an effect asynchronously, registering `onExit` as a fiber observer and
|
|
14759
14955
|
* returning an interruptor.
|
|
14760
14956
|
*
|
|
14957
|
+
* **Details**
|
|
14958
|
+
*
|
|
14761
14959
|
* The interruptor calls `fiber.interruptUnsafe` with the optional interruptor
|
|
14762
14960
|
* id.
|
|
14763
14961
|
*
|
|
@@ -14798,7 +14996,7 @@ export declare const runCallback: <A, E>(effect: Effect<A, E, never>, options?:
|
|
|
14798
14996
|
/**
|
|
14799
14997
|
* Executes an effect and returns the result as a `Promise`.
|
|
14800
14998
|
*
|
|
14801
|
-
* **When to
|
|
14999
|
+
* **When to use**
|
|
14802
15000
|
*
|
|
14803
15001
|
* Use `runPromise` when you need to execute an effect and work with the
|
|
14804
15002
|
* result using `Promise` syntax, typically for compatibility with other
|
|
@@ -14807,8 +15005,6 @@ export declare const runCallback: <A, E>(effect: Effect<A, E, never>, options?:
|
|
|
14807
15005
|
* If the effect succeeds, the promise will resolve with the result. If the
|
|
14808
15006
|
* effect fails, the promise will reject with an error.
|
|
14809
15007
|
*
|
|
14810
|
-
* @see {@link runPromiseExit} for a version that returns an `Exit` type instead of rejecting.
|
|
14811
|
-
*
|
|
14812
15008
|
* **Example** (Running a successful effect as a Promise)
|
|
14813
15009
|
*
|
|
14814
15010
|
* ```ts
|
|
@@ -14829,6 +15025,7 @@ export declare const runCallback: <A, E>(effect: Effect<A, E, never>, options?:
|
|
|
14829
15025
|
* // (FiberFailure) Error: my error
|
|
14830
15026
|
* ```
|
|
14831
15027
|
*
|
|
15028
|
+
* @see {@link runPromiseExit} for a version that returns an `Exit` type instead of rejecting.
|
|
14832
15029
|
* @category Running Effects
|
|
14833
15030
|
* @since 2.0.0
|
|
14834
15031
|
*/
|
|
@@ -14867,7 +15064,7 @@ export declare const runPromiseWith: <R>(context: Context.Context<R>) => <A, E>(
|
|
|
14867
15064
|
* Runs an effect and returns a `Promise` that resolves to an `Exit`, which
|
|
14868
15065
|
* represents the outcome (success or failure) of the effect.
|
|
14869
15066
|
*
|
|
14870
|
-
* **When to
|
|
15067
|
+
* **When to use**
|
|
14871
15068
|
*
|
|
14872
15069
|
* Use `runPromiseExit` when you need to determine if an effect succeeded
|
|
14873
15070
|
* or failed, including any defects, and you want to work with a `Promise`.
|
|
@@ -14948,7 +15145,7 @@ export declare const runPromiseExitWith: <R>(context: Context.Context<R>) => <A,
|
|
|
14948
15145
|
/**
|
|
14949
15146
|
* Executes an effect synchronously and returns its success value.
|
|
14950
15147
|
*
|
|
14951
|
-
* **When to
|
|
15148
|
+
* **When to use**
|
|
14952
15149
|
*
|
|
14953
15150
|
* Use `runSync` only for effects that can complete synchronously.
|
|
14954
15151
|
*
|
|
@@ -14958,9 +15155,6 @@ export declare const runPromiseExitWith: <R>(context: Context.Context<R>) => <A,
|
|
|
14958
15155
|
* `runSync` throws a `FiberFailure` instead of returning a value. Use
|
|
14959
15156
|
* `runSyncExit` when you want the failure captured as an `Exit`.
|
|
14960
15157
|
*
|
|
14961
|
-
* @see {@link runSyncExit} for a version that returns an `Exit` type instead of
|
|
14962
|
-
* throwing an error.
|
|
14963
|
-
*
|
|
14964
15158
|
* **Example** (Running a synchronous effect)
|
|
14965
15159
|
*
|
|
14966
15160
|
* ```ts
|
|
@@ -15002,6 +15196,8 @@ export declare const runPromiseExitWith: <R>(context: Context.Context<R>) => <A,
|
|
|
15002
15196
|
* // (FiberFailure) AsyncFiberException: Fiber #0 cannot be resolved synchronously. This is caused by using runSync on an effect that performs async work
|
|
15003
15197
|
* ```
|
|
15004
15198
|
*
|
|
15199
|
+
* @see {@link runSyncExit} for a version that returns an `Exit` type instead of
|
|
15200
|
+
* throwing an error.
|
|
15005
15201
|
* @category Running Effects
|
|
15006
15202
|
* @since 2.0.0
|
|
15007
15203
|
*/
|
|
@@ -15041,7 +15237,7 @@ export declare const runSyncWith: <R>(context: Context.Context<R>) => <A, E>(eff
|
|
|
15041
15237
|
* Runs an effect synchronously and returns the result as an `Exit` type, which
|
|
15042
15238
|
* represents the outcome (success or failure) of the effect.
|
|
15043
15239
|
*
|
|
15044
|
-
* **When to
|
|
15240
|
+
* **When to use**
|
|
15045
15241
|
*
|
|
15046
15242
|
* Use `runSyncExit` to find out whether an effect succeeded or failed,
|
|
15047
15243
|
* including any defects, without dealing with asynchronous operations.
|
|
@@ -15152,6 +15348,8 @@ export declare const runSyncExitWith: <R>(context: Context.Context<R>) => <A, E>
|
|
|
15152
15348
|
/**
|
|
15153
15349
|
* Type helpers for functions built with `Effect.fn` and `Effect.fnUntraced`.
|
|
15154
15350
|
*
|
|
15351
|
+
* **Details**
|
|
15352
|
+
*
|
|
15155
15353
|
* Use these to describe generator-based signatures and traced or untraced variants.
|
|
15156
15354
|
*
|
|
15157
15355
|
* @since 3.11.0
|
|
@@ -15751,6 +15949,8 @@ export declare namespace fn {
|
|
|
15751
15949
|
/**
|
|
15752
15950
|
* Creates an Effect-returning function without tracing.
|
|
15753
15951
|
*
|
|
15952
|
+
* **Details**
|
|
15953
|
+
*
|
|
15754
15954
|
* `Effect.fnUntraced` also acts as a `pipe` function, so you can append transforms after the body.
|
|
15755
15955
|
*
|
|
15756
15956
|
* **Example** (Defining untraced effect functions)
|
|
@@ -15773,6 +15973,8 @@ export declare const fnUntraced: fn.Untraced;
|
|
|
15773
15973
|
/**
|
|
15774
15974
|
* Creates a traced function with an optional span name and `SpanOptionsNoTrace` that adds spans and stack frames, plus pipeable post-processing that receives the Effect and the original arguments.
|
|
15775
15975
|
*
|
|
15976
|
+
* **Details**
|
|
15977
|
+
*
|
|
15776
15978
|
* Pipeable functions run after the body and can transform the resulting Effect.
|
|
15777
15979
|
*
|
|
15778
15980
|
* **Example** (Defining traced effect functions)
|
|
@@ -15829,6 +16031,8 @@ export declare const clockWith: <A, E, R>(f: (clock: Clock) => Effect<A, E, R>)
|
|
|
15829
16031
|
/**
|
|
15830
16032
|
* Creates a logger function that logs at the specified level.
|
|
15831
16033
|
*
|
|
16034
|
+
* **Details**
|
|
16035
|
+
*
|
|
15832
16036
|
* If no level is provided, the logger uses the fiber's current log level and
|
|
15833
16037
|
* extracts any `Cause` values from the message list.
|
|
15834
16038
|
*
|
|
@@ -16126,6 +16330,8 @@ export declare const annotateLogs: {
|
|
|
16126
16330
|
/**
|
|
16127
16331
|
* Adds log annotations to the current scope.
|
|
16128
16332
|
*
|
|
16333
|
+
* **Details**
|
|
16334
|
+
*
|
|
16129
16335
|
* This differs from `annotateLogs`, which only annotates a specific effect.
|
|
16130
16336
|
* `annotateLogsScoped` updates annotations for the entire current `Scope` and
|
|
16131
16337
|
* restores the previous annotations when the scope closes.
|
|
@@ -16153,6 +16359,8 @@ export declare const annotateLogsScoped: {
|
|
|
16153
16359
|
/**
|
|
16154
16360
|
* Adds log annotations to the current scope.
|
|
16155
16361
|
*
|
|
16362
|
+
* **Details**
|
|
16363
|
+
*
|
|
16156
16364
|
* This differs from `annotateLogs`, which only annotates a specific effect.
|
|
16157
16365
|
* `annotateLogsScoped` updates annotations for the entire current `Scope` and
|
|
16158
16366
|
* restores the previous annotations when the scope closes.
|
|
@@ -16180,6 +16388,8 @@ export declare const annotateLogsScoped: {
|
|
|
16180
16388
|
/**
|
|
16181
16389
|
* Adds log annotations to the current scope.
|
|
16182
16390
|
*
|
|
16391
|
+
* **Details**
|
|
16392
|
+
*
|
|
16183
16393
|
* This differs from `annotateLogs`, which only annotates a specific effect.
|
|
16184
16394
|
* `annotateLogsScoped` updates annotations for the entire current `Scope` and
|
|
16185
16395
|
* restores the previous annotations when the scope closes.
|
|
@@ -16240,6 +16450,8 @@ export declare const withLogSpan: ((label: string) => <A, E, R>(effect: Effect<A
|
|
|
16240
16450
|
/**
|
|
16241
16451
|
* Updates the `Metric` every time the `Effect` is executed.
|
|
16242
16452
|
*
|
|
16453
|
+
* **Details**
|
|
16454
|
+
*
|
|
16243
16455
|
* Also accepts an optional function which can be used to map the `Exit` value
|
|
16244
16456
|
* of the `Effect` into a valid `Input` for the `Metric`.
|
|
16245
16457
|
*
|
|
@@ -16291,6 +16503,8 @@ export declare const track: {
|
|
|
16291
16503
|
/**
|
|
16292
16504
|
* Updates the `Metric` every time the `Effect` is executed.
|
|
16293
16505
|
*
|
|
16506
|
+
* **Details**
|
|
16507
|
+
*
|
|
16294
16508
|
* Also accepts an optional function which can be used to map the `Exit` value
|
|
16295
16509
|
* of the `Effect` into a valid `Input` for the `Metric`.
|
|
16296
16510
|
*
|
|
@@ -16342,6 +16556,8 @@ export declare const track: {
|
|
|
16342
16556
|
/**
|
|
16343
16557
|
* Updates the `Metric` every time the `Effect` is executed.
|
|
16344
16558
|
*
|
|
16559
|
+
* **Details**
|
|
16560
|
+
*
|
|
16345
16561
|
* Also accepts an optional function which can be used to map the `Exit` value
|
|
16346
16562
|
* of the `Effect` into a valid `Input` for the `Metric`.
|
|
16347
16563
|
*
|
|
@@ -16393,6 +16609,8 @@ export declare const track: {
|
|
|
16393
16609
|
/**
|
|
16394
16610
|
* Updates the `Metric` every time the `Effect` is executed.
|
|
16395
16611
|
*
|
|
16612
|
+
* **Details**
|
|
16613
|
+
*
|
|
16396
16614
|
* Also accepts an optional function which can be used to map the `Exit` value
|
|
16397
16615
|
* of the `Effect` into a valid `Input` for the `Metric`.
|
|
16398
16616
|
*
|
|
@@ -16444,6 +16662,8 @@ export declare const track: {
|
|
|
16444
16662
|
/**
|
|
16445
16663
|
* Updates the `Metric` every time the `Effect` is executed.
|
|
16446
16664
|
*
|
|
16665
|
+
* **Details**
|
|
16666
|
+
*
|
|
16447
16667
|
* Also accepts an optional function which can be used to map the `Exit` value
|
|
16448
16668
|
* of the `Effect` into a valid `Input` for the `Metric`.
|
|
16449
16669
|
*
|
|
@@ -16497,6 +16717,8 @@ export declare const track: {
|
|
|
16497
16717
|
* Updates the provided `Metric` every time the wrapped `Effect` succeeds with
|
|
16498
16718
|
* a value.
|
|
16499
16719
|
*
|
|
16720
|
+
* **Details**
|
|
16721
|
+
*
|
|
16500
16722
|
* Also accepts an optional function which can be used to map the success value
|
|
16501
16723
|
* of the `Effect` into a valid `Input` for the `Metric`.
|
|
16502
16724
|
*
|
|
@@ -16545,6 +16767,8 @@ export declare const trackSuccesses: {
|
|
|
16545
16767
|
* Updates the provided `Metric` every time the wrapped `Effect` succeeds with
|
|
16546
16768
|
* a value.
|
|
16547
16769
|
*
|
|
16770
|
+
* **Details**
|
|
16771
|
+
*
|
|
16548
16772
|
* Also accepts an optional function which can be used to map the success value
|
|
16549
16773
|
* of the `Effect` into a valid `Input` for the `Metric`.
|
|
16550
16774
|
*
|
|
@@ -16593,6 +16817,8 @@ export declare const trackSuccesses: {
|
|
|
16593
16817
|
* Updates the provided `Metric` every time the wrapped `Effect` succeeds with
|
|
16594
16818
|
* a value.
|
|
16595
16819
|
*
|
|
16820
|
+
* **Details**
|
|
16821
|
+
*
|
|
16596
16822
|
* Also accepts an optional function which can be used to map the success value
|
|
16597
16823
|
* of the `Effect` into a valid `Input` for the `Metric`.
|
|
16598
16824
|
*
|
|
@@ -16641,6 +16867,8 @@ export declare const trackSuccesses: {
|
|
|
16641
16867
|
* Updates the provided `Metric` every time the wrapped `Effect` succeeds with
|
|
16642
16868
|
* a value.
|
|
16643
16869
|
*
|
|
16870
|
+
* **Details**
|
|
16871
|
+
*
|
|
16644
16872
|
* Also accepts an optional function which can be used to map the success value
|
|
16645
16873
|
* of the `Effect` into a valid `Input` for the `Metric`.
|
|
16646
16874
|
*
|
|
@@ -16689,6 +16917,8 @@ export declare const trackSuccesses: {
|
|
|
16689
16917
|
* Updates the provided `Metric` every time the wrapped `Effect` succeeds with
|
|
16690
16918
|
* a value.
|
|
16691
16919
|
*
|
|
16920
|
+
* **Details**
|
|
16921
|
+
*
|
|
16692
16922
|
* Also accepts an optional function which can be used to map the success value
|
|
16693
16923
|
* of the `Effect` into a valid `Input` for the `Metric`.
|
|
16694
16924
|
*
|
|
@@ -16738,6 +16968,8 @@ export declare const trackSuccesses: {
|
|
|
16738
16968
|
* Updates the provided `Metric` every time the wrapped `Effect` fails with an
|
|
16739
16969
|
* **expected** error.
|
|
16740
16970
|
*
|
|
16971
|
+
* **Details**
|
|
16972
|
+
*
|
|
16741
16973
|
* Also accepts an optional function which can be used to map the error value
|
|
16742
16974
|
* of the `Effect` into a valid `Input` for the `Metric`.
|
|
16743
16975
|
*
|
|
@@ -16788,6 +17020,8 @@ export declare const trackErrors: {
|
|
|
16788
17020
|
* Updates the provided `Metric` every time the wrapped `Effect` fails with an
|
|
16789
17021
|
* **expected** error.
|
|
16790
17022
|
*
|
|
17023
|
+
* **Details**
|
|
17024
|
+
*
|
|
16791
17025
|
* Also accepts an optional function which can be used to map the error value
|
|
16792
17026
|
* of the `Effect` into a valid `Input` for the `Metric`.
|
|
16793
17027
|
*
|
|
@@ -16838,6 +17072,8 @@ export declare const trackErrors: {
|
|
|
16838
17072
|
* Updates the provided `Metric` every time the wrapped `Effect` fails with an
|
|
16839
17073
|
* **expected** error.
|
|
16840
17074
|
*
|
|
17075
|
+
* **Details**
|
|
17076
|
+
*
|
|
16841
17077
|
* Also accepts an optional function which can be used to map the error value
|
|
16842
17078
|
* of the `Effect` into a valid `Input` for the `Metric`.
|
|
16843
17079
|
*
|
|
@@ -16888,6 +17124,8 @@ export declare const trackErrors: {
|
|
|
16888
17124
|
* Updates the provided `Metric` every time the wrapped `Effect` fails with an
|
|
16889
17125
|
* **expected** error.
|
|
16890
17126
|
*
|
|
17127
|
+
* **Details**
|
|
17128
|
+
*
|
|
16891
17129
|
* Also accepts an optional function which can be used to map the error value
|
|
16892
17130
|
* of the `Effect` into a valid `Input` for the `Metric`.
|
|
16893
17131
|
*
|
|
@@ -16938,6 +17176,8 @@ export declare const trackErrors: {
|
|
|
16938
17176
|
* Updates the provided `Metric` every time the wrapped `Effect` fails with an
|
|
16939
17177
|
* **expected** error.
|
|
16940
17178
|
*
|
|
17179
|
+
* **Details**
|
|
17180
|
+
*
|
|
16941
17181
|
* Also accepts an optional function which can be used to map the error value
|
|
16942
17182
|
* of the `Effect` into a valid `Input` for the `Metric`.
|
|
16943
17183
|
*
|
|
@@ -16989,6 +17229,8 @@ export declare const trackErrors: {
|
|
|
16989
17229
|
* Updates the provided `Metric` every time the wrapped `Effect` fails with an
|
|
16990
17230
|
* **unexpected** error (i.e. a defect).
|
|
16991
17231
|
*
|
|
17232
|
+
* **Details**
|
|
17233
|
+
*
|
|
16992
17234
|
* Also accepts an optional function which can be used to map the defect value
|
|
16993
17235
|
* of the `Effect` into a valid `Input` for the `Metric`.
|
|
16994
17236
|
*
|
|
@@ -17040,6 +17282,8 @@ export declare const trackDefects: {
|
|
|
17040
17282
|
* Updates the provided `Metric` every time the wrapped `Effect` fails with an
|
|
17041
17283
|
* **unexpected** error (i.e. a defect).
|
|
17042
17284
|
*
|
|
17285
|
+
* **Details**
|
|
17286
|
+
*
|
|
17043
17287
|
* Also accepts an optional function which can be used to map the defect value
|
|
17044
17288
|
* of the `Effect` into a valid `Input` for the `Metric`.
|
|
17045
17289
|
*
|
|
@@ -17091,6 +17335,8 @@ export declare const trackDefects: {
|
|
|
17091
17335
|
* Updates the provided `Metric` every time the wrapped `Effect` fails with an
|
|
17092
17336
|
* **unexpected** error (i.e. a defect).
|
|
17093
17337
|
*
|
|
17338
|
+
* **Details**
|
|
17339
|
+
*
|
|
17094
17340
|
* Also accepts an optional function which can be used to map the defect value
|
|
17095
17341
|
* of the `Effect` into a valid `Input` for the `Metric`.
|
|
17096
17342
|
*
|
|
@@ -17142,6 +17388,8 @@ export declare const trackDefects: {
|
|
|
17142
17388
|
* Updates the provided `Metric` every time the wrapped `Effect` fails with an
|
|
17143
17389
|
* **unexpected** error (i.e. a defect).
|
|
17144
17390
|
*
|
|
17391
|
+
* **Details**
|
|
17392
|
+
*
|
|
17145
17393
|
* Also accepts an optional function which can be used to map the defect value
|
|
17146
17394
|
* of the `Effect` into a valid `Input` for the `Metric`.
|
|
17147
17395
|
*
|
|
@@ -17193,6 +17441,8 @@ export declare const trackDefects: {
|
|
|
17193
17441
|
* Updates the provided `Metric` every time the wrapped `Effect` fails with an
|
|
17194
17442
|
* **unexpected** error (i.e. a defect).
|
|
17195
17443
|
*
|
|
17444
|
+
* **Details**
|
|
17445
|
+
*
|
|
17196
17446
|
* Also accepts an optional function which can be used to map the defect value
|
|
17197
17447
|
* of the `Effect` into a valid `Input` for the `Metric`.
|
|
17198
17448
|
*
|
|
@@ -17245,6 +17495,8 @@ export declare const trackDefects: {
|
|
|
17245
17495
|
* Updates the provided `Metric` with the `Duration` of time (in nanoseconds)
|
|
17246
17496
|
* that the wrapped `Effect` took to complete.
|
|
17247
17497
|
*
|
|
17498
|
+
* **Details**
|
|
17499
|
+
*
|
|
17248
17500
|
* Also accepts an optional function which can be used to map the `Duration`
|
|
17249
17501
|
* that the wrapped `Effect` took to complete into a valid `Input` for the
|
|
17250
17502
|
* `Metric`.
|
|
@@ -17292,6 +17544,8 @@ export declare const trackDuration: {
|
|
|
17292
17544
|
* Updates the provided `Metric` with the `Duration` of time (in nanoseconds)
|
|
17293
17545
|
* that the wrapped `Effect` took to complete.
|
|
17294
17546
|
*
|
|
17547
|
+
* **Details**
|
|
17548
|
+
*
|
|
17295
17549
|
* Also accepts an optional function which can be used to map the `Duration`
|
|
17296
17550
|
* that the wrapped `Effect` took to complete into a valid `Input` for the
|
|
17297
17551
|
* `Metric`.
|
|
@@ -17339,6 +17593,8 @@ export declare const trackDuration: {
|
|
|
17339
17593
|
* Updates the provided `Metric` with the `Duration` of time (in nanoseconds)
|
|
17340
17594
|
* that the wrapped `Effect` took to complete.
|
|
17341
17595
|
*
|
|
17596
|
+
* **Details**
|
|
17597
|
+
*
|
|
17342
17598
|
* Also accepts an optional function which can be used to map the `Duration`
|
|
17343
17599
|
* that the wrapped `Effect` took to complete into a valid `Input` for the
|
|
17344
17600
|
* `Metric`.
|
|
@@ -17386,6 +17642,8 @@ export declare const trackDuration: {
|
|
|
17386
17642
|
* Updates the provided `Metric` with the `Duration` of time (in nanoseconds)
|
|
17387
17643
|
* that the wrapped `Effect` took to complete.
|
|
17388
17644
|
*
|
|
17645
|
+
* **Details**
|
|
17646
|
+
*
|
|
17389
17647
|
* Also accepts an optional function which can be used to map the `Duration`
|
|
17390
17648
|
* that the wrapped `Effect` took to complete into a valid `Input` for the
|
|
17391
17649
|
* `Metric`.
|
|
@@ -17433,6 +17691,8 @@ export declare const trackDuration: {
|
|
|
17433
17691
|
* Updates the provided `Metric` with the `Duration` of time (in nanoseconds)
|
|
17434
17692
|
* that the wrapped `Effect` took to complete.
|
|
17435
17693
|
*
|
|
17694
|
+
* **Details**
|
|
17695
|
+
*
|
|
17436
17696
|
* Also accepts an optional function which can be used to map the `Duration`
|
|
17437
17697
|
* that the wrapped `Effect` took to complete into a valid `Input` for the
|
|
17438
17698
|
* `Metric`.
|
|
@@ -17487,6 +17747,8 @@ declare const Transaction_base: Context.ServiceClass<Transaction, "effect/Effect
|
|
|
17487
17747
|
/**
|
|
17488
17748
|
* Service that holds the current transaction state, it includes
|
|
17489
17749
|
*
|
|
17750
|
+
* **Details**
|
|
17751
|
+
*
|
|
17490
17752
|
* - a journal that stores any non committed change to TxRef values
|
|
17491
17753
|
* - a retry flag to know if the transaction should be retried
|
|
17492
17754
|
*
|
|
@@ -17512,6 +17774,8 @@ export declare class Transaction extends Transaction_base {
|
|
|
17512
17774
|
* Defines a transaction boundary. Transactions are "all or nothing" with respect to changes
|
|
17513
17775
|
* made to transactional values (i.e. TxRef) that occur within the transaction body.
|
|
17514
17776
|
*
|
|
17777
|
+
* **Details**
|
|
17778
|
+
*
|
|
17515
17779
|
* If called inside an active transaction, `tx` composes with the current transaction and reuses
|
|
17516
17780
|
* its journal and retry state instead of creating a nested boundary.
|
|
17517
17781
|
*
|
|
@@ -17555,10 +17819,9 @@ export declare const tx: <A, E, R>(effect: Effect<A, E, R>) => Effect<A, E, Excl
|
|
|
17555
17819
|
/**
|
|
17556
17820
|
* Signals that the current transaction needs to be retried.
|
|
17557
17821
|
*
|
|
17558
|
-
*
|
|
17822
|
+
* **Details**
|
|
17559
17823
|
*
|
|
17560
|
-
*
|
|
17561
|
-
* @since 4.0.0
|
|
17824
|
+
* NOTE: the transaction retries on any change to transactional values (i.e. TxRef) accessed in its body.
|
|
17562
17825
|
*
|
|
17563
17826
|
* **Example** (Retrying transactions)
|
|
17564
17827
|
*
|
|
@@ -17588,6 +17851,9 @@ export declare const tx: <A, E, R>(effect: Effect<A, E, R>) => Effect<A, E, Excl
|
|
|
17588
17851
|
*
|
|
17589
17852
|
* Effect.runPromise(program).catch(console.error)
|
|
17590
17853
|
* ```
|
|
17854
|
+
*
|
|
17855
|
+
* @category Transactions
|
|
17856
|
+
* @since 4.0.0
|
|
17591
17857
|
*/
|
|
17592
17858
|
export declare const txRetry: Effect<never, never, Transaction>;
|
|
17593
17859
|
/**
|
|
@@ -18011,6 +18277,8 @@ export declare const effectify: {
|
|
|
18011
18277
|
/**
|
|
18012
18278
|
* Ensures that an effect's success type extends a given type `A`.
|
|
18013
18279
|
*
|
|
18280
|
+
* **Details**
|
|
18281
|
+
*
|
|
18014
18282
|
* This function provides compile-time type checking to ensure that the success
|
|
18015
18283
|
* value of an effect conforms to a specific type constraint.
|
|
18016
18284
|
*
|
|
@@ -18038,6 +18306,8 @@ export declare const satisfiesSuccessType: <A>() => <A2 extends A, E, R>(effect:
|
|
|
18038
18306
|
/**
|
|
18039
18307
|
* Ensures that an effect's error type extends a given type `E`.
|
|
18040
18308
|
*
|
|
18309
|
+
* **Details**
|
|
18310
|
+
*
|
|
18041
18311
|
* This function provides compile-time type checking to ensure that the error
|
|
18042
18312
|
* type of an effect conforms to a specific type constraint.
|
|
18043
18313
|
*
|
|
@@ -18067,6 +18337,8 @@ export declare const satisfiesErrorType: <E>() => <A, E2 extends E, R>(effect: E
|
|
|
18067
18337
|
/**
|
|
18068
18338
|
* Ensures that an effect's requirements type extends a given type `R`.
|
|
18069
18339
|
*
|
|
18340
|
+
* **Details**
|
|
18341
|
+
*
|
|
18070
18342
|
* This function provides compile-time type checking to ensure that the
|
|
18071
18343
|
* requirements (context) type of an effect conforms to a specific type constraint.
|
|
18072
18344
|
*
|
|
@@ -18095,13 +18367,15 @@ export declare const satisfiesServicesType: <R>() => <A, E, R2 extends R>(effect
|
|
|
18095
18367
|
* An optimized version of `map` that checks if an effect is already resolved
|
|
18096
18368
|
* and applies the mapping function eagerly when possible.
|
|
18097
18369
|
*
|
|
18098
|
-
* **When to
|
|
18370
|
+
* **When to use**
|
|
18099
18371
|
*
|
|
18100
18372
|
* `mapEager` provides better performance for effects that are already resolved
|
|
18101
18373
|
* by applying the transformation immediately instead of deferring it through
|
|
18102
18374
|
* the effect pipeline.
|
|
18103
18375
|
*
|
|
18104
|
-
* **
|
|
18376
|
+
* **Details**
|
|
18377
|
+
*
|
|
18378
|
+
* Behavior:
|
|
18105
18379
|
*
|
|
18106
18380
|
* - For **Success effects**: Applies the mapping function immediately to the value
|
|
18107
18381
|
* - For **Failure effects**: Returns the failure as-is without applying the mapping
|
|
@@ -18129,13 +18403,15 @@ export declare const mapEager: {
|
|
|
18129
18403
|
* An optimized version of `map` that checks if an effect is already resolved
|
|
18130
18404
|
* and applies the mapping function eagerly when possible.
|
|
18131
18405
|
*
|
|
18132
|
-
* **When to
|
|
18406
|
+
* **When to use**
|
|
18133
18407
|
*
|
|
18134
18408
|
* `mapEager` provides better performance for effects that are already resolved
|
|
18135
18409
|
* by applying the transformation immediately instead of deferring it through
|
|
18136
18410
|
* the effect pipeline.
|
|
18137
18411
|
*
|
|
18138
|
-
* **
|
|
18412
|
+
* **Details**
|
|
18413
|
+
*
|
|
18414
|
+
* Behavior:
|
|
18139
18415
|
*
|
|
18140
18416
|
* - For **Success effects**: Applies the mapping function immediately to the value
|
|
18141
18417
|
* - For **Failure effects**: Returns the failure as-is without applying the mapping
|
|
@@ -18163,13 +18439,15 @@ export declare const mapEager: {
|
|
|
18163
18439
|
* An optimized version of `map` that checks if an effect is already resolved
|
|
18164
18440
|
* and applies the mapping function eagerly when possible.
|
|
18165
18441
|
*
|
|
18166
|
-
* **When to
|
|
18442
|
+
* **When to use**
|
|
18167
18443
|
*
|
|
18168
18444
|
* `mapEager` provides better performance for effects that are already resolved
|
|
18169
18445
|
* by applying the transformation immediately instead of deferring it through
|
|
18170
18446
|
* the effect pipeline.
|
|
18171
18447
|
*
|
|
18172
|
-
* **
|
|
18448
|
+
* **Details**
|
|
18449
|
+
*
|
|
18450
|
+
* Behavior:
|
|
18173
18451
|
*
|
|
18174
18452
|
* - For **Success effects**: Applies the mapping function immediately to the value
|
|
18175
18453
|
* - For **Failure effects**: Returns the failure as-is without applying the mapping
|
|
@@ -18198,13 +18476,15 @@ export declare const mapEager: {
|
|
|
18198
18476
|
* An optimized version of `mapError` that checks if an effect is already resolved
|
|
18199
18477
|
* and applies the error mapping function eagerly when possible.
|
|
18200
18478
|
*
|
|
18201
|
-
* **When to
|
|
18479
|
+
* **When to use**
|
|
18202
18480
|
*
|
|
18203
18481
|
* `mapErrorEager` provides better performance for effects that are already resolved
|
|
18204
18482
|
* by applying the error transformation immediately instead of deferring it through
|
|
18205
18483
|
* the effect pipeline.
|
|
18206
18484
|
*
|
|
18207
|
-
* **
|
|
18485
|
+
* **Details**
|
|
18486
|
+
*
|
|
18487
|
+
* Behavior:
|
|
18208
18488
|
*
|
|
18209
18489
|
* - For **Success effects**: Returns the success as-is (no error to transform)
|
|
18210
18490
|
* - For **Failure effects**: Applies the mapping function immediately to the error
|
|
@@ -18235,13 +18515,15 @@ export declare const mapErrorEager: {
|
|
|
18235
18515
|
* An optimized version of `mapError` that checks if an effect is already resolved
|
|
18236
18516
|
* and applies the error mapping function eagerly when possible.
|
|
18237
18517
|
*
|
|
18238
|
-
* **When to
|
|
18518
|
+
* **When to use**
|
|
18239
18519
|
*
|
|
18240
18520
|
* `mapErrorEager` provides better performance for effects that are already resolved
|
|
18241
18521
|
* by applying the error transformation immediately instead of deferring it through
|
|
18242
18522
|
* the effect pipeline.
|
|
18243
18523
|
*
|
|
18244
|
-
* **
|
|
18524
|
+
* **Details**
|
|
18525
|
+
*
|
|
18526
|
+
* Behavior:
|
|
18245
18527
|
*
|
|
18246
18528
|
* - For **Success effects**: Returns the success as-is (no error to transform)
|
|
18247
18529
|
* - For **Failure effects**: Applies the mapping function immediately to the error
|
|
@@ -18272,13 +18554,15 @@ export declare const mapErrorEager: {
|
|
|
18272
18554
|
* An optimized version of `mapError` that checks if an effect is already resolved
|
|
18273
18555
|
* and applies the error mapping function eagerly when possible.
|
|
18274
18556
|
*
|
|
18275
|
-
* **When to
|
|
18557
|
+
* **When to use**
|
|
18276
18558
|
*
|
|
18277
18559
|
* `mapErrorEager` provides better performance for effects that are already resolved
|
|
18278
18560
|
* by applying the error transformation immediately instead of deferring it through
|
|
18279
18561
|
* the effect pipeline.
|
|
18280
18562
|
*
|
|
18281
|
-
* **
|
|
18563
|
+
* **Details**
|
|
18564
|
+
*
|
|
18565
|
+
* Behavior:
|
|
18282
18566
|
*
|
|
18283
18567
|
* - For **Success effects**: Returns the success as-is (no error to transform)
|
|
18284
18568
|
* - For **Failure effects**: Applies the mapping function immediately to the error
|
|
@@ -18310,13 +18594,15 @@ export declare const mapErrorEager: {
|
|
|
18310
18594
|
* An optimized version of `mapBoth` that checks if an effect is already resolved
|
|
18311
18595
|
* and applies the appropriate mapping function eagerly when possible.
|
|
18312
18596
|
*
|
|
18313
|
-
* **When to
|
|
18597
|
+
* **When to use**
|
|
18314
18598
|
*
|
|
18315
18599
|
* `mapBothEager` provides better performance for effects that are already resolved
|
|
18316
18600
|
* by applying the transformation immediately instead of deferring it through
|
|
18317
18601
|
* the effect pipeline.
|
|
18318
18602
|
*
|
|
18319
|
-
* **
|
|
18603
|
+
* **Details**
|
|
18604
|
+
*
|
|
18605
|
+
* Behavior:
|
|
18320
18606
|
*
|
|
18321
18607
|
* - For **Success effects**: Applies the `onSuccess` function immediately to the value
|
|
18322
18608
|
* - For **Failure effects**: Applies the `onFailure` function immediately to the error
|
|
@@ -18349,13 +18635,15 @@ export declare const mapBothEager: {
|
|
|
18349
18635
|
* An optimized version of `mapBoth` that checks if an effect is already resolved
|
|
18350
18636
|
* and applies the appropriate mapping function eagerly when possible.
|
|
18351
18637
|
*
|
|
18352
|
-
* **When to
|
|
18638
|
+
* **When to use**
|
|
18353
18639
|
*
|
|
18354
18640
|
* `mapBothEager` provides better performance for effects that are already resolved
|
|
18355
18641
|
* by applying the transformation immediately instead of deferring it through
|
|
18356
18642
|
* the effect pipeline.
|
|
18357
18643
|
*
|
|
18358
|
-
* **
|
|
18644
|
+
* **Details**
|
|
18645
|
+
*
|
|
18646
|
+
* Behavior:
|
|
18359
18647
|
*
|
|
18360
18648
|
* - For **Success effects**: Applies the `onSuccess` function immediately to the value
|
|
18361
18649
|
* - For **Failure effects**: Applies the `onFailure` function immediately to the error
|
|
@@ -18391,13 +18679,15 @@ export declare const mapBothEager: {
|
|
|
18391
18679
|
* An optimized version of `mapBoth` that checks if an effect is already resolved
|
|
18392
18680
|
* and applies the appropriate mapping function eagerly when possible.
|
|
18393
18681
|
*
|
|
18394
|
-
* **When to
|
|
18682
|
+
* **When to use**
|
|
18395
18683
|
*
|
|
18396
18684
|
* `mapBothEager` provides better performance for effects that are already resolved
|
|
18397
18685
|
* by applying the transformation immediately instead of deferring it through
|
|
18398
18686
|
* the effect pipeline.
|
|
18399
18687
|
*
|
|
18400
|
-
* **
|
|
18688
|
+
* **Details**
|
|
18689
|
+
*
|
|
18690
|
+
* Behavior:
|
|
18401
18691
|
*
|
|
18402
18692
|
* - For **Success effects**: Applies the `onSuccess` function immediately to the value
|
|
18403
18693
|
* - For **Failure effects**: Applies the `onFailure` function immediately to the error
|
|
@@ -18434,13 +18724,15 @@ export declare const mapBothEager: {
|
|
|
18434
18724
|
* An optimized version of `flatMap` that checks if an effect is already resolved
|
|
18435
18725
|
* and applies the flatMap function eagerly when possible.
|
|
18436
18726
|
*
|
|
18437
|
-
* **When to
|
|
18727
|
+
* **When to use**
|
|
18438
18728
|
*
|
|
18439
18729
|
* `flatMapEager` provides better performance for effects that are already resolved
|
|
18440
18730
|
* by applying the transformation immediately instead of deferring it through
|
|
18441
18731
|
* the effect pipeline.
|
|
18442
18732
|
*
|
|
18443
|
-
* **
|
|
18733
|
+
* **Details**
|
|
18734
|
+
*
|
|
18735
|
+
* Behavior:
|
|
18444
18736
|
*
|
|
18445
18737
|
* - For **Success effects**: Applies the flatMap function immediately to the value
|
|
18446
18738
|
* - For **Failure effects**: Returns the failure as-is without applying the flatMap
|
|
@@ -18471,13 +18763,15 @@ export declare const flatMapEager: {
|
|
|
18471
18763
|
* An optimized version of `flatMap` that checks if an effect is already resolved
|
|
18472
18764
|
* and applies the flatMap function eagerly when possible.
|
|
18473
18765
|
*
|
|
18474
|
-
* **When to
|
|
18766
|
+
* **When to use**
|
|
18475
18767
|
*
|
|
18476
18768
|
* `flatMapEager` provides better performance for effects that are already resolved
|
|
18477
18769
|
* by applying the transformation immediately instead of deferring it through
|
|
18478
18770
|
* the effect pipeline.
|
|
18479
18771
|
*
|
|
18480
|
-
* **
|
|
18772
|
+
* **Details**
|
|
18773
|
+
*
|
|
18774
|
+
* Behavior:
|
|
18481
18775
|
*
|
|
18482
18776
|
* - For **Success effects**: Applies the flatMap function immediately to the value
|
|
18483
18777
|
* - For **Failure effects**: Returns the failure as-is without applying the flatMap
|
|
@@ -18508,13 +18802,15 @@ export declare const flatMapEager: {
|
|
|
18508
18802
|
* An optimized version of `flatMap` that checks if an effect is already resolved
|
|
18509
18803
|
* and applies the flatMap function eagerly when possible.
|
|
18510
18804
|
*
|
|
18511
|
-
* **When to
|
|
18805
|
+
* **When to use**
|
|
18512
18806
|
*
|
|
18513
18807
|
* `flatMapEager` provides better performance for effects that are already resolved
|
|
18514
18808
|
* by applying the transformation immediately instead of deferring it through
|
|
18515
18809
|
* the effect pipeline.
|
|
18516
18810
|
*
|
|
18517
|
-
* **
|
|
18811
|
+
* **Details**
|
|
18812
|
+
*
|
|
18813
|
+
* Behavior:
|
|
18518
18814
|
*
|
|
18519
18815
|
* - For **Success effects**: Applies the flatMap function immediately to the value
|
|
18520
18816
|
* - For **Failure effects**: Returns the failure as-is without applying the flatMap
|
|
@@ -18546,13 +18842,15 @@ export declare const flatMapEager: {
|
|
|
18546
18842
|
* An optimized version of `catch` that checks if an effect is already resolved
|
|
18547
18843
|
* and applies the catch function eagerly when possible.
|
|
18548
18844
|
*
|
|
18549
|
-
* **When to
|
|
18845
|
+
* **When to use**
|
|
18550
18846
|
*
|
|
18551
18847
|
* `catchEager` provides better performance for effects that are already resolved
|
|
18552
18848
|
* by applying the error recovery immediately instead of deferring it through
|
|
18553
18849
|
* the effect pipeline.
|
|
18554
18850
|
*
|
|
18555
|
-
* **
|
|
18851
|
+
* **Details**
|
|
18852
|
+
*
|
|
18853
|
+
* Behavior:
|
|
18556
18854
|
*
|
|
18557
18855
|
* - For **Success effects**: Returns the success as-is (no error to catch)
|
|
18558
18856
|
* - For **Failure effects**: Applies the catch function immediately to the error
|
|
@@ -18593,13 +18891,15 @@ export declare const catchEager: {
|
|
|
18593
18891
|
* An optimized version of `catch` that checks if an effect is already resolved
|
|
18594
18892
|
* and applies the catch function eagerly when possible.
|
|
18595
18893
|
*
|
|
18596
|
-
* **When to
|
|
18894
|
+
* **When to use**
|
|
18597
18895
|
*
|
|
18598
18896
|
* `catchEager` provides better performance for effects that are already resolved
|
|
18599
18897
|
* by applying the error recovery immediately instead of deferring it through
|
|
18600
18898
|
* the effect pipeline.
|
|
18601
18899
|
*
|
|
18602
|
-
* **
|
|
18900
|
+
* **Details**
|
|
18901
|
+
*
|
|
18902
|
+
* Behavior:
|
|
18603
18903
|
*
|
|
18604
18904
|
* - For **Success effects**: Returns the success as-is (no error to catch)
|
|
18605
18905
|
* - For **Failure effects**: Applies the catch function immediately to the error
|
|
@@ -18640,13 +18940,15 @@ export declare const catchEager: {
|
|
|
18640
18940
|
* An optimized version of `catch` that checks if an effect is already resolved
|
|
18641
18941
|
* and applies the catch function eagerly when possible.
|
|
18642
18942
|
*
|
|
18643
|
-
* **When to
|
|
18943
|
+
* **When to use**
|
|
18644
18944
|
*
|
|
18645
18945
|
* `catchEager` provides better performance for effects that are already resolved
|
|
18646
18946
|
* by applying the error recovery immediately instead of deferring it through
|
|
18647
18947
|
* the effect pipeline.
|
|
18648
18948
|
*
|
|
18649
|
-
* **
|
|
18949
|
+
* **Details**
|
|
18950
|
+
*
|
|
18951
|
+
* Behavior:
|
|
18650
18952
|
*
|
|
18651
18953
|
* - For **Success effects**: Returns the success as-is (no error to catch)
|
|
18652
18954
|
* - For **Failure effects**: Applies the catch function immediately to the error
|
|
@@ -18687,6 +18989,8 @@ export declare const catchEager: {
|
|
|
18687
18989
|
/**
|
|
18688
18990
|
* Creates untraced function effects with eager evaluation optimization.
|
|
18689
18991
|
*
|
|
18992
|
+
* **Details**
|
|
18993
|
+
*
|
|
18690
18994
|
* Executes generator functions eagerly when all yielded effects are synchronous,
|
|
18691
18995
|
* stopping at the first async effect and deferring to normal execution.
|
|
18692
18996
|
*
|