effect 4.0.0-beta.67 → 4.0.0-beta.69
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 +41 -42
- package/dist/Array.d.ts.map +1 -1
- package/dist/Array.js +23 -23
- package/dist/Array.js.map +1 -1
- package/dist/BigDecimal.d.ts +265 -265
- package/dist/BigDecimal.js +128 -128
- package/dist/BigInt.d.ts +175 -177
- package/dist/BigInt.d.ts.map +1 -1
- package/dist/BigInt.js +81 -79
- package/dist/BigInt.js.map +1 -1
- package/dist/Boolean.d.ts +127 -125
- package/dist/Boolean.d.ts.map +1 -1
- package/dist/Boolean.js +55 -53
- package/dist/Boolean.js.map +1 -1
- package/dist/Brand.d.ts +10 -4
- package/dist/Brand.d.ts.map +1 -1
- package/dist/Brand.js +3 -2
- package/dist/Brand.js.map +1 -1
- package/dist/Cache.d.ts +36 -36
- package/dist/Cache.js +17 -17
- package/dist/Cause.d.ts +17 -18
- package/dist/Cause.d.ts.map +1 -1
- package/dist/Cause.js +12 -12
- package/dist/Cause.js.map +1 -1
- package/dist/Channel.d.ts +234 -241
- package/dist/Channel.d.ts.map +1 -1
- package/dist/Channel.js +98 -102
- package/dist/Channel.js.map +1 -1
- package/dist/Chunk.d.ts +33 -56
- package/dist/Chunk.d.ts.map +1 -1
- package/dist/Chunk.js +17 -26
- package/dist/Chunk.js.map +1 -1
- package/dist/Clock.d.ts +1 -1
- package/dist/Clock.js +1 -1
- package/dist/Combiner.d.ts +9 -1
- package/dist/Combiner.d.ts.map +1 -1
- package/dist/Combiner.js +8 -0
- package/dist/Combiner.js.map +1 -1
- package/dist/Config.d.ts +78 -68
- package/dist/Config.d.ts.map +1 -1
- package/dist/Config.js +53 -49
- package/dist/Config.js.map +1 -1
- package/dist/ConfigProvider.d.ts +33 -32
- package/dist/ConfigProvider.d.ts.map +1 -1
- package/dist/ConfigProvider.js +19 -18
- package/dist/ConfigProvider.js.map +1 -1
- package/dist/Console.d.ts +19 -19
- package/dist/Console.js +19 -19
- package/dist/Context.d.ts +70 -108
- package/dist/Context.d.ts.map +1 -1
- package/dist/Context.js +30 -44
- package/dist/Context.js.map +1 -1
- package/dist/Cron.d.ts +3 -5
- package/dist/Cron.d.ts.map +1 -1
- package/dist/Cron.js +3 -5
- package/dist/Cron.js.map +1 -1
- package/dist/Crypto.d.ts +208 -0
- package/dist/Crypto.d.ts.map +1 -0
- package/dist/Crypto.js +157 -0
- package/dist/Crypto.js.map +1 -0
- package/dist/Data.d.ts +6 -1
- package/dist/Data.d.ts.map +1 -1
- package/dist/Data.js.map +1 -1
- package/dist/DateTime.d.ts +29 -31
- package/dist/DateTime.d.ts.map +1 -1
- package/dist/DateTime.js +19 -19
- package/dist/DateTime.js.map +1 -1
- package/dist/Deferred.d.ts +8 -9
- package/dist/Deferred.d.ts.map +1 -1
- package/dist/Deferred.js +6 -6
- package/dist/Deferred.js.map +1 -1
- package/dist/Differ.d.ts +2 -2
- package/dist/Duration.d.ts +30 -27
- package/dist/Duration.d.ts.map +1 -1
- package/dist/Duration.js +15 -12
- package/dist/Duration.js.map +1 -1
- package/dist/Effect.d.ts +879 -1137
- package/dist/Effect.d.ts.map +1 -1
- package/dist/Effect.js +375 -465
- package/dist/Effect.js.map +1 -1
- package/dist/Effectable.d.ts +2 -2
- package/dist/Effectable.js +2 -2
- package/dist/Encoding.d.ts +9 -9
- package/dist/Encoding.js +9 -9
- package/dist/Equal.d.ts +4 -3
- package/dist/Equal.d.ts.map +1 -1
- package/dist/Equal.js +4 -3
- package/dist/Equal.js.map +1 -1
- package/dist/Equivalence.d.ts +4 -5
- package/dist/Equivalence.d.ts.map +1 -1
- package/dist/Equivalence.js +2 -2
- package/dist/Equivalence.js.map +1 -1
- package/dist/ErrorReporter.d.ts +14 -14
- package/dist/ErrorReporter.js +9 -9
- package/dist/ExecutionPlan.d.ts +18 -9
- package/dist/ExecutionPlan.d.ts.map +1 -1
- package/dist/ExecutionPlan.js +6 -4
- package/dist/ExecutionPlan.js.map +1 -1
- package/dist/Exit.d.ts +0 -1
- package/dist/Exit.d.ts.map +1 -1
- package/dist/Exit.js.map +1 -1
- package/dist/Fiber.d.ts +1 -2
- package/dist/Fiber.d.ts.map +1 -1
- package/dist/Fiber.js +1 -1
- package/dist/Fiber.js.map +1 -1
- package/dist/FiberHandle.d.ts +5 -5
- package/dist/FiberHandle.js +3 -3
- package/dist/FiberMap.d.ts +10 -10
- package/dist/FiberMap.js +4 -4
- package/dist/FiberSet.d.ts +4 -4
- package/dist/FiberSet.js +2 -2
- package/dist/FileSystem.d.ts +10 -12
- package/dist/FileSystem.d.ts.map +1 -1
- package/dist/FileSystem.js +3 -3
- package/dist/FileSystem.js.map +1 -1
- package/dist/Filter.d.ts +54 -54
- package/dist/Filter.js +28 -28
- package/dist/Formatter.d.ts +4 -2
- package/dist/Formatter.d.ts.map +1 -1
- package/dist/Formatter.js +3 -69
- package/dist/Formatter.js.map +1 -1
- package/dist/Function.d.ts +64 -65
- package/dist/Function.d.ts.map +1 -1
- package/dist/Function.js +41 -41
- package/dist/Function.js.map +1 -1
- package/dist/Graph.d.ts +157 -175
- package/dist/Graph.d.ts.map +1 -1
- package/dist/Graph.js +72 -80
- package/dist/Graph.js.map +1 -1
- package/dist/Hash.d.ts +4 -6
- package/dist/Hash.d.ts.map +1 -1
- package/dist/Hash.js +2 -2
- package/dist/Hash.js.map +1 -1
- package/dist/HashMap.d.ts +121 -157
- package/dist/HashMap.d.ts.map +1 -1
- package/dist/HashMap.js +47 -59
- package/dist/HashMap.js.map +1 -1
- package/dist/HashRing.d.ts +34 -34
- package/dist/HashRing.js +16 -16
- package/dist/HashSet.d.ts +51 -55
- package/dist/HashSet.d.ts.map +1 -1
- package/dist/HashSet.js +19 -20
- package/dist/HashSet.js.map +1 -1
- package/dist/Inspectable.d.ts +6 -4
- package/dist/Inspectable.d.ts.map +1 -1
- package/dist/Inspectable.js +6 -4
- package/dist/Inspectable.js.map +1 -1
- package/dist/Iterable.d.ts +37 -83
- package/dist/Iterable.d.ts.map +1 -1
- package/dist/Iterable.js +21 -39
- package/dist/Iterable.js.map +1 -1
- package/dist/JsonPatch.d.ts +8 -6
- package/dist/JsonPatch.d.ts.map +1 -1
- package/dist/JsonPatch.js +5 -3
- package/dist/JsonPatch.js.map +1 -1
- package/dist/JsonPointer.d.ts +13 -11
- package/dist/JsonPointer.d.ts.map +1 -1
- package/dist/JsonPointer.js +13 -11
- package/dist/JsonPointer.js.map +1 -1
- package/dist/JsonSchema.d.ts +16 -0
- package/dist/JsonSchema.d.ts.map +1 -1
- package/dist/JsonSchema.js +10 -0
- package/dist/JsonSchema.js.map +1 -1
- package/dist/Latch.d.ts +4 -16
- package/dist/Latch.d.ts.map +1 -1
- package/dist/Latch.js +2 -14
- package/dist/Latch.js.map +1 -1
- package/dist/Layer.d.ts +94 -135
- package/dist/Layer.d.ts.map +1 -1
- package/dist/Layer.js +44 -61
- package/dist/Layer.js.map +1 -1
- package/dist/LayerMap.d.ts +15 -16
- package/dist/LayerMap.d.ts.map +1 -1
- package/dist/LayerMap.js +6 -6
- package/dist/LogLevel.d.ts +13 -13
- package/dist/LogLevel.js +4 -4
- package/dist/Logger.d.ts +10 -11
- package/dist/Logger.d.ts.map +1 -1
- package/dist/Logger.js +10 -11
- package/dist/Logger.js.map +1 -1
- package/dist/ManagedRuntime.d.ts +5 -4
- package/dist/ManagedRuntime.d.ts.map +1 -1
- package/dist/ManagedRuntime.js +4 -3
- package/dist/ManagedRuntime.js.map +1 -1
- package/dist/Match.d.ts +2 -4
- package/dist/Match.d.ts.map +1 -1
- package/dist/Match.js +1 -2
- package/dist/Match.js.map +1 -1
- package/dist/Metric.d.ts +48 -50
- package/dist/Metric.d.ts.map +1 -1
- package/dist/Metric.js +22 -22
- package/dist/Metric.js.map +1 -1
- package/dist/MutableHashMap.d.ts +30 -30
- package/dist/MutableHashMap.d.ts.map +1 -1
- package/dist/MutableHashMap.js +15 -14
- package/dist/MutableHashMap.js.map +1 -1
- package/dist/MutableHashSet.d.ts.map +1 -1
- package/dist/MutableHashSet.js +0 -2
- package/dist/MutableHashSet.js.map +1 -1
- package/dist/MutableList.d.ts +23 -24
- package/dist/MutableList.d.ts.map +1 -1
- package/dist/MutableList.js +17 -19
- package/dist/MutableList.js.map +1 -1
- package/dist/MutableRef.d.ts.map +1 -1
- package/dist/MutableRef.js +0 -1
- package/dist/MutableRef.js.map +1 -1
- package/dist/Newtype.d.ts +12 -2
- package/dist/Newtype.d.ts.map +1 -1
- package/dist/Newtype.js +8 -2
- package/dist/Newtype.js.map +1 -1
- package/dist/NonEmptyIterable.d.ts +5 -12
- package/dist/NonEmptyIterable.d.ts.map +1 -1
- package/dist/NonEmptyIterable.js +3 -8
- package/dist/NonEmptyIterable.js.map +1 -1
- package/dist/Number.d.ts +145 -141
- package/dist/Number.d.ts.map +1 -1
- package/dist/Number.js +65 -61
- package/dist/Number.js.map +1 -1
- package/dist/Optic.d.ts +5 -5
- package/dist/Optic.js +5 -5
- package/dist/Option.d.ts +105 -109
- package/dist/Option.d.ts.map +1 -1
- package/dist/Option.js +50 -52
- package/dist/Option.js.map +1 -1
- package/dist/Order.d.ts +6 -6
- package/dist/Order.js +6 -6
- package/dist/Ordering.d.ts +15 -19
- package/dist/Ordering.d.ts.map +1 -1
- package/dist/Ordering.js +6 -6
- package/dist/Ordering.js.map +1 -1
- package/dist/PartitionedSemaphore.d.ts +3 -3
- package/dist/PartitionedSemaphore.js +2 -2
- package/dist/Path.d.ts +4 -4
- package/dist/Path.d.ts.map +1 -1
- package/dist/Path.js +2 -1
- package/dist/Path.js.map +1 -1
- package/dist/Pipeable.d.ts +10 -7
- package/dist/Pipeable.d.ts.map +1 -1
- package/dist/Pipeable.js +6 -4
- package/dist/Pipeable.js.map +1 -1
- package/dist/PlatformError.d.ts +3 -3
- package/dist/PlatformError.js +2 -2
- package/dist/Predicate.d.ts +2 -4
- package/dist/Predicate.d.ts.map +1 -1
- package/dist/Predicate.js +3 -3
- package/dist/Predicate.js.map +1 -1
- package/dist/PrimaryKey.d.ts +2 -1
- package/dist/PrimaryKey.d.ts.map +1 -1
- package/dist/PrimaryKey.js +2 -1
- package/dist/PrimaryKey.js.map +1 -1
- package/dist/PubSub.d.ts +25 -51
- package/dist/PubSub.d.ts.map +1 -1
- package/dist/PubSub.js +17 -35
- package/dist/PubSub.js.map +1 -1
- package/dist/Queue.d.ts +45 -60
- package/dist/Queue.d.ts.map +1 -1
- package/dist/Queue.js +27 -33
- package/dist/Queue.js.map +1 -1
- package/dist/Random.d.ts +27 -38
- package/dist/Random.d.ts.map +1 -1
- package/dist/Random.js +17 -54
- package/dist/Random.js.map +1 -1
- package/dist/RcMap.d.ts +11 -11
- package/dist/RcMap.js +3 -3
- package/dist/RcRef.d.ts +0 -1
- package/dist/RcRef.d.ts.map +1 -1
- package/dist/RcRef.js.map +1 -1
- package/dist/Record.d.ts +9 -8
- package/dist/Record.d.ts.map +1 -1
- package/dist/Record.js +7 -5
- package/dist/Record.js.map +1 -1
- package/dist/Redactable.d.ts +7 -5
- package/dist/Redactable.d.ts.map +1 -1
- package/dist/Redactable.js +5 -3
- package/dist/Redactable.js.map +1 -1
- package/dist/Redacted.d.ts +2 -3
- package/dist/Redacted.d.ts.map +1 -1
- package/dist/Redacted.js +2 -2
- package/dist/Redacted.js.map +1 -1
- package/dist/Reducer.d.ts +3 -1
- package/dist/Reducer.d.ts.map +1 -1
- package/dist/Reducer.js +2 -0
- package/dist/Reducer.js.map +1 -1
- package/dist/Ref.d.ts +7 -17
- package/dist/Ref.d.ts.map +1 -1
- package/dist/Ref.js +5 -12
- package/dist/Ref.js.map +1 -1
- package/dist/RegExp.d.ts +1 -1
- package/dist/RegExp.js +1 -1
- package/dist/Request.d.ts +2 -1
- package/dist/Request.d.ts.map +1 -1
- package/dist/Request.js +1 -0
- package/dist/Request.js.map +1 -1
- package/dist/RequestResolver.d.ts +2 -3
- package/dist/RequestResolver.d.ts.map +1 -1
- package/dist/RequestResolver.js +1 -1
- package/dist/RequestResolver.js.map +1 -1
- package/dist/Resource.d.ts +1 -1
- package/dist/Resource.js +1 -1
- package/dist/Result.d.ts +124 -142
- package/dist/Result.d.ts.map +1 -1
- package/dist/Result.js +51 -63
- package/dist/Result.js.map +1 -1
- package/dist/Runtime.d.ts +2 -7
- package/dist/Runtime.d.ts.map +1 -1
- package/dist/Runtime.js +1 -3
- package/dist/Runtime.js.map +1 -1
- package/dist/Schedule.d.ts +69 -72
- package/dist/Schedule.d.ts.map +1 -1
- package/dist/Schedule.js +31 -33
- package/dist/Schedule.js.map +1 -1
- package/dist/Scheduler.d.ts +2 -2
- package/dist/Scheduler.js +2 -2
- package/dist/Schema.d.ts +491 -321
- package/dist/Schema.d.ts.map +1 -1
- package/dist/Schema.js +220 -172
- package/dist/Schema.js.map +1 -1
- package/dist/SchemaAST.d.ts +98 -77
- package/dist/SchemaAST.d.ts.map +1 -1
- package/dist/SchemaAST.js +89 -68
- package/dist/SchemaAST.js.map +1 -1
- package/dist/SchemaGetter.d.ts +23 -23
- package/dist/SchemaGetter.js +20 -20
- package/dist/SchemaIssue.d.ts +18 -16
- package/dist/SchemaIssue.d.ts.map +1 -1
- package/dist/SchemaIssue.js +16 -14
- package/dist/SchemaIssue.js.map +1 -1
- package/dist/SchemaParser.d.ts +39 -40
- package/dist/SchemaParser.d.ts.map +1 -1
- package/dist/SchemaParser.js +48 -51
- package/dist/SchemaParser.js.map +1 -1
- package/dist/SchemaRepresentation.d.ts +89 -77
- package/dist/SchemaRepresentation.d.ts.map +1 -1
- package/dist/SchemaRepresentation.js +47 -37
- package/dist/SchemaRepresentation.js.map +1 -1
- package/dist/SchemaTransformation.d.ts +36 -5
- package/dist/SchemaTransformation.d.ts.map +1 -1
- package/dist/SchemaTransformation.js +33 -5
- package/dist/SchemaTransformation.js.map +1 -1
- package/dist/SchemaUtils.d.ts +1 -1
- package/dist/SchemaUtils.js +1 -1
- package/dist/Scope.d.ts +12 -29
- package/dist/Scope.d.ts.map +1 -1
- package/dist/Scope.js +6 -11
- package/dist/Scope.js.map +1 -1
- package/dist/ScopedCache.d.ts +37 -37
- package/dist/ScopedCache.js +17 -17
- package/dist/Semaphore.d.ts +4 -16
- package/dist/Semaphore.d.ts.map +1 -1
- package/dist/Semaphore.js +2 -14
- package/dist/Semaphore.js.map +1 -1
- package/dist/Sink.d.ts +36 -39
- package/dist/Sink.d.ts.map +1 -1
- package/dist/Sink.js +18 -18
- package/dist/Sink.js.map +1 -1
- package/dist/Stdio.d.ts +6 -6
- package/dist/Stdio.js +4 -4
- package/dist/Stream.d.ts +671 -808
- package/dist/Stream.d.ts.map +1 -1
- package/dist/Stream.js +289 -363
- package/dist/Stream.js.map +1 -1
- package/dist/String.d.ts +3 -2
- package/dist/String.d.ts.map +1 -1
- package/dist/String.js +3 -2
- package/dist/String.js.map +1 -1
- package/dist/Struct.d.ts +20 -18
- package/dist/Struct.d.ts.map +1 -1
- package/dist/Struct.js +10 -8
- package/dist/Struct.js.map +1 -1
- package/dist/SubscriptionRef.d.ts +2 -2
- package/dist/SubscriptionRef.js +2 -2
- package/dist/Symbol.d.ts +3 -3
- package/dist/Symbol.js +3 -3
- package/dist/SynchronizedRef.d.ts +1 -1
- package/dist/SynchronizedRef.js +1 -1
- package/dist/Take.d.ts +2 -2
- package/dist/Take.js +1 -1
- package/dist/Terminal.d.ts +5 -5
- package/dist/Terminal.js +2 -2
- package/dist/Tracer.d.ts +9 -9
- package/dist/Tracer.js +2 -2
- package/dist/Trie.d.ts +70 -106
- package/dist/Trie.d.ts.map +1 -1
- package/dist/Trie.js +29 -43
- package/dist/Trie.js.map +1 -1
- package/dist/Tuple.d.ts +34 -32
- package/dist/Tuple.d.ts.map +1 -1
- package/dist/Tuple.js +16 -14
- package/dist/Tuple.js.map +1 -1
- package/dist/TxChunk.d.ts +27 -18
- package/dist/TxChunk.d.ts.map +1 -1
- package/dist/TxChunk.js +15 -10
- package/dist/TxChunk.js.map +1 -1
- package/dist/TxDeferred.d.ts +11 -11
- package/dist/TxDeferred.js +5 -5
- package/dist/TxHashMap.d.ts +60 -61
- package/dist/TxHashMap.d.ts.map +1 -1
- package/dist/TxHashMap.js +23 -23
- package/dist/TxHashMap.js.map +1 -1
- package/dist/TxHashSet.d.ts +28 -32
- package/dist/TxHashSet.d.ts.map +1 -1
- package/dist/TxHashSet.js +13 -16
- package/dist/TxHashSet.js.map +1 -1
- package/dist/TxPriorityQueue.d.ts +30 -30
- package/dist/TxPriorityQueue.js +18 -18
- package/dist/TxPubSub.d.ts +18 -18
- package/dist/TxPubSub.js +14 -14
- package/dist/TxQueue.d.ts +26 -29
- package/dist/TxQueue.d.ts.map +1 -1
- package/dist/TxQueue.js +17 -17
- package/dist/TxQueue.js.map +1 -1
- package/dist/TxReentrantLock.d.ts +21 -21
- package/dist/TxReentrantLock.js +15 -15
- package/dist/TxRef.d.ts +24 -24
- package/dist/TxRef.js +11 -11
- package/dist/TxSemaphore.d.ts +13 -74
- package/dist/TxSemaphore.d.ts.map +1 -1
- package/dist/TxSemaphore.js +9 -52
- package/dist/TxSemaphore.js.map +1 -1
- package/dist/TxSubscriptionRef.d.ts +24 -24
- package/dist/TxSubscriptionRef.js +11 -11
- package/dist/Types.d.ts +1 -4
- package/dist/Types.d.ts.map +1 -1
- package/dist/UndefinedOr.d.ts +14 -0
- package/dist/UndefinedOr.d.ts.map +1 -1
- package/dist/UndefinedOr.js +8 -0
- package/dist/UndefinedOr.js.map +1 -1
- package/dist/Unify.d.ts +8 -8
- package/dist/Unify.js +1 -1
- package/dist/Utils.d.ts +1 -2
- package/dist/Utils.d.ts.map +1 -1
- package/dist/Utils.js.map +1 -1
- package/dist/index.d.ts +1934 -436
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1934 -436
- package/dist/index.js.map +1 -1
- package/dist/testing/FastCheck.d.ts +3 -3
- package/dist/testing/FastCheck.js +3 -3
- package/dist/testing/TestClock.d.ts +2 -3
- package/dist/testing/TestClock.d.ts.map +1 -1
- package/dist/testing/TestClock.js +1 -1
- package/dist/testing/TestClock.js.map +1 -1
- package/dist/testing/TestConsole.d.ts +8 -9
- package/dist/testing/TestConsole.d.ts.map +1 -1
- package/dist/testing/TestConsole.js +5 -5
- package/dist/testing/TestConsole.js.map +1 -1
- package/dist/testing/TestSchema.d.ts +2 -0
- package/dist/testing/TestSchema.d.ts.map +1 -1
- package/dist/testing/TestSchema.js +2 -0
- package/dist/testing/TestSchema.js.map +1 -1
- package/dist/testing/index.d.ts +34 -0
- package/dist/testing/index.d.ts.map +1 -1
- package/dist/testing/index.js +34 -0
- package/dist/testing/index.js.map +1 -1
- package/dist/unstable/ai/AiError.d.ts +10 -19
- package/dist/unstable/ai/AiError.d.ts.map +1 -1
- package/dist/unstable/ai/AiError.js +0 -9
- package/dist/unstable/ai/AiError.js.map +1 -1
- package/dist/unstable/ai/Chat.d.ts +0 -1
- package/dist/unstable/ai/Chat.d.ts.map +1 -1
- package/dist/unstable/ai/Chat.js.map +1 -1
- package/dist/unstable/ai/McpSchema.d.ts +3 -0
- package/dist/unstable/ai/McpSchema.d.ts.map +1 -1
- package/dist/unstable/ai/McpSchema.js +2 -0
- package/dist/unstable/ai/McpSchema.js.map +1 -1
- package/dist/unstable/ai/McpServer.d.ts +3 -1
- package/dist/unstable/ai/McpServer.d.ts.map +1 -1
- package/dist/unstable/ai/McpServer.js +1 -1
- package/dist/unstable/ai/McpServer.js.map +1 -1
- package/dist/unstable/ai/Model.d.ts +2 -6
- package/dist/unstable/ai/Model.d.ts.map +1 -1
- package/dist/unstable/ai/Model.js +2 -2
- package/dist/unstable/ai/Model.js.map +1 -1
- package/dist/unstable/ai/Prompt.d.ts +8 -10
- package/dist/unstable/ai/Prompt.d.ts.map +1 -1
- package/dist/unstable/ai/Prompt.js +4 -4
- package/dist/unstable/ai/Prompt.js.map +1 -1
- package/dist/unstable/ai/Response.d.ts +20 -20
- package/dist/unstable/ai/ResponseIdTracker.d.ts +1 -1
- package/dist/unstable/ai/ResponseIdTracker.js +1 -1
- package/dist/unstable/ai/Telemetry.d.ts +5 -5
- package/dist/unstable/ai/Telemetry.js +3 -3
- package/dist/unstable/ai/Tokenizer.d.ts +1 -1
- package/dist/unstable/ai/Tool.d.ts +14 -12
- package/dist/unstable/ai/Tool.d.ts.map +1 -1
- package/dist/unstable/ai/Tool.js +10 -9
- package/dist/unstable/ai/Tool.js.map +1 -1
- package/dist/unstable/ai/index.d.ts +80 -6
- package/dist/unstable/ai/index.d.ts.map +1 -1
- package/dist/unstable/ai/index.js +80 -6
- package/dist/unstable/ai/index.js.map +1 -1
- package/dist/unstable/cli/CliOutput.d.ts +5 -6
- package/dist/unstable/cli/CliOutput.d.ts.map +1 -1
- package/dist/unstable/cli/CliOutput.js +2 -3
- package/dist/unstable/cli/CliOutput.js.map +1 -1
- package/dist/unstable/cli/Command.d.ts +3 -3
- package/dist/unstable/cli/Command.js +1 -1
- package/dist/unstable/cli/Flag.d.ts +23 -0
- package/dist/unstable/cli/Flag.d.ts.map +1 -1
- package/dist/unstable/cli/Flag.js +23 -0
- package/dist/unstable/cli/Flag.js.map +1 -1
- package/dist/unstable/cli/HelpDoc.d.ts +4 -4
- package/dist/unstable/cli/Param.d.ts +33 -1
- package/dist/unstable/cli/Param.d.ts.map +1 -1
- package/dist/unstable/cli/Param.js +64 -38
- package/dist/unstable/cli/Param.js.map +1 -1
- package/dist/unstable/cli/Primitive.d.ts +1 -1
- package/dist/unstable/cli/Primitive.js +1 -1
- package/dist/unstable/cli/Prompt.d.ts +6 -14
- package/dist/unstable/cli/Prompt.d.ts.map +1 -1
- package/dist/unstable/cli/Prompt.js +2 -2
- package/dist/unstable/cli/Prompt.js.map +1 -1
- package/dist/unstable/cli/index.d.ts +212 -0
- package/dist/unstable/cli/index.d.ts.map +1 -1
- package/dist/unstable/cli/index.js +205 -6
- package/dist/unstable/cli/index.js.map +1 -1
- package/dist/unstable/cli/internal/command.d.ts.map +1 -1
- package/dist/unstable/cli/internal/command.js +3 -0
- 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/help.d.ts.map +1 -1
- package/dist/unstable/cli/internal/help.js +10 -0
- package/dist/unstable/cli/internal/help.js.map +1 -1
- package/dist/unstable/cli/internal/parser.js +3 -1
- package/dist/unstable/cli/internal/parser.js.map +1 -1
- package/dist/unstable/cluster/ClusterCron.d.ts +1 -1
- package/dist/unstable/cluster/ClusterCron.js +1 -1
- package/dist/unstable/cluster/ClusterSchema.d.ts +8 -8
- package/dist/unstable/cluster/ClusterSchema.js +8 -8
- package/dist/unstable/cluster/ClusterWorkflowEngine.d.ts +2 -2
- package/dist/unstable/cluster/ClusterWorkflowEngine.js +2 -2
- package/dist/unstable/cluster/Entity.d.ts +0 -1
- package/dist/unstable/cluster/Entity.d.ts.map +1 -1
- package/dist/unstable/cluster/Entity.js.map +1 -1
- package/dist/unstable/cluster/EntityProxy.d.ts +10 -14
- package/dist/unstable/cluster/EntityProxy.d.ts.map +1 -1
- package/dist/unstable/cluster/EntityProxy.js +8 -14
- package/dist/unstable/cluster/EntityProxy.js.map +1 -1
- package/dist/unstable/cluster/EntityProxyServer.d.ts +3 -2
- package/dist/unstable/cluster/EntityProxyServer.d.ts.map +1 -1
- package/dist/unstable/cluster/EntityProxyServer.js +2 -2
- package/dist/unstable/cluster/EntityResource.d.ts +2 -2
- package/dist/unstable/cluster/EntityResource.js +1 -1
- package/dist/unstable/cluster/Envelope.d.ts +1 -1
- package/dist/unstable/cluster/Envelope.js +1 -1
- package/dist/unstable/cluster/HttpRunner.d.ts +11 -11
- package/dist/unstable/cluster/HttpRunner.js +11 -11
- package/dist/unstable/cluster/K8sHttpClient.d.ts +5 -5
- package/dist/unstable/cluster/K8sHttpClient.js +5 -5
- package/dist/unstable/cluster/MachineId.d.ts +1 -1
- package/dist/unstable/cluster/MachineId.js +1 -1
- package/dist/unstable/cluster/MessageStorage.d.ts +1 -2
- package/dist/unstable/cluster/MessageStorage.d.ts.map +1 -1
- package/dist/unstable/cluster/MessageStorage.js +1 -1
- package/dist/unstable/cluster/MessageStorage.js.map +1 -1
- package/dist/unstable/cluster/Runner.d.ts +1 -1
- package/dist/unstable/cluster/Runner.js +1 -1
- package/dist/unstable/cluster/RunnerHealth.d.ts +2 -2
- package/dist/unstable/cluster/RunnerHealth.js +2 -2
- package/dist/unstable/cluster/RunnerServer.d.ts +4 -4
- package/dist/unstable/cluster/RunnerServer.js +4 -4
- package/dist/unstable/cluster/Runners.d.ts +3 -3
- package/dist/unstable/cluster/Runners.js +3 -3
- package/dist/unstable/cluster/ShardId.d.ts +7 -5
- package/dist/unstable/cluster/ShardId.d.ts.map +1 -1
- package/dist/unstable/cluster/ShardId.js +6 -4
- package/dist/unstable/cluster/ShardId.js.map +1 -1
- package/dist/unstable/cluster/Sharding.js +1 -1
- package/dist/unstable/cluster/ShardingConfig.d.ts +2 -2
- package/dist/unstable/cluster/ShardingConfig.js +2 -2
- package/dist/unstable/cluster/SingleRunner.d.ts +1 -1
- package/dist/unstable/cluster/SingleRunner.js +1 -1
- package/dist/unstable/cluster/Snowflake.d.ts +10 -9
- package/dist/unstable/cluster/Snowflake.d.ts.map +1 -1
- package/dist/unstable/cluster/Snowflake.js +4 -3
- package/dist/unstable/cluster/Snowflake.js.map +1 -1
- package/dist/unstable/cluster/SocketRunner.d.ts +2 -2
- package/dist/unstable/cluster/SocketRunner.js +2 -2
- package/dist/unstable/cluster/SqlMessageStorage.d.ts +3 -3
- package/dist/unstable/cluster/SqlMessageStorage.js +3 -3
- package/dist/unstable/cluster/SqlRunnerStorage.d.ts +3 -3
- package/dist/unstable/cluster/SqlRunnerStorage.js +3 -3
- package/dist/unstable/cluster/TestRunner.d.ts +1 -1
- package/dist/unstable/cluster/TestRunner.js +1 -1
- package/dist/unstable/cluster/index.d.ts +790 -0
- package/dist/unstable/cluster/index.d.ts.map +1 -1
- package/dist/unstable/cluster/index.js +790 -0
- package/dist/unstable/cluster/index.js.map +1 -1
- package/dist/unstable/devtools/index.d.ts +58 -0
- package/dist/unstable/devtools/index.d.ts.map +1 -1
- package/dist/unstable/devtools/index.js +58 -0
- package/dist/unstable/devtools/index.js.map +1 -1
- package/dist/unstable/encoding/Sse.d.ts +16 -16
- package/dist/unstable/encoding/Sse.js +11 -11
- package/dist/unstable/encoding/index.d.ts +49 -0
- package/dist/unstable/encoding/index.d.ts.map +1 -1
- package/dist/unstable/encoding/index.js +49 -0
- package/dist/unstable/encoding/index.js.map +1 -1
- package/dist/unstable/eventlog/Event.d.ts +2 -2
- package/dist/unstable/eventlog/Event.js +1 -1
- package/dist/unstable/eventlog/EventGroup.d.ts +2 -2
- package/dist/unstable/eventlog/EventGroup.js +1 -1
- package/dist/unstable/eventlog/EventLog.d.ts +6 -7
- package/dist/unstable/eventlog/EventLog.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLog.js +4 -4
- package/dist/unstable/eventlog/EventLog.js.map +1 -1
- package/dist/unstable/eventlog/EventLogRemote.d.ts +2 -2
- package/dist/unstable/eventlog/EventLogRemote.js +2 -2
- package/dist/unstable/eventlog/EventLogServer.d.ts +2 -2
- package/dist/unstable/eventlog/EventLogServer.js +2 -2
- package/dist/unstable/eventlog/EventLogServerEncrypted.d.ts +2 -2
- package/dist/unstable/eventlog/EventLogServerEncrypted.js +2 -2
- package/dist/unstable/eventlog/EventLogServerUnencrypted.d.ts +1 -1
- package/dist/unstable/eventlog/EventLogServerUnencrypted.js +1 -1
- package/dist/unstable/eventlog/EventLogSessionAuth.d.ts +1 -1
- package/dist/unstable/eventlog/index.d.ts +240 -0
- package/dist/unstable/eventlog/index.d.ts.map +1 -1
- package/dist/unstable/eventlog/index.js +240 -0
- package/dist/unstable/eventlog/index.js.map +1 -1
- package/dist/unstable/http/Cookies.d.ts +6 -6
- package/dist/unstable/http/Cookies.js +4 -4
- package/dist/unstable/http/Etag.d.ts +2 -2
- package/dist/unstable/http/Etag.js +2 -2
- package/dist/unstable/http/Headers.d.ts +2 -2
- package/dist/unstable/http/Headers.js +1 -1
- package/dist/unstable/http/HttpClient.d.ts +5 -6
- package/dist/unstable/http/HttpClient.d.ts.map +1 -1
- package/dist/unstable/http/HttpClient.js +5 -4
- package/dist/unstable/http/HttpClient.js.map +1 -1
- package/dist/unstable/http/HttpClientError.d.ts +1 -1
- package/dist/unstable/http/HttpClientError.js +1 -1
- package/dist/unstable/http/HttpClientRequest.d.ts +4 -4
- package/dist/unstable/http/HttpClientRequest.js +4 -4
- package/dist/unstable/http/HttpClientResponse.d.ts +6 -6
- package/dist/unstable/http/HttpClientResponse.js +6 -6
- package/dist/unstable/http/HttpEffect.d.ts +5 -5
- package/dist/unstable/http/HttpEffect.js +5 -5
- package/dist/unstable/http/HttpIncomingMessage.d.ts +7 -6
- package/dist/unstable/http/HttpIncomingMessage.d.ts.map +1 -1
- package/dist/unstable/http/HttpIncomingMessage.js +7 -6
- package/dist/unstable/http/HttpIncomingMessage.js.map +1 -1
- package/dist/unstable/http/HttpMethod.d.ts +4 -2
- package/dist/unstable/http/HttpMethod.d.ts.map +1 -1
- package/dist/unstable/http/HttpMethod.js +4 -1
- package/dist/unstable/http/HttpMethod.js.map +1 -1
- package/dist/unstable/http/HttpMiddleware.d.ts +1 -0
- package/dist/unstable/http/HttpMiddleware.d.ts.map +1 -1
- package/dist/unstable/http/HttpMiddleware.js.map +1 -1
- package/dist/unstable/http/HttpRouter.d.ts +23 -25
- package/dist/unstable/http/HttpRouter.d.ts.map +1 -1
- package/dist/unstable/http/HttpRouter.js +23 -22
- package/dist/unstable/http/HttpRouter.js.map +1 -1
- package/dist/unstable/http/HttpServerError.d.ts +4 -1
- package/dist/unstable/http/HttpServerError.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerError.js +4 -1
- package/dist/unstable/http/HttpServerError.js.map +1 -1
- package/dist/unstable/http/HttpServerRequest.d.ts +15 -15
- package/dist/unstable/http/HttpServerRequest.js +15 -15
- package/dist/unstable/http/HttpServerRespondable.d.ts +1 -1
- package/dist/unstable/http/HttpServerRespondable.js +1 -1
- package/dist/unstable/http/HttpServerResponse.d.ts +5 -4
- package/dist/unstable/http/HttpServerResponse.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerResponse.js +5 -4
- package/dist/unstable/http/HttpServerResponse.js.map +1 -1
- package/dist/unstable/http/HttpStaticServer.d.ts +2 -4
- package/dist/unstable/http/HttpStaticServer.d.ts.map +1 -1
- package/dist/unstable/http/HttpStaticServer.js +2 -4
- package/dist/unstable/http/HttpStaticServer.js.map +1 -1
- package/dist/unstable/http/Multipart.d.ts +20 -19
- package/dist/unstable/http/Multipart.d.ts.map +1 -1
- package/dist/unstable/http/Multipart.js +19 -17
- package/dist/unstable/http/Multipart.js.map +1 -1
- package/dist/unstable/http/Template.d.ts +0 -1
- package/dist/unstable/http/Template.d.ts.map +1 -1
- package/dist/unstable/http/Template.js.map +1 -1
- package/dist/unstable/http/Url.d.ts +17 -17
- package/dist/unstable/http/Url.js +8 -8
- package/dist/unstable/http/UrlParams.d.ts +14 -12
- package/dist/unstable/http/UrlParams.d.ts.map +1 -1
- package/dist/unstable/http/UrlParams.js +12 -10
- package/dist/unstable/http/UrlParams.js.map +1 -1
- package/dist/unstable/http/index.d.ts +452 -0
- package/dist/unstable/http/index.d.ts.map +1 -1
- package/dist/unstable/http/index.js +452 -0
- package/dist/unstable/http/index.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiBuilder.d.ts +0 -1
- package/dist/unstable/httpapi/HttpApiBuilder.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiBuilder.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiClient.d.ts +0 -1
- package/dist/unstable/httpapi/HttpApiClient.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiClient.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiMiddleware.d.ts +4 -2
- package/dist/unstable/httpapi/HttpApiMiddleware.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiMiddleware.js +3 -1
- package/dist/unstable/httpapi/HttpApiMiddleware.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiScalar.d.ts +2 -2
- package/dist/unstable/httpapi/HttpApiSchema.d.ts +19 -8
- package/dist/unstable/httpapi/HttpApiSchema.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiSchema.js +11 -8
- package/dist/unstable/httpapi/HttpApiSchema.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiSecurity.d.ts +0 -1
- package/dist/unstable/httpapi/HttpApiSecurity.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiSecurity.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiSwagger.d.ts +0 -2
- package/dist/unstable/httpapi/HttpApiSwagger.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiSwagger.js +0 -2
- package/dist/unstable/httpapi/HttpApiSwagger.js.map +1 -1
- package/dist/unstable/httpapi/index.d.ts +310 -25
- package/dist/unstable/httpapi/index.d.ts.map +1 -1
- package/dist/unstable/httpapi/index.js +310 -25
- package/dist/unstable/httpapi/index.js.map +1 -1
- package/dist/unstable/observability/Otlp.d.ts +3 -3
- package/dist/unstable/observability/Otlp.js +3 -3
- package/dist/unstable/observability/OtlpExporter.d.ts +1 -1
- package/dist/unstable/observability/OtlpExporter.js +1 -1
- package/dist/unstable/observability/OtlpLogger.d.ts +3 -2
- package/dist/unstable/observability/OtlpLogger.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpLogger.js +2 -2
- package/dist/unstable/observability/OtlpLogger.js.map +1 -1
- package/dist/unstable/observability/OtlpMetrics.d.ts +5 -4
- package/dist/unstable/observability/OtlpMetrics.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpMetrics.js +2 -2
- package/dist/unstable/observability/OtlpMetrics.js.map +1 -1
- package/dist/unstable/observability/OtlpResource.d.ts +9 -9
- package/dist/unstable/observability/OtlpResource.js +2 -2
- package/dist/unstable/observability/OtlpSerialization.d.ts +3 -3
- package/dist/unstable/observability/OtlpSerialization.js +3 -3
- package/dist/unstable/observability/OtlpTracer.d.ts +5 -2
- package/dist/unstable/observability/OtlpTracer.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpTracer.js +2 -2
- package/dist/unstable/observability/OtlpTracer.js.map +1 -1
- package/dist/unstable/observability/PrometheusMetrics.d.ts +7 -7
- package/dist/unstable/observability/PrometheusMetrics.js +2 -2
- package/dist/unstable/observability/index.d.ts +159 -3
- package/dist/unstable/observability/index.d.ts.map +1 -1
- package/dist/unstable/observability/index.js +159 -3
- package/dist/unstable/observability/index.js.map +1 -1
- package/dist/unstable/persistence/KeyValueStore.d.ts +4 -4
- package/dist/unstable/persistence/KeyValueStore.js +1 -1
- package/dist/unstable/persistence/Persistable.d.ts +11 -11
- package/dist/unstable/persistence/Persistable.js +1 -1
- package/dist/unstable/persistence/PersistedCache.d.ts +2 -2
- package/dist/unstable/persistence/PersistedCache.js +1 -1
- package/dist/unstable/persistence/PersistedQueue.d.ts +6 -6
- package/dist/unstable/persistence/PersistedQueue.js +3 -3
- package/dist/unstable/persistence/Persistence.d.ts +2 -1
- package/dist/unstable/persistence/Persistence.d.ts.map +1 -1
- package/dist/unstable/persistence/Persistence.js +2 -1
- package/dist/unstable/persistence/Persistence.js.map +1 -1
- package/dist/unstable/persistence/RateLimiter.d.ts +19 -15
- package/dist/unstable/persistence/RateLimiter.d.ts.map +1 -1
- package/dist/unstable/persistence/RateLimiter.js +14 -10
- package/dist/unstable/persistence/RateLimiter.js.map +1 -1
- package/dist/unstable/persistence/Redis.d.ts +3 -3
- package/dist/unstable/persistence/Redis.js +3 -3
- package/dist/unstable/persistence/index.d.ts +147 -0
- package/dist/unstable/persistence/index.d.ts.map +1 -1
- package/dist/unstable/persistence/index.js +147 -0
- package/dist/unstable/persistence/index.js.map +1 -1
- package/dist/unstable/process/ChildProcess.d.ts +41 -41
- package/dist/unstable/process/ChildProcess.js +11 -11
- package/dist/unstable/process/ChildProcessSpawner.d.ts +10 -10
- package/dist/unstable/process/ChildProcessSpawner.js +5 -5
- package/dist/unstable/process/index.d.ts +1 -1
- package/dist/unstable/process/index.js +1 -1
- package/dist/unstable/reactivity/AsyncResult.d.ts +8 -6
- package/dist/unstable/reactivity/AsyncResult.d.ts.map +1 -1
- package/dist/unstable/reactivity/AsyncResult.js +3 -3
- package/dist/unstable/reactivity/AsyncResult.js.map +1 -1
- package/dist/unstable/reactivity/Atom.d.ts +25 -20
- package/dist/unstable/reactivity/Atom.d.ts.map +1 -1
- package/dist/unstable/reactivity/Atom.js +12 -12
- package/dist/unstable/reactivity/Atom.js.map +1 -1
- package/dist/unstable/reactivity/AtomHttpApi.d.ts +2 -2
- package/dist/unstable/reactivity/AtomHttpApi.js +1 -1
- package/dist/unstable/reactivity/AtomRef.d.ts +2 -2
- package/dist/unstable/reactivity/AtomRef.js +1 -1
- package/dist/unstable/reactivity/AtomRegistry.d.ts +16 -16
- package/dist/unstable/reactivity/AtomRegistry.js +7 -7
- package/dist/unstable/reactivity/AtomRpc.d.ts +2 -2
- package/dist/unstable/reactivity/AtomRpc.js +1 -1
- package/dist/unstable/reactivity/Reactivity.d.ts +2 -3
- package/dist/unstable/reactivity/Reactivity.d.ts.map +1 -1
- package/dist/unstable/reactivity/Reactivity.js +2 -3
- package/dist/unstable/reactivity/Reactivity.js.map +1 -1
- package/dist/unstable/reactivity/index.d.ts +166 -0
- package/dist/unstable/reactivity/index.d.ts.map +1 -1
- package/dist/unstable/reactivity/index.js +166 -0
- package/dist/unstable/reactivity/index.js.map +1 -1
- package/dist/unstable/rpc/Rpc.d.ts +0 -1
- package/dist/unstable/rpc/Rpc.d.ts.map +1 -1
- package/dist/unstable/rpc/Rpc.js.map +1 -1
- package/dist/unstable/rpc/RpcClient.d.ts +0 -1
- package/dist/unstable/rpc/RpcClient.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcClient.js.map +1 -1
- package/dist/unstable/rpc/RpcClientError.d.ts +2 -2
- package/dist/unstable/rpc/RpcClientError.js +2 -2
- package/dist/unstable/rpc/RpcMiddleware.d.ts +2 -2
- package/dist/unstable/rpc/RpcMiddleware.js +1 -1
- package/dist/unstable/rpc/RpcWorker.d.ts +0 -1
- package/dist/unstable/rpc/RpcWorker.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcWorker.js +1 -1
- package/dist/unstable/rpc/RpcWorker.js.map +1 -1
- package/dist/unstable/rpc/Utils.d.ts +2 -0
- package/dist/unstable/rpc/Utils.d.ts.map +1 -1
- package/dist/unstable/rpc/Utils.js +2 -0
- package/dist/unstable/rpc/Utils.js.map +1 -1
- package/dist/unstable/rpc/index.d.ts +272 -0
- package/dist/unstable/rpc/index.d.ts.map +1 -1
- package/dist/unstable/rpc/index.js +272 -0
- package/dist/unstable/rpc/index.js.map +1 -1
- package/dist/unstable/schema/Model.d.ts +63 -8
- package/dist/unstable/schema/Model.d.ts.map +1 -1
- package/dist/unstable/schema/Model.js +44 -5
- package/dist/unstable/schema/Model.js.map +1 -1
- package/dist/unstable/schema/VariantSchema.d.ts +1 -4
- package/dist/unstable/schema/VariantSchema.d.ts.map +1 -1
- package/dist/unstable/schema/VariantSchema.js +1 -1
- package/dist/unstable/schema/VariantSchema.js.map +1 -1
- package/dist/unstable/schema/index.d.ts +37 -0
- package/dist/unstable/schema/index.d.ts.map +1 -1
- package/dist/unstable/schema/index.js +37 -0
- package/dist/unstable/schema/index.js.map +1 -1
- package/dist/unstable/socket/Socket.d.ts +5 -4
- package/dist/unstable/socket/Socket.d.ts.map +1 -1
- package/dist/unstable/socket/Socket.js +4 -3
- package/dist/unstable/socket/Socket.js.map +1 -1
- package/dist/unstable/socket/index.d.ts +44 -0
- package/dist/unstable/socket/index.d.ts.map +1 -1
- package/dist/unstable/socket/index.js +44 -0
- package/dist/unstable/socket/index.js.map +1 -1
- package/dist/unstable/sql/Migrator.d.ts +11 -9
- package/dist/unstable/sql/Migrator.d.ts.map +1 -1
- package/dist/unstable/sql/Migrator.js +10 -8
- package/dist/unstable/sql/Migrator.js.map +1 -1
- package/dist/unstable/sql/SqlClient.d.ts +4 -0
- package/dist/unstable/sql/SqlClient.d.ts.map +1 -1
- package/dist/unstable/sql/SqlClient.js +2 -0
- package/dist/unstable/sql/SqlClient.js.map +1 -1
- package/dist/unstable/sql/SqlConnection.d.ts +3 -3
- package/dist/unstable/sql/SqlError.d.ts +18 -0
- package/dist/unstable/sql/SqlError.d.ts.map +1 -1
- package/dist/unstable/sql/SqlError.js +17 -0
- package/dist/unstable/sql/SqlError.js.map +1 -1
- package/dist/unstable/sql/SqlModel.d.ts +0 -1
- package/dist/unstable/sql/SqlModel.d.ts.map +1 -1
- package/dist/unstable/sql/SqlModel.js.map +1 -1
- package/dist/unstable/sql/SqlSchema.d.ts +5 -5
- package/dist/unstable/sql/SqlSchema.js +5 -5
- package/dist/unstable/sql/SqlStream.d.ts +1 -0
- package/dist/unstable/sql/SqlStream.d.ts.map +1 -1
- package/dist/unstable/sql/SqlStream.js +1 -0
- package/dist/unstable/sql/SqlStream.js.map +1 -1
- package/dist/unstable/sql/Statement.d.ts +27 -24
- package/dist/unstable/sql/Statement.d.ts.map +1 -1
- package/dist/unstable/sql/Statement.js +9 -6
- package/dist/unstable/sql/Statement.js.map +1 -1
- package/dist/unstable/sql/index.d.ts +178 -1
- package/dist/unstable/sql/index.d.ts.map +1 -1
- package/dist/unstable/sql/index.js +178 -1
- package/dist/unstable/sql/index.js.map +1 -1
- package/dist/unstable/workers/Transferable.d.ts +7 -7
- package/dist/unstable/workers/Transferable.js +4 -4
- package/dist/unstable/workers/Worker.d.ts +1 -0
- package/dist/unstable/workers/Worker.d.ts.map +1 -1
- package/dist/unstable/workers/Worker.js +1 -0
- package/dist/unstable/workers/Worker.js.map +1 -1
- package/dist/unstable/workers/WorkerError.d.ts +8 -8
- package/dist/unstable/workers/WorkerError.js +7 -7
- package/dist/unstable/workers/index.d.ts +80 -0
- package/dist/unstable/workers/index.d.ts.map +1 -1
- package/dist/unstable/workers/index.js +80 -0
- package/dist/unstable/workers/index.js.map +1 -1
- package/dist/unstable/workflow/Activity.d.ts +7 -7
- package/dist/unstable/workflow/Activity.js +2 -2
- package/dist/unstable/workflow/DurableClock.d.ts +2 -2
- package/dist/unstable/workflow/DurableClock.js +1 -1
- package/dist/unstable/workflow/DurableDeferred.d.ts +22 -20
- package/dist/unstable/workflow/DurableDeferred.d.ts.map +1 -1
- package/dist/unstable/workflow/DurableDeferred.js +8 -7
- package/dist/unstable/workflow/DurableDeferred.js.map +1 -1
- package/dist/unstable/workflow/DurableQueue.d.ts +7 -5
- package/dist/unstable/workflow/DurableQueue.d.ts.map +1 -1
- package/dist/unstable/workflow/DurableQueue.js +5 -3
- package/dist/unstable/workflow/DurableQueue.js.map +1 -1
- package/dist/unstable/workflow/Workflow.d.ts +12 -10
- package/dist/unstable/workflow/Workflow.d.ts.map +1 -1
- package/dist/unstable/workflow/Workflow.js +3 -3
- package/dist/unstable/workflow/Workflow.js.map +1 -1
- package/dist/unstable/workflow/WorkflowEngine.d.ts +4 -4
- package/dist/unstable/workflow/WorkflowEngine.d.ts.map +1 -1
- package/dist/unstable/workflow/WorkflowEngine.js +9 -13
- package/dist/unstable/workflow/WorkflowEngine.js.map +1 -1
- package/dist/unstable/workflow/WorkflowProxy.d.ts +10 -12
- package/dist/unstable/workflow/WorkflowProxy.d.ts.map +1 -1
- package/dist/unstable/workflow/WorkflowProxy.js +8 -12
- package/dist/unstable/workflow/WorkflowProxy.js.map +1 -1
- package/dist/unstable/workflow/WorkflowProxyServer.d.ts +3 -2
- package/dist/unstable/workflow/WorkflowProxyServer.d.ts.map +1 -1
- package/dist/unstable/workflow/WorkflowProxyServer.js +2 -2
- package/dist/unstable/workflow/index.d.ts +160 -0
- package/dist/unstable/workflow/index.d.ts.map +1 -1
- package/dist/unstable/workflow/index.js +160 -0
- package/dist/unstable/workflow/index.js.map +1 -1
- package/package.json +3 -3
- package/src/Array.ts +41 -42
- package/src/BigDecimal.ts +265 -265
- package/src/BigInt.ts +175 -177
- package/src/Boolean.ts +127 -125
- package/src/Brand.ts +10 -4
- package/src/Cache.ts +42 -42
- package/src/Cause.ts +17 -18
- package/src/Channel.ts +256 -257
- package/src/Chunk.ts +33 -56
- package/src/Clock.ts +1 -1
- package/src/Combiner.ts +9 -1
- package/src/Config.ts +78 -68
- package/src/ConfigProvider.ts +33 -32
- package/src/Console.ts +23 -23
- package/src/Context.ts +70 -108
- package/src/Cron.ts +3 -5
- package/src/Crypto.ts +327 -0
- package/src/Data.ts +6 -1
- package/src/DateTime.ts +29 -31
- package/src/Deferred.ts +8 -9
- package/src/Differ.ts +2 -2
- package/src/Duration.ts +30 -27
- package/src/Effect.ts +893 -1151
- package/src/Effectable.ts +2 -2
- package/src/Encoding.ts +9 -9
- package/src/Equal.ts +4 -3
- package/src/Equivalence.ts +4 -5
- package/src/ErrorReporter.ts +14 -14
- package/src/ExecutionPlan.ts +18 -9
- package/src/Exit.ts +0 -1
- package/src/Fiber.ts +1 -2
- package/src/FiberHandle.ts +5 -5
- package/src/FiberMap.ts +10 -10
- package/src/FiberSet.ts +4 -4
- package/src/FileSystem.ts +10 -12
- package/src/Filter.ts +54 -54
- package/src/Formatter.ts +4 -70
- package/src/Function.ts +64 -65
- package/src/Graph.ts +157 -175
- package/src/Hash.ts +4 -6
- package/src/HashMap.ts +121 -157
- package/src/HashRing.ts +34 -34
- package/src/HashSet.ts +51 -55
- package/src/Inspectable.ts +8 -7
- package/src/Iterable.ts +37 -83
- package/src/JsonPatch.ts +9 -7
- package/src/JsonPointer.ts +13 -11
- package/src/JsonSchema.ts +16 -0
- package/src/Latch.ts +4 -16
- package/src/Layer.ts +94 -135
- package/src/LayerMap.ts +15 -16
- package/src/LogLevel.ts +13 -13
- package/src/Logger.ts +16 -17
- package/src/ManagedRuntime.ts +5 -4
- package/src/Match.ts +2 -4
- package/src/Metric.ts +56 -58
- package/src/MutableHashMap.ts +42 -44
- package/src/MutableHashSet.ts +0 -2
- package/src/MutableList.ts +23 -26
- package/src/MutableRef.ts +0 -1
- package/src/Newtype.ts +12 -2
- package/src/NonEmptyIterable.ts +5 -12
- package/src/Number.ts +145 -141
- package/src/Optic.ts +5 -5
- package/src/Option.ts +105 -109
- package/src/Order.ts +6 -6
- package/src/Ordering.ts +15 -19
- package/src/PartitionedSemaphore.ts +3 -3
- package/src/Path.ts +4 -4
- package/src/Pipeable.ts +10 -7
- package/src/PlatformError.ts +3 -3
- package/src/Predicate.ts +3 -5
- package/src/PrimaryKey.ts +2 -1
- package/src/PubSub.ts +25 -51
- package/src/Queue.ts +45 -60
- package/src/Random.ts +31 -74
- package/src/RcMap.ts +11 -11
- package/src/RcRef.ts +0 -1
- package/src/Record.ts +9 -8
- package/src/Redactable.ts +7 -5
- package/src/Redacted.ts +2 -3
- package/src/Reducer.ts +3 -1
- package/src/Ref.ts +15 -33
- package/src/RegExp.ts +1 -1
- package/src/Request.ts +2 -1
- package/src/RequestResolver.ts +2 -3
- package/src/Resource.ts +1 -1
- package/src/Result.ts +124 -142
- package/src/Runtime.ts +2 -7
- package/src/Schedule.ts +74 -77
- package/src/Scheduler.ts +2 -2
- package/src/Schema.ts +491 -321
- package/src/SchemaAST.ts +98 -77
- package/src/SchemaGetter.ts +23 -23
- package/src/SchemaIssue.ts +18 -16
- package/src/SchemaParser.ts +46 -49
- package/src/SchemaRepresentation.ts +89 -77
- package/src/SchemaTransformation.ts +36 -5
- package/src/SchemaUtils.ts +1 -1
- package/src/Scope.ts +12 -29
- package/src/ScopedCache.ts +43 -43
- package/src/Semaphore.ts +4 -16
- package/src/Sink.ts +36 -39
- package/src/Stdio.ts +6 -6
- package/src/Stream.ts +789 -828
- package/src/String.ts +3 -2
- package/src/Struct.ts +20 -18
- package/src/SubscriptionRef.ts +2 -2
- package/src/Symbol.ts +3 -3
- package/src/SynchronizedRef.ts +1 -1
- package/src/Take.ts +2 -2
- package/src/Terminal.ts +5 -5
- package/src/Tracer.ts +9 -9
- package/src/Trie.ts +70 -106
- package/src/Tuple.ts +34 -32
- package/src/TxChunk.ts +27 -18
- package/src/TxDeferred.ts +11 -11
- package/src/TxHashMap.ts +62 -63
- package/src/TxHashSet.ts +38 -42
- package/src/TxPriorityQueue.ts +31 -31
- package/src/TxPubSub.ts +18 -18
- package/src/TxQueue.ts +26 -29
- package/src/TxReentrantLock.ts +21 -21
- package/src/TxRef.ts +24 -24
- package/src/TxSemaphore.ts +13 -74
- package/src/TxSubscriptionRef.ts +24 -24
- package/src/Types.ts +1 -4
- package/src/UndefinedOr.ts +14 -0
- package/src/Unify.ts +8 -8
- package/src/Utils.ts +1 -2
- package/src/index.ts +1932 -433
- package/src/testing/FastCheck.ts +3 -3
- package/src/testing/TestClock.ts +2 -3
- package/src/testing/TestConsole.ts +8 -9
- package/src/testing/TestSchema.ts +2 -0
- package/src/testing/index.ts +34 -0
- package/src/unstable/ai/AiError.ts +10 -19
- package/src/unstable/ai/Chat.ts +0 -1
- package/src/unstable/ai/McpSchema.ts +3 -0
- package/src/unstable/ai/McpServer.ts +3 -1
- package/src/unstable/ai/Model.ts +2 -6
- package/src/unstable/ai/Prompt.ts +8 -10
- package/src/unstable/ai/Response.ts +20 -20
- package/src/unstable/ai/ResponseIdTracker.ts +1 -1
- package/src/unstable/ai/Telemetry.ts +5 -5
- package/src/unstable/ai/Tokenizer.ts +1 -1
- package/src/unstable/ai/Tool.ts +14 -12
- package/src/unstable/ai/index.ts +80 -6
- package/src/unstable/cli/CliOutput.ts +5 -6
- package/src/unstable/cli/Command.ts +3 -3
- package/src/unstable/cli/Flag.ts +24 -0
- package/src/unstable/cli/HelpDoc.ts +4 -4
- package/src/unstable/cli/Param.ts +101 -72
- package/src/unstable/cli/Primitive.ts +1 -1
- package/src/unstable/cli/Prompt.ts +6 -14
- package/src/unstable/cli/index.ts +205 -6
- package/src/unstable/cli/internal/command.ts +3 -0
- package/src/unstable/cli/internal/completions/descriptor.ts +3 -0
- package/src/unstable/cli/internal/help.ts +10 -0
- package/src/unstable/cli/internal/parser.ts +3 -1
- package/src/unstable/cluster/ClusterCron.ts +1 -1
- package/src/unstable/cluster/ClusterSchema.ts +8 -8
- package/src/unstable/cluster/ClusterWorkflowEngine.ts +2 -2
- package/src/unstable/cluster/Entity.ts +0 -1
- package/src/unstable/cluster/EntityProxy.ts +10 -14
- package/src/unstable/cluster/EntityProxyServer.ts +3 -2
- package/src/unstable/cluster/EntityResource.ts +2 -2
- package/src/unstable/cluster/Envelope.ts +1 -1
- package/src/unstable/cluster/HttpRunner.ts +11 -11
- package/src/unstable/cluster/K8sHttpClient.ts +5 -5
- package/src/unstable/cluster/MachineId.ts +1 -1
- package/src/unstable/cluster/MessageStorage.ts +1 -2
- package/src/unstable/cluster/Runner.ts +1 -1
- package/src/unstable/cluster/RunnerHealth.ts +2 -2
- package/src/unstable/cluster/RunnerServer.ts +4 -4
- package/src/unstable/cluster/Runners.ts +3 -3
- package/src/unstable/cluster/ShardId.ts +7 -5
- package/src/unstable/cluster/Sharding.ts +1 -1
- package/src/unstable/cluster/ShardingConfig.ts +2 -2
- package/src/unstable/cluster/SingleRunner.ts +1 -1
- package/src/unstable/cluster/Snowflake.ts +10 -9
- package/src/unstable/cluster/SocketRunner.ts +2 -2
- package/src/unstable/cluster/SqlMessageStorage.ts +3 -3
- package/src/unstable/cluster/SqlRunnerStorage.ts +3 -3
- package/src/unstable/cluster/TestRunner.ts +1 -1
- package/src/unstable/cluster/index.ts +790 -0
- package/src/unstable/devtools/index.ts +58 -0
- package/src/unstable/encoding/Sse.ts +16 -16
- package/src/unstable/encoding/index.ts +49 -0
- package/src/unstable/eventlog/Event.ts +2 -2
- package/src/unstable/eventlog/EventGroup.ts +2 -2
- package/src/unstable/eventlog/EventLog.ts +6 -7
- package/src/unstable/eventlog/EventLogRemote.ts +2 -2
- package/src/unstable/eventlog/EventLogServer.ts +2 -2
- package/src/unstable/eventlog/EventLogServerEncrypted.ts +2 -2
- package/src/unstable/eventlog/EventLogServerUnencrypted.ts +1 -1
- package/src/unstable/eventlog/EventLogSessionAuth.ts +1 -1
- package/src/unstable/eventlog/index.ts +240 -0
- package/src/unstable/http/Cookies.ts +6 -6
- package/src/unstable/http/Etag.ts +2 -2
- package/src/unstable/http/Headers.ts +2 -2
- package/src/unstable/http/HttpClient.ts +5 -6
- package/src/unstable/http/HttpClientError.ts +1 -1
- package/src/unstable/http/HttpClientRequest.ts +4 -4
- package/src/unstable/http/HttpClientResponse.ts +6 -6
- package/src/unstable/http/HttpEffect.ts +5 -5
- package/src/unstable/http/HttpIncomingMessage.ts +7 -6
- package/src/unstable/http/HttpMethod.ts +4 -2
- package/src/unstable/http/HttpMiddleware.ts +1 -0
- package/src/unstable/http/HttpRouter.ts +23 -25
- package/src/unstable/http/HttpServerError.ts +4 -1
- package/src/unstable/http/HttpServerRequest.ts +15 -15
- package/src/unstable/http/HttpServerRespondable.ts +1 -1
- package/src/unstable/http/HttpServerResponse.ts +5 -4
- package/src/unstable/http/HttpStaticServer.ts +2 -4
- package/src/unstable/http/Multipart.ts +20 -19
- package/src/unstable/http/Template.ts +0 -1
- package/src/unstable/http/Url.ts +17 -17
- package/src/unstable/http/UrlParams.ts +14 -12
- package/src/unstable/http/index.ts +452 -0
- package/src/unstable/httpapi/HttpApiBuilder.ts +0 -1
- package/src/unstable/httpapi/HttpApiClient.ts +0 -1
- package/src/unstable/httpapi/HttpApiMiddleware.ts +4 -2
- package/src/unstable/httpapi/HttpApiScalar.ts +2 -2
- package/src/unstable/httpapi/HttpApiSchema.ts +19 -8
- package/src/unstable/httpapi/HttpApiSecurity.ts +0 -1
- package/src/unstable/httpapi/HttpApiSwagger.ts +0 -2
- package/src/unstable/httpapi/index.ts +310 -25
- package/src/unstable/observability/Otlp.ts +3 -3
- package/src/unstable/observability/OtlpExporter.ts +1 -1
- package/src/unstable/observability/OtlpLogger.ts +3 -2
- package/src/unstable/observability/OtlpMetrics.ts +5 -4
- package/src/unstable/observability/OtlpResource.ts +9 -9
- package/src/unstable/observability/OtlpSerialization.ts +3 -3
- package/src/unstable/observability/OtlpTracer.ts +5 -2
- package/src/unstable/observability/PrometheusMetrics.ts +7 -7
- package/src/unstable/observability/index.ts +159 -3
- package/src/unstable/persistence/KeyValueStore.ts +4 -4
- package/src/unstable/persistence/Persistable.ts +11 -11
- package/src/unstable/persistence/PersistedCache.ts +2 -2
- package/src/unstable/persistence/PersistedQueue.ts +6 -6
- package/src/unstable/persistence/Persistence.ts +2 -1
- package/src/unstable/persistence/RateLimiter.ts +19 -15
- package/src/unstable/persistence/Redis.ts +3 -3
- package/src/unstable/persistence/index.ts +147 -0
- package/src/unstable/process/ChildProcess.ts +42 -42
- package/src/unstable/process/ChildProcessSpawner.ts +10 -10
- package/src/unstable/process/index.ts +1 -1
- package/src/unstable/reactivity/AsyncResult.ts +8 -6
- package/src/unstable/reactivity/Atom.ts +25 -20
- package/src/unstable/reactivity/AtomHttpApi.ts +2 -2
- package/src/unstable/reactivity/AtomRef.ts +2 -2
- package/src/unstable/reactivity/AtomRegistry.ts +17 -17
- package/src/unstable/reactivity/AtomRpc.ts +2 -2
- package/src/unstable/reactivity/Reactivity.ts +2 -3
- package/src/unstable/reactivity/index.ts +166 -0
- package/src/unstable/rpc/Rpc.ts +0 -1
- package/src/unstable/rpc/RpcClient.ts +0 -1
- package/src/unstable/rpc/RpcClientError.ts +2 -2
- package/src/unstable/rpc/RpcMiddleware.ts +2 -2
- package/src/unstable/rpc/RpcWorker.ts +3 -2
- package/src/unstable/rpc/Utils.ts +2 -0
- package/src/unstable/rpc/index.ts +272 -0
- package/src/unstable/schema/Model.ts +98 -10
- package/src/unstable/schema/VariantSchema.ts +1 -4
- package/src/unstable/schema/index.ts +37 -0
- package/src/unstable/socket/Socket.ts +5 -4
- package/src/unstable/socket/index.ts +44 -0
- package/src/unstable/sql/Migrator.ts +14 -12
- package/src/unstable/sql/SqlClient.ts +4 -0
- package/src/unstable/sql/SqlConnection.ts +3 -3
- package/src/unstable/sql/SqlError.ts +18 -0
- package/src/unstable/sql/SqlModel.ts +0 -1
- package/src/unstable/sql/SqlSchema.ts +5 -5
- package/src/unstable/sql/SqlStream.ts +1 -0
- package/src/unstable/sql/Statement.ts +27 -24
- package/src/unstable/sql/index.ts +178 -1
- package/src/unstable/workers/Transferable.ts +7 -7
- package/src/unstable/workers/Worker.ts +1 -0
- package/src/unstable/workers/WorkerError.ts +8 -8
- package/src/unstable/workers/index.ts +80 -0
- package/src/unstable/workflow/Activity.ts +7 -7
- package/src/unstable/workflow/DurableClock.ts +2 -2
- package/src/unstable/workflow/DurableDeferred.ts +22 -20
- package/src/unstable/workflow/DurableQueue.ts +7 -5
- package/src/unstable/workflow/Workflow.ts +12 -10
- package/src/unstable/workflow/WorkflowEngine.ts +11 -15
- package/src/unstable/workflow/WorkflowProxy.ts +10 -12
- package/src/unstable/workflow/WorkflowProxyServer.ts +3 -2
- package/src/unstable/workflow/index.ts +160 -0
package/dist/Schema.d.ts
CHANGED
|
@@ -125,6 +125,7 @@ declare const TypeId = "~effect/Schema/Schema";
|
|
|
125
125
|
* @see {@link optionalKey} — mark a struct field as optional
|
|
126
126
|
* @see {@link optional} — mark a struct field as optional with `| undefined`
|
|
127
127
|
*
|
|
128
|
+
* @category models
|
|
128
129
|
* @since 4.0.0
|
|
129
130
|
*/
|
|
130
131
|
export type Optionality = "required" | "optional";
|
|
@@ -133,6 +134,7 @@ export type Optionality = "required" | "optional";
|
|
|
133
134
|
*
|
|
134
135
|
* @see {@link mutableKey} — mark a struct field as mutable
|
|
135
136
|
*
|
|
137
|
+
* @category models
|
|
136
138
|
* @since 4.0.0
|
|
137
139
|
*/
|
|
138
140
|
export type Mutability = "readonly" | "mutable";
|
|
@@ -142,6 +144,7 @@ export type Mutability = "readonly" | "mutable";
|
|
|
142
144
|
* @see {@link withConstructorDefault} — add a default to a schema field
|
|
143
145
|
* @see {@link tag} — creates a literal field with a constructor default
|
|
144
146
|
*
|
|
147
|
+
* @category models
|
|
145
148
|
* @since 4.0.0
|
|
146
149
|
*/
|
|
147
150
|
export type ConstructorDefault = "no-default" | "with-default";
|
|
@@ -155,7 +158,8 @@ export type ConstructorDefault = "no-default" | "with-default";
|
|
|
155
158
|
* @see {@link Bottom.makeEffect}
|
|
156
159
|
* @see {@link Bottom.make}
|
|
157
160
|
*
|
|
158
|
-
* @
|
|
161
|
+
* @category models
|
|
162
|
+
* @since 3.13.4
|
|
159
163
|
*/
|
|
160
164
|
export interface MakeOptions {
|
|
161
165
|
/**
|
|
@@ -182,6 +186,7 @@ export interface MakeOptions {
|
|
|
182
186
|
* @see {@link Schema} — tracks only the decoded Type
|
|
183
187
|
* @see {@link Codec} — tracks Type + Encoded
|
|
184
188
|
*
|
|
189
|
+
* @category models
|
|
185
190
|
* @since 4.0.0
|
|
186
191
|
*/
|
|
187
192
|
export interface Bottom<out T, out E, out RD, out RE, out Ast extends AST.AST, out Rebuild extends Top, out TypeMakeIn = T, out Iso = T, in out TypeParameters extends ReadonlyArray<Top> = readonly [], out TypeMake = TypeMakeIn, out TypeMutability extends Mutability = "readonly", out TypeOptionality extends Optionality = "required", out TypeConstructorDefault extends ConstructorDefault = "no-default", out EncodedMutability extends Mutability = "readonly", out EncodedOptionality extends Optionality = "required"> extends Pipeable.Pipeable {
|
|
@@ -207,8 +212,6 @@ export interface Bottom<out T, out E, out RD, out RE, out Ast extends AST.AST, o
|
|
|
207
212
|
rebuild(ast: this["ast"]): this["Rebuild"];
|
|
208
213
|
/**
|
|
209
214
|
* Constructs a value from the make input representation.
|
|
210
|
-
*
|
|
211
|
-
* @throws {Error} The issue is contained in the error cause.
|
|
212
215
|
*/
|
|
213
216
|
make(input: this["~type.make.in"], options?: MakeOptions): this["Type"];
|
|
214
217
|
makeOption(input: this["~type.make.in"], options?: MakeOptions): Option_.Option<this["Type"]>;
|
|
@@ -219,7 +222,7 @@ export interface Bottom<out T, out E, out RD, out RE, out Ast extends AST.AST, o
|
|
|
219
222
|
* type `T`, the encoded type `E`, and the list of type-parameter schemas
|
|
220
223
|
* `TypeParameters`.
|
|
221
224
|
*
|
|
222
|
-
* @category
|
|
225
|
+
* @category constructors
|
|
223
226
|
* @since 4.0.0
|
|
224
227
|
*/
|
|
225
228
|
export interface declareConstructor<T, E, TypeParameters extends ReadonlyArray<Top>, Iso = T> extends Bottom<T, E, TypeParameters[number]["DecodingServices"], TypeParameters[number]["EncodingServices"], AST.Declaration, declareConstructor<T, E, TypeParameters, Iso>, T, Iso, TypeParameters> {
|
|
@@ -241,10 +244,7 @@ export interface declareConstructor<T, E, TypeParameters extends ReadonlyArray<T
|
|
|
241
244
|
* **Example** (Schema for a parametric `Box<A>` type)
|
|
242
245
|
*
|
|
243
246
|
* ```ts
|
|
244
|
-
* import { Effect, Schema } from "effect"
|
|
245
|
-
* import * as SchemaParser from "effect/SchemaParser"
|
|
246
|
-
* import * as Issue from "effect/SchemaIssue"
|
|
247
|
-
* import * as Option from "effect/Option"
|
|
247
|
+
* import { Effect, Option, Schema, SchemaIssue as Issue, SchemaParser } from "effect"
|
|
248
248
|
*
|
|
249
249
|
* interface Box<A> {
|
|
250
250
|
* readonly value: A
|
|
@@ -271,7 +271,7 @@ export interface declareConstructor<T, E, TypeParameters extends ReadonlyArray<T
|
|
|
271
271
|
* const schema = Box(Schema.Number)
|
|
272
272
|
* ```
|
|
273
273
|
*
|
|
274
|
-
* @category
|
|
274
|
+
* @category constructors
|
|
275
275
|
* @since 4.0.0
|
|
276
276
|
*/
|
|
277
277
|
export declare function declareConstructor<T, E = T, Iso = T>(): <const TypeParameters extends ReadonlyArray<Top>>(typeParameters: TypeParameters, run: (typeParameters: { readonly [K in keyof TypeParameters]: Codec<TypeParameters[K]["Type"], TypeParameters[K]["Encoded"]>; }) => (u: unknown, self: AST.Declaration, options: AST.ParseOptions) => Effect.Effect<T, Issue.Issue>, annotations?: Annotations.Declaration<T, TypeParameters>) => declareConstructor<T, E, TypeParameters, Iso>;
|
|
@@ -279,8 +279,8 @@ export declare function declareConstructor<T, E = T, Iso = T>(): <const TypePara
|
|
|
279
279
|
* The schema type returned by {@link declare}, representing a non-parametric
|
|
280
280
|
* opaque type `T` with no type parameters.
|
|
281
281
|
*
|
|
282
|
-
* @category
|
|
283
|
-
* @since
|
|
282
|
+
* @category constructors
|
|
283
|
+
* @since 3.13.3
|
|
284
284
|
*/
|
|
285
285
|
export interface declare<T, Iso = T> extends declareConstructor<T, T, readonly [], Iso> {
|
|
286
286
|
readonly "Rebuild": declare<T, Iso>;
|
|
@@ -311,8 +311,8 @@ export interface declare<T, Iso = T> extends declareConstructor<T, T, readonly [
|
|
|
311
311
|
*
|
|
312
312
|
* @see {@link declareConstructor} for creating schemas for parametric types.
|
|
313
313
|
*
|
|
314
|
-
* @category
|
|
315
|
-
* @since
|
|
314
|
+
* @category constructors
|
|
315
|
+
* @since 3.10.0
|
|
316
316
|
*/
|
|
317
317
|
export declare function declare<T, Iso = T>(is: (u: unknown) => u is T, annotations?: Annotations.Declaration<T> | undefined): declare<T, Iso>;
|
|
318
318
|
/**
|
|
@@ -339,6 +339,7 @@ export declare function declare<T, Iso = T>(is: (u: unknown) => u is T, annotati
|
|
|
339
339
|
* type E = typeof bottom["Encoded"] // string
|
|
340
340
|
* ```
|
|
341
341
|
*
|
|
342
|
+
* @category utils
|
|
342
343
|
* @since 4.0.0
|
|
343
344
|
*/
|
|
344
345
|
export declare function revealBottom<S extends Top>(bottom: S): Bottom<S["Type"], S["Encoded"], S["DecodingServices"], S["EncodingServices"], S["ast"], S["Rebuild"], S["~type.make.in"], S["Iso"], S["~type.parameters"], S["~type.make"], S["~type.mutability"], S["~type.optionality"], S["~type.constructor.default"], S["~encoded.mutability"], S["~encoded.optionality"]>;
|
|
@@ -365,7 +366,7 @@ export declare function revealBottom<S extends Top>(bottom: S): Bottom<S["Type"]
|
|
|
365
366
|
*
|
|
366
367
|
* @see {@link annotateEncoded} to annotate the encoded side instead.
|
|
367
368
|
*
|
|
368
|
-
* @category
|
|
369
|
+
* @category annotations
|
|
369
370
|
* @since 4.0.0
|
|
370
371
|
*/
|
|
371
372
|
export declare function annotate<S extends Top>(annotations: Annotations.Bottom<S["Type"], S["~type.parameters"]>): (self: S) => S["Rebuild"];
|
|
@@ -394,7 +395,7 @@ export declare function annotate<S extends Top>(annotations: Annotations.Bottom<
|
|
|
394
395
|
*
|
|
395
396
|
* @see {@link annotate} to annotate the type side instead.
|
|
396
397
|
*
|
|
397
|
-
* @category
|
|
398
|
+
* @category annotations
|
|
398
399
|
* @since 4.0.0
|
|
399
400
|
*/
|
|
400
401
|
export declare function annotateEncoded<S extends Top>(annotations: Annotations.Bottom<S["Encoded"], readonly []>): (self: S) => S["Rebuild"];
|
|
@@ -423,7 +424,7 @@ export declare function annotateEncoded<S extends Top>(annotations: Annotations.
|
|
|
423
424
|
* })
|
|
424
425
|
* ```
|
|
425
426
|
*
|
|
426
|
-
* @category
|
|
427
|
+
* @category annotations
|
|
427
428
|
* @since 4.0.0
|
|
428
429
|
*/
|
|
429
430
|
export declare function annotateKey<S extends Top>(annotations: Annotations.Key<S["Type"]>): (self: S) => S["Rebuild"];
|
|
@@ -440,6 +441,7 @@ export declare function annotateKey<S extends Top>(annotations: Annotations.Key<
|
|
|
440
441
|
* - {@link Decoder}`<T, RD>` — for decode-only APIs
|
|
441
442
|
* - {@link Encoder}`<E, RE>` — for encode-only APIs
|
|
442
443
|
*
|
|
444
|
+
* @category models
|
|
443
445
|
* @since 4.0.0
|
|
444
446
|
*/
|
|
445
447
|
export interface Top extends Bottom<unknown, unknown, unknown, unknown, AST.AST, Top, unknown, unknown, any, // this is because TypeParameters is invariant
|
|
@@ -448,7 +450,7 @@ unknown, Mutability, Optionality, ConstructorDefault, Mutability, Optionality> {
|
|
|
448
450
|
/**
|
|
449
451
|
* Namespace of type-level helpers for {@link Schema}.
|
|
450
452
|
*
|
|
451
|
-
* @since
|
|
453
|
+
* @since 3.10.0
|
|
452
454
|
*/
|
|
453
455
|
export declare namespace Schema {
|
|
454
456
|
/**
|
|
@@ -464,7 +466,8 @@ export declare namespace Schema {
|
|
|
464
466
|
* // { readonly name: string; readonly age: number }
|
|
465
467
|
* ```
|
|
466
468
|
*
|
|
467
|
-
* @
|
|
469
|
+
* @category utility types
|
|
470
|
+
* @since 3.10.0
|
|
468
471
|
*/
|
|
469
472
|
type Type<S> = S extends Top ? S["Type"] : never;
|
|
470
473
|
}
|
|
@@ -493,7 +496,8 @@ export declare namespace Schema {
|
|
|
493
496
|
* @see {@link Codec} — also tracks Encoded, DecodingServices, EncodingServices
|
|
494
497
|
* @see {@link Schema.Type} — extract the decoded type at the type level
|
|
495
498
|
*
|
|
496
|
-
* @
|
|
499
|
+
* @category models
|
|
500
|
+
* @since 3.10.0
|
|
497
501
|
*/
|
|
498
502
|
export interface Schema<out T> extends Top {
|
|
499
503
|
readonly "Type": T;
|
|
@@ -518,7 +522,8 @@ export declare namespace Codec {
|
|
|
518
522
|
* // string
|
|
519
523
|
* ```
|
|
520
524
|
*
|
|
521
|
-
* @
|
|
525
|
+
* @category utility types
|
|
526
|
+
* @since 3.10.0
|
|
522
527
|
*/
|
|
523
528
|
type Encoded<S> = S extends Top ? S["Encoded"] : never;
|
|
524
529
|
/**
|
|
@@ -534,6 +539,7 @@ export declare namespace Codec {
|
|
|
534
539
|
* // never
|
|
535
540
|
* ```
|
|
536
541
|
*
|
|
542
|
+
* @category utility types
|
|
537
543
|
* @since 4.0.0
|
|
538
544
|
*/
|
|
539
545
|
type DecodingServices<S> = S extends Top ? S["DecodingServices"] : never;
|
|
@@ -550,19 +556,10 @@ export declare namespace Codec {
|
|
|
550
556
|
* // never
|
|
551
557
|
* ```
|
|
552
558
|
*
|
|
559
|
+
* @category utility types
|
|
553
560
|
* @since 4.0.0
|
|
554
561
|
*/
|
|
555
562
|
type EncodingServices<S> = S extends Top ? S["EncodingServices"] : never;
|
|
556
|
-
/**
|
|
557
|
-
* Converts a schema type into an assertion function signature. The resulting
|
|
558
|
-
* function narrows its argument to `I & S["Type"]`. Only schemas with
|
|
559
|
-
* `DecodingServices: never` (i.e. no required services) can be used here.
|
|
560
|
-
*
|
|
561
|
-
* Produced by {@link asserts}.
|
|
562
|
-
*
|
|
563
|
-
* @since 4.0.0
|
|
564
|
-
*/
|
|
565
|
-
type ToAsserts<S extends Top> = <I>(input: I) => asserts input is I & S["Type"];
|
|
566
563
|
}
|
|
567
564
|
/**
|
|
568
565
|
* A schema that additionally supports optic (lens/prism) operations.
|
|
@@ -577,6 +574,7 @@ export declare namespace Codec {
|
|
|
577
574
|
* `Optic` automatically. You normally interact with this interface through
|
|
578
575
|
* {@link Optic_} utilities rather than constructing it directly.
|
|
579
576
|
*
|
|
577
|
+
* @category models
|
|
580
578
|
* @since 4.0.0
|
|
581
579
|
*/
|
|
582
580
|
export interface Optic<out T, out Iso> extends Schema<T> {
|
|
@@ -613,6 +611,7 @@ export interface Optic<out T, out Iso> extends Schema<T> {
|
|
|
613
611
|
* @see {@link Codec.EncodingServices} — extract required encoding services
|
|
614
612
|
* @see {@link revealCodec} — helper to make TypeScript infer the full Codec type
|
|
615
613
|
*
|
|
614
|
+
* @category models
|
|
616
615
|
* @since 4.0.0
|
|
617
616
|
*/
|
|
618
617
|
export interface Codec<out T, out E = T, out RD = never, out RE = never> extends Schema<T> {
|
|
@@ -639,6 +638,7 @@ export interface Codec<out T, out E = T, out RD = never, out RE = never> extends
|
|
|
639
638
|
* validate(Schema.NumberFromString) // ok
|
|
640
639
|
* ```
|
|
641
640
|
*
|
|
641
|
+
* @category models
|
|
642
642
|
* @since 4.0.0
|
|
643
643
|
*/
|
|
644
644
|
export interface Decoder<out T, out RD = never> extends Codec<T, unknown, RD, unknown> {
|
|
@@ -662,6 +662,7 @@ export interface Decoder<out T, out RD = never> extends Codec<T, unknown, RD, un
|
|
|
662
662
|
* serialize(Schema.NumberFromString) // ok — encodes number to string
|
|
663
663
|
* ```
|
|
664
664
|
*
|
|
665
|
+
* @category models
|
|
665
666
|
* @since 4.0.0
|
|
666
667
|
*/
|
|
667
668
|
export interface Encoder<out E, out RE = never> extends Codec<unknown, E, unknown, RE> {
|
|
@@ -687,6 +688,7 @@ export interface Encoder<out E, out RE = never> extends Codec<unknown, E, unknow
|
|
|
687
688
|
* type Enc = typeof codec["Encoded"] // string
|
|
688
689
|
* ```
|
|
689
690
|
*
|
|
691
|
+
* @category utils
|
|
690
692
|
* @since 4.0.0
|
|
691
693
|
*/
|
|
692
694
|
export declare function revealCodec<T, E, RD, RE>(codec: Codec<T, E, RD, RE>): Codec<T, E, RD, RE>;
|
|
@@ -737,6 +739,7 @@ SchemaError };
|
|
|
737
739
|
* }
|
|
738
740
|
* ```
|
|
739
741
|
*
|
|
742
|
+
* @category guards
|
|
740
743
|
* @since 4.0.0
|
|
741
744
|
*/
|
|
742
745
|
export declare function isSchemaError(u: unknown): u is SchemaError;
|
|
@@ -813,7 +816,6 @@ export declare function toStandardSchemaV1<S extends Decoder<unknown>>(self: S,
|
|
|
813
816
|
*
|
|
814
817
|
* @category Standard Schema
|
|
815
818
|
* @since 4.0.0
|
|
816
|
-
* @experimental
|
|
817
819
|
*/
|
|
818
820
|
export declare function toStandardJSONSchemaV1<S extends Top>(self: S): StandardJSONSchemaV1<S["Encoded"], S["Type"]> & S;
|
|
819
821
|
/**
|
|
@@ -842,8 +844,8 @@ export declare function toStandardJSONSchemaV1<S extends Top>(self: S): Standard
|
|
|
842
844
|
* }
|
|
843
845
|
* ```
|
|
844
846
|
*
|
|
845
|
-
* @category
|
|
846
|
-
* @since
|
|
847
|
+
* @category guards
|
|
848
|
+
* @since 3.10.0
|
|
847
849
|
*/
|
|
848
850
|
export declare const is: typeof Parser.is;
|
|
849
851
|
/**
|
|
@@ -859,30 +861,25 @@ export declare const is: typeof Parser.is;
|
|
|
859
861
|
* ```ts
|
|
860
862
|
* import { Schema } from "effect"
|
|
861
863
|
*
|
|
862
|
-
* const
|
|
863
|
-
* Schema.String
|
|
864
|
-
* )
|
|
864
|
+
* const input: unknown = "hello"
|
|
865
865
|
*
|
|
866
|
-
* // This will pass silently (no return value)
|
|
867
|
-
*
|
|
868
|
-
*
|
|
869
|
-
* console.log("String assertion passed")
|
|
870
|
-
* } catch (error) {
|
|
871
|
-
* console.log("String assertion failed")
|
|
872
|
-
* }
|
|
866
|
+
* // This will pass silently (no return value) and narrow input to string
|
|
867
|
+
* Schema.asserts(Schema.String, input)
|
|
868
|
+
* console.log(input.toUpperCase())
|
|
873
869
|
*
|
|
874
870
|
* // This will throw an error
|
|
875
871
|
* try {
|
|
876
|
-
*
|
|
872
|
+
* const invalid: unknown = 123
|
|
873
|
+
* Schema.asserts(Schema.String, invalid)
|
|
877
874
|
* } catch (error) {
|
|
878
875
|
* console.log("Non-string assertion failed as expected")
|
|
879
876
|
* }
|
|
880
877
|
* ```
|
|
881
878
|
*
|
|
882
|
-
* @category
|
|
879
|
+
* @category guards
|
|
883
880
|
* @since 4.0.0
|
|
884
881
|
*/
|
|
885
|
-
export declare const asserts:
|
|
882
|
+
export declare const asserts: <S extends Top, I>(schema: S, input: I) => asserts input is I & S["Type"];
|
|
886
883
|
/**
|
|
887
884
|
* Decodes an `unknown` input against a schema, returning an `Effect` that
|
|
888
885
|
* succeeds with the decoded value or fails with a {@link SchemaError}. Use this
|
|
@@ -891,7 +888,7 @@ export declare const asserts: typeof Parser.asserts;
|
|
|
891
888
|
* Options may be provided either when creating the decoder or when applying it;
|
|
892
889
|
* application options override creation options.
|
|
893
890
|
*
|
|
894
|
-
* @category
|
|
891
|
+
* @category decoding
|
|
895
892
|
* @since 4.0.0
|
|
896
893
|
*/
|
|
897
894
|
export declare function decodeUnknownEffect<S extends Top>(schema: S, options?: AST.ParseOptions): (input: unknown, options?: AST.ParseOptions) => Effect.Effect<S["Type"], SchemaError, S["DecodingServices"]>;
|
|
@@ -903,7 +900,7 @@ export declare function decodeUnknownEffect<S extends Top>(schema: S, options?:
|
|
|
903
900
|
* Options may be provided either when creating the decoder or when applying it;
|
|
904
901
|
* application options override creation options.
|
|
905
902
|
*
|
|
906
|
-
* @category
|
|
903
|
+
* @category decoding
|
|
907
904
|
* @since 4.0.0
|
|
908
905
|
*/
|
|
909
906
|
export declare const decodeEffect: <S extends Top>(schema: S, options?: AST.ParseOptions) => (input: S["Encoded"], options?: AST.ParseOptions) => Effect.Effect<S["Type"], SchemaError, S["DecodingServices"]>;
|
|
@@ -916,7 +913,7 @@ export declare const decodeEffect: <S extends Top>(schema: S, options?: AST.Pars
|
|
|
916
913
|
* Options may be provided either when creating the decoder or when applying it;
|
|
917
914
|
* application options override creation options.
|
|
918
915
|
*
|
|
919
|
-
* @category
|
|
916
|
+
* @category decoding
|
|
920
917
|
* @since 4.0.0
|
|
921
918
|
*/
|
|
922
919
|
export declare function decodeUnknownExit<S extends Decoder<unknown>>(schema: S, options?: AST.ParseOptions): (input: unknown, options?: AST.ParseOptions) => Exit_.Exit<S["Type"], SchemaError>;
|
|
@@ -929,7 +926,7 @@ export declare function decodeUnknownExit<S extends Decoder<unknown>>(schema: S,
|
|
|
929
926
|
* Options may be provided either when creating the decoder or when applying it;
|
|
930
927
|
* application options override creation options.
|
|
931
928
|
*
|
|
932
|
-
* @category
|
|
929
|
+
* @category decoding
|
|
933
930
|
* @since 4.0.0
|
|
934
931
|
*/
|
|
935
932
|
export declare const decodeExit: <S extends Decoder<unknown>>(schema: S, options?: AST.ParseOptions) => (input: S["Encoded"], options?: AST.ParseOptions) => Exit_.Exit<S["Type"], SchemaError>;
|
|
@@ -942,8 +939,8 @@ export declare const decodeExit: <S extends Decoder<unknown>>(schema: S, options
|
|
|
942
939
|
* Options may be provided either when creating the decoder or when applying it;
|
|
943
940
|
* application options override creation options.
|
|
944
941
|
*
|
|
945
|
-
* @category
|
|
946
|
-
* @since
|
|
942
|
+
* @category decoding
|
|
943
|
+
* @since 3.10.0
|
|
947
944
|
*/
|
|
948
945
|
export declare const decodeUnknownOption: typeof Parser.decodeUnknownOption;
|
|
949
946
|
/**
|
|
@@ -953,8 +950,8 @@ export declare const decodeUnknownOption: typeof Parser.decodeUnknownOption;
|
|
|
953
950
|
* Options may be provided either when creating the decoder or when applying it;
|
|
954
951
|
* application options override creation options.
|
|
955
952
|
*
|
|
956
|
-
* @category
|
|
957
|
-
* @since
|
|
953
|
+
* @category decoding
|
|
954
|
+
* @since 3.10.0
|
|
958
955
|
*/
|
|
959
956
|
export declare const decodeOption: <S extends Decoder<unknown>>(schema: S, options?: AST.ParseOptions) => (input: S["Encoded"], options?: AST.ParseOptions) => Option_.Option<S["Type"]>;
|
|
960
957
|
/**
|
|
@@ -964,7 +961,7 @@ export declare const decodeOption: <S extends Decoder<unknown>>(schema: S, optio
|
|
|
964
961
|
* Options may be provided either when creating the decoder or when applying it;
|
|
965
962
|
* application options override creation options.
|
|
966
963
|
*
|
|
967
|
-
* @category
|
|
964
|
+
* @category decoding
|
|
968
965
|
* @since 4.0.0
|
|
969
966
|
*/
|
|
970
967
|
export declare const decodeUnknownResult: typeof Parser.decodeUnknownResult;
|
|
@@ -975,7 +972,7 @@ export declare const decodeUnknownResult: typeof Parser.decodeUnknownResult;
|
|
|
975
972
|
* Options may be provided either when creating the decoder or when applying it;
|
|
976
973
|
* application options override creation options.
|
|
977
974
|
*
|
|
978
|
-
* @category
|
|
975
|
+
* @category decoding
|
|
979
976
|
* @since 4.0.0
|
|
980
977
|
*/
|
|
981
978
|
export declare const decodeResult: <S extends Decoder<unknown>>(schema: S, options?: AST.ParseOptions) => (input: S["Encoded"], options?: AST.ParseOptions) => Result_.Result<S["Type"], Issue.Issue>;
|
|
@@ -987,8 +984,8 @@ export declare const decodeResult: <S extends Decoder<unknown>>(schema: S, optio
|
|
|
987
984
|
* Options may be provided either when creating the decoder or when applying it;
|
|
988
985
|
* application options override creation options.
|
|
989
986
|
*
|
|
990
|
-
* @category
|
|
991
|
-
* @since
|
|
987
|
+
* @category decoding
|
|
988
|
+
* @since 3.10.0
|
|
992
989
|
*/
|
|
993
990
|
export declare const decodeUnknownPromise: typeof Parser.decodeUnknownPromise;
|
|
994
991
|
/**
|
|
@@ -1000,8 +997,8 @@ export declare const decodeUnknownPromise: typeof Parser.decodeUnknownPromise;
|
|
|
1000
997
|
* Options may be provided either when creating the decoder or when applying it;
|
|
1001
998
|
* application options override creation options.
|
|
1002
999
|
*
|
|
1003
|
-
* @category
|
|
1004
|
-
* @since
|
|
1000
|
+
* @category decoding
|
|
1001
|
+
* @since 3.10.0
|
|
1005
1002
|
*/
|
|
1006
1003
|
export declare const decodePromise: typeof Parser.decodePromise;
|
|
1007
1004
|
/**
|
|
@@ -1033,7 +1030,7 @@ export declare const decodePromise: typeof Parser.decodePromise;
|
|
|
1033
1030
|
* // └─ Expected a numeric string, actual "not a number"
|
|
1034
1031
|
* ```
|
|
1035
1032
|
*
|
|
1036
|
-
* @category
|
|
1033
|
+
* @category decoding
|
|
1037
1034
|
* @since 4.0.0
|
|
1038
1035
|
*/
|
|
1039
1036
|
export declare const decodeUnknownSync: typeof Parser.decodeUnknownSync;
|
|
@@ -1047,7 +1044,7 @@ export declare const decodeUnknownSync: typeof Parser.decodeUnknownSync;
|
|
|
1047
1044
|
* provided either when creating the decoder or when applying it; application
|
|
1048
1045
|
* options override creation options.
|
|
1049
1046
|
*
|
|
1050
|
-
* @category
|
|
1047
|
+
* @category decoding
|
|
1051
1048
|
* @since 4.0.0
|
|
1052
1049
|
*/
|
|
1053
1050
|
export declare const decodeSync: <S extends Decoder<unknown>>(schema: S, options?: AST.ParseOptions) => (input: S["Encoded"], options?: AST.ParseOptions) => S["Type"];
|
|
@@ -1070,7 +1067,7 @@ export declare const decodeSync: <S extends Decoder<unknown>>(schema: S, options
|
|
|
1070
1067
|
* // Output: "42"
|
|
1071
1068
|
* ```
|
|
1072
1069
|
*
|
|
1073
|
-
* @category
|
|
1070
|
+
* @category encoding
|
|
1074
1071
|
* @since 4.0.0
|
|
1075
1072
|
*/
|
|
1076
1073
|
export declare function encodeUnknownEffect<S extends Top>(schema: S, options?: AST.ParseOptions): (input: unknown, options?: AST.ParseOptions) => Effect.Effect<S["Encoded"], SchemaError, S["EncodingServices"]>;
|
|
@@ -1082,7 +1079,7 @@ export declare function encodeUnknownEffect<S extends Top>(schema: S, options?:
|
|
|
1082
1079
|
* Options may be provided either when creating the encoder or when applying it;
|
|
1083
1080
|
* application options override creation options.
|
|
1084
1081
|
*
|
|
1085
|
-
* @category
|
|
1082
|
+
* @category encoding
|
|
1086
1083
|
* @since 4.0.0
|
|
1087
1084
|
*/
|
|
1088
1085
|
export declare const encodeEffect: <S extends Top>(schema: S, options?: AST.ParseOptions) => (input: S["Type"], options?: AST.ParseOptions) => Effect.Effect<S["Encoded"], SchemaError, S["EncodingServices"]>;
|
|
@@ -1095,7 +1092,7 @@ export declare const encodeEffect: <S extends Top>(schema: S, options?: AST.Pars
|
|
|
1095
1092
|
* Options may be provided either when creating the encoder or when applying it;
|
|
1096
1093
|
* application options override creation options.
|
|
1097
1094
|
*
|
|
1098
|
-
* @category
|
|
1095
|
+
* @category encoding
|
|
1099
1096
|
* @since 4.0.0
|
|
1100
1097
|
*/
|
|
1101
1098
|
export declare function encodeUnknownExit<S extends Encoder<unknown>>(schema: S, options?: AST.ParseOptions): (input: unknown, options?: AST.ParseOptions) => Exit_.Exit<S["Encoded"], SchemaError>;
|
|
@@ -1108,7 +1105,7 @@ export declare function encodeUnknownExit<S extends Encoder<unknown>>(schema: S,
|
|
|
1108
1105
|
* Options may be provided either when creating the encoder or when applying it;
|
|
1109
1106
|
* application options override creation options.
|
|
1110
1107
|
*
|
|
1111
|
-
* @category
|
|
1108
|
+
* @category encoding
|
|
1112
1109
|
* @since 4.0.0
|
|
1113
1110
|
*/
|
|
1114
1111
|
export declare const encodeExit: <S extends Encoder<unknown>>(schema: S, options?: AST.ParseOptions) => (input: S["Type"], options?: AST.ParseOptions) => Exit_.Exit<S["Encoded"], SchemaError>;
|
|
@@ -1121,8 +1118,8 @@ export declare const encodeExit: <S extends Encoder<unknown>>(schema: S, options
|
|
|
1121
1118
|
* Options may be provided either when creating the encoder or when applying it;
|
|
1122
1119
|
* application options override creation options.
|
|
1123
1120
|
*
|
|
1124
|
-
* @category
|
|
1125
|
-
* @since
|
|
1121
|
+
* @category encoding
|
|
1122
|
+
* @since 3.10.0
|
|
1126
1123
|
*/
|
|
1127
1124
|
export declare const encodeUnknownOption: typeof Parser.encodeUnknownOption;
|
|
1128
1125
|
/**
|
|
@@ -1132,8 +1129,8 @@ export declare const encodeUnknownOption: typeof Parser.encodeUnknownOption;
|
|
|
1132
1129
|
* Options may be provided either when creating the encoder or when applying it;
|
|
1133
1130
|
* application options override creation options.
|
|
1134
1131
|
*
|
|
1135
|
-
* @category
|
|
1136
|
-
* @since
|
|
1132
|
+
* @category encoding
|
|
1133
|
+
* @since 3.10.0
|
|
1137
1134
|
*/
|
|
1138
1135
|
export declare const encodeOption: <S extends Encoder<unknown>>(schema: S, options?: AST.ParseOptions) => (input: S["Type"], options?: AST.ParseOptions) => Option_.Option<S["Encoded"]>;
|
|
1139
1136
|
/**
|
|
@@ -1143,7 +1140,7 @@ export declare const encodeOption: <S extends Encoder<unknown>>(schema: S, optio
|
|
|
1143
1140
|
* Options may be provided either when creating the encoder or when applying it;
|
|
1144
1141
|
* application options override creation options.
|
|
1145
1142
|
*
|
|
1146
|
-
* @category
|
|
1143
|
+
* @category encoding
|
|
1147
1144
|
* @since 4.0.0
|
|
1148
1145
|
*/
|
|
1149
1146
|
export declare const encodeUnknownResult: typeof Parser.encodeUnknownResult;
|
|
@@ -1154,7 +1151,7 @@ export declare const encodeUnknownResult: typeof Parser.encodeUnknownResult;
|
|
|
1154
1151
|
* Options may be provided either when creating the encoder or when applying it;
|
|
1155
1152
|
* application options override creation options.
|
|
1156
1153
|
*
|
|
1157
|
-
* @category
|
|
1154
|
+
* @category encoding
|
|
1158
1155
|
* @since 4.0.0
|
|
1159
1156
|
*/
|
|
1160
1157
|
export declare const encodeResult: <S extends Encoder<unknown>>(schema: S, options?: AST.ParseOptions) => (input: S["Type"], options?: AST.ParseOptions) => Result_.Result<S["Encoded"], Issue.Issue>;
|
|
@@ -1166,8 +1163,8 @@ export declare const encodeResult: <S extends Encoder<unknown>>(schema: S, optio
|
|
|
1166
1163
|
* Options may be provided either when creating the encoder or when applying it;
|
|
1167
1164
|
* application options override creation options.
|
|
1168
1165
|
*
|
|
1169
|
-
* @category
|
|
1170
|
-
* @since
|
|
1166
|
+
* @category encoding
|
|
1167
|
+
* @since 3.10.0
|
|
1171
1168
|
*/
|
|
1172
1169
|
export declare const encodeUnknownPromise: <S extends Encoder<unknown>>(schema: S, options?: AST.ParseOptions) => (input: unknown, options?: AST.ParseOptions) => Promise<S["Encoded"]>;
|
|
1173
1170
|
/**
|
|
@@ -1177,8 +1174,8 @@ export declare const encodeUnknownPromise: <S extends Encoder<unknown>>(schema:
|
|
|
1177
1174
|
* Options may be provided either when creating the encoder or when applying it;
|
|
1178
1175
|
* application options override creation options.
|
|
1179
1176
|
*
|
|
1180
|
-
* @category
|
|
1181
|
-
* @since
|
|
1177
|
+
* @category encoding
|
|
1178
|
+
* @since 3.10.0
|
|
1182
1179
|
*/
|
|
1183
1180
|
export declare const encodePromise: <S extends Encoder<unknown>>(schema: S, options?: AST.ParseOptions) => (input: S["Type"], options?: AST.ParseOptions) => Promise<S["Encoded"]>;
|
|
1184
1181
|
/**
|
|
@@ -1191,7 +1188,7 @@ export declare const encodePromise: <S extends Encoder<unknown>>(schema: S, opti
|
|
|
1191
1188
|
* Options may be provided either when creating the encoder or when applying it;
|
|
1192
1189
|
* application options override creation options.
|
|
1193
1190
|
*
|
|
1194
|
-
* @category
|
|
1191
|
+
* @category encoding
|
|
1195
1192
|
* @since 4.0.0
|
|
1196
1193
|
*/
|
|
1197
1194
|
export declare const encodeUnknownSync: typeof Parser.encodeUnknownSync;
|
|
@@ -1202,7 +1199,7 @@ export declare const encodeUnknownSync: typeof Parser.encodeUnknownSync;
|
|
|
1202
1199
|
* Options may be provided either when creating the encoder or when applying it;
|
|
1203
1200
|
* application options override creation options.
|
|
1204
1201
|
*
|
|
1205
|
-
* @category
|
|
1202
|
+
* @category encoding
|
|
1206
1203
|
* @since 4.0.0
|
|
1207
1204
|
*/
|
|
1208
1205
|
export declare const encodeSync: <S extends Encoder<unknown>>(schema: S, options?: AST.ParseOptions) => (input: S["Type"], options?: AST.ParseOptions) => S["Encoded"];
|
|
@@ -1218,8 +1215,8 @@ export declare const encodeSync: <S extends Encoder<unknown>>(schema: S, options
|
|
|
1218
1215
|
* the bridge between the untyped AST representation and the strongly-typed
|
|
1219
1216
|
* schema.
|
|
1220
1217
|
*
|
|
1221
|
-
* @category
|
|
1222
|
-
* @since
|
|
1218
|
+
* @category constructors
|
|
1219
|
+
* @since 3.10.0
|
|
1223
1220
|
*/
|
|
1224
1221
|
export declare const make: <S extends Top>(ast: S["ast"], options?: object) => S;
|
|
1225
1222
|
/**
|
|
@@ -1240,6 +1237,7 @@ export declare const make: <S extends Top>(ast: S["ast"], options?: object) => S
|
|
|
1240
1237
|
* // "a"
|
|
1241
1238
|
* ```
|
|
1242
1239
|
*
|
|
1240
|
+
* @category constructors
|
|
1243
1241
|
* @since 4.0.0
|
|
1244
1242
|
*/
|
|
1245
1243
|
export declare function asClass<S extends Top>(schema: S): S & {
|
|
@@ -1248,8 +1246,8 @@ export declare function asClass<S extends Top>(schema: S): S & {
|
|
|
1248
1246
|
/**
|
|
1249
1247
|
* Tests if a value is a `Schema`.
|
|
1250
1248
|
*
|
|
1251
|
-
* @category
|
|
1252
|
-
* @since
|
|
1249
|
+
* @category guards
|
|
1250
|
+
* @since 3.10.0
|
|
1253
1251
|
*/
|
|
1254
1252
|
export declare function isSchema(u: unknown): u is Top;
|
|
1255
1253
|
/**
|
|
@@ -1257,6 +1255,7 @@ export declare function isSchema(u: unknown): u is Top;
|
|
|
1257
1255
|
* when present must match the wrapped schema (no implicit `undefined`).
|
|
1258
1256
|
* Produced by {@link optionalKey}.
|
|
1259
1257
|
*
|
|
1258
|
+
* @category models
|
|
1260
1259
|
* @since 4.0.0
|
|
1261
1260
|
*/
|
|
1262
1261
|
export interface optionalKey<S extends Top> extends Bottom<S["Type"], S["Encoded"], S["DecodingServices"], S["EncodingServices"], S["ast"], optionalKey<S>, S["~type.make.in"], S["Iso"], S["~type.parameters"], S["~type.make"], S["~type.mutability"], "optional", S["~type.constructor.default"], S["~encoded.mutability"], "optional"> {
|
|
@@ -1285,6 +1284,7 @@ interface optionalKeyLambda extends Lambda {
|
|
|
1285
1284
|
* type Person = typeof schema["Type"]
|
|
1286
1285
|
* ```
|
|
1287
1286
|
*
|
|
1287
|
+
* @category combinators
|
|
1288
1288
|
* @since 4.0.0
|
|
1289
1289
|
*/
|
|
1290
1290
|
export declare const optionalKey: optionalKeyLambda;
|
|
@@ -1296,6 +1296,7 @@ interface requiredKeyLambda extends Lambda {
|
|
|
1296
1296
|
* Reverses {@link optionalKey}, returning the inner required schema. Only
|
|
1297
1297
|
* applicable to schemas already wrapped with `optionalKey`.
|
|
1298
1298
|
*
|
|
1299
|
+
* @category combinators
|
|
1299
1300
|
* @since 4.0.0
|
|
1300
1301
|
*/
|
|
1301
1302
|
export declare const requiredKey: requiredKeyLambda;
|
|
@@ -1303,7 +1304,8 @@ export declare const requiredKey: requiredKeyLambda;
|
|
|
1303
1304
|
* Companion type for an optional struct key that also accepts `undefined`.
|
|
1304
1305
|
* Equivalent to `optionalKey<UndefinedOr<S>>`. Produced by {@link optional}.
|
|
1305
1306
|
*
|
|
1306
|
-
* @
|
|
1307
|
+
* @category models
|
|
1308
|
+
* @since 3.10.0
|
|
1307
1309
|
*/
|
|
1308
1310
|
export interface optional<S extends Top> extends optionalKey<UndefinedOr<S>> {
|
|
1309
1311
|
readonly "Rebuild": optional<S>;
|
|
@@ -1335,7 +1337,8 @@ interface optionalLambda extends Lambda {
|
|
|
1335
1337
|
* type Person = typeof schema.Type
|
|
1336
1338
|
* ```
|
|
1337
1339
|
*
|
|
1338
|
-
* @
|
|
1340
|
+
* @category combinators
|
|
1341
|
+
* @since 3.10.0
|
|
1339
1342
|
*/
|
|
1340
1343
|
export declare const optional: optionalLambda;
|
|
1341
1344
|
interface requiredLambda extends Lambda {
|
|
@@ -1346,13 +1349,15 @@ interface requiredLambda extends Lambda {
|
|
|
1346
1349
|
* Reverses {@link optional}, returning the inner schema (unwrapping `UndefinedOr`).
|
|
1347
1350
|
* Only applicable to schemas already wrapped with `optional`.
|
|
1348
1351
|
*
|
|
1349
|
-
* @
|
|
1352
|
+
* @category combinators
|
|
1353
|
+
* @since 3.10.0
|
|
1350
1354
|
*/
|
|
1351
1355
|
export declare const required: requiredLambda;
|
|
1352
1356
|
/**
|
|
1353
1357
|
* Companion type for a mutable struct key. The key's property is writable.
|
|
1354
1358
|
* Produced by {@link mutableKey}.
|
|
1355
1359
|
*
|
|
1360
|
+
* @category models
|
|
1356
1361
|
* @since 4.0.0
|
|
1357
1362
|
*/
|
|
1358
1363
|
export interface mutableKey<S extends Top> extends Bottom<S["Type"], S["Encoded"], S["DecodingServices"], S["EncodingServices"], S["ast"], mutableKey<S>, S["~type.make.in"], S["Iso"], S["~type.parameters"], S["~type.make"], "mutable", S["~type.optionality"], S["~type.constructor.default"], "mutable", S["~encoded.optionality"]> {
|
|
@@ -1366,6 +1371,7 @@ interface mutableKeyLambda extends Lambda {
|
|
|
1366
1371
|
* Makes a struct field mutable (removes the `readonly` modifier on the property).
|
|
1367
1372
|
* Use {@link readonlyKey} to reverse.
|
|
1368
1373
|
*
|
|
1374
|
+
* @category combinators
|
|
1369
1375
|
* @since 4.0.0
|
|
1370
1376
|
*/
|
|
1371
1377
|
export declare const mutableKey: mutableKeyLambda;
|
|
@@ -1377,6 +1383,7 @@ interface readonlyKeyLambda extends Lambda {
|
|
|
1377
1383
|
* Reverses {@link mutableKey}, returning the inner schema as readonly again.
|
|
1378
1384
|
* Only applicable to schemas already wrapped with `mutableKey`.
|
|
1379
1385
|
*
|
|
1386
|
+
* @category combinators
|
|
1380
1387
|
* @since 4.0.0
|
|
1381
1388
|
*/
|
|
1382
1389
|
export declare const readonlyKey: readonlyKeyLambda;
|
|
@@ -1384,6 +1391,7 @@ export declare const readonlyKey: readonlyKeyLambda;
|
|
|
1384
1391
|
* Schema type that collapses a transformation schema to its decoded `Type` on
|
|
1385
1392
|
* both sides (Type = Encoded = S["Type"]). Produced by {@link toType}.
|
|
1386
1393
|
*
|
|
1394
|
+
* @category transforming
|
|
1387
1395
|
* @since 4.0.0
|
|
1388
1396
|
*/
|
|
1389
1397
|
export interface toType<S extends Top> extends Bottom<S["Type"], S["Type"], never, never, S["ast"], toType<S>, S["~type.make.in"], S["Iso"], S["~type.parameters"], S["~type.make"], S["~type.mutability"], S["~type.optionality"], S["~type.constructor.default"], S["~encoded.mutability"], S["~encoded.optionality"]> {
|
|
@@ -1396,6 +1404,7 @@ interface toTypeLambda extends Lambda {
|
|
|
1396
1404
|
* Extracts the type-side schema: sets `Encoded` to equal the decoded `Type`,
|
|
1397
1405
|
* discarding the encoding transformation path.
|
|
1398
1406
|
*
|
|
1407
|
+
* @category transforming
|
|
1399
1408
|
* @since 4.0.0
|
|
1400
1409
|
*/
|
|
1401
1410
|
export declare const toType: toTypeLambda;
|
|
@@ -1403,6 +1412,7 @@ export declare const toType: toTypeLambda;
|
|
|
1403
1412
|
* Schema type that collapses a transformation schema to its `Encoded` side on
|
|
1404
1413
|
* both sides (Type = Encoded = S["Encoded"]). Produced by {@link toEncoded}.
|
|
1405
1414
|
*
|
|
1415
|
+
* @category transforming
|
|
1406
1416
|
* @since 4.0.0
|
|
1407
1417
|
*/
|
|
1408
1418
|
export interface toEncoded<S extends Top> extends Bottom<S["Encoded"], S["Encoded"], never, never, AST.AST, toEncoded<S>, S["Encoded"], S["Encoded"], ReadonlyArray<Top>, S["Encoded"], S["~type.mutability"], S["~type.optionality"], S["~type.constructor.default"], S["~encoded.mutability"], S["~encoded.optionality"]> {
|
|
@@ -1415,6 +1425,7 @@ interface toEncodedLambda extends Lambda {
|
|
|
1415
1425
|
* Extracts the encoded-side schema: sets `Type` to equal the `Encoded`,
|
|
1416
1426
|
* discarding the decoding transformation path.
|
|
1417
1427
|
*
|
|
1428
|
+
* @category transforming
|
|
1418
1429
|
* @since 4.0.0
|
|
1419
1430
|
*/
|
|
1420
1431
|
export declare const toEncoded: toEncodedLambda;
|
|
@@ -1423,6 +1434,7 @@ declare const FlipTypeId = "~effect/Schema/flip";
|
|
|
1423
1434
|
* Schema type representing a flipped schema where `Type` and `Encoded` are
|
|
1424
1435
|
* swapped. Produced by {@link flip}.
|
|
1425
1436
|
*
|
|
1437
|
+
* @category transforming
|
|
1426
1438
|
* @since 4.0.0
|
|
1427
1439
|
*/
|
|
1428
1440
|
export interface flip<S extends Top> extends Bottom<S["Encoded"], S["Type"], S["EncodingServices"], S["DecodingServices"], AST.AST, flip<S>, S["Encoded"], S["Encoded"], ReadonlyArray<Top>, S["Encoded"], S["~encoded.mutability"], S["~encoded.optionality"], ConstructorDefault, S["~type.mutability"], S["~type.optionality"]> {
|
|
@@ -1443,6 +1455,7 @@ export interface flip<S extends Top> extends Bottom<S["Encoded"], S["Type"], S["
|
|
|
1443
1455
|
* // flipped: decodes number → string
|
|
1444
1456
|
* ```
|
|
1445
1457
|
*
|
|
1458
|
+
* @category transforming
|
|
1446
1459
|
* @since 4.0.0
|
|
1447
1460
|
*/
|
|
1448
1461
|
export declare function flip<S extends Top>(schema: S): S extends flip<infer F> ? F["Rebuild"] : flip<S>;
|
|
@@ -1450,7 +1463,8 @@ export declare function flip<S extends Top>(schema: S): S extends flip<infer F>
|
|
|
1450
1463
|
* Represents a schema for a single literal value.
|
|
1451
1464
|
*
|
|
1452
1465
|
* @see {@link Literal} for the constructor function.
|
|
1453
|
-
* @
|
|
1466
|
+
* @category models
|
|
1467
|
+
* @since 3.10.0
|
|
1454
1468
|
*/
|
|
1455
1469
|
export interface Literal<L extends AST.LiteralValue> extends Bottom<L, L, never, never, AST.Literal, Literal<L>> {
|
|
1456
1470
|
readonly literal: L;
|
|
@@ -1460,6 +1474,7 @@ export interface Literal<L extends AST.LiteralValue> extends Bottom<L, L, never,
|
|
|
1460
1474
|
* Creates a schema for a single literal value (string, number, bigint, boolean, or null).
|
|
1461
1475
|
*
|
|
1462
1476
|
* **Example** (String literal)
|
|
1477
|
+
*
|
|
1463
1478
|
* ```ts
|
|
1464
1479
|
* import { Schema } from "effect"
|
|
1465
1480
|
*
|
|
@@ -1470,13 +1485,14 @@ export interface Literal<L extends AST.LiteralValue> extends Bottom<L, L, never,
|
|
|
1470
1485
|
* @see {@link Literals} for a schema that represents a union of literals.
|
|
1471
1486
|
* @see {@link tag} for a schema that represents a literal value that can be
|
|
1472
1487
|
* used as a discriminator field in tagged unions and has a constructor default.
|
|
1473
|
-
* @
|
|
1488
|
+
* @category constructors
|
|
1489
|
+
* @since 3.10.0
|
|
1474
1490
|
*/
|
|
1475
1491
|
export declare function Literal<L extends AST.LiteralValue>(literal: L): Literal<L>;
|
|
1476
1492
|
/**
|
|
1477
1493
|
* Namespace for {@link TemplateLiteral} helper types.
|
|
1478
1494
|
*
|
|
1479
|
-
* @since
|
|
1495
|
+
* @since 3.10.0
|
|
1480
1496
|
*/
|
|
1481
1497
|
export declare namespace TemplateLiteral {
|
|
1482
1498
|
/**
|
|
@@ -1486,6 +1502,7 @@ export declare namespace TemplateLiteral {
|
|
|
1486
1502
|
* The schema's encoded value must be a `string`, `number`, or `bigint` so it can
|
|
1487
1503
|
* be converted into a template literal string segment.
|
|
1488
1504
|
*
|
|
1505
|
+
* @category utility types
|
|
1489
1506
|
* @since 4.0.0
|
|
1490
1507
|
*/
|
|
1491
1508
|
interface SchemaPart extends Top {
|
|
@@ -1494,6 +1511,7 @@ export declare namespace TemplateLiteral {
|
|
|
1494
1511
|
/**
|
|
1495
1512
|
* Literal value that can be used directly as a part of a `TemplateLiteral`.
|
|
1496
1513
|
*
|
|
1514
|
+
* @category utility types
|
|
1497
1515
|
* @since 4.0.0
|
|
1498
1516
|
*/
|
|
1499
1517
|
type LiteralPart = string | number | bigint;
|
|
@@ -1501,12 +1519,14 @@ export declare namespace TemplateLiteral {
|
|
|
1501
1519
|
* A single part of a `TemplateLiteral`, either an interpolated schema part or a
|
|
1502
1520
|
* literal `string`, `number`, or `bigint`.
|
|
1503
1521
|
*
|
|
1522
|
+
* @category utility types
|
|
1504
1523
|
* @since 4.0.0
|
|
1505
1524
|
*/
|
|
1506
1525
|
type Part = SchemaPart | LiteralPart;
|
|
1507
1526
|
/**
|
|
1508
1527
|
* Ordered list of parts used to construct a `TemplateLiteral` schema.
|
|
1509
1528
|
*
|
|
1529
|
+
* @category utility types
|
|
1510
1530
|
* @since 4.0.0
|
|
1511
1531
|
*/
|
|
1512
1532
|
type Parts = ReadonlyArray<Part>;
|
|
@@ -1515,7 +1535,8 @@ export declare namespace TemplateLiteral {
|
|
|
1515
1535
|
* Computes the encoded string literal type produced by concatenating the encoded
|
|
1516
1536
|
* forms of all template literal parts.
|
|
1517
1537
|
*
|
|
1518
|
-
* @
|
|
1538
|
+
* @category utility types
|
|
1539
|
+
* @since 3.10.0
|
|
1519
1540
|
*/
|
|
1520
1541
|
type Encoded<Parts> = Parts extends readonly [...infer Init, infer Last] ? AppendType<Encoded<Init>, Last> : ``;
|
|
1521
1542
|
}
|
|
@@ -1524,7 +1545,8 @@ export declare namespace TemplateLiteral {
|
|
|
1524
1545
|
* The encoded type is a string formed by concatenating the parts.
|
|
1525
1546
|
*
|
|
1526
1547
|
* @see {@link TemplateLiteral} for the constructor function.
|
|
1527
|
-
* @
|
|
1548
|
+
* @category models
|
|
1549
|
+
* @since 3.10.0
|
|
1528
1550
|
*/
|
|
1529
1551
|
export interface TemplateLiteral<Parts extends TemplateLiteral.Parts> extends Bottom<TemplateLiteral.Encoded<Parts>, TemplateLiteral.Encoded<Parts>, never, never, AST.TemplateLiteral, TemplateLiteral<Parts>> {
|
|
1530
1552
|
readonly parts: Parts;
|
|
@@ -1534,6 +1556,7 @@ export interface TemplateLiteral<Parts extends TemplateLiteral.Parts> extends Bo
|
|
|
1534
1556
|
* a literal string/number/bigint or a schema whose encoded type is a string, number, or bigint.
|
|
1535
1557
|
*
|
|
1536
1558
|
* **Example** (URL path pattern)
|
|
1559
|
+
*
|
|
1537
1560
|
* ```ts
|
|
1538
1561
|
* import { Schema } from "effect"
|
|
1539
1562
|
*
|
|
@@ -1542,13 +1565,14 @@ export interface TemplateLiteral<Parts extends TemplateLiteral.Parts> extends Bo
|
|
|
1542
1565
|
* ```
|
|
1543
1566
|
*
|
|
1544
1567
|
* @see {@link TemplateLiteralParser} for a schema that also parses matched parts into a tuple.
|
|
1545
|
-
* @
|
|
1568
|
+
* @category constructors
|
|
1569
|
+
* @since 3.10.0
|
|
1546
1570
|
*/
|
|
1547
1571
|
export declare function TemplateLiteral<const Parts extends TemplateLiteral.Parts>(parts: Parts): TemplateLiteral<Parts>;
|
|
1548
1572
|
/**
|
|
1549
1573
|
* Namespace for {@link TemplateLiteralParser} helper types.
|
|
1550
1574
|
*
|
|
1551
|
-
* @since
|
|
1575
|
+
* @since 3.10.0
|
|
1552
1576
|
*/
|
|
1553
1577
|
export declare namespace TemplateLiteralParser {
|
|
1554
1578
|
/**
|
|
@@ -1558,7 +1582,8 @@ export declare namespace TemplateLiteralParser {
|
|
|
1558
1582
|
* Literal parts contribute their literal value to the tuple. Schema parts
|
|
1559
1583
|
* contribute their decoded `Type`.
|
|
1560
1584
|
*
|
|
1561
|
-
* @
|
|
1585
|
+
* @category utility types
|
|
1586
|
+
* @since 3.10.0
|
|
1562
1587
|
*/
|
|
1563
1588
|
type Type<Parts> = Parts extends readonly [infer Head, ...infer Tail] ? readonly [
|
|
1564
1589
|
Head extends TemplateLiteral.LiteralPart ? Head : Head extends Codec<infer T, unknown, unknown, unknown> ? T : never,
|
|
@@ -1570,7 +1595,8 @@ export declare namespace TemplateLiteralParser {
|
|
|
1570
1595
|
* them into a tuple of typed values, one per schema part.
|
|
1571
1596
|
*
|
|
1572
1597
|
* @see {@link TemplateLiteralParser} for the constructor function.
|
|
1573
|
-
* @
|
|
1598
|
+
* @category models
|
|
1599
|
+
* @since 3.10.0
|
|
1574
1600
|
*/
|
|
1575
1601
|
export interface TemplateLiteralParser<Parts extends TemplateLiteral.Parts> extends Bottom<TemplateLiteralParser.Type<Parts>, TemplateLiteral.Encoded<Parts>, never, never, AST.Arrays, TemplateLiteralParser<Parts>> {
|
|
1576
1602
|
readonly parts: Parts;
|
|
@@ -1580,6 +1606,7 @@ export interface TemplateLiteralParser<Parts extends TemplateLiteral.Parts> exte
|
|
|
1580
1606
|
* one element per schema part.
|
|
1581
1607
|
*
|
|
1582
1608
|
* **Example** (Parse path parameters)
|
|
1609
|
+
*
|
|
1583
1610
|
* ```ts
|
|
1584
1611
|
* import { Schema } from "effect"
|
|
1585
1612
|
*
|
|
@@ -1588,7 +1615,8 @@ export interface TemplateLiteralParser<Parts extends TemplateLiteral.Parts> exte
|
|
|
1588
1615
|
* ```
|
|
1589
1616
|
*
|
|
1590
1617
|
* @see {@link TemplateLiteral} for a validation-only version that keeps the string encoded.
|
|
1591
|
-
* @
|
|
1618
|
+
* @category constructors
|
|
1619
|
+
* @since 3.10.0
|
|
1592
1620
|
*/
|
|
1593
1621
|
export declare function TemplateLiteralParser<const Parts extends TemplateLiteral.Parts>(parts: Parts): TemplateLiteralParser<Parts>;
|
|
1594
1622
|
/**
|
|
@@ -1596,6 +1624,7 @@ export declare function TemplateLiteralParser<const Parts extends TemplateLitera
|
|
|
1596
1624
|
* `as const` object, accepting any of its values.
|
|
1597
1625
|
*
|
|
1598
1626
|
* @see {@link Enum} for the constructor function.
|
|
1627
|
+
* @category models
|
|
1599
1628
|
* @since 4.0.0
|
|
1600
1629
|
*/
|
|
1601
1630
|
export interface Enum<A extends {
|
|
@@ -1607,6 +1636,7 @@ export interface Enum<A extends {
|
|
|
1607
1636
|
* Creates a schema from a TypeScript enum object. Validates that the input is one of the enum's values.
|
|
1608
1637
|
*
|
|
1609
1638
|
* **Example** (Direction enum)
|
|
1639
|
+
*
|
|
1610
1640
|
* ```ts
|
|
1611
1641
|
* import { Schema } from "effect"
|
|
1612
1642
|
*
|
|
@@ -1619,6 +1649,7 @@ export interface Enum<A extends {
|
|
|
1619
1649
|
* // accepts "Up" or "Down"
|
|
1620
1650
|
* ```
|
|
1621
1651
|
*
|
|
1652
|
+
* @category constructors
|
|
1622
1653
|
* @since 4.0.0
|
|
1623
1654
|
*/
|
|
1624
1655
|
export declare function Enum<A extends {
|
|
@@ -1628,21 +1659,24 @@ export declare function Enum<A extends {
|
|
|
1628
1659
|
* Schema for the `never` type. Always fails validation.
|
|
1629
1660
|
*
|
|
1630
1661
|
* @see {@link Never} for the schema value.
|
|
1631
|
-
* @
|
|
1662
|
+
* @category models
|
|
1663
|
+
* @since 3.10.0
|
|
1632
1664
|
*/
|
|
1633
1665
|
export interface Never extends Bottom<never, never, never, never, AST.Never, Never> {
|
|
1634
1666
|
}
|
|
1635
1667
|
/**
|
|
1636
1668
|
* Schema for the `never` type. Always fails validation — no value satisfies it.
|
|
1637
1669
|
*
|
|
1638
|
-
* @
|
|
1670
|
+
* @category schemas
|
|
1671
|
+
* @since 3.10.0
|
|
1639
1672
|
*/
|
|
1640
1673
|
export declare const Never: Never;
|
|
1641
1674
|
/**
|
|
1642
1675
|
* Schema for the `any` type. Accepts any value without validation.
|
|
1643
1676
|
*
|
|
1644
1677
|
* @see {@link Any} for the schema value.
|
|
1645
|
-
* @
|
|
1678
|
+
* @category models
|
|
1679
|
+
* @since 3.10.0
|
|
1646
1680
|
*/
|
|
1647
1681
|
export interface Any extends Bottom<any, any, never, never, AST.Any, Any> {
|
|
1648
1682
|
}
|
|
@@ -1650,14 +1684,16 @@ export interface Any extends Bottom<any, any, never, never, AST.Any, Any> {
|
|
|
1650
1684
|
* Schema for the `any` type. Accepts any value without validation.
|
|
1651
1685
|
*
|
|
1652
1686
|
* @see {@link Unknown} for a safer alternative that uses `unknown`.
|
|
1653
|
-
* @
|
|
1687
|
+
* @category schemas
|
|
1688
|
+
* @since 3.10.0
|
|
1654
1689
|
*/
|
|
1655
1690
|
export declare const Any: Any;
|
|
1656
1691
|
/**
|
|
1657
1692
|
* Schema for the `unknown` type. Accepts any value without validation.
|
|
1658
1693
|
*
|
|
1659
1694
|
* @see {@link Unknown} for the schema value.
|
|
1660
|
-
* @
|
|
1695
|
+
* @category models
|
|
1696
|
+
* @since 3.10.0
|
|
1661
1697
|
*/
|
|
1662
1698
|
export interface Unknown extends Bottom<unknown, unknown, never, never, AST.Unknown, Unknown> {
|
|
1663
1699
|
}
|
|
@@ -1665,14 +1701,16 @@ export interface Unknown extends Bottom<unknown, unknown, never, never, AST.Unkn
|
|
|
1665
1701
|
* Schema for the `unknown` type. Accepts any value without validation.
|
|
1666
1702
|
*
|
|
1667
1703
|
* @see {@link Any} for the `any` variant.
|
|
1668
|
-
* @
|
|
1704
|
+
* @category schemas
|
|
1705
|
+
* @since 3.10.0
|
|
1669
1706
|
*/
|
|
1670
1707
|
export declare const Unknown: Unknown;
|
|
1671
1708
|
/**
|
|
1672
1709
|
* Schema for the `null` literal. Validates that the input is strictly `null`.
|
|
1673
1710
|
*
|
|
1674
1711
|
* @see {@link Null} for the schema value.
|
|
1675
|
-
* @
|
|
1712
|
+
* @category models
|
|
1713
|
+
* @since 3.10.0
|
|
1676
1714
|
*/
|
|
1677
1715
|
export interface Null extends Bottom<null, null, never, never, AST.Null, Null> {
|
|
1678
1716
|
}
|
|
@@ -1680,14 +1718,16 @@ export interface Null extends Bottom<null, null, never, never, AST.Null, Null> {
|
|
|
1680
1718
|
* Schema for the `null` literal. Validates that the input is strictly `null`.
|
|
1681
1719
|
*
|
|
1682
1720
|
* @see {@link NullOr} for a union with another schema.
|
|
1683
|
-
* @
|
|
1721
|
+
* @category schemas
|
|
1722
|
+
* @since 3.10.0
|
|
1684
1723
|
*/
|
|
1685
1724
|
export declare const Null: Null;
|
|
1686
1725
|
/**
|
|
1687
1726
|
* Schema for the `undefined` literal. Validates that the input is strictly `undefined`.
|
|
1688
1727
|
*
|
|
1689
1728
|
* @see {@link Undefined} for the schema value.
|
|
1690
|
-
* @
|
|
1729
|
+
* @category models
|
|
1730
|
+
* @since 3.10.0
|
|
1691
1731
|
*/
|
|
1692
1732
|
export interface Undefined extends Bottom<undefined, undefined, never, never, AST.Undefined, Undefined> {
|
|
1693
1733
|
}
|
|
@@ -1695,13 +1735,15 @@ export interface Undefined extends Bottom<undefined, undefined, never, never, AS
|
|
|
1695
1735
|
* Schema for the `undefined` literal. Validates that the input is strictly `undefined`.
|
|
1696
1736
|
*
|
|
1697
1737
|
* @see {@link UndefinedOr} for a union with another schema.
|
|
1698
|
-
* @
|
|
1738
|
+
* @category schemas
|
|
1739
|
+
* @since 3.10.0
|
|
1699
1740
|
*/
|
|
1700
1741
|
export declare const Undefined: Undefined;
|
|
1701
1742
|
/**
|
|
1702
1743
|
* Schema for `string` values.
|
|
1703
1744
|
*
|
|
1704
1745
|
* @see {@link String} for the schema value.
|
|
1746
|
+
* @category models
|
|
1705
1747
|
* @since 4.0.0
|
|
1706
1748
|
*/
|
|
1707
1749
|
export interface String extends Bottom<string, string, never, never, AST.String, String> {
|
|
@@ -1709,6 +1751,7 @@ export interface String extends Bottom<string, string, never, never, AST.String,
|
|
|
1709
1751
|
/**
|
|
1710
1752
|
* Schema for `string` values. Validates that the input is `typeof` `"string"`.
|
|
1711
1753
|
*
|
|
1754
|
+
* @category schemas
|
|
1712
1755
|
* @since 4.0.0
|
|
1713
1756
|
*/
|
|
1714
1757
|
export declare const String: String;
|
|
@@ -1716,6 +1759,7 @@ export declare const String: String;
|
|
|
1716
1759
|
* Schema for `number` values, including `NaN`, `Infinity`, and `-Infinity`.
|
|
1717
1760
|
*
|
|
1718
1761
|
* @see {@link Number} for the schema value.
|
|
1762
|
+
* @category models
|
|
1719
1763
|
* @since 4.0.0
|
|
1720
1764
|
*/
|
|
1721
1765
|
export interface Number extends Bottom<number, number, never, never, AST.Number, Number> {
|
|
@@ -1729,6 +1773,7 @@ export interface Number extends Bottom<number, number, never, never, AST.Number,
|
|
|
1729
1773
|
* - Non-finite values are serialized as strings (`"NaN"`, `"Infinity"`, `"-Infinity"`).
|
|
1730
1774
|
*
|
|
1731
1775
|
* @see {@link Finite} for a schema that excludes non-finite values.
|
|
1776
|
+
* @category schemas
|
|
1732
1777
|
* @since 4.0.0
|
|
1733
1778
|
*/
|
|
1734
1779
|
export declare const Number: Number;
|
|
@@ -1736,6 +1781,7 @@ export declare const Number: Number;
|
|
|
1736
1781
|
* Schema for `boolean` values.
|
|
1737
1782
|
*
|
|
1738
1783
|
* @see {@link Boolean} for the schema value.
|
|
1784
|
+
* @category models
|
|
1739
1785
|
* @since 4.0.0
|
|
1740
1786
|
*/
|
|
1741
1787
|
export interface Boolean extends Bottom<boolean, boolean, never, never, AST.Boolean, Boolean> {
|
|
@@ -1751,6 +1797,7 @@ export declare const Boolean: Boolean;
|
|
|
1751
1797
|
* Schema for `symbol` values.
|
|
1752
1798
|
*
|
|
1753
1799
|
* @see {@link Symbol} for the schema value.
|
|
1800
|
+
* @category models
|
|
1754
1801
|
* @since 4.0.0
|
|
1755
1802
|
*/
|
|
1756
1803
|
export interface Symbol extends Bottom<symbol, symbol, never, never, AST.Symbol, Symbol> {
|
|
@@ -1759,6 +1806,7 @@ export interface Symbol extends Bottom<symbol, symbol, never, never, AST.Symbol,
|
|
|
1759
1806
|
* Schema for `symbol` values. Validates that the input is `typeof` `"symbol"`.
|
|
1760
1807
|
*
|
|
1761
1808
|
* @see {@link UniqueSymbol} for a schema that matches a specific symbol.
|
|
1809
|
+
* @category schemas
|
|
1762
1810
|
* @since 4.0.0
|
|
1763
1811
|
*/
|
|
1764
1812
|
export declare const Symbol: Symbol;
|
|
@@ -1766,6 +1814,7 @@ export declare const Symbol: Symbol;
|
|
|
1766
1814
|
* Schema for `bigint` values.
|
|
1767
1815
|
*
|
|
1768
1816
|
* @see {@link BigInt} for the schema value.
|
|
1817
|
+
* @category models
|
|
1769
1818
|
* @since 4.0.0
|
|
1770
1819
|
*/
|
|
1771
1820
|
export interface BigInt extends Bottom<bigint, bigint, never, never, AST.BigInt, BigInt> {
|
|
@@ -1773,6 +1822,7 @@ export interface BigInt extends Bottom<bigint, bigint, never, never, AST.BigInt,
|
|
|
1773
1822
|
/**
|
|
1774
1823
|
* Schema for `bigint` values. Validates that the input is `typeof` `"bigint"`.
|
|
1775
1824
|
*
|
|
1825
|
+
* @category schemas
|
|
1776
1826
|
* @since 4.0.0
|
|
1777
1827
|
*/
|
|
1778
1828
|
export declare const BigInt: BigInt;
|
|
@@ -1780,20 +1830,23 @@ export declare const BigInt: BigInt;
|
|
|
1780
1830
|
* Schema for the `void` type.
|
|
1781
1831
|
*
|
|
1782
1832
|
* @see {@link Void} for the schema value.
|
|
1783
|
-
* @
|
|
1833
|
+
* @category models
|
|
1834
|
+
* @since 3.10.0
|
|
1784
1835
|
*/
|
|
1785
1836
|
export interface Void extends Bottom<void, void, never, never, AST.Void, Void> {
|
|
1786
1837
|
}
|
|
1787
1838
|
/**
|
|
1788
1839
|
* Schema for the `void` type. Accepts `undefined` as the encoded value.
|
|
1789
1840
|
*
|
|
1790
|
-
* @
|
|
1841
|
+
* @category schemas
|
|
1842
|
+
* @since 3.10.0
|
|
1791
1843
|
*/
|
|
1792
1844
|
export declare const Void: Void;
|
|
1793
1845
|
/**
|
|
1794
1846
|
* Schema for the `object` type keyword.
|
|
1795
1847
|
*
|
|
1796
1848
|
* @see {@link ObjectKeyword} for the schema value.
|
|
1849
|
+
* @category models
|
|
1797
1850
|
* @since 4.0.0
|
|
1798
1851
|
*/
|
|
1799
1852
|
export interface ObjectKeyword extends Bottom<object, object, never, never, AST.ObjectKeyword, ObjectKeyword> {
|
|
@@ -1802,6 +1855,7 @@ export interface ObjectKeyword extends Bottom<object, object, never, never, AST.
|
|
|
1802
1855
|
* Schema for the `object` type. Validates that the input is a non-null object or function
|
|
1803
1856
|
* (i.e. `typeof value === "object" && value !== null || typeof value === "function"`).
|
|
1804
1857
|
*
|
|
1858
|
+
* @category schemas
|
|
1805
1859
|
* @since 4.0.0
|
|
1806
1860
|
*/
|
|
1807
1861
|
export declare const ObjectKeyword: ObjectKeyword;
|
|
@@ -1809,6 +1863,7 @@ export declare const ObjectKeyword: ObjectKeyword;
|
|
|
1809
1863
|
* Represents a schema for a specific unique symbol.
|
|
1810
1864
|
*
|
|
1811
1865
|
* @see {@link UniqueSymbol} for the constructor function.
|
|
1866
|
+
* @category models
|
|
1812
1867
|
* @since 4.0.0
|
|
1813
1868
|
*/
|
|
1814
1869
|
export interface UniqueSymbol<sym extends symbol> extends Bottom<sym, sym, never, never, AST.UniqueSymbol, UniqueSymbol<sym>> {
|
|
@@ -1817,6 +1872,7 @@ export interface UniqueSymbol<sym extends symbol> extends Bottom<sym, sym, never
|
|
|
1817
1872
|
* Creates a schema for a specific symbol. Only that exact symbol satisfies the schema.
|
|
1818
1873
|
*
|
|
1819
1874
|
* **Example** (Specific symbol)
|
|
1875
|
+
*
|
|
1820
1876
|
* ```ts
|
|
1821
1877
|
* import { Schema } from "effect"
|
|
1822
1878
|
*
|
|
@@ -1825,6 +1881,7 @@ export interface UniqueSymbol<sym extends symbol> extends Bottom<sym, sym, never
|
|
|
1825
1881
|
* ```
|
|
1826
1882
|
*
|
|
1827
1883
|
* @see {@link Symbol} for a schema that accepts any symbol.
|
|
1884
|
+
* @category constructors
|
|
1828
1885
|
* @since 4.0.0
|
|
1829
1886
|
*/
|
|
1830
1887
|
export declare function UniqueSymbol<const sym extends symbol>(symbol: sym): UniqueSymbol<sym>;
|
|
@@ -1841,13 +1898,14 @@ export declare function UniqueSymbol<const sym extends symbol>(symbol: sym): Uni
|
|
|
1841
1898
|
* - `Struct.MakeIn<F>` — constructor input (optional/defaulted fields may be omitted)
|
|
1842
1899
|
* - `Struct.DecodingServices<F>` / `Struct.EncodingServices<F>` — required services
|
|
1843
1900
|
*
|
|
1844
|
-
* @since
|
|
1901
|
+
* @since 3.10.0
|
|
1845
1902
|
*/
|
|
1846
1903
|
export declare namespace Struct {
|
|
1847
1904
|
/**
|
|
1848
1905
|
* Constraint for a struct field map: an object whose values are schemas.
|
|
1849
1906
|
*
|
|
1850
|
-
* @
|
|
1907
|
+
* @category utility types
|
|
1908
|
+
* @since 3.10.0
|
|
1851
1909
|
*/
|
|
1852
1910
|
type Fields = {
|
|
1853
1911
|
readonly [x: PropertyKey]: Top;
|
|
@@ -1878,7 +1936,8 @@ export declare namespace Struct {
|
|
|
1878
1936
|
* Field schemas contribute their decoded `Type`. `optionalKey` and `optional`
|
|
1879
1937
|
* produce optional properties, while `mutableKey` produces writable properties.
|
|
1880
1938
|
*
|
|
1881
|
-
* @
|
|
1939
|
+
* @category utility types
|
|
1940
|
+
* @since 3.10.0
|
|
1882
1941
|
*/
|
|
1883
1942
|
type Type<F extends Fields> = Simplify<Type_<F>>;
|
|
1884
1943
|
type Iso_<F extends Fields, O extends keyof F = TypeOptionalKeys<F>, M extends keyof F = TypeMutableKeys<F>> = {
|
|
@@ -1898,6 +1957,7 @@ export declare namespace Struct {
|
|
|
1898
1957
|
* The resulting property optionality and mutability follow the same field
|
|
1899
1958
|
* modifiers used by `Struct.Type`.
|
|
1900
1959
|
*
|
|
1960
|
+
* @category utility types
|
|
1901
1961
|
* @since 4.0.0
|
|
1902
1962
|
*/
|
|
1903
1963
|
type Iso<F extends Fields> = Simplify<Iso_<F>>;
|
|
@@ -1928,13 +1988,15 @@ export declare namespace Struct {
|
|
|
1928
1988
|
* mutability modifiers determine whether properties are optional or writable in
|
|
1929
1989
|
* the encoded shape.
|
|
1930
1990
|
*
|
|
1931
|
-
* @
|
|
1991
|
+
* @category utility types
|
|
1992
|
+
* @since 3.10.0
|
|
1932
1993
|
*/
|
|
1933
1994
|
type Encoded<F extends Fields> = Simplify<Encoded_<F>>;
|
|
1934
1995
|
/**
|
|
1935
1996
|
* Union of all decoding service requirements needed by the schemas in a struct
|
|
1936
1997
|
* field map.
|
|
1937
1998
|
*
|
|
1999
|
+
* @category utility types
|
|
1938
2000
|
* @since 4.0.0
|
|
1939
2001
|
*/
|
|
1940
2002
|
type DecodingServices<F extends Fields> = {
|
|
@@ -1944,6 +2006,7 @@ export declare namespace Struct {
|
|
|
1944
2006
|
* Union of all encoding service requirements needed by the schemas in a struct
|
|
1945
2007
|
* field map.
|
|
1946
2008
|
*
|
|
2009
|
+
* @category utility types
|
|
1947
2010
|
* @since 4.0.0
|
|
1948
2011
|
*/
|
|
1949
2012
|
type EncodingServices<F extends Fields> = {
|
|
@@ -1966,6 +2029,7 @@ export declare namespace Struct {
|
|
|
1966
2029
|
* Required fields use each field schema's `~type.make` input. Fields marked
|
|
1967
2030
|
* optional or with a constructor default may be omitted.
|
|
1968
2031
|
*
|
|
2032
|
+
* @category utility types
|
|
1969
2033
|
* @since 4.0.0
|
|
1970
2034
|
*/
|
|
1971
2035
|
type MakeIn<F extends Fields> = Simplify<MakeIn_<F>>;
|
|
@@ -1978,7 +2042,8 @@ export declare namespace Struct {
|
|
|
1978
2042
|
* The `fields` property exposes the original field map for reuse, and
|
|
1979
2043
|
* `mapFields` creates a new struct schema by transforming that field map.
|
|
1980
2044
|
*
|
|
1981
|
-
* @
|
|
2045
|
+
* @category models
|
|
2046
|
+
* @since 3.10.0
|
|
1982
2047
|
*/
|
|
1983
2048
|
export interface Struct<Fields extends Struct.Fields> extends Bottom<Struct.Type<Fields>, Struct.Encoded<Fields>, Struct.DecodingServices<Fields>, Struct.EncodingServices<Fields>, AST.Objects, Struct<Fields>, Struct.MakeIn<Fields>, Struct.Iso<Fields>> {
|
|
1984
2049
|
/**
|
|
@@ -2049,8 +2114,8 @@ export interface Struct<Fields extends Struct.Fields> extends Bottom<Struct.Type
|
|
|
2049
2114
|
* // { name: 'Alice', age: 30 }
|
|
2050
2115
|
* ```
|
|
2051
2116
|
*
|
|
2052
|
-
* @category
|
|
2053
|
-
* @since
|
|
2117
|
+
* @category constructors
|
|
2118
|
+
* @since 3.10.0
|
|
2054
2119
|
*/
|
|
2055
2120
|
export declare function Struct<const Fields extends Struct.Fields>(fields: Fields): Struct<Fields>;
|
|
2056
2121
|
interface fieldsAssign<NewFields extends Struct.Fields> extends Lambda {
|
|
@@ -2073,6 +2138,7 @@ interface fieldsAssign<NewFields extends Struct.Fields> extends Lambda {
|
|
|
2073
2138
|
* ]).mapMembers(Tuple.map(Schema.fieldsAssign({ c: Schema.Number })))
|
|
2074
2139
|
* ```
|
|
2075
2140
|
*
|
|
2141
|
+
* @category combinators
|
|
2076
2142
|
* @since 4.0.0
|
|
2077
2143
|
*/
|
|
2078
2144
|
export declare function fieldsAssign<const NewFields extends Struct.Fields>(fields: NewFields): fieldsAssign<NewFields>;
|
|
@@ -2080,6 +2146,7 @@ export declare function fieldsAssign<const NewFields extends Struct.Fields>(fiel
|
|
|
2080
2146
|
* Schema type for a struct with renamed encoded keys. Produced by
|
|
2081
2147
|
* {@link encodeKeys}.
|
|
2082
2148
|
*
|
|
2149
|
+
* @category transforming
|
|
2083
2150
|
* @since 4.0.0
|
|
2084
2151
|
*/
|
|
2085
2152
|
export interface encodeKeys<S extends Top & {
|
|
@@ -2111,7 +2178,7 @@ export interface encodeKeys<S extends Top & {
|
|
|
2111
2178
|
* // { name: 'Alice', age: 30 }
|
|
2112
2179
|
* ```
|
|
2113
2180
|
*
|
|
2114
|
-
* @category
|
|
2181
|
+
* @category transforming
|
|
2115
2182
|
* @since 4.0.0
|
|
2116
2183
|
*/
|
|
2117
2184
|
export declare function encodeKeys<S extends Top & {
|
|
@@ -2145,8 +2212,8 @@ export declare function encodeKeys<S extends Top & {
|
|
|
2145
2212
|
* // Alice Smith
|
|
2146
2213
|
* ```
|
|
2147
2214
|
*
|
|
2215
|
+
* @category transforming
|
|
2148
2216
|
* @since 4.0.0
|
|
2149
|
-
* @experimental
|
|
2150
2217
|
*/
|
|
2151
2218
|
export declare function extendTo<S extends Struct<Struct.Fields>, const Fields extends Struct.Fields>(
|
|
2152
2219
|
/** The new fields to add */
|
|
@@ -2162,7 +2229,7 @@ derive: {
|
|
|
2162
2229
|
* - `Record.Type<K, V>` — decoded type of the record
|
|
2163
2230
|
* - `Record.Encoded<K, V>` — encoded type of the record
|
|
2164
2231
|
*
|
|
2165
|
-
* @since
|
|
2232
|
+
* @since 3.10.0
|
|
2166
2233
|
*/
|
|
2167
2234
|
export declare namespace Record {
|
|
2168
2235
|
/**
|
|
@@ -2172,6 +2239,7 @@ export declare namespace Record {
|
|
|
2172
2239
|
* The key schema must decode and encode property keys (`string`, `number`, or
|
|
2173
2240
|
* `symbol`) so it can describe object property names.
|
|
2174
2241
|
*
|
|
2242
|
+
* @category utility types
|
|
2175
2243
|
* @since 4.0.0
|
|
2176
2244
|
*/
|
|
2177
2245
|
interface Key extends Codec<PropertyKey, PropertyKey, unknown, unknown> {
|
|
@@ -2187,7 +2255,8 @@ export declare namespace Record {
|
|
|
2187
2255
|
* property's decoded `Type`. Optional and mutable value schemas affect the
|
|
2188
2256
|
* resulting property optionality and writability.
|
|
2189
2257
|
*
|
|
2190
|
-
* @
|
|
2258
|
+
* @category utility types
|
|
2259
|
+
* @since 3.10.0
|
|
2191
2260
|
*/
|
|
2192
2261
|
type Type<Key extends Record.Key, Value extends Top> = Value extends {
|
|
2193
2262
|
readonly "~type.optionality": "optional";
|
|
@@ -2208,6 +2277,7 @@ export declare namespace Record {
|
|
|
2208
2277
|
* Computes the iso object type for a record schema from the key schema's `Iso`
|
|
2209
2278
|
* keys and the value schema's `Iso` values.
|
|
2210
2279
|
*
|
|
2280
|
+
* @category utility types
|
|
2211
2281
|
* @since 4.0.0
|
|
2212
2282
|
*/
|
|
2213
2283
|
type Iso<Key extends Record.Key, Value extends Top> = Value extends {
|
|
@@ -2233,7 +2303,8 @@ export declare namespace Record {
|
|
|
2233
2303
|
* Encoded-side optionality and mutability on the value schema determine whether
|
|
2234
2304
|
* the encoded record properties are optional or writable.
|
|
2235
2305
|
*
|
|
2236
|
-
* @
|
|
2306
|
+
* @category utility types
|
|
2307
|
+
* @since 3.10.0
|
|
2237
2308
|
*/
|
|
2238
2309
|
type Encoded<Key extends Record.Key, Value extends Top> = Value extends {
|
|
2239
2310
|
readonly "~encoded.optionality": "optional";
|
|
@@ -2254,6 +2325,7 @@ export declare namespace Record {
|
|
|
2254
2325
|
* Union of the decoding service requirements of a record's key schema and value
|
|
2255
2326
|
* schema.
|
|
2256
2327
|
*
|
|
2328
|
+
* @category utility types
|
|
2257
2329
|
* @since 4.0.0
|
|
2258
2330
|
*/
|
|
2259
2331
|
type DecodingServices<Key extends Record.Key, Value extends Top> = Key["DecodingServices"] | Value["DecodingServices"];
|
|
@@ -2261,6 +2333,7 @@ export declare namespace Record {
|
|
|
2261
2333
|
* Union of the encoding service requirements of a record's key schema and value
|
|
2262
2334
|
* schema.
|
|
2263
2335
|
*
|
|
2336
|
+
* @category utility types
|
|
2264
2337
|
* @since 4.0.0
|
|
2265
2338
|
*/
|
|
2266
2339
|
type EncodingServices<Key extends Record.Key, Value extends Top> = Key["EncodingServices"] | Value["EncodingServices"];
|
|
@@ -2272,6 +2345,7 @@ export declare namespace Record {
|
|
|
2272
2345
|
* `~type.make` type. Value optionality and mutability determine whether
|
|
2273
2346
|
* properties are optional or writable.
|
|
2274
2347
|
*
|
|
2348
|
+
* @category utility types
|
|
2275
2349
|
* @since 4.0.0
|
|
2276
2350
|
*/
|
|
2277
2351
|
type MakeIn<Key extends Record.Key, Value extends Top> = Value extends {
|
|
@@ -2294,6 +2368,7 @@ export declare namespace Record {
|
|
|
2294
2368
|
* Companion type for a key-value record (map) with a typed key and value schema.
|
|
2295
2369
|
* Produced by {@link Record}.
|
|
2296
2370
|
*
|
|
2371
|
+
* @category models
|
|
2297
2372
|
* @since 4.0.0
|
|
2298
2373
|
*/
|
|
2299
2374
|
export interface $Record<Key extends Record.Key, Value extends Top> extends Bottom<Record.Type<Key, Value>, Record.Encoded<Key, Value>, Record.DecodingServices<Key, Value>, Record.EncodingServices<Key, Value>, AST.Objects, $Record<Key, Value>, Simplify<Record.MakeIn<Key, Value>>, Record.Iso<Key, Value>> {
|
|
@@ -2318,8 +2393,8 @@ export interface $Record<Key extends Record.Key, Value extends Top> extends Bott
|
|
|
2318
2393
|
* // { a: 1, b: 2 }
|
|
2319
2394
|
* ```
|
|
2320
2395
|
*
|
|
2321
|
-
* @category
|
|
2322
|
-
* @since
|
|
2396
|
+
* @category constructors
|
|
2397
|
+
* @since 3.10.0
|
|
2323
2398
|
*/
|
|
2324
2399
|
export declare function Record<Key extends Record.Key, Value extends Top>(key: Key, value: Value, options?: {
|
|
2325
2400
|
readonly keyValueCombiner: {
|
|
@@ -2340,6 +2415,7 @@ export declare namespace StructWithRest {
|
|
|
2340
2415
|
* Constraint for object-like schemas that can be used as the fixed portion of a
|
|
2341
2416
|
* `StructWithRest` schema.
|
|
2342
2417
|
*
|
|
2418
|
+
* @category utility types
|
|
2343
2419
|
* @since 4.0.0
|
|
2344
2420
|
*/
|
|
2345
2421
|
type Objects = Top & {
|
|
@@ -2349,7 +2425,8 @@ export declare namespace StructWithRest {
|
|
|
2349
2425
|
* Readonly list of record schemas that provide the additional index signatures
|
|
2350
2426
|
* for a `StructWithRest` schema.
|
|
2351
2427
|
*
|
|
2352
|
-
* @
|
|
2428
|
+
* @category utility types
|
|
2429
|
+
* @since 3.10.0
|
|
2353
2430
|
*/
|
|
2354
2431
|
type Records = ReadonlyArray<$Record<Record.Key, Top>>;
|
|
2355
2432
|
type MergeTuple<T extends ReadonlyArray<unknown>> = T extends readonly [infer Head, ...infer Tail] ? Head & MergeTuple<Tail> : {};
|
|
@@ -2357,7 +2434,8 @@ export declare namespace StructWithRest {
|
|
|
2357
2434
|
* Computes the decoded type for `StructWithRest` by intersecting the base object
|
|
2358
2435
|
* schema's decoded `Type` with the decoded types of all rest record schemas.
|
|
2359
2436
|
*
|
|
2360
|
-
* @
|
|
2437
|
+
* @category utility types
|
|
2438
|
+
* @since 3.10.0
|
|
2361
2439
|
*/
|
|
2362
2440
|
type Type<S extends Objects, Records extends StructWithRest.Records> = S["Type"] & MergeTuple<{
|
|
2363
2441
|
readonly [K in keyof Records]: Records[K]["Type"];
|
|
@@ -2366,6 +2444,7 @@ export declare namespace StructWithRest {
|
|
|
2366
2444
|
* Computes the iso type for `StructWithRest` by intersecting the base object
|
|
2367
2445
|
* schema's `Iso` type with the `Iso` types of all rest record schemas.
|
|
2368
2446
|
*
|
|
2447
|
+
* @category utility types
|
|
2369
2448
|
* @since 4.0.0
|
|
2370
2449
|
*/
|
|
2371
2450
|
type Iso<S extends Objects, Records extends StructWithRest.Records> = S["Iso"] & MergeTuple<{
|
|
@@ -2375,7 +2454,8 @@ export declare namespace StructWithRest {
|
|
|
2375
2454
|
* Computes the encoded type for `StructWithRest` by intersecting the base object
|
|
2376
2455
|
* schema's encoded type with the encoded types of all rest record schemas.
|
|
2377
2456
|
*
|
|
2378
|
-
* @
|
|
2457
|
+
* @category utility types
|
|
2458
|
+
* @since 3.10.0
|
|
2379
2459
|
*/
|
|
2380
2460
|
type Encoded<S extends Objects, Records extends StructWithRest.Records> = S["Encoded"] & MergeTuple<{
|
|
2381
2461
|
readonly [K in keyof Records]: Records[K]["Encoded"];
|
|
@@ -2384,6 +2464,7 @@ export declare namespace StructWithRest {
|
|
|
2384
2464
|
* Union of the decoding service requirements of the base object schema and all
|
|
2385
2465
|
* rest record schemas.
|
|
2386
2466
|
*
|
|
2467
|
+
* @category utility types
|
|
2387
2468
|
* @since 4.0.0
|
|
2388
2469
|
*/
|
|
2389
2470
|
type DecodingServices<S extends Objects, Records extends StructWithRest.Records> = S["DecodingServices"] | {
|
|
@@ -2393,6 +2474,7 @@ export declare namespace StructWithRest {
|
|
|
2393
2474
|
* Union of the encoding service requirements of the base object schema and all
|
|
2394
2475
|
* rest record schemas.
|
|
2395
2476
|
*
|
|
2477
|
+
* @category utility types
|
|
2396
2478
|
* @since 4.0.0
|
|
2397
2479
|
*/
|
|
2398
2480
|
type EncodingServices<S extends Objects, Records extends StructWithRest.Records> = S["EncodingServices"] | {
|
|
@@ -2403,6 +2485,7 @@ export declare namespace StructWithRest {
|
|
|
2403
2485
|
* intersecting the base object's make input with the make inputs of all rest
|
|
2404
2486
|
* record schemas.
|
|
2405
2487
|
*
|
|
2488
|
+
* @category utility types
|
|
2406
2489
|
* @since 4.0.0
|
|
2407
2490
|
*/
|
|
2408
2491
|
type MakeIn<S extends Objects, Records extends StructWithRest.Records> = S["~type.make"] & MergeTuple<{
|
|
@@ -2413,6 +2496,7 @@ export declare namespace StructWithRest {
|
|
|
2413
2496
|
* Companion type for a struct combined with one or more record schemas. Produced
|
|
2414
2497
|
* by {@link StructWithRest}.
|
|
2415
2498
|
*
|
|
2499
|
+
* @category models
|
|
2416
2500
|
* @since 4.0.0
|
|
2417
2501
|
*/
|
|
2418
2502
|
export interface StructWithRest<S extends StructWithRest.Objects, Records extends StructWithRest.Records> extends Bottom<Simplify<StructWithRest.Type<S, Records>>, Simplify<StructWithRest.Encoded<S, Records>>, StructWithRest.DecodingServices<S, Records>, StructWithRest.EncodingServices<S, Records>, AST.Objects, StructWithRest<S, Records>, Simplify<StructWithRest.MakeIn<S, Records>>, Simplify<StructWithRest.Iso<S, Records>>> {
|
|
@@ -2437,7 +2521,7 @@ export interface StructWithRest<S extends StructWithRest.Objects, Records extend
|
|
|
2437
2521
|
* type T = typeof schema.Type
|
|
2438
2522
|
* ```
|
|
2439
2523
|
*
|
|
2440
|
-
* @category
|
|
2524
|
+
* @category constructors
|
|
2441
2525
|
* @since 4.0.0
|
|
2442
2526
|
*/
|
|
2443
2527
|
export declare function StructWithRest<const S extends StructWithRest.Objects, const Records extends StructWithRest.Records>(schema: S, records: Records): StructWithRest<S, Records>;
|
|
@@ -2449,14 +2533,15 @@ export declare function StructWithRest<const S extends StructWithRest.Objects, c
|
|
|
2449
2533
|
* - `Tuple.Encoded<E>` — encoded tuple type
|
|
2450
2534
|
* - `Tuple.MakeIn<E>` — constructor input tuple
|
|
2451
2535
|
*
|
|
2452
|
-
* @since
|
|
2536
|
+
* @since 3.10.0
|
|
2453
2537
|
*/
|
|
2454
2538
|
export declare namespace Tuple {
|
|
2455
2539
|
/**
|
|
2456
2540
|
* Constraint for the readonly array of element schemas used to define a
|
|
2457
2541
|
* fixed-length `Tuple` schema.
|
|
2458
2542
|
*
|
|
2459
|
-
* @
|
|
2543
|
+
* @category utility types
|
|
2544
|
+
* @since 3.10.0
|
|
2460
2545
|
*/
|
|
2461
2546
|
type Elements = ReadonlyArray<Top>;
|
|
2462
2547
|
type Type_<Elements, Out extends ReadonlyArray<any> = readonly []> = Elements extends readonly [infer Head, ...infer Tail] ? Head extends {
|
|
@@ -2471,7 +2556,8 @@ export declare namespace Tuple {
|
|
|
2471
2556
|
* Each element contributes its decoded `Type`; optional element schemas produce
|
|
2472
2557
|
* optional tuple positions.
|
|
2473
2558
|
*
|
|
2474
|
-
* @
|
|
2559
|
+
* @category utility types
|
|
2560
|
+
* @since 3.10.0
|
|
2475
2561
|
*/
|
|
2476
2562
|
type Type<E extends Elements> = Type_<E>;
|
|
2477
2563
|
type Iso_<Elements, Out extends ReadonlyArray<any> = readonly []> = Elements extends readonly [infer Head, ...infer Tail] ? Head extends {
|
|
@@ -2483,6 +2569,7 @@ export declare namespace Tuple {
|
|
|
2483
2569
|
* Computes the iso tuple type for a tuple element schema array from each
|
|
2484
2570
|
* element schema's `Iso` type.
|
|
2485
2571
|
*
|
|
2572
|
+
* @category utility types
|
|
2486
2573
|
* @since 4.0.0
|
|
2487
2574
|
*/
|
|
2488
2575
|
type Iso<E extends Elements> = Iso_<E>;
|
|
@@ -2498,13 +2585,15 @@ export declare namespace Tuple {
|
|
|
2498
2585
|
* Each element contributes its `Encoded` type; encoded-side optional element
|
|
2499
2586
|
* schemas produce optional tuple positions.
|
|
2500
2587
|
*
|
|
2501
|
-
* @
|
|
2588
|
+
* @category utility types
|
|
2589
|
+
* @since 3.10.0
|
|
2502
2590
|
*/
|
|
2503
2591
|
type Encoded<E extends Elements> = Encoded_<E>;
|
|
2504
2592
|
/**
|
|
2505
2593
|
* Union of all decoding service requirements needed by the tuple element
|
|
2506
2594
|
* schemas.
|
|
2507
2595
|
*
|
|
2596
|
+
* @category utility types
|
|
2508
2597
|
* @since 4.0.0
|
|
2509
2598
|
*/
|
|
2510
2599
|
type DecodingServices<E extends Elements> = E[number]["DecodingServices"];
|
|
@@ -2512,6 +2601,7 @@ export declare namespace Tuple {
|
|
|
2512
2601
|
* Union of all encoding service requirements needed by the tuple element
|
|
2513
2602
|
* schemas.
|
|
2514
2603
|
*
|
|
2604
|
+
* @category utility types
|
|
2515
2605
|
* @since 4.0.0
|
|
2516
2606
|
*/
|
|
2517
2607
|
type EncodingServices<E extends Elements> = E[number]["EncodingServices"];
|
|
@@ -2529,6 +2619,7 @@ export declare namespace Tuple {
|
|
|
2529
2619
|
* Each element uses its `~type.make` input type. Optional elements and elements
|
|
2530
2620
|
* with constructor defaults produce optional tuple positions.
|
|
2531
2621
|
*
|
|
2622
|
+
* @category utility types
|
|
2532
2623
|
* @since 4.0.0
|
|
2533
2624
|
*/
|
|
2534
2625
|
type MakeIn<E extends Elements> = MakeIn_<E>;
|
|
@@ -2536,7 +2627,8 @@ export declare namespace Tuple {
|
|
|
2536
2627
|
/**
|
|
2537
2628
|
* Companion type for a fixed-length tuple. Produced by {@link Tuple}.
|
|
2538
2629
|
*
|
|
2539
|
-
* @
|
|
2630
|
+
* @category models
|
|
2631
|
+
* @since 3.10.0
|
|
2540
2632
|
*/
|
|
2541
2633
|
export interface Tuple<Elements extends Tuple.Elements> extends Bottom<Tuple.Type<Elements>, Tuple.Encoded<Elements>, Tuple.DecodingServices<Elements>, Tuple.EncodingServices<Elements>, AST.Arrays, Tuple<Elements>, Tuple.MakeIn<Elements>, Tuple.Iso<Elements>> {
|
|
2542
2634
|
readonly elements: Elements;
|
|
@@ -2573,8 +2665,8 @@ export interface Tuple<Elements extends Tuple.Elements> extends Bottom<Tuple.Typ
|
|
|
2573
2665
|
* // [ 'hello', 42 ]
|
|
2574
2666
|
* ```
|
|
2575
2667
|
*
|
|
2576
|
-
* @category
|
|
2577
|
-
* @since
|
|
2668
|
+
* @category constructors
|
|
2669
|
+
* @since 3.10.0
|
|
2578
2670
|
*/
|
|
2579
2671
|
export declare function Tuple<const Elements extends ReadonlyArray<Top>>(elements: Elements): Tuple<Elements>;
|
|
2580
2672
|
/**
|
|
@@ -2592,7 +2684,8 @@ export declare namespace TupleWithRest {
|
|
|
2592
2684
|
* Constraint for tuple-like schemas that can be used as the fixed leading
|
|
2593
2685
|
* portion of a `TupleWithRest` schema.
|
|
2594
2686
|
*
|
|
2595
|
-
* @
|
|
2687
|
+
* @category utility types
|
|
2688
|
+
* @since 3.10.0
|
|
2596
2689
|
*/
|
|
2597
2690
|
type TupleType = Top & {
|
|
2598
2691
|
readonly Type: ReadonlyArray<unknown>;
|
|
@@ -2608,7 +2701,8 @@ export declare namespace TupleWithRest {
|
|
|
2608
2701
|
* The first schema describes the repeated rest element. Additional schemas, when
|
|
2609
2702
|
* present, describe trailing tuple elements after the repeated rest segment.
|
|
2610
2703
|
*
|
|
2611
|
-
* @
|
|
2704
|
+
* @category utility types
|
|
2705
|
+
* @since 3.10.0
|
|
2612
2706
|
*/
|
|
2613
2707
|
type Rest = readonly [Top, ...Array<Top>];
|
|
2614
2708
|
/**
|
|
@@ -2619,7 +2713,8 @@ export declare namespace TupleWithRest {
|
|
|
2619
2713
|
* values decoded by the first rest schema, and includes any trailing rest schemas
|
|
2620
2714
|
* as fixed tuple positions.
|
|
2621
2715
|
*
|
|
2622
|
-
* @
|
|
2716
|
+
* @category utility types
|
|
2717
|
+
* @since 3.10.0
|
|
2623
2718
|
*/
|
|
2624
2719
|
type Type<T extends ReadonlyArray<unknown>, Rest extends TupleWithRest.Rest> = Rest extends readonly [infer Head extends Top, ...infer Tail extends ReadonlyArray<Top>] ? Readonly<[
|
|
2625
2720
|
...T,
|
|
@@ -2636,6 +2731,7 @@ export declare namespace TupleWithRest {
|
|
|
2636
2731
|
* or more values using the first rest schema's `Iso`, and includes any trailing
|
|
2637
2732
|
* rest schemas as fixed tuple positions.
|
|
2638
2733
|
*
|
|
2734
|
+
* @category utility types
|
|
2639
2735
|
* @since 4.0.0
|
|
2640
2736
|
*/
|
|
2641
2737
|
type Iso<T extends ReadonlyArray<unknown>, Rest extends TupleWithRest.Rest> = Rest extends readonly [infer Head extends Top, ...infer Tail extends ReadonlyArray<Top>] ? Readonly<[
|
|
@@ -2653,7 +2749,8 @@ export declare namespace TupleWithRest {
|
|
|
2653
2749
|
* first rest schema may repeat zero or more times, and the encoded types of any
|
|
2654
2750
|
* additional rest schemas become required trailing tuple elements.
|
|
2655
2751
|
*
|
|
2656
|
-
* @
|
|
2752
|
+
* @category utility types
|
|
2753
|
+
* @since 3.10.0
|
|
2657
2754
|
*/
|
|
2658
2755
|
type Encoded<E extends ReadonlyArray<unknown>, Rest extends TupleWithRest.Rest> = Rest extends readonly [infer Head extends Top, ...infer Tail extends ReadonlyArray<Top>] ? readonly [
|
|
2659
2756
|
...E,
|
|
@@ -2670,6 +2767,7 @@ export declare namespace TupleWithRest {
|
|
|
2670
2767
|
* the first rest schema may repeat zero or more times, and the make input types
|
|
2671
2768
|
* of any additional rest schemas become required trailing tuple elements.
|
|
2672
2769
|
*
|
|
2770
|
+
* @category utility types
|
|
2673
2771
|
* @since 4.0.0
|
|
2674
2772
|
*/
|
|
2675
2773
|
type MakeIn<M extends ReadonlyArray<unknown>, Rest extends TupleWithRest.Rest> = Rest extends readonly [infer Head extends Top, ...infer Tail extends ReadonlyArray<Top>] ? readonly [
|
|
@@ -2684,6 +2782,7 @@ export declare namespace TupleWithRest {
|
|
|
2684
2782
|
* Companion type for a tuple with additional rest elements. Produced by
|
|
2685
2783
|
* {@link TupleWithRest}.
|
|
2686
2784
|
*
|
|
2785
|
+
* @category models
|
|
2687
2786
|
* @since 4.0.0
|
|
2688
2787
|
*/
|
|
2689
2788
|
export interface TupleWithRest<S extends TupleWithRest.TupleType, Rest extends TupleWithRest.Rest> extends Bottom<TupleWithRest.Type<S["Type"], Rest>, TupleWithRest.Encoded<S["Encoded"], Rest>, S["DecodingServices"] | Rest[number]["DecodingServices"], S["EncodingServices"] | Rest[number]["EncodingServices"], AST.Arrays, TupleWithRest<S, Rest>, TupleWithRest.MakeIn<S["~type.make"], Rest>, TupleWithRest.Iso<S["Iso"], Rest>> {
|
|
@@ -2716,7 +2815,7 @@ export interface TupleWithRest<S extends TupleWithRest.TupleType, Rest extends T
|
|
|
2716
2815
|
* // [ 'hello', 1, true, false ]
|
|
2717
2816
|
* ```
|
|
2718
2817
|
*
|
|
2719
|
-
* @category
|
|
2818
|
+
* @category constructors
|
|
2720
2819
|
* @since 4.0.0
|
|
2721
2820
|
*/
|
|
2722
2821
|
export declare function TupleWithRest<S extends Tuple<Tuple.Elements>, const Rest extends TupleWithRest.Rest>(schema: S, rest: Rest): TupleWithRest<S, Rest>;
|
|
@@ -2728,6 +2827,7 @@ export declare function TupleWithRest<S extends Tuple<Tuple.Elements>, const Res
|
|
|
2728
2827
|
* `ReadonlyArray<S["Encoded"]>`, and the element schema is available as
|
|
2729
2828
|
* `schema`.
|
|
2730
2829
|
*
|
|
2830
|
+
* @category models
|
|
2731
2831
|
* @since 4.0.0
|
|
2732
2832
|
*/
|
|
2733
2833
|
export interface $Array<S extends Top> extends Bottom<ReadonlyArray<S["Type"]>, ReadonlyArray<S["Encoded"]>, S["DecodingServices"], S["EncodingServices"], AST.Arrays, $Array<S>, ReadonlyArray<S["~type.make"]>, ReadonlyArray<S["Iso"]>> {
|
|
@@ -2738,7 +2838,7 @@ interface ArrayLambda extends Lambda {
|
|
|
2738
2838
|
readonly "~lambda.out": this["~lambda.in"] extends Top ? $Array<this["~lambda.in"]> : never;
|
|
2739
2839
|
}
|
|
2740
2840
|
/**
|
|
2741
|
-
* @category
|
|
2841
|
+
* @category constructors
|
|
2742
2842
|
* @since 4.0.0
|
|
2743
2843
|
*/
|
|
2744
2844
|
declare const ArraySchema: ArrayLambda;
|
|
@@ -2758,14 +2858,15 @@ export {
|
|
|
2758
2858
|
* // [ 'a', 'b', 'c' ]
|
|
2759
2859
|
* ```
|
|
2760
2860
|
*
|
|
2761
|
-
* @category
|
|
2861
|
+
* @category constructors
|
|
2762
2862
|
* @since 4.0.0
|
|
2763
2863
|
*/
|
|
2764
2864
|
ArraySchema as Array };
|
|
2765
2865
|
/**
|
|
2766
2866
|
* Companion type for a non-empty `ReadonlyArray`. Produced by {@link NonEmptyArray}.
|
|
2767
2867
|
*
|
|
2768
|
-
* @
|
|
2868
|
+
* @category models
|
|
2869
|
+
* @since 3.10.0
|
|
2769
2870
|
*/
|
|
2770
2871
|
export interface NonEmptyArray<S extends Top> extends Bottom<readonly [S["Type"], ...Array<S["Type"]>], readonly [S["Encoded"], ...Array<S["Encoded"]>], S["DecodingServices"], S["EncodingServices"], AST.Arrays, NonEmptyArray<S>, readonly [S["~type.make"], ...Array<S["~type.make"]>], readonly [S["Iso"], ...Array<S["Iso"]>]> {
|
|
2771
2872
|
readonly schema: S;
|
|
@@ -2789,8 +2890,8 @@ interface NonEmptyArrayLambda extends Lambda {
|
|
|
2789
2890
|
* Schema.decodeUnknownSync(schema)([]) // throws
|
|
2790
2891
|
* ```
|
|
2791
2892
|
*
|
|
2792
|
-
* @category
|
|
2793
|
-
* @since
|
|
2893
|
+
* @category constructors
|
|
2894
|
+
* @since 3.10.0
|
|
2794
2895
|
*/
|
|
2795
2896
|
export declare const NonEmptyArray: NonEmptyArrayLambda;
|
|
2796
2897
|
/**
|
|
@@ -2802,7 +2903,7 @@ export declare const NonEmptyArray: NonEmptyArrayLambda;
|
|
|
2802
2903
|
* `ReadonlyArray<S["Type"]>`.
|
|
2803
2904
|
*
|
|
2804
2905
|
* @category Arrays
|
|
2805
|
-
* @since
|
|
2906
|
+
* @since 3.10.0
|
|
2806
2907
|
*/
|
|
2807
2908
|
export interface ArrayEnsure<S extends Top> extends decodeTo<$Array<toType<S>>, Union<readonly [S, $Array<S>]>> {
|
|
2808
2909
|
readonly "Rebuild": ArrayEnsure<S>;
|
|
@@ -2820,12 +2921,13 @@ export interface ArrayEnsure<S extends Top> extends decodeTo<$Array<toType<S>>,
|
|
|
2820
2921
|
* arrays and arrays with two or more elements are encoded as arrays.
|
|
2821
2922
|
*
|
|
2822
2923
|
* @category Arrays
|
|
2823
|
-
* @since
|
|
2924
|
+
* @since 3.10.0
|
|
2824
2925
|
*/
|
|
2825
2926
|
export declare function ArrayEnsure<S extends Top>(schema: S): ArrayEnsure<S>;
|
|
2826
2927
|
/**
|
|
2827
2928
|
* Companion type for an array with unique elements. Produced by {@link UniqueArray}.
|
|
2828
2929
|
*
|
|
2930
|
+
* @category models
|
|
2829
2931
|
* @since 4.0.0
|
|
2830
2932
|
*/
|
|
2831
2933
|
export interface UniqueArray<S extends Top> extends $Array<S> {
|
|
@@ -2837,7 +2939,7 @@ export interface UniqueArray<S extends Top> extends $Array<S> {
|
|
|
2837
2939
|
* The equivalence used to determine uniqueness is the one provided by
|
|
2838
2940
|
* `Schema.toEquivalence(item)`.
|
|
2839
2941
|
*
|
|
2840
|
-
* @category
|
|
2942
|
+
* @category constructors
|
|
2841
2943
|
* @since 4.0.0
|
|
2842
2944
|
*/
|
|
2843
2945
|
export declare function UniqueArray<S extends Top>(item: S): UniqueArray<S>;
|
|
@@ -2845,7 +2947,8 @@ export declare function UniqueArray<S extends Top>(item: S): UniqueArray<S>;
|
|
|
2845
2947
|
* Schema type that makes array or tuple elements mutable (removes `readonly`).
|
|
2846
2948
|
* Produced by {@link mutable}.
|
|
2847
2949
|
*
|
|
2848
|
-
* @
|
|
2950
|
+
* @category transforming
|
|
2951
|
+
* @since 3.10.0
|
|
2849
2952
|
*/
|
|
2850
2953
|
export interface mutable<S extends Top & {
|
|
2851
2954
|
readonly "ast": AST.Arrays;
|
|
@@ -2874,13 +2977,15 @@ interface mutableLambda extends Lambda {
|
|
|
2874
2977
|
* type T = typeof schema.Type
|
|
2875
2978
|
* ```
|
|
2876
2979
|
*
|
|
2877
|
-
* @
|
|
2980
|
+
* @category transforming
|
|
2981
|
+
* @since 3.10.0
|
|
2878
2982
|
*/
|
|
2879
2983
|
export declare const mutable: mutableLambda;
|
|
2880
2984
|
/**
|
|
2881
2985
|
* Companion type for a union of multiple schemas. Produced by {@link Union}.
|
|
2882
2986
|
*
|
|
2883
|
-
* @
|
|
2987
|
+
* @category models
|
|
2988
|
+
* @since 3.10.0
|
|
2884
2989
|
*/
|
|
2885
2990
|
export interface Union<Members extends ReadonlyArray<Top>> extends Bottom<{
|
|
2886
2991
|
[K in keyof Members]: Members[K]["Type"];
|
|
@@ -2935,8 +3040,8 @@ export interface Union<Members extends ReadonlyArray<Top>> extends Bottom<{
|
|
|
2935
3040
|
* Schema.decodeUnknownSync(schema)(42) // 42
|
|
2936
3041
|
* ```
|
|
2937
3042
|
*
|
|
2938
|
-
* @category
|
|
2939
|
-
* @since
|
|
3043
|
+
* @category constructors
|
|
3044
|
+
* @since 3.10.0
|
|
2940
3045
|
*/
|
|
2941
3046
|
export declare function Union<const Members extends ReadonlyArray<Top>>(members: Members, options?: {
|
|
2942
3047
|
mode?: "anyOf" | "oneOf";
|
|
@@ -2945,6 +3050,7 @@ export declare function Union<const Members extends ReadonlyArray<Top>>(members:
|
|
|
2945
3050
|
* Represents a union schema of multiple literal values.
|
|
2946
3051
|
*
|
|
2947
3052
|
* @see {@link Literals} for the constructor function.
|
|
3053
|
+
* @category models
|
|
2948
3054
|
* @since 4.0.0
|
|
2949
3055
|
*/
|
|
2950
3056
|
export interface Literals<L extends ReadonlyArray<AST.LiteralValue>> extends Bottom<L[number], L[number], never, never, AST.Union<AST.Literal>, Literals<L>> {
|
|
@@ -2967,6 +3073,7 @@ export interface Literals<L extends ReadonlyArray<AST.LiteralValue>> extends Bot
|
|
|
2967
3073
|
* Creates a union schema from an array of literal values.
|
|
2968
3074
|
*
|
|
2969
3075
|
* **Example** (Status codes)
|
|
3076
|
+
*
|
|
2970
3077
|
* ```ts
|
|
2971
3078
|
* import { Schema } from "effect"
|
|
2972
3079
|
*
|
|
@@ -2975,14 +3082,15 @@ export interface Literals<L extends ReadonlyArray<AST.LiteralValue>> extends Bot
|
|
|
2975
3082
|
* ```
|
|
2976
3083
|
*
|
|
2977
3084
|
* @see {@link Literal} for a schema that represents a single literal.
|
|
2978
|
-
* @category
|
|
3085
|
+
* @category constructors
|
|
2979
3086
|
* @since 4.0.0
|
|
2980
3087
|
*/
|
|
2981
3088
|
export declare function Literals<const L extends ReadonlyArray<AST.LiteralValue>>(literals: L): Literals<L>;
|
|
2982
3089
|
/**
|
|
2983
3090
|
* Companion type for `S | null`. Produced by {@link NullOr}.
|
|
2984
3091
|
*
|
|
2985
|
-
* @
|
|
3092
|
+
* @category models
|
|
3093
|
+
* @since 3.10.0
|
|
2986
3094
|
*/
|
|
2987
3095
|
export interface NullOr<S extends Top> extends Union<readonly [S, Null]> {
|
|
2988
3096
|
readonly "Rebuild": NullOr<S>;
|
|
@@ -2994,14 +3102,15 @@ interface NullOrLambda extends Lambda {
|
|
|
2994
3102
|
/**
|
|
2995
3103
|
* Creates a union schema of `S | null`.
|
|
2996
3104
|
*
|
|
2997
|
-
* @category
|
|
2998
|
-
* @since
|
|
3105
|
+
* @category constructors
|
|
3106
|
+
* @since 3.10.0
|
|
2999
3107
|
*/
|
|
3000
3108
|
export declare const NullOr: NullOrLambda;
|
|
3001
3109
|
/**
|
|
3002
3110
|
* Companion type for `S | undefined`. Produced by {@link UndefinedOr}.
|
|
3003
3111
|
*
|
|
3004
|
-
* @
|
|
3112
|
+
* @category models
|
|
3113
|
+
* @since 3.10.0
|
|
3005
3114
|
*/
|
|
3006
3115
|
export interface UndefinedOr<S extends Top> extends Union<readonly [S, Undefined]> {
|
|
3007
3116
|
readonly "Rebuild": UndefinedOr<S>;
|
|
@@ -3013,13 +3122,14 @@ interface UndefinedOrLambda extends Lambda {
|
|
|
3013
3122
|
/**
|
|
3014
3123
|
* Creates a union schema of `S | undefined`.
|
|
3015
3124
|
*
|
|
3016
|
-
* @category
|
|
3017
|
-
* @since
|
|
3125
|
+
* @category constructors
|
|
3126
|
+
* @since 3.10.0
|
|
3018
3127
|
*/
|
|
3019
3128
|
export declare const UndefinedOr: UndefinedOrLambda;
|
|
3020
3129
|
/**
|
|
3021
3130
|
* Companion type for `S | null | undefined`. Produced by {@link NullishOr}.
|
|
3022
|
-
* @
|
|
3131
|
+
* @category models
|
|
3132
|
+
* @since 3.10.0
|
|
3023
3133
|
*/
|
|
3024
3134
|
export interface NullishOr<S extends Top> extends Union<readonly [S, Null, Undefined]> {
|
|
3025
3135
|
readonly "Rebuild": NullishOr<S>;
|
|
@@ -3030,13 +3140,14 @@ interface NullishOrLambda extends Lambda {
|
|
|
3030
3140
|
}
|
|
3031
3141
|
/**
|
|
3032
3142
|
* Creates a union schema of `S | null | undefined`.
|
|
3033
|
-
* @category
|
|
3034
|
-
* @since
|
|
3143
|
+
* @category constructors
|
|
3144
|
+
* @since 3.10.0
|
|
3035
3145
|
*/
|
|
3036
3146
|
export declare const NullishOr: NullishOrLambda;
|
|
3037
3147
|
/**
|
|
3038
3148
|
* Schema type wrapping a lazily-evaluated schema. Produced by {@link suspend}.
|
|
3039
|
-
* @
|
|
3149
|
+
* @category models
|
|
3150
|
+
* @since 3.10.0
|
|
3040
3151
|
*/
|
|
3041
3152
|
export interface suspend<S extends Top> extends Bottom<S["Type"], S["Encoded"], S["DecodingServices"], S["EncodingServices"], AST.Suspend, suspend<S>, S["~type.make.in"], S["Iso"], S["~type.parameters"], S["~type.make"], S["~type.mutability"], S["~type.optionality"], S["~type.constructor.default"], S["~encoded.mutability"], S["~encoded.optionality"]> {
|
|
3042
3153
|
}
|
|
@@ -3046,6 +3157,7 @@ export interface suspend<S extends Top> extends Bottom<S["Type"], S["Encoded"],
|
|
|
3046
3157
|
* preventing infinite recursion during schema definition.
|
|
3047
3158
|
*
|
|
3048
3159
|
* **Example** (Recursive tree schema)
|
|
3160
|
+
*
|
|
3049
3161
|
* ```ts
|
|
3050
3162
|
* import { Schema } from "effect"
|
|
3051
3163
|
*
|
|
@@ -3060,8 +3172,8 @@ export interface suspend<S extends Top> extends Bottom<S["Type"], S["Encoded"],
|
|
|
3060
3172
|
* })
|
|
3061
3173
|
* ```
|
|
3062
3174
|
*
|
|
3063
|
-
* @category
|
|
3064
|
-
* @since
|
|
3175
|
+
* @category constructors
|
|
3176
|
+
* @since 3.10.0
|
|
3065
3177
|
*/
|
|
3066
3178
|
export declare function suspend<S extends Top>(f: () => S): suspend<S>;
|
|
3067
3179
|
/**
|
|
@@ -3069,6 +3181,7 @@ export declare function suspend<S extends Top>(f: () => S): suspend<S>;
|
|
|
3069
3181
|
* changing the TypeScript type.
|
|
3070
3182
|
*
|
|
3071
3183
|
* **Example** (Adding checks to a schema)
|
|
3184
|
+
*
|
|
3072
3185
|
* ```ts
|
|
3073
3186
|
* import { Schema } from "effect"
|
|
3074
3187
|
*
|
|
@@ -3077,7 +3190,7 @@ export declare function suspend<S extends Top>(f: () => S): suspend<S>;
|
|
|
3077
3190
|
* )
|
|
3078
3191
|
* ```
|
|
3079
3192
|
*
|
|
3080
|
-
* @category
|
|
3193
|
+
* @category filtering
|
|
3081
3194
|
* @since 4.0.0
|
|
3082
3195
|
*/
|
|
3083
3196
|
export declare function check<S extends Top>(...checks: readonly [AST.Check<S["Type"]>, ...Array<AST.Check<S["Type"]>>]): (self: S) => S["Rebuild"];
|
|
@@ -3085,7 +3198,8 @@ export declare function check<S extends Top>(...checks: readonly [AST.Check<S["T
|
|
|
3085
3198
|
* The output type of {@link refine}, narrowing the schema's `Type` to `T` via a
|
|
3086
3199
|
* type guard.
|
|
3087
3200
|
*
|
|
3088
|
-
* @
|
|
3201
|
+
* @category filtering
|
|
3202
|
+
* @since 3.10.0
|
|
3089
3203
|
*/
|
|
3090
3204
|
export interface refine<T extends S["Type"], S extends Top> extends Bottom<T, S["Encoded"], S["DecodingServices"], S["EncodingServices"], S["ast"], refine<T, S>, S["~type.make.in"], T, S["~type.parameters"], T, S["~type.mutability"], S["~type.optionality"], S["~type.constructor.default"], S["~encoded.mutability"], S["~encoded.optionality"]> {
|
|
3091
3205
|
readonly schema: S;
|
|
@@ -3100,8 +3214,8 @@ export interface refine<T extends S["Type"], S extends Top> extends Bottom<T, S[
|
|
|
3100
3214
|
* names type-level failures before the refinement runs; it does not name the
|
|
3101
3215
|
* failed refinement itself.
|
|
3102
3216
|
*
|
|
3103
|
-
* @category
|
|
3104
|
-
* @since
|
|
3217
|
+
* @category filtering
|
|
3218
|
+
* @since 3.10.0
|
|
3105
3219
|
*/
|
|
3106
3220
|
export declare function refine<S extends Top, T extends S["Type"]>(refinement: (value: S["Type"]) => value is T, annotations?: Annotations.Filter): (schema: S) => refine<T, S>;
|
|
3107
3221
|
type DistributeBrands<B> = UnionToIntersection<B extends infer U extends string ? Brand.Brand<U> : never>;
|
|
@@ -3109,7 +3223,8 @@ type DistributeBrands<B> = UnionToIntersection<B extends infer U extends string
|
|
|
3109
3223
|
* The output type of {@link brand}, intersecting the schema's `Type` with one or
|
|
3110
3224
|
* more {@link Brand.Brand} tags.
|
|
3111
3225
|
*
|
|
3112
|
-
* @
|
|
3226
|
+
* @category branding
|
|
3227
|
+
* @since 3.10.0
|
|
3113
3228
|
*/
|
|
3114
3229
|
export interface brand<S extends Top, B> extends Bottom<S["Type"] & DistributeBrands<B>, S["Encoded"], S["DecodingServices"], S["EncodingServices"], S["ast"], brand<S, B>, S["~type.make.in"], S["Type"] & DistributeBrands<B>, S["~type.parameters"], S["Type"] & DistributeBrands<B>, S["~type.mutability"], S["~type.optionality"], S["~type.constructor.default"], S["~encoded.mutability"], S["~encoded.optionality"]> {
|
|
3115
3230
|
readonly schema: S;
|
|
@@ -3119,16 +3234,16 @@ export interface brand<S extends Top, B> extends Bottom<S["Type"] & DistributeBr
|
|
|
3119
3234
|
* Adds a nominal brand to a schema, intersecting the output type with
|
|
3120
3235
|
* `Brand.Brand<B>` to prevent accidental mixing of structurally identical types.
|
|
3121
3236
|
*
|
|
3122
|
-
* @category
|
|
3123
|
-
* @since
|
|
3237
|
+
* @category branding
|
|
3238
|
+
* @since 3.10.0
|
|
3124
3239
|
*/
|
|
3125
3240
|
export declare function brand<B extends string>(identifier: B): <S extends Top>(schema: S) => brand<S["Rebuild"], B>;
|
|
3126
3241
|
/**
|
|
3127
3242
|
* Creates a branded schema from a {@link Brand.Constructor}, applying the
|
|
3128
3243
|
* constructor's checks and brand tag to the underlying schema.
|
|
3129
3244
|
*
|
|
3130
|
-
* @category
|
|
3131
|
-
* @since
|
|
3245
|
+
* @category branding
|
|
3246
|
+
* @since 3.10.0
|
|
3132
3247
|
*/
|
|
3133
3248
|
export declare function fromBrand<A extends Brand.Brand<any>>(identifier: string, ctor: Brand.Constructor<A>): <S extends Top & {
|
|
3134
3249
|
readonly "Type": Brand.Brand.Unbranded<A>;
|
|
@@ -3140,6 +3255,7 @@ export declare function fromBrand<A extends Brand.Brand<any>>(identifier: string
|
|
|
3140
3255
|
* or augment it — including adding service requirements via `RD`.
|
|
3141
3256
|
*
|
|
3142
3257
|
* @see {@link middlewareDecoding} for the constructor
|
|
3258
|
+
* @category decoding
|
|
3143
3259
|
* @since 4.0.0
|
|
3144
3260
|
*/
|
|
3145
3261
|
export interface middlewareDecoding<S extends Top, RD> extends Bottom<S["Type"], S["Encoded"], RD, S["EncodingServices"], S["ast"], middlewareDecoding<S, RD>, S["~type.make.in"], S["Iso"], S["~type.parameters"], S["~type.make"], S["~type.mutability"], S["~type.optionality"], S["~type.constructor.default"], S["~encoded.mutability"], S["~encoded.optionality"]> {
|
|
@@ -3165,6 +3281,7 @@ export interface middlewareDecoding<S extends Top, RD> extends Bottom<S["Type"],
|
|
|
3165
3281
|
* ```
|
|
3166
3282
|
*
|
|
3167
3283
|
* @see {@link catchDecoding} for a simpler error-recovery variant
|
|
3284
|
+
* @category decoding
|
|
3168
3285
|
* @since 4.0.0
|
|
3169
3286
|
*/
|
|
3170
3287
|
export declare function middlewareDecoding<S extends Top, RD>(decode: (effect: Effect.Effect<Option_.Option<S["Type"]>, Issue.Issue, S["DecodingServices"]>, options: AST.ParseOptions) => Effect.Effect<Option_.Option<S["Type"]>, Issue.Issue, RD>): (schema: S) => middlewareDecoding<S, RD>;
|
|
@@ -3175,6 +3292,7 @@ export declare function middlewareDecoding<S extends Top, RD>(decode: (effect: E
|
|
|
3175
3292
|
* or augment it — including adding service requirements via `RE`.
|
|
3176
3293
|
*
|
|
3177
3294
|
* @see {@link middlewareEncoding} for the constructor
|
|
3295
|
+
* @category encoding
|
|
3178
3296
|
* @since 4.0.0
|
|
3179
3297
|
*/
|
|
3180
3298
|
export interface middlewareEncoding<S extends Top, RE> extends Bottom<S["Type"], S["Encoded"], S["DecodingServices"], RE, S["ast"], middlewareEncoding<S, RE>, S["~type.make.in"], S["Iso"], S["~type.parameters"], S["~type.make"], S["~type.mutability"], S["~type.optionality"], S["~type.constructor.default"], S["~encoded.mutability"], S["~encoded.optionality"]> {
|
|
@@ -3200,6 +3318,7 @@ export interface middlewareEncoding<S extends Top, RE> extends Bottom<S["Type"],
|
|
|
3200
3318
|
* ```
|
|
3201
3319
|
*
|
|
3202
3320
|
* @see {@link catchEncoding} for a simpler error-recovery variant
|
|
3321
|
+
* @category encoding
|
|
3203
3322
|
* @since 4.0.0
|
|
3204
3323
|
*/
|
|
3205
3324
|
export declare function middlewareEncoding<S extends Top, RE>(encode: (effect: Effect.Effect<Option_.Option<S["Encoded"]>, Issue.Issue, S["EncodingServices"]>, options: AST.ParseOptions) => Effect.Effect<Option_.Option<S["Encoded"]>, Issue.Issue, RE>): (schema: S) => middlewareEncoding<S, RE>;
|
|
@@ -3220,12 +3339,14 @@ export declare function middlewareEncoding<S extends Top, RE>(encode: (effect: E
|
|
|
3220
3339
|
* ```
|
|
3221
3340
|
*
|
|
3222
3341
|
* @see {@link catchDecodingWithContext} to add service requirements to the handler
|
|
3342
|
+
* @category error handling
|
|
3223
3343
|
* @since 4.0.0
|
|
3224
3344
|
*/
|
|
3225
3345
|
export declare function catchDecoding<S extends Top>(f: (issue: Issue.Issue) => Effect.Effect<Option_.Option<S["Type"]>, Issue.Issue>): (self: S) => S["Rebuild"];
|
|
3226
3346
|
/**
|
|
3227
3347
|
* Like {@link catchDecoding}, but the handler may require Effect services (`R`).
|
|
3228
3348
|
*
|
|
3349
|
+
* @category error handling
|
|
3229
3350
|
* @since 4.0.0
|
|
3230
3351
|
*/
|
|
3231
3352
|
export declare function catchDecodingWithContext<S extends Top, R = never>(f: (issue: Issue.Issue) => Effect.Effect<Option_.Option<S["Type"]>, Issue.Issue, R>): (self: S) => middlewareDecoding<S, S["DecodingServices"] | R>;
|
|
@@ -3236,12 +3357,14 @@ export declare function catchDecodingWithContext<S extends Top, R = never>(f: (i
|
|
|
3236
3357
|
* succeeds with a fallback value or re-fails with a (possibly different) issue.
|
|
3237
3358
|
*
|
|
3238
3359
|
* @see {@link catchEncodingWithContext} to add service requirements to the handler
|
|
3360
|
+
* @category error handling
|
|
3239
3361
|
* @since 4.0.0
|
|
3240
3362
|
*/
|
|
3241
3363
|
export declare function catchEncoding<S extends Top>(f: (issue: Issue.Issue) => Effect.Effect<Option_.Option<S["Encoded"]>, Issue.Issue>): (self: S) => S["Rebuild"];
|
|
3242
3364
|
/**
|
|
3243
3365
|
* Like {@link catchEncoding}, but the handler may require Effect services (`R`).
|
|
3244
3366
|
*
|
|
3367
|
+
* @category error handling
|
|
3245
3368
|
* @since 4.0.0
|
|
3246
3369
|
*/
|
|
3247
3370
|
export declare function catchEncodingWithContext<S extends Top, R = never>(f: (issue: Issue.Issue) => Effect.Effect<Option_.Option<S["Encoded"]>, Issue.Issue, R>): (self: S) => middlewareEncoding<S, S["EncodingServices"] | R>;
|
|
@@ -3255,6 +3378,7 @@ export declare function catchEncodingWithContext<S extends Top, R = never>(f: (i
|
|
|
3255
3378
|
* services are `To["EncodingServices"] | From["EncodingServices"] | RE`.
|
|
3256
3379
|
*
|
|
3257
3380
|
* @see {@link compose} for the passthrough (no transformation) variant
|
|
3381
|
+
* @category transforming
|
|
3258
3382
|
* @since 4.0.0
|
|
3259
3383
|
*/
|
|
3260
3384
|
export interface decodeTo<To extends Top, From extends Top, RD = never, RE = never> extends Bottom<To["Type"], From["Encoded"], To["DecodingServices"] | From["DecodingServices"] | RD, To["EncodingServices"] | From["EncodingServices"] | RE, To["ast"], decodeTo<To, From, RD, RE>, To["~type.make.in"], To["Iso"], To["~type.parameters"], To["~type.make"], To["~type.mutability"], To["~type.optionality"], To["~type.constructor.default"], From["~encoded.mutability"], From["~encoded.optionality"]> {
|
|
@@ -3268,7 +3392,8 @@ export interface decodeTo<To extends Top, From extends Top, RD = never, RE = nev
|
|
|
3268
3392
|
* are composed using their natural encoding/decoding chain.
|
|
3269
3393
|
*
|
|
3270
3394
|
* @see {@link decodeTo} for the transformation variant
|
|
3271
|
-
* @
|
|
3395
|
+
* @category transforming
|
|
3396
|
+
* @since 3.10.0
|
|
3272
3397
|
*/
|
|
3273
3398
|
export interface compose<To extends Top, From extends Top> extends decodeTo<To, From> {
|
|
3274
3399
|
}
|
|
@@ -3312,6 +3437,7 @@ export interface compose<To extends Top, From extends Top> extends decodeTo<To,
|
|
|
3312
3437
|
* // result: 123
|
|
3313
3438
|
* ```
|
|
3314
3439
|
*
|
|
3440
|
+
* @category transforming
|
|
3315
3441
|
* @since 4.0.0
|
|
3316
3442
|
*/
|
|
3317
3443
|
export declare function decodeTo<To extends Top>(to: To): <From extends Top>(from: From) => compose<To, From>;
|
|
@@ -3354,7 +3480,8 @@ export declare function decodeTo<To extends Top, From extends Top, RD = never, R
|
|
|
3354
3480
|
* // result: "hello"
|
|
3355
3481
|
* ```
|
|
3356
3482
|
*
|
|
3357
|
-
* @
|
|
3483
|
+
* @category transforming
|
|
3484
|
+
* @since 3.10.0
|
|
3358
3485
|
*/
|
|
3359
3486
|
export declare function decode<S extends Top, RD = never, RE = never>(transformation: {
|
|
3360
3487
|
readonly decode: Getter.Getter<S["Type"], S["Type"], RD>;
|
|
@@ -3380,6 +3507,7 @@ export declare function decode<S extends Top, RD = never, RE = never>(transforma
|
|
|
3380
3507
|
* )
|
|
3381
3508
|
* ```
|
|
3382
3509
|
*
|
|
3510
|
+
* @category transforming
|
|
3383
3511
|
* @since 4.0.0
|
|
3384
3512
|
*/
|
|
3385
3513
|
export declare function encodeTo<To extends Top>(to: To): <From extends Top>(from: From) => decodeTo<From, To>;
|
|
@@ -3407,7 +3535,8 @@ export declare function encodeTo<To extends Top, From extends Top, RD = never, R
|
|
|
3407
3535
|
* )
|
|
3408
3536
|
* ```
|
|
3409
3537
|
*
|
|
3410
|
-
* @
|
|
3538
|
+
* @category transforming
|
|
3539
|
+
* @since 3.10.0
|
|
3411
3540
|
*/
|
|
3412
3541
|
export declare function encode<S extends Top, RD = never, RE = never>(transformation: {
|
|
3413
3542
|
readonly decode: Getter.Getter<S["Encoded"], S["Encoded"], RD>;
|
|
@@ -3418,6 +3547,7 @@ export declare function encode<S extends Top, RD = never, RE = never>(transforma
|
|
|
3418
3547
|
*
|
|
3419
3548
|
* Only schemas that satisfy this constraint can be passed to {@link withConstructorDefault}.
|
|
3420
3549
|
*
|
|
3550
|
+
* @category models
|
|
3421
3551
|
* @since 4.0.0
|
|
3422
3552
|
*/
|
|
3423
3553
|
export interface WithoutConstructorDefault {
|
|
@@ -3434,7 +3564,8 @@ export interface WithoutConstructorDefault {
|
|
|
3434
3564
|
* added.
|
|
3435
3565
|
*
|
|
3436
3566
|
* @see {@link withConstructorDefault} for the constructor
|
|
3437
|
-
* @
|
|
3567
|
+
* @category constructors
|
|
3568
|
+
* @since 3.10.0
|
|
3438
3569
|
*/
|
|
3439
3570
|
export interface withConstructorDefault<S extends Top & WithoutConstructorDefault> extends Bottom<S["Type"], S["Encoded"], S["DecodingServices"], S["EncodingServices"], S["ast"], withConstructorDefault<S>, S["~type.make.in"], S["Iso"], S["~type.parameters"], S["~type.make"], S["~type.mutability"], S["~type.optionality"], "with-default", S["~encoded.mutability"], S["~encoded.optionality"]> {
|
|
3440
3571
|
readonly schema: S;
|
|
@@ -3461,7 +3592,8 @@ export interface withConstructorDefault<S extends Top & WithoutConstructorDefaul
|
|
|
3461
3592
|
* // value: { name: "anonymous" }
|
|
3462
3593
|
* ```
|
|
3463
3594
|
*
|
|
3464
|
-
* @
|
|
3595
|
+
* @category constructors
|
|
3596
|
+
* @since 3.10.0
|
|
3465
3597
|
*/
|
|
3466
3598
|
export declare function withConstructorDefault<S extends Top & WithoutConstructorDefault>(defaultValue: Effect.Effect<S["~type.make.in"], SchemaError>): (schema: S) => withConstructorDefault<S>;
|
|
3467
3599
|
/**
|
|
@@ -3469,6 +3601,7 @@ export declare function withConstructorDefault<S extends Top & WithoutConstructo
|
|
|
3469
3601
|
* side is `optionalKey` and that fills in a default `Encoded` value during decoding.
|
|
3470
3602
|
*
|
|
3471
3603
|
* @see {@link withDecodingDefaultKey} for the constructor
|
|
3604
|
+
* @category decoding
|
|
3472
3605
|
* @since 4.0.0
|
|
3473
3606
|
*/
|
|
3474
3607
|
export interface withDecodingDefaultKey<S extends Top, R = never> extends decodeTo<S, optionalKey<toEncoded<S>>, R> {
|
|
@@ -3481,6 +3614,7 @@ export interface withDecodingDefaultKey<S extends Top, R = never> extends decode
|
|
|
3481
3614
|
* - `"passthrough"` (default): pass the value through during encoding
|
|
3482
3615
|
* - `"omit"`: omit the key from the encoded output
|
|
3483
3616
|
*
|
|
3617
|
+
* @category models
|
|
3484
3618
|
* @since 4.0.0
|
|
3485
3619
|
*/
|
|
3486
3620
|
export type DecodingDefaultOptions = {
|
|
@@ -3515,6 +3649,7 @@ export type DecodingDefaultOptions = {
|
|
|
3515
3649
|
*
|
|
3516
3650
|
* @see {@link withDecodingDefault} for the value-level variant (key absent **or** `undefined`)
|
|
3517
3651
|
* @see {@link withDecodingDefaultTypeKey} for the variant where the default is a `Type` value
|
|
3652
|
+
* @category decoding
|
|
3518
3653
|
* @since 4.0.0
|
|
3519
3654
|
*/
|
|
3520
3655
|
export declare function withDecodingDefaultKey<S extends Top, R = never>(defaultValue: Effect.Effect<S["Encoded"], SchemaError, R>, options?: DecodingDefaultOptions): (self: S) => withDecodingDefaultKey<S, R>;
|
|
@@ -3524,6 +3659,7 @@ export declare function withDecodingDefaultKey<S extends Top, R = never>(default
|
|
|
3524
3659
|
* during decoding.
|
|
3525
3660
|
*
|
|
3526
3661
|
* @see {@link withDecodingDefaultTypeKey} for the constructor
|
|
3662
|
+
* @category decoding
|
|
3527
3663
|
* @since 4.0.0
|
|
3528
3664
|
*/
|
|
3529
3665
|
export interface withDecodingDefaultTypeKey<S extends Top, R = never> extends decodeTo<withDecodingDefaultKey<toType<S>, R>, optionalKey<S>> {
|
|
@@ -3546,6 +3682,7 @@ export interface withDecodingDefaultTypeKey<S extends Top, R = never> extends de
|
|
|
3546
3682
|
*
|
|
3547
3683
|
* @see {@link withDecodingDefaultKey} for the variant where the default is an `Encoded` value
|
|
3548
3684
|
* @see {@link withDecodingDefaultType} for the value-level variant
|
|
3685
|
+
* @category decoding
|
|
3549
3686
|
* @since 4.0.0
|
|
3550
3687
|
*/
|
|
3551
3688
|
export declare function withDecodingDefaultTypeKey<S extends Top, R = never>(defaultValue: Effect.Effect<S["Type"], SchemaError, R>, options?: DecodingDefaultOptions): (self: S) => withDecodingDefaultTypeKey<S, R>;
|
|
@@ -3554,7 +3691,8 @@ export declare function withDecodingDefaultTypeKey<S extends Top, R = never>(def
|
|
|
3554
3691
|
* side is `optional` and that fills in a default `Encoded` value during decoding.
|
|
3555
3692
|
*
|
|
3556
3693
|
* @see {@link withDecodingDefault} for the constructor
|
|
3557
|
-
* @
|
|
3694
|
+
* @category decoding
|
|
3695
|
+
* @since 3.10.0
|
|
3558
3696
|
*/
|
|
3559
3697
|
export interface withDecodingDefault<S extends Top, R = never> extends decodeTo<S, optional<toEncoded<S>>, R> {
|
|
3560
3698
|
readonly "Rebuild": withDecodingDefault<S, R>;
|
|
@@ -3588,7 +3726,8 @@ export interface withDecodingDefault<S extends Top, R = never> extends decodeTo<
|
|
|
3588
3726
|
*
|
|
3589
3727
|
* @see {@link withDecodingDefaultKey} for the key-level variant (key absent only, not `undefined`)
|
|
3590
3728
|
* @see {@link withDecodingDefaultType} for the variant where the default is a `Type` value
|
|
3591
|
-
* @
|
|
3729
|
+
* @category decoding
|
|
3730
|
+
* @since 3.10.0
|
|
3592
3731
|
*/
|
|
3593
3732
|
export declare function withDecodingDefault<S extends Top, R = never>(defaultValue: Effect.Effect<S["Encoded"], SchemaError, R>, options?: DecodingDefaultOptions): (self: S) => withDecodingDefault<S, R>;
|
|
3594
3733
|
/**
|
|
@@ -3597,6 +3736,7 @@ export declare function withDecodingDefault<S extends Top, R = never>(defaultVal
|
|
|
3597
3736
|
* decoding.
|
|
3598
3737
|
*
|
|
3599
3738
|
* @see {@link withDecodingDefaultType} for the constructor
|
|
3739
|
+
* @category decoding
|
|
3600
3740
|
* @since 4.0.0
|
|
3601
3741
|
*/
|
|
3602
3742
|
export interface withDecodingDefaultType<S extends Top, R = never> extends decodeTo<withDecodingDefault<toType<S>, R>, optional<S>> {
|
|
@@ -3619,6 +3759,7 @@ export interface withDecodingDefaultType<S extends Top, R = never> extends decod
|
|
|
3619
3759
|
*
|
|
3620
3760
|
* @see {@link withDecodingDefault} for the variant where the default is an `Encoded` value
|
|
3621
3761
|
* @see {@link withDecodingDefaultTypeKey} for the key-level variant
|
|
3762
|
+
* @category decoding
|
|
3622
3763
|
* @since 4.0.0
|
|
3623
3764
|
*/
|
|
3624
3765
|
export declare function withDecodingDefaultType<S extends Top, R = never>(defaultValue: Effect.Effect<S["Type"], SchemaError, R>, options?: DecodingDefaultOptions): (self: S) => withDecodingDefaultType<S, R>;
|
|
@@ -3628,7 +3769,8 @@ export declare function withDecodingDefaultType<S extends Top, R = never>(defaul
|
|
|
3628
3769
|
* Used as the type of the `_tag` field in {@link TaggedStruct} and related helpers.
|
|
3629
3770
|
*
|
|
3630
3771
|
* @see {@link tag} for the constructor
|
|
3631
|
-
* @
|
|
3772
|
+
* @category constructors
|
|
3773
|
+
* @since 3.10.0
|
|
3632
3774
|
*/
|
|
3633
3775
|
export interface tag<Tag extends AST.LiteralValue> extends withConstructorDefault<Literal<Tag>> {
|
|
3634
3776
|
}
|
|
@@ -3651,7 +3793,8 @@ export interface tag<Tag extends AST.LiteralValue> extends withConstructorDefaul
|
|
|
3651
3793
|
*
|
|
3652
3794
|
* @see {@link tagDefaultOmit} to also omit the tag during encoding
|
|
3653
3795
|
* @see {@link TaggedStruct} for a shorthand that adds `_tag` automatically
|
|
3654
|
-
* @
|
|
3796
|
+
* @category constructors
|
|
3797
|
+
* @since 3.10.0
|
|
3655
3798
|
*/
|
|
3656
3799
|
export declare function tag<Tag extends AST.LiteralValue>(literal: Tag): tag<Tag>;
|
|
3657
3800
|
/**
|
|
@@ -3675,6 +3818,7 @@ export declare function tag<Tag extends AST.LiteralValue>(literal: Tag): tag<Tag
|
|
|
3675
3818
|
* ```
|
|
3676
3819
|
*
|
|
3677
3820
|
* @see {@link tag} for the variant that keeps the tag during encoding
|
|
3821
|
+
* @category constructors
|
|
3678
3822
|
* @since 4.0.0
|
|
3679
3823
|
*/
|
|
3680
3824
|
export declare function tagDefaultOmit<Tag extends AST.LiteralValue>(literal: Tag): withDecodingDefaultKey<tag<Tag>, never>;
|
|
@@ -3682,7 +3826,8 @@ export declare function tagDefaultOmit<Tag extends AST.LiteralValue>(literal: Ta
|
|
|
3682
3826
|
* The type produced by {@link TaggedStruct} — a {@link Struct} with an extra `_tag` field of type {@link tag}.
|
|
3683
3827
|
*
|
|
3684
3828
|
* @see {@link TaggedStruct} for the constructor
|
|
3685
|
-
* @
|
|
3829
|
+
* @category models
|
|
3830
|
+
* @since 3.10.0
|
|
3686
3831
|
*/
|
|
3687
3832
|
export type TaggedStruct<Tag extends AST.LiteralValue, Fields extends Struct.Fields> = Struct<Simplify<{
|
|
3688
3833
|
readonly _tag: tag<Tag>;
|
|
@@ -3726,8 +3871,8 @@ export type TaggedStruct<Tag extends AST.LiteralValue, Fields extends Struct.Fie
|
|
|
3726
3871
|
* const literal = tagged.fields._tag.schema.literal
|
|
3727
3872
|
* ```
|
|
3728
3873
|
*
|
|
3729
|
-
* @category
|
|
3730
|
-
* @since
|
|
3874
|
+
* @category constructors
|
|
3875
|
+
* @since 3.10.0
|
|
3731
3876
|
*/
|
|
3732
3877
|
export declare function TaggedStruct<const Tag extends AST.LiteralValue, const Fields extends Struct.Fields>(value: Tag, fields: Fields): TaggedStruct<Tag, Fields>;
|
|
3733
3878
|
/**
|
|
@@ -3765,8 +3910,8 @@ type TaggedUnionUtils<Tag extends PropertyKey, Members extends ReadonlyArray<Top
|
|
|
3765
3910
|
* The type produced by {@link toTaggedUnion} — a {@link Union} augmented with `cases`, `guards`, `isAnyOf`, and `match` utilities.
|
|
3766
3911
|
*
|
|
3767
3912
|
* @see {@link toTaggedUnion} for the constructor
|
|
3913
|
+
* @category combinators
|
|
3768
3914
|
* @since 4.0.0
|
|
3769
|
-
* @experimental
|
|
3770
3915
|
*/
|
|
3771
3916
|
export type toTaggedUnion<Tag extends PropertyKey, Members extends ReadonlyArray<Top & {
|
|
3772
3917
|
readonly Type: {
|
|
@@ -3794,8 +3939,8 @@ export type toTaggedUnion<Tag extends PropertyKey, Members extends ReadonlyArray
|
|
|
3794
3939
|
* ```
|
|
3795
3940
|
*
|
|
3796
3941
|
* @see {@link TaggedUnion} for a shorthand that builds the union from scratch
|
|
3942
|
+
* @category combinators
|
|
3797
3943
|
* @since 4.0.0
|
|
3798
|
-
* @experimental
|
|
3799
3944
|
*/
|
|
3800
3945
|
export declare function toTaggedUnion<const Tag extends PropertyKey>(tag: Tag): <const Members extends ReadonlyArray<Top & {
|
|
3801
3946
|
readonly Type: { readonly [K in Tag]: PropertyKey; };
|
|
@@ -3805,8 +3950,8 @@ export declare function toTaggedUnion<const Tag extends PropertyKey>(tag: Tag):
|
|
|
3805
3950
|
* Produced by {@link TaggedUnion}.
|
|
3806
3951
|
*
|
|
3807
3952
|
* @see {@link TaggedUnion} for the constructor
|
|
3953
|
+
* @category models
|
|
3808
3954
|
* @since 4.0.0
|
|
3809
|
-
* @experimental
|
|
3810
3955
|
*/
|
|
3811
3956
|
export interface TaggedUnion<Cases extends Record<string, Top>> extends Bottom<{
|
|
3812
3957
|
[K in keyof Cases]: Cases[K]["Type"];
|
|
@@ -3858,7 +4003,7 @@ export interface TaggedUnion<Cases extends Record<string, Top>> extends Bottom<{
|
|
|
3858
4003
|
* ```
|
|
3859
4004
|
*
|
|
3860
4005
|
* @see {@link toTaggedUnion} to augment an existing union instead
|
|
3861
|
-
* @category
|
|
4006
|
+
* @category constructors
|
|
3862
4007
|
* @since 4.0.0
|
|
3863
4008
|
*/
|
|
3864
4009
|
export declare function TaggedUnion<const CasesByTag extends Record<string, Struct.Fields>>(casesByTag: CasesByTag): TaggedUnion<{
|
|
@@ -3870,6 +4015,7 @@ export declare function TaggedUnion<const CasesByTag extends Record<string, Stru
|
|
|
3870
4015
|
* making the decoded value nominally distinct.
|
|
3871
4016
|
*
|
|
3872
4017
|
* @see {@link Opaque} for the constructor
|
|
4018
|
+
* @category models
|
|
3873
4019
|
* @since 4.0.0
|
|
3874
4020
|
*/
|
|
3875
4021
|
export interface Opaque<Self, S extends Top, Brand> extends Bottom<Self, S["Encoded"], S["DecodingServices"], S["EncodingServices"], S["ast"], S["Rebuild"], S["~type.make.in"], S["Iso"], S["~type.parameters"], S["~type.make"], S["~type.mutability"], S["~type.optionality"], S["~type.constructor.default"], S["~encoded.mutability"], S["~encoded.optionality"]> {
|
|
@@ -3896,6 +4042,7 @@ export interface Opaque<Self, S extends Top, Brand> extends Bottom<Self, S["Enco
|
|
|
3896
4042
|
* // person: Person
|
|
3897
4043
|
* ```
|
|
3898
4044
|
*
|
|
4045
|
+
* @category constructors
|
|
3899
4046
|
* @since 4.0.0
|
|
3900
4047
|
*/
|
|
3901
4048
|
export declare function Opaque<Self, Brand = {}>(): <S extends Top>(schema: S) => Opaque<Self, S, Brand> & Omit<S, keyof Top>;
|
|
@@ -3903,7 +4050,8 @@ export declare function Opaque<Self, Brand = {}>(): <S extends Top>(schema: S) =
|
|
|
3903
4050
|
* The type produced by {@link instanceOf} — a declaration schema that validates class instances.
|
|
3904
4051
|
*
|
|
3905
4052
|
* @see {@link instanceOf} for the constructor
|
|
3906
|
-
* @
|
|
4053
|
+
* @category models
|
|
4054
|
+
* @since 3.10.0
|
|
3907
4055
|
*/
|
|
3908
4056
|
export interface instanceOf<T, Iso = T> extends declare<T, Iso> {
|
|
3909
4057
|
readonly "Rebuild": instanceOf<T, Iso>;
|
|
@@ -3923,14 +4071,15 @@ export interface instanceOf<T, Iso = T> extends declare<T, Iso> {
|
|
|
3923
4071
|
* // decoded: Date
|
|
3924
4072
|
* ```
|
|
3925
4073
|
*
|
|
3926
|
-
* @category
|
|
3927
|
-
* @since
|
|
4074
|
+
* @category constructors
|
|
4075
|
+
* @since 3.10.0
|
|
3928
4076
|
*/
|
|
3929
4077
|
export declare function instanceOf<C extends abstract new (...args: any) => any, Iso = InstanceType<C>>(constructor: C, annotations?: Annotations.Declaration<InstanceType<C>> | undefined): instanceOf<InstanceType<C>, Iso>;
|
|
3930
4078
|
/**
|
|
3931
4079
|
* Constructs an `AST.Link` that describes how a value of type `T` encodes to and decodes from a `To` schema.
|
|
3932
4080
|
* Used when building low-level AST transformations that bridge two schema types.
|
|
3933
4081
|
*
|
|
4082
|
+
* @category transforming
|
|
3934
4083
|
* @since 4.0.0
|
|
3935
4084
|
*/
|
|
3936
4085
|
export declare function link<T>(): <To extends Top>(encodeTo: To, transformation: {
|
|
@@ -4008,8 +4157,8 @@ export declare const makeFilter: <T>(filter: (input: T, ast: AST.AST, options: A
|
|
|
4008
4157
|
* {@link Issue.Issue}; the result is wrapped in an {@link Issue.Pointer}
|
|
4009
4158
|
* at the given `path`.
|
|
4010
4159
|
*
|
|
4011
|
-
* @category
|
|
4012
|
-
* @since
|
|
4160
|
+
* @category models
|
|
4161
|
+
* @since 3.10.0
|
|
4013
4162
|
*/
|
|
4014
4163
|
export type FilterIssue = string | Issue.Issue | {
|
|
4015
4164
|
readonly path: ReadonlyArray<PropertyKey>;
|
|
@@ -4033,8 +4182,8 @@ export type FilterIssue = string | Issue.Issue | {
|
|
|
4033
4182
|
* to returning that element directly; otherwise the entries are grouped
|
|
4034
4183
|
* into an {@link Issue.Composite}.
|
|
4035
4184
|
*
|
|
4036
|
-
* @category
|
|
4037
|
-
* @since
|
|
4185
|
+
* @category models
|
|
4186
|
+
* @since 3.10.0
|
|
4038
4187
|
*/
|
|
4039
4188
|
export type FilterOutput = undefined | boolean | FilterIssue | ReadonlyArray<FilterIssue>;
|
|
4040
4189
|
/**
|
|
@@ -4781,6 +4930,7 @@ export declare const isBetweenBigDecimal: (options: {
|
|
|
4781
4930
|
* length.
|
|
4782
4931
|
*
|
|
4783
4932
|
* **Example** (Minimum length check)
|
|
4933
|
+
*
|
|
4784
4934
|
* ```ts
|
|
4785
4935
|
* import { Schema } from "effect"
|
|
4786
4936
|
*
|
|
@@ -5012,7 +5162,7 @@ export declare function isUnique<T>(annotations?: Annotations.Filter): AST.Filte
|
|
|
5012
5162
|
* strings with a length of at least one.
|
|
5013
5163
|
*
|
|
5014
5164
|
* @category String
|
|
5015
|
-
* @since
|
|
5165
|
+
* @since 3.10.0
|
|
5016
5166
|
*/
|
|
5017
5167
|
export interface NonEmptyString extends String {
|
|
5018
5168
|
readonly "Rebuild": NonEmptyString;
|
|
@@ -5022,7 +5172,7 @@ export interface NonEmptyString extends String {
|
|
|
5022
5172
|
* character.
|
|
5023
5173
|
*
|
|
5024
5174
|
* @category String
|
|
5025
|
-
* @since
|
|
5175
|
+
* @since 3.10.0
|
|
5026
5176
|
*/
|
|
5027
5177
|
export declare const NonEmptyString: NonEmptyString;
|
|
5028
5178
|
/**
|
|
@@ -5030,7 +5180,7 @@ export declare const NonEmptyString: NonEmptyString;
|
|
|
5030
5180
|
* length is exactly one.
|
|
5031
5181
|
*
|
|
5032
5182
|
* @category String
|
|
5033
|
-
* @since
|
|
5183
|
+
* @since 3.10.0
|
|
5034
5184
|
*/
|
|
5035
5185
|
export interface Char extends String {
|
|
5036
5186
|
readonly "Rebuild": Char;
|
|
@@ -5039,7 +5189,7 @@ export interface Char extends String {
|
|
|
5039
5189
|
* A schema representing a single character.
|
|
5040
5190
|
*
|
|
5041
5191
|
* @category String
|
|
5042
|
-
* @since
|
|
5192
|
+
* @since 3.10.0
|
|
5043
5193
|
*/
|
|
5044
5194
|
export declare const Char: Char;
|
|
5045
5195
|
/**
|
|
@@ -5049,8 +5199,7 @@ export declare const Char: Char;
|
|
|
5049
5199
|
* **Example** (Option schema)
|
|
5050
5200
|
*
|
|
5051
5201
|
* ```ts
|
|
5052
|
-
* import { Schema } from "effect"
|
|
5053
|
-
* import { Option } from "effect"
|
|
5202
|
+
* import { Option, Schema } from "effect"
|
|
5054
5203
|
*
|
|
5055
5204
|
* const schema = Schema.Option(Schema.Number)
|
|
5056
5205
|
*
|
|
@@ -5061,7 +5210,7 @@ export declare const Char: Char;
|
|
|
5061
5210
|
* ```
|
|
5062
5211
|
*
|
|
5063
5212
|
* @category Option
|
|
5064
|
-
* @since
|
|
5213
|
+
* @since 3.10.0
|
|
5065
5214
|
*/
|
|
5066
5215
|
export interface Option<A extends Top> extends declareConstructor<Option_.Option<A["Type"]>, Option_.Option<A["Encoded"]>, readonly [A], OptionIso<A>> {
|
|
5067
5216
|
readonly "Rebuild": Option<A>;
|
|
@@ -5087,7 +5236,7 @@ export type OptionIso<A extends Top> = {
|
|
|
5087
5236
|
* Creates a schema for `Option<A>`. See {@link Option} for details.
|
|
5088
5237
|
*
|
|
5089
5238
|
* @category Option
|
|
5090
|
-
* @since
|
|
5239
|
+
* @since 3.10.0
|
|
5091
5240
|
*/
|
|
5092
5241
|
export declare function Option<A extends Top>(value: A): Option<A>;
|
|
5093
5242
|
/**
|
|
@@ -5095,7 +5244,7 @@ export declare function Option<A extends Top>(value: A): Option<A>;
|
|
|
5095
5244
|
* other values as `Some`.
|
|
5096
5245
|
*
|
|
5097
5246
|
* @category Option
|
|
5098
|
-
* @since
|
|
5247
|
+
* @since 3.10.0
|
|
5099
5248
|
*/
|
|
5100
5249
|
export interface OptionFromNullOr<S extends Top> extends decodeTo<Option<toType<S>>, NullOr<S>> {
|
|
5101
5250
|
readonly "Rebuild": OptionFromNullOr<S>;
|
|
@@ -5112,7 +5261,7 @@ export interface OptionFromNullOr<S extends Top> extends decodeTo<Option<toType<
|
|
|
5112
5261
|
* - `Some` is encoded as the value
|
|
5113
5262
|
*
|
|
5114
5263
|
* @category Option
|
|
5115
|
-
* @since
|
|
5264
|
+
* @since 3.10.0
|
|
5116
5265
|
*/
|
|
5117
5266
|
export declare function OptionFromNullOr<S extends Top>(schema: S): OptionFromNullOr<S>;
|
|
5118
5267
|
/**
|
|
@@ -5120,7 +5269,7 @@ export declare function OptionFromNullOr<S extends Top>(schema: S): OptionFromNu
|
|
|
5120
5269
|
* all other values as `Some`.
|
|
5121
5270
|
*
|
|
5122
5271
|
* @category Option
|
|
5123
|
-
* @since
|
|
5272
|
+
* @since 3.10.0
|
|
5124
5273
|
*/
|
|
5125
5274
|
export interface OptionFromUndefinedOr<S extends Top> extends decodeTo<Option<toType<S>>, UndefinedOr<S>> {
|
|
5126
5275
|
readonly "Rebuild": OptionFromUndefinedOr<S>;
|
|
@@ -5137,7 +5286,7 @@ export interface OptionFromUndefinedOr<S extends Top> extends decodeTo<Option<to
|
|
|
5137
5286
|
* - `Some` is encoded as the value
|
|
5138
5287
|
*
|
|
5139
5288
|
* @category Option
|
|
5140
|
-
* @since
|
|
5289
|
+
* @since 3.10.0
|
|
5141
5290
|
*/
|
|
5142
5291
|
export declare function OptionFromUndefinedOr<S extends Top>(schema: S): OptionFromUndefinedOr<S>;
|
|
5143
5292
|
/**
|
|
@@ -5145,7 +5294,7 @@ export declare function OptionFromUndefinedOr<S extends Top>(schema: S): OptionF
|
|
|
5145
5294
|
* `None` and all other values as `Some`.
|
|
5146
5295
|
*
|
|
5147
5296
|
* @category Option
|
|
5148
|
-
* @since
|
|
5297
|
+
* @since 3.10.0
|
|
5149
5298
|
*/
|
|
5150
5299
|
export interface OptionFromNullishOr<S extends Top> extends decodeTo<Option<toType<S>>, NullishOr<S>> {
|
|
5151
5300
|
readonly "Rebuild": OptionFromNullishOr<S>;
|
|
@@ -5162,7 +5311,7 @@ export interface OptionFromNullishOr<S extends Top> extends decodeTo<Option<toTy
|
|
|
5162
5311
|
* - `Some` is encoded as the value
|
|
5163
5312
|
*
|
|
5164
5313
|
* @category Option
|
|
5165
|
-
* @since
|
|
5314
|
+
* @since 3.10.0
|
|
5166
5315
|
*/
|
|
5167
5316
|
export declare function OptionFromNullishOr<S extends Top>(schema: S, options?: {
|
|
5168
5317
|
onNoneEncoding: null | undefined;
|
|
@@ -5292,7 +5441,7 @@ export declare function Result<A extends Top, E extends Top>(success: A, failure
|
|
|
5292
5441
|
* values. The inner value is hidden from error messages.
|
|
5293
5442
|
*
|
|
5294
5443
|
* @category Redacted
|
|
5295
|
-
* @since
|
|
5444
|
+
* @since 3.10.0
|
|
5296
5445
|
*/
|
|
5297
5446
|
export interface Redacted<S extends Top> extends declareConstructor<Redacted_.Redacted<S["Type"]>, Redacted_.Redacted<S["Encoded"]>, readonly [S]> {
|
|
5298
5447
|
readonly "Rebuild": Redacted<S>;
|
|
@@ -5319,7 +5468,7 @@ export interface Redacted<S extends Top> extends declareConstructor<Redacted_.Re
|
|
|
5319
5468
|
* but it will deserialize a value into a `Redacted` instance.
|
|
5320
5469
|
*
|
|
5321
5470
|
* @category Redacted
|
|
5322
|
-
* @since
|
|
5471
|
+
* @since 3.10.0
|
|
5323
5472
|
*/
|
|
5324
5473
|
export declare function Redacted<S extends Top>(value: S, options?: {
|
|
5325
5474
|
readonly label?: string | undefined;
|
|
@@ -5407,7 +5556,7 @@ export declare function CauseReason<E extends Top, D extends Top>(error: E, defe
|
|
|
5407
5556
|
* unexpected defects.
|
|
5408
5557
|
*
|
|
5409
5558
|
* @category Cause
|
|
5410
|
-
* @since
|
|
5559
|
+
* @since 3.10.0
|
|
5411
5560
|
*/
|
|
5412
5561
|
export interface Cause<E extends Top, D extends Top> extends declareConstructor<Cause_.Cause<E["Type"]>, Cause_.Cause<E["Encoded"]>, readonly [E, D], CauseIso<E, D>> {
|
|
5413
5562
|
readonly "Rebuild": Cause<E, D>;
|
|
@@ -5427,7 +5576,7 @@ export type CauseIso<E extends Top, D extends Top> = ReadonlyArray<CauseReasonIs
|
|
|
5427
5576
|
* and unexpected defects.
|
|
5428
5577
|
*
|
|
5429
5578
|
* @category Cause
|
|
5430
|
-
* @since
|
|
5579
|
+
* @since 3.10.0
|
|
5431
5580
|
*/
|
|
5432
5581
|
export declare function Cause<E extends Top, D extends Top>(error: E, defect: D): Cause<E, D>;
|
|
5433
5582
|
/**
|
|
@@ -5447,7 +5596,7 @@ export interface Error extends instanceOf<globalThis.Error> {
|
|
|
5447
5596
|
* and decodes that object back into an `Error`. The stack trace is omitted from
|
|
5448
5597
|
* the encoded form for security.
|
|
5449
5598
|
*
|
|
5450
|
-
* @category
|
|
5599
|
+
* @category schemas
|
|
5451
5600
|
* @since 4.0.0
|
|
5452
5601
|
*/
|
|
5453
5602
|
export declare const Error: Error;
|
|
@@ -5459,7 +5608,7 @@ export declare const Error: Error;
|
|
|
5459
5608
|
* Encodes an `Error` as an object with `message`, optional `name`, and optional
|
|
5460
5609
|
* `stack` properties, and decodes that object back into an `Error`.
|
|
5461
5610
|
*
|
|
5462
|
-
* @category
|
|
5611
|
+
* @category schemas
|
|
5463
5612
|
* @since 4.0.0
|
|
5464
5613
|
*/
|
|
5465
5614
|
export declare const ErrorWithStack: Error;
|
|
@@ -5468,7 +5617,7 @@ export declare const ErrorWithStack: Error;
|
|
|
5468
5617
|
* `Error` values and arbitrary unknown defect values.
|
|
5469
5618
|
*
|
|
5470
5619
|
* @category Defect
|
|
5471
|
-
* @since
|
|
5620
|
+
* @since 3.10.0
|
|
5472
5621
|
*/
|
|
5473
5622
|
export interface Defect extends Union<readonly [
|
|
5474
5623
|
decodeTo<Error, Struct<{
|
|
@@ -5488,8 +5637,8 @@ export interface Defect extends Union<readonly [
|
|
|
5488
5637
|
* Unknown defects are serialized with `JSON.stringify` when possible and fall
|
|
5489
5638
|
* back to Effect's formatted representation when JSON serialization fails.
|
|
5490
5639
|
*
|
|
5491
|
-
* @category
|
|
5492
|
-
* @since
|
|
5640
|
+
* @category constructors
|
|
5641
|
+
* @since 3.10.0
|
|
5493
5642
|
*/
|
|
5494
5643
|
export declare const Defect: Defect;
|
|
5495
5644
|
/**
|
|
@@ -5505,7 +5654,7 @@ export declare const DefectWithStack: Defect;
|
|
|
5505
5654
|
* failure with a `Cause` containing typed errors and defects.
|
|
5506
5655
|
*
|
|
5507
5656
|
* @category Exit
|
|
5508
|
-
* @since
|
|
5657
|
+
* @since 3.10.0
|
|
5509
5658
|
*/
|
|
5510
5659
|
export interface Exit<A extends Top, E extends Top, D extends Top> extends declareConstructor<Exit_.Exit<A["Type"], E["Type"]>, Exit_.Exit<A["Encoded"], E["Encoded"]>, readonly [A, E, D], ExitIso<A, E, D>> {
|
|
5511
5660
|
readonly "Rebuild": Exit<A, E, D>;
|
|
@@ -5535,7 +5684,7 @@ export type ExitIso<A extends Top, E extends Top, D extends Top> = {
|
|
|
5535
5684
|
* failure, and unexpected defect channels.
|
|
5536
5685
|
*
|
|
5537
5686
|
* @category Exit
|
|
5538
|
-
* @since
|
|
5687
|
+
* @since 3.10.0
|
|
5539
5688
|
*/
|
|
5540
5689
|
export declare function Exit<A extends Top, E extends Top, D extends Top>(value: A, error: E, defect: D): Exit<A, E, D>;
|
|
5541
5690
|
/**
|
|
@@ -5563,7 +5712,7 @@ export type ReadonlyMapIso<Key extends Top, Value extends Top> = ReadonlyArray<r
|
|
|
5563
5712
|
* conform to the provided schemas.
|
|
5564
5713
|
*
|
|
5565
5714
|
* @category ReadonlyMap
|
|
5566
|
-
* @since
|
|
5715
|
+
* @since 3.10.0
|
|
5567
5716
|
*/
|
|
5568
5717
|
export declare function ReadonlyMap<Key extends Top, Value extends Top>(key: Key, value: Value): $ReadonlyMap<Key, Value>;
|
|
5569
5718
|
/**
|
|
@@ -5571,7 +5720,7 @@ export declare function ReadonlyMap<Key extends Top, Value extends Top>(key: Key
|
|
|
5571
5720
|
* provided schemas.
|
|
5572
5721
|
*
|
|
5573
5722
|
* @category HashMap
|
|
5574
|
-
* @since
|
|
5723
|
+
* @since 3.10.0
|
|
5575
5724
|
*/
|
|
5576
5725
|
export interface HashMap<Key extends Top, Value extends Top> extends declareConstructor<HashMap_.HashMap<Key["Type"], Value["Type"]>, HashMap_.HashMap<Key["Encoded"], Value["Encoded"]>, readonly [Key, Value], HashMapIso<Key, Value>> {
|
|
5577
5726
|
readonly "Rebuild": HashMap<Key, Value>;
|
|
@@ -5591,7 +5740,7 @@ export type HashMapIso<Key extends Top, Value extends Top> = ReadonlyArray<reado
|
|
|
5591
5740
|
* conform to the provided schemas.
|
|
5592
5741
|
*
|
|
5593
5742
|
* @category HashMap
|
|
5594
|
-
* @since
|
|
5743
|
+
* @since 3.10.0
|
|
5595
5744
|
*/
|
|
5596
5745
|
export declare function HashMap<Key extends Top, Value extends Top>(key: Key, value: Value): HashMap<Key, Value>;
|
|
5597
5746
|
/**
|
|
@@ -5618,7 +5767,7 @@ export type ReadonlySetIso<Value extends Top> = ReadonlyArray<Value["Iso"]>;
|
|
|
5618
5767
|
* provided element schema.
|
|
5619
5768
|
*
|
|
5620
5769
|
* @category ReadonlySet
|
|
5621
|
-
* @since
|
|
5770
|
+
* @since 3.10.0
|
|
5622
5771
|
*/
|
|
5623
5772
|
export declare function ReadonlySet<Value extends Top>(value: Value): $ReadonlySet<Value>;
|
|
5624
5773
|
/**
|
|
@@ -5626,7 +5775,7 @@ export declare function ReadonlySet<Value extends Top>(value: Value): $ReadonlyS
|
|
|
5626
5775
|
* schema.
|
|
5627
5776
|
*
|
|
5628
5777
|
* @category HashSet
|
|
5629
|
-
* @since
|
|
5778
|
+
* @since 3.10.0
|
|
5630
5779
|
*/
|
|
5631
5780
|
export interface HashSet<Value extends Top> extends declareConstructor<HashSet_.HashSet<Value["Type"]>, HashSet_.HashSet<Value["Encoded"]>, readonly [Value], HashSetIso<Value>> {
|
|
5632
5781
|
readonly "Rebuild": HashSet<Value>;
|
|
@@ -5645,7 +5794,7 @@ export type HashSetIso<Value extends Top> = ReadonlyArray<Value["Iso"]>;
|
|
|
5645
5794
|
* provided schema.
|
|
5646
5795
|
*
|
|
5647
5796
|
* @category HashSet
|
|
5648
|
-
* @since
|
|
5797
|
+
* @since 3.10.0
|
|
5649
5798
|
*/
|
|
5650
5799
|
export declare function HashSet<Value extends Top>(value: Value): HashSet<Value>;
|
|
5651
5800
|
/**
|
|
@@ -5653,7 +5802,7 @@ export declare function HashSet<Value extends Top>(value: Value): HashSet<Value>
|
|
|
5653
5802
|
* must conform to the provided schema.
|
|
5654
5803
|
*
|
|
5655
5804
|
* @category Chunk
|
|
5656
|
-
* @since
|
|
5805
|
+
* @since 3.10.0
|
|
5657
5806
|
*/
|
|
5658
5807
|
export interface Chunk<Value extends Top> extends declareConstructor<Chunk_.Chunk<Value["Type"]>, Chunk_.Chunk<Value["Encoded"]>, readonly [Value], ChunkIso<Value>> {
|
|
5659
5808
|
readonly "Rebuild": Chunk<Value>;
|
|
@@ -5672,7 +5821,7 @@ export type ChunkIso<Value extends Top> = ReadonlyArray<Value["Iso"]>;
|
|
|
5672
5821
|
* provided schema.
|
|
5673
5822
|
*
|
|
5674
5823
|
* @category Chunk
|
|
5675
|
-
* @since
|
|
5824
|
+
* @since 3.10.0
|
|
5676
5825
|
*/
|
|
5677
5826
|
export declare function Chunk<Value extends Top>(value: Value): Chunk<Value>;
|
|
5678
5827
|
/**
|
|
@@ -5772,7 +5921,7 @@ export declare const Date: Date;
|
|
|
5772
5921
|
* JavaScript `Date` instances.
|
|
5773
5922
|
*
|
|
5774
5923
|
* @category Date
|
|
5775
|
-
* @since
|
|
5924
|
+
* @since 3.10.0
|
|
5776
5925
|
*/
|
|
5777
5926
|
export interface DateFromString extends decodeTo<Date, String> {
|
|
5778
5927
|
readonly "Rebuild": DateFromString;
|
|
@@ -5789,7 +5938,7 @@ export interface DateFromString extends decodeTo<Date, String> {
|
|
|
5789
5938
|
* `"Invalid Date"`.
|
|
5790
5939
|
*
|
|
5791
5940
|
* @category Date
|
|
5792
|
-
* @since
|
|
5941
|
+
* @since 3.10.0
|
|
5793
5942
|
*/
|
|
5794
5943
|
export declare const DateFromString: DateFromString;
|
|
5795
5944
|
/**
|
|
@@ -5816,7 +5965,7 @@ export declare const DateValid: DateValid;
|
|
|
5816
5965
|
* Type-level representation of the schema for Effect `Duration` values.
|
|
5817
5966
|
*
|
|
5818
5967
|
* @category Duration
|
|
5819
|
-
* @since
|
|
5968
|
+
* @since 3.10.0
|
|
5820
5969
|
*/
|
|
5821
5970
|
export interface Duration extends declare<Duration_.Duration> {
|
|
5822
5971
|
readonly "Rebuild": Duration;
|
|
@@ -5830,8 +5979,7 @@ export interface Duration extends declare<Duration_.Duration> {
|
|
|
5830
5979
|
* **Example** (Duration schema)
|
|
5831
5980
|
*
|
|
5832
5981
|
* ```ts
|
|
5833
|
-
* import { Schema } from "effect"
|
|
5834
|
-
* import { Duration } from "effect"
|
|
5982
|
+
* import { Duration, Schema } from "effect"
|
|
5835
5983
|
*
|
|
5836
5984
|
* Schema.decodeUnknownSync(Schema.Duration)(Duration.seconds(5))
|
|
5837
5985
|
* // => Duration(5s)
|
|
@@ -5839,7 +5987,7 @@ export interface Duration extends declare<Duration_.Duration> {
|
|
|
5839
5987
|
*
|
|
5840
5988
|
* @category Duration
|
|
5841
5989
|
*
|
|
5842
|
-
* @since
|
|
5990
|
+
* @since 3.10.0
|
|
5843
5991
|
*/
|
|
5844
5992
|
export declare const Duration: Duration;
|
|
5845
5993
|
/**
|
|
@@ -5871,7 +6019,7 @@ export declare const DurationFromString: DurationFromString;
|
|
|
5871
6019
|
* nanosecond `bigint` values into `Duration` values.
|
|
5872
6020
|
*
|
|
5873
6021
|
* @category Duration
|
|
5874
|
-
* @since
|
|
6022
|
+
* @since 3.10.0
|
|
5875
6023
|
*/
|
|
5876
6024
|
export interface DurationFromNanos extends decodeTo<Duration, BigInt> {
|
|
5877
6025
|
readonly "Rebuild": DurationFromNanos;
|
|
@@ -5889,7 +6037,7 @@ export interface DurationFromNanos extends decodeTo<Duration, BigInt> {
|
|
|
5889
6037
|
* `Duration.infinity`.
|
|
5890
6038
|
*
|
|
5891
6039
|
* @category Duration
|
|
5892
|
-
* @since
|
|
6040
|
+
* @since 3.10.0
|
|
5893
6041
|
*/
|
|
5894
6042
|
export declare const DurationFromNanos: DurationFromNanos;
|
|
5895
6043
|
/**
|
|
@@ -5897,7 +6045,7 @@ export declare const DurationFromNanos: DurationFromNanos;
|
|
|
5897
6045
|
* non-negative millisecond numbers into `Duration` values.
|
|
5898
6046
|
*
|
|
5899
6047
|
* @category Duration
|
|
5900
|
-
* @since
|
|
6048
|
+
* @since 3.10.0
|
|
5901
6049
|
*/
|
|
5902
6050
|
export interface DurationFromMillis extends decodeTo<Duration, Number> {
|
|
5903
6051
|
readonly "Rebuild": DurationFromMillis;
|
|
@@ -5916,14 +6064,14 @@ export interface DurationFromMillis extends decodeTo<Duration, Number> {
|
|
|
5916
6064
|
* representing milliseconds
|
|
5917
6065
|
*
|
|
5918
6066
|
* @category Duration
|
|
5919
|
-
* @since
|
|
6067
|
+
* @since 3.10.0
|
|
5920
6068
|
*/
|
|
5921
6069
|
export declare const DurationFromMillis: DurationFromMillis;
|
|
5922
6070
|
/**
|
|
5923
6071
|
* Type-level representation of the schema for Effect `BigDecimal` values.
|
|
5924
6072
|
*
|
|
5925
6073
|
* @category BigDecimal
|
|
5926
|
-
* @since
|
|
6074
|
+
* @since 3.10.0
|
|
5927
6075
|
*/
|
|
5928
6076
|
export interface BigDecimal extends declare<BigDecimal_.BigDecimal> {
|
|
5929
6077
|
readonly "Rebuild": BigDecimal;
|
|
@@ -5936,7 +6084,7 @@ export interface BigDecimal extends declare<BigDecimal_.BigDecimal> {
|
|
|
5936
6084
|
* - encodes `BigDecimal` as a `string`
|
|
5937
6085
|
*
|
|
5938
6086
|
* @category BigDecimal
|
|
5939
|
-
* @since
|
|
6087
|
+
* @since 3.10.0
|
|
5940
6088
|
*/
|
|
5941
6089
|
export declare const BigDecimal: BigDecimal;
|
|
5942
6090
|
/**
|
|
@@ -5983,7 +6131,7 @@ export interface UnknownFromJsonString extends fromJsonString<Unknown> {
|
|
|
5983
6131
|
* - Any value is encoded as a JSON string using `JSON.stringify`.
|
|
5984
6132
|
* - If the value is not a valid JSON value, encoding fails.
|
|
5985
6133
|
*
|
|
5986
|
-
* **Example**
|
|
6134
|
+
* **Example** (Decoding unknown JSON strings)
|
|
5987
6135
|
*
|
|
5988
6136
|
* ```ts
|
|
5989
6137
|
* import { Schema } from "effect"
|
|
@@ -6016,7 +6164,7 @@ export interface fromJsonString<S extends Top> extends decodeTo<S, String> {
|
|
|
6016
6164
|
* The resulting schema first parses the input string as JSON, and then runs the
|
|
6017
6165
|
* provided schema on the parsed result.
|
|
6018
6166
|
*
|
|
6019
|
-
* **Example**
|
|
6167
|
+
* **Example** (Decoding JSON strings with a schema)
|
|
6020
6168
|
*
|
|
6021
6169
|
* ```ts
|
|
6022
6170
|
* import { Schema } from "effect"
|
|
@@ -6034,7 +6182,7 @@ export interface fromJsonString<S extends Top> extends decodeTo<S, String> {
|
|
|
6034
6182
|
* resulting schema will be a JSON Schema with a `contentSchema` property that
|
|
6035
6183
|
* contains the JSON Schema for the given schema.
|
|
6036
6184
|
*
|
|
6037
|
-
* **Example**
|
|
6185
|
+
* **Example** (Emitting JSON Schema for a JSON string decoder)
|
|
6038
6186
|
*
|
|
6039
6187
|
* ```ts
|
|
6040
6188
|
* import { Schema } from "effect"
|
|
@@ -6200,6 +6348,7 @@ export interface fromFormData<S extends Top> extends decodeTo<S, FormData> {
|
|
|
6200
6348
|
* // Success({"a":1}) // Note: the value is a number
|
|
6201
6349
|
* ```
|
|
6202
6350
|
*
|
|
6351
|
+
* @category decoding
|
|
6203
6352
|
* @since 4.0.0
|
|
6204
6353
|
*/
|
|
6205
6354
|
export declare function fromFormData<S extends Top>(schema: S): fromFormData<S>;
|
|
@@ -6304,6 +6453,7 @@ export interface fromURLSearchParams<S extends Top> extends decodeTo<S, URLSearc
|
|
|
6304
6453
|
* // Success({"a":1}) // Note: the value is a number
|
|
6305
6454
|
* ```
|
|
6306
6455
|
*
|
|
6456
|
+
* @category decoding
|
|
6307
6457
|
* @since 4.0.0
|
|
6308
6458
|
*/
|
|
6309
6459
|
export declare function fromURLSearchParams<S extends Top>(schema: S): fromURLSearchParams<S>;
|
|
@@ -6312,7 +6462,7 @@ export declare function fromURLSearchParams<S extends Top>(schema: S): fromURLSe
|
|
|
6312
6462
|
* `Infinity`, and `-Infinity`.
|
|
6313
6463
|
*
|
|
6314
6464
|
* @category Number
|
|
6315
|
-
* @since
|
|
6465
|
+
* @since 3.10.0
|
|
6316
6466
|
*/
|
|
6317
6467
|
export interface Finite extends Number {
|
|
6318
6468
|
readonly "Rebuild": Finite;
|
|
@@ -6321,7 +6471,7 @@ export interface Finite extends Number {
|
|
|
6321
6471
|
* A schema for finite numbers, rejecting `NaN`, `Infinity`, and `-Infinity`.
|
|
6322
6472
|
*
|
|
6323
6473
|
* @category Number
|
|
6324
|
-
* @since
|
|
6474
|
+
* @since 3.10.0
|
|
6325
6475
|
*/
|
|
6326
6476
|
export declare const Finite: Finite;
|
|
6327
6477
|
/**
|
|
@@ -6329,7 +6479,7 @@ export declare const Finite: Finite;
|
|
|
6329
6479
|
* integer numbers.
|
|
6330
6480
|
*
|
|
6331
6481
|
* @category Number
|
|
6332
|
-
* @since
|
|
6482
|
+
* @since 3.10.0
|
|
6333
6483
|
*/
|
|
6334
6484
|
export interface Int extends Number {
|
|
6335
6485
|
readonly "Rebuild": Int;
|
|
@@ -6338,7 +6488,7 @@ export interface Int extends Number {
|
|
|
6338
6488
|
* A schema for integers, rejecting `NaN`, `Infinity`, and `-Infinity`.
|
|
6339
6489
|
*
|
|
6340
6490
|
* @category Number
|
|
6341
|
-
* @since
|
|
6491
|
+
* @since 3.10.0
|
|
6342
6492
|
*/
|
|
6343
6493
|
export declare const Int: Int;
|
|
6344
6494
|
/**
|
|
@@ -6346,7 +6496,7 @@ export declare const Int: Int;
|
|
|
6346
6496
|
* numbers using JavaScript number coercion.
|
|
6347
6497
|
*
|
|
6348
6498
|
* @category Number
|
|
6349
|
-
* @since
|
|
6499
|
+
* @since 3.10.0
|
|
6350
6500
|
*/
|
|
6351
6501
|
export interface NumberFromString extends decodeTo<Finite, String> {
|
|
6352
6502
|
readonly "Rebuild": NumberFromString;
|
|
@@ -6364,7 +6514,7 @@ export interface NumberFromString extends decodeTo<Finite, String> {
|
|
|
6364
6514
|
* A number is encoded as a `string`.
|
|
6365
6515
|
*
|
|
6366
6516
|
* @category Number
|
|
6367
|
-
* @since
|
|
6517
|
+
* @since 3.10.0
|
|
6368
6518
|
*/
|
|
6369
6519
|
export declare const NumberFromString: NumberFromString;
|
|
6370
6520
|
/**
|
|
@@ -6419,7 +6569,7 @@ export declare const BigIntFromString: BigIntFromString;
|
|
|
6419
6569
|
* trailing whitespace.
|
|
6420
6570
|
*
|
|
6421
6571
|
* @category String
|
|
6422
|
-
* @since
|
|
6572
|
+
* @since 3.10.0
|
|
6423
6573
|
*/
|
|
6424
6574
|
export interface Trimmed extends String {
|
|
6425
6575
|
readonly "Rebuild": Trimmed;
|
|
@@ -6428,7 +6578,7 @@ export interface Trimmed extends String {
|
|
|
6428
6578
|
* A schema for strings that contains no leading or trailing whitespaces.
|
|
6429
6579
|
*
|
|
6430
6580
|
* @category String
|
|
6431
|
-
* @since
|
|
6581
|
+
* @since 3.10.0
|
|
6432
6582
|
*/
|
|
6433
6583
|
export declare const Trimmed: Trimmed;
|
|
6434
6584
|
/**
|
|
@@ -6436,7 +6586,7 @@ export declare const Trimmed: Trimmed;
|
|
|
6436
6586
|
* whitespace while decoding and encodes the trimmed string unchanged.
|
|
6437
6587
|
*
|
|
6438
6588
|
* @category String
|
|
6439
|
-
* @since
|
|
6589
|
+
* @since 3.10.0
|
|
6440
6590
|
*/
|
|
6441
6591
|
export interface Trim extends decodeTo<Trimmed, String> {
|
|
6442
6592
|
readonly "Rebuild": Trim;
|
|
@@ -6451,7 +6601,7 @@ export interface Trim extends decodeTo<Trimmed, String> {
|
|
|
6451
6601
|
* - The trimmed string is encoded as is.
|
|
6452
6602
|
*
|
|
6453
6603
|
* @category String
|
|
6454
|
-
* @since
|
|
6604
|
+
* @since 3.10.0
|
|
6455
6605
|
*/
|
|
6456
6606
|
export declare const Trim: Trim;
|
|
6457
6607
|
/**
|
|
@@ -6459,7 +6609,7 @@ export declare const Trim: Trim;
|
|
|
6459
6609
|
* base64-encoded strings and UTF-8 strings.
|
|
6460
6610
|
*
|
|
6461
6611
|
* @category String
|
|
6462
|
-
* @since
|
|
6612
|
+
* @since 3.10.0
|
|
6463
6613
|
*/
|
|
6464
6614
|
export interface StringFromBase64 extends decodeTo<String, String> {
|
|
6465
6615
|
readonly "Rebuild": StringFromBase64;
|
|
@@ -6474,7 +6624,7 @@ export interface StringFromBase64 extends decodeTo<String, String> {
|
|
|
6474
6624
|
* - A `string` is encoded as a base64-encoded string.
|
|
6475
6625
|
*
|
|
6476
6626
|
* @category String
|
|
6477
|
-
* @since
|
|
6627
|
+
* @since 3.10.0
|
|
6478
6628
|
*/
|
|
6479
6629
|
export declare const StringFromBase64: StringFromBase64;
|
|
6480
6630
|
/**
|
|
@@ -6482,7 +6632,7 @@ export declare const StringFromBase64: StringFromBase64;
|
|
|
6482
6632
|
* base64-encoded strings and UTF-8 strings.
|
|
6483
6633
|
*
|
|
6484
6634
|
* @category String
|
|
6485
|
-
* @since
|
|
6635
|
+
* @since 3.10.0
|
|
6486
6636
|
*/
|
|
6487
6637
|
export interface StringFromBase64Url extends decodeTo<String, String> {
|
|
6488
6638
|
readonly "Rebuild": StringFromBase64Url;
|
|
@@ -6497,7 +6647,7 @@ export interface StringFromBase64Url extends decodeTo<String, String> {
|
|
|
6497
6647
|
* - A `string` is encoded as a base64 (URL) encoded string.
|
|
6498
6648
|
*
|
|
6499
6649
|
* @category String
|
|
6500
|
-
* @since
|
|
6650
|
+
* @since 3.10.0
|
|
6501
6651
|
*/
|
|
6502
6652
|
export declare const StringFromBase64Url: StringFromBase64Url;
|
|
6503
6653
|
/**
|
|
@@ -6505,7 +6655,7 @@ export declare const StringFromBase64Url: StringFromBase64Url;
|
|
|
6505
6655
|
* strings and UTF-8 strings.
|
|
6506
6656
|
*
|
|
6507
6657
|
* @category String
|
|
6508
|
-
* @since
|
|
6658
|
+
* @since 3.10.0
|
|
6509
6659
|
*/
|
|
6510
6660
|
export interface StringFromHex extends decodeTo<String, String> {
|
|
6511
6661
|
readonly "Rebuild": StringFromHex;
|
|
@@ -6520,7 +6670,7 @@ export interface StringFromHex extends decodeTo<String, String> {
|
|
|
6520
6670
|
* - A `string` is encoded as a hex string.
|
|
6521
6671
|
*
|
|
6522
6672
|
* @category String
|
|
6523
|
-
* @since
|
|
6673
|
+
* @since 3.10.0
|
|
6524
6674
|
*/
|
|
6525
6675
|
export declare const StringFromHex: StringFromHex;
|
|
6526
6676
|
/**
|
|
@@ -6528,7 +6678,7 @@ export declare const StringFromHex: StringFromHex;
|
|
|
6528
6678
|
* URI-component encoded strings and UTF-8 strings.
|
|
6529
6679
|
*
|
|
6530
6680
|
* @category String
|
|
6531
|
-
* @since
|
|
6681
|
+
* @since 3.12.0
|
|
6532
6682
|
*/
|
|
6533
6683
|
export interface StringFromUriComponent extends decodeTo<String, String> {
|
|
6534
6684
|
readonly "Rebuild": StringFromUriComponent;
|
|
@@ -6543,7 +6693,7 @@ export interface StringFromUriComponent extends decodeTo<String, String> {
|
|
|
6543
6693
|
* Encoding:
|
|
6544
6694
|
* - A `string` is encoded as a URI component encoded string.
|
|
6545
6695
|
*
|
|
6546
|
-
* **Example**
|
|
6696
|
+
* **Example** (Decoding URI component strings)
|
|
6547
6697
|
*
|
|
6548
6698
|
* ```ts
|
|
6549
6699
|
* import { Schema } from "effect"
|
|
@@ -6562,7 +6712,7 @@ export interface StringFromUriComponent extends decodeTo<String, String> {
|
|
|
6562
6712
|
* ```
|
|
6563
6713
|
*
|
|
6564
6714
|
* @category String
|
|
6565
|
-
* @since
|
|
6715
|
+
* @since 3.12.0
|
|
6566
6716
|
*/
|
|
6567
6717
|
export declare const StringFromUriComponent: StringFromUriComponent;
|
|
6568
6718
|
/**
|
|
@@ -6633,7 +6783,7 @@ export declare const Uint8Array: Uint8Array;
|
|
|
6633
6783
|
* base64-encoded strings and `Uint8Array` values.
|
|
6634
6784
|
*
|
|
6635
6785
|
* @category Uint8Array
|
|
6636
|
-
* @since
|
|
6786
|
+
* @since 3.10.0
|
|
6637
6787
|
*/
|
|
6638
6788
|
export interface Uint8ArrayFromBase64 extends decodeTo<Uint8Array, String> {
|
|
6639
6789
|
readonly "Rebuild": Uint8ArrayFromBase64;
|
|
@@ -6649,7 +6799,7 @@ export interface Uint8ArrayFromBase64 extends decodeTo<Uint8Array, String> {
|
|
|
6649
6799
|
* - A `Uint8Array` is encoded as a base64-encoded string.
|
|
6650
6800
|
*
|
|
6651
6801
|
* @category Uint8Array
|
|
6652
|
-
* @since
|
|
6802
|
+
* @since 3.10.0
|
|
6653
6803
|
*/
|
|
6654
6804
|
export declare const Uint8ArrayFromBase64: Uint8ArrayFromBase64;
|
|
6655
6805
|
/**
|
|
@@ -6657,7 +6807,7 @@ export declare const Uint8ArrayFromBase64: Uint8ArrayFromBase64;
|
|
|
6657
6807
|
* URL-safe base64-encoded strings and `Uint8Array` values.
|
|
6658
6808
|
*
|
|
6659
6809
|
* @category Uint8Array
|
|
6660
|
-
* @since
|
|
6810
|
+
* @since 3.10.0
|
|
6661
6811
|
*/
|
|
6662
6812
|
export interface Uint8ArrayFromBase64Url extends decodeTo<Uint8Array, String> {
|
|
6663
6813
|
readonly "Rebuild": Uint8ArrayFromBase64Url;
|
|
@@ -6673,7 +6823,7 @@ export interface Uint8ArrayFromBase64Url extends decodeTo<Uint8Array, String> {
|
|
|
6673
6823
|
* - A `Uint8Array` is encoded as a base64 (URL) encoded string.
|
|
6674
6824
|
*
|
|
6675
6825
|
* @category Uint8Array
|
|
6676
|
-
* @since
|
|
6826
|
+
* @since 3.10.0
|
|
6677
6827
|
*/
|
|
6678
6828
|
export declare const Uint8ArrayFromBase64Url: Uint8ArrayFromBase64Url;
|
|
6679
6829
|
/**
|
|
@@ -6681,7 +6831,7 @@ export declare const Uint8ArrayFromBase64Url: Uint8ArrayFromBase64Url;
|
|
|
6681
6831
|
* hex-encoded strings and `Uint8Array` values.
|
|
6682
6832
|
*
|
|
6683
6833
|
* @category Uint8Array
|
|
6684
|
-
* @since
|
|
6834
|
+
* @since 3.10.0
|
|
6685
6835
|
*/
|
|
6686
6836
|
export interface Uint8ArrayFromHex extends decodeTo<Uint8Array, String> {
|
|
6687
6837
|
readonly "Rebuild": Uint8ArrayFromHex;
|
|
@@ -6697,7 +6847,7 @@ export interface Uint8ArrayFromHex extends decodeTo<Uint8Array, String> {
|
|
|
6697
6847
|
* - A `Uint8Array` is encoded as a hex encoded string.
|
|
6698
6848
|
*
|
|
6699
6849
|
* @category Uint8Array
|
|
6700
|
-
* @since
|
|
6850
|
+
* @since 3.10.0
|
|
6701
6851
|
*/
|
|
6702
6852
|
export declare const Uint8ArrayFromHex: Uint8ArrayFromHex;
|
|
6703
6853
|
/**
|
|
@@ -6705,7 +6855,7 @@ export declare const Uint8ArrayFromHex: Uint8ArrayFromHex;
|
|
|
6705
6855
|
* UTC ISO string JSON encoding.
|
|
6706
6856
|
*
|
|
6707
6857
|
* @category DateTime
|
|
6708
|
-
* @since
|
|
6858
|
+
* @since 3.10.0
|
|
6709
6859
|
*/
|
|
6710
6860
|
export interface DateTimeUtc extends declare<DateTime.Utc> {
|
|
6711
6861
|
readonly "Rebuild": DateTimeUtc;
|
|
@@ -6718,7 +6868,7 @@ export interface DateTimeUtc extends declare<DateTime.Utc> {
|
|
|
6718
6868
|
* - encodes `DateTime.Utc` as a UTC ISO string
|
|
6719
6869
|
*
|
|
6720
6870
|
* @category DateTime
|
|
6721
|
-
* @since
|
|
6871
|
+
* @since 3.10.0
|
|
6722
6872
|
*/
|
|
6723
6873
|
export declare const DateTimeUtc: DateTimeUtc;
|
|
6724
6874
|
/**
|
|
@@ -6726,7 +6876,7 @@ export declare const DateTimeUtc: DateTimeUtc;
|
|
|
6726
6876
|
* JavaScript `Date` values to `DateTime.Utc`.
|
|
6727
6877
|
*
|
|
6728
6878
|
* @category DateTime
|
|
6729
|
-
* @since
|
|
6879
|
+
* @since 3.12.0
|
|
6730
6880
|
*/
|
|
6731
6881
|
export interface DateTimeUtcFromDate extends decodeTo<DateTimeUtc, Date> {
|
|
6732
6882
|
readonly "Rebuild": DateTimeUtcFromDate;
|
|
@@ -6741,7 +6891,7 @@ export interface DateTimeUtcFromDate extends decodeTo<DateTimeUtc, Date> {
|
|
|
6741
6891
|
* - A `DateTime.Utc` is encoded as a `Date`
|
|
6742
6892
|
*
|
|
6743
6893
|
* @category DateTime
|
|
6744
|
-
* @since
|
|
6894
|
+
* @since 3.12.0
|
|
6745
6895
|
*/
|
|
6746
6896
|
export declare const DateTimeUtcFromDate: DateTimeUtcFromDate;
|
|
6747
6897
|
/**
|
|
@@ -6798,7 +6948,7 @@ export declare const DateTimeUtcFromMillis: DateTimeUtcFromMillis;
|
|
|
6798
6948
|
* `DateTime.TimeZone.Offset` values encoded as offset milliseconds.
|
|
6799
6949
|
*
|
|
6800
6950
|
* @category DateTime
|
|
6801
|
-
* @since
|
|
6951
|
+
* @since 3.10.0
|
|
6802
6952
|
*/
|
|
6803
6953
|
export interface TimeZoneOffset extends declare<DateTime.TimeZone.Offset> {
|
|
6804
6954
|
readonly "Rebuild": TimeZoneOffset;
|
|
@@ -6811,7 +6961,7 @@ export interface TimeZoneOffset extends declare<DateTime.TimeZone.Offset> {
|
|
|
6811
6961
|
* - encodes `DateTime.TimeZone.Offset` as a number (offset in milliseconds)
|
|
6812
6962
|
*
|
|
6813
6963
|
* @category DateTime
|
|
6814
|
-
* @since
|
|
6964
|
+
* @since 3.10.0
|
|
6815
6965
|
*/
|
|
6816
6966
|
export declare const TimeZoneOffset: TimeZoneOffset;
|
|
6817
6967
|
/**
|
|
@@ -6819,7 +6969,7 @@ export declare const TimeZoneOffset: TimeZoneOffset;
|
|
|
6819
6969
|
* `DateTime.TimeZone.Named` values encoded as IANA time zone identifiers.
|
|
6820
6970
|
*
|
|
6821
6971
|
* @category DateTime
|
|
6822
|
-
* @since
|
|
6972
|
+
* @since 3.10.0
|
|
6823
6973
|
*/
|
|
6824
6974
|
export interface TimeZoneNamed extends declare<DateTime.TimeZone.Named> {
|
|
6825
6975
|
readonly "Rebuild": TimeZoneNamed;
|
|
@@ -6832,7 +6982,7 @@ export interface TimeZoneNamed extends declare<DateTime.TimeZone.Named> {
|
|
|
6832
6982
|
* - encodes `DateTime.TimeZone.Named` as a string (IANA time zone identifier)
|
|
6833
6983
|
*
|
|
6834
6984
|
* @category DateTime
|
|
6835
|
-
* @since
|
|
6985
|
+
* @since 3.10.0
|
|
6836
6986
|
*/
|
|
6837
6987
|
export declare const TimeZoneNamed: TimeZoneNamed;
|
|
6838
6988
|
/**
|
|
@@ -6863,7 +7013,7 @@ export declare const TimeZoneNamedFromString: TimeZoneNamedFromString;
|
|
|
6863
7013
|
* encoded as either IANA identifiers or numeric offset strings.
|
|
6864
7014
|
*
|
|
6865
7015
|
* @category DateTime
|
|
6866
|
-
* @since
|
|
7016
|
+
* @since 3.10.0
|
|
6867
7017
|
*/
|
|
6868
7018
|
export interface TimeZone extends declare<DateTime.TimeZone> {
|
|
6869
7019
|
readonly "Rebuild": TimeZone;
|
|
@@ -6877,7 +7027,7 @@ export interface TimeZone extends declare<DateTime.TimeZone> {
|
|
|
6877
7027
|
* `+03:00`)
|
|
6878
7028
|
*
|
|
6879
7029
|
* @category DateTime
|
|
6880
|
-
* @since
|
|
7030
|
+
* @since 3.10.0
|
|
6881
7031
|
*/
|
|
6882
7032
|
export declare const TimeZone: TimeZone;
|
|
6883
7033
|
/**
|
|
@@ -6908,7 +7058,7 @@ export declare const TimeZoneFromString: TimeZoneFromString;
|
|
|
6908
7058
|
* with ISO offset or named-zone string JSON encoding.
|
|
6909
7059
|
*
|
|
6910
7060
|
* @category DateTime
|
|
6911
|
-
* @since
|
|
7061
|
+
* @since 3.10.0
|
|
6912
7062
|
*/
|
|
6913
7063
|
export interface DateTimeZoned extends declare<DateTime.Zoned> {
|
|
6914
7064
|
readonly "Rebuild": DateTimeZoned;
|
|
@@ -6924,7 +7074,7 @@ export interface DateTimeZoned extends declare<DateTime.Zoned> {
|
|
|
6924
7074
|
* `YYYY-MM-DDTHH:mm:ss.sss+HH:MM[Time/Zone]`
|
|
6925
7075
|
*
|
|
6926
7076
|
* @category DateTime
|
|
6927
|
-
* @since
|
|
7077
|
+
* @since 3.10.0
|
|
6928
7078
|
*/
|
|
6929
7079
|
export declare const DateTimeZoned: DateTimeZoned;
|
|
6930
7080
|
/**
|
|
@@ -6959,7 +7109,8 @@ export declare const DateTimeZonedFromString: DateTimeZonedFromString;
|
|
|
6959
7109
|
* The interface exposes the schema's `fields`, an `identifier` string, and
|
|
6960
7110
|
* helpers such as `mapFields`, `annotate`, `check`, and `extend`.
|
|
6961
7111
|
*
|
|
6962
|
-
* @
|
|
7112
|
+
* @category models
|
|
7113
|
+
* @since 3.10.0
|
|
6963
7114
|
*/
|
|
6964
7115
|
export interface Class<Self, S extends Top & {
|
|
6965
7116
|
readonly fields: Struct.Fields;
|
|
@@ -7029,8 +7180,8 @@ type MissingSelfGeneric<Usage extends string> = `Missing \`Self\` generic - use
|
|
|
7029
7180
|
* console.log(dog.breed) // "Labrador"
|
|
7030
7181
|
* ```
|
|
7031
7182
|
*
|
|
7032
|
-
* @category
|
|
7033
|
-
* @since
|
|
7183
|
+
* @category constructors
|
|
7184
|
+
* @since 3.10.0
|
|
7034
7185
|
*/
|
|
7035
7186
|
export declare const Class: {
|
|
7036
7187
|
/**
|
|
@@ -7074,8 +7225,8 @@ export declare const Class: {
|
|
|
7074
7225
|
* console.log(dog.breed) // "Labrador"
|
|
7075
7226
|
* ```
|
|
7076
7227
|
*
|
|
7077
|
-
* @category
|
|
7078
|
-
* @since
|
|
7228
|
+
* @category constructors
|
|
7229
|
+
* @since 3.10.0
|
|
7079
7230
|
*/
|
|
7080
7231
|
<Self = never, Brand = {}>(identifier: string): {
|
|
7081
7232
|
/**
|
|
@@ -7119,8 +7270,8 @@ export declare const Class: {
|
|
|
7119
7270
|
* console.log(dog.breed) // "Labrador"
|
|
7120
7271
|
* ```
|
|
7121
7272
|
*
|
|
7122
|
-
* @category
|
|
7123
|
-
* @since
|
|
7273
|
+
* @category constructors
|
|
7274
|
+
* @since 3.10.0
|
|
7124
7275
|
*/
|
|
7125
7276
|
<const Fields extends Struct.Fields>(fields: Fields, annotations?: Annotations.Declaration<Self, readonly [Struct<Fields>]>): [Self] extends [never] ? MissingSelfGeneric<"Schema.Class"> : Class<Self, Struct<Fields>, Brand>;
|
|
7126
7277
|
/**
|
|
@@ -7164,8 +7315,8 @@ export declare const Class: {
|
|
|
7164
7315
|
* console.log(dog.breed) // "Labrador"
|
|
7165
7316
|
* ```
|
|
7166
7317
|
*
|
|
7167
|
-
* @category
|
|
7168
|
-
* @since
|
|
7318
|
+
* @category constructors
|
|
7319
|
+
* @since 3.10.0
|
|
7169
7320
|
*/
|
|
7170
7321
|
<S extends Struct<Struct.Fields>>(schema: S, annotations?: Annotations.Declaration<Self, readonly [S]>): [Self] extends [never] ? MissingSelfGeneric<"Schema.Class"> : Class<Self, S, Brand>;
|
|
7171
7322
|
};
|
|
@@ -7192,8 +7343,8 @@ export declare const Class: {
|
|
|
7192
7343
|
* console.log(c.radius) // 5
|
|
7193
7344
|
* ```
|
|
7194
7345
|
*
|
|
7195
|
-
* @category
|
|
7196
|
-
* @since
|
|
7346
|
+
* @category constructors
|
|
7347
|
+
* @since 3.10.0
|
|
7197
7348
|
*/
|
|
7198
7349
|
export declare const TaggedClass: {
|
|
7199
7350
|
/**
|
|
@@ -7218,8 +7369,8 @@ export declare const TaggedClass: {
|
|
|
7218
7369
|
* console.log(c.radius) // 5
|
|
7219
7370
|
* ```
|
|
7220
7371
|
*
|
|
7221
|
-
* @category
|
|
7222
|
-
* @since
|
|
7372
|
+
* @category constructors
|
|
7373
|
+
* @since 3.10.0
|
|
7223
7374
|
*/
|
|
7224
7375
|
<Self = never, Brand = {}>(identifier?: string): {
|
|
7225
7376
|
/**
|
|
@@ -7244,8 +7395,8 @@ export declare const TaggedClass: {
|
|
|
7244
7395
|
* console.log(c.radius) // 5
|
|
7245
7396
|
* ```
|
|
7246
7397
|
*
|
|
7247
|
-
* @category
|
|
7248
|
-
* @since
|
|
7398
|
+
* @category constructors
|
|
7399
|
+
* @since 3.10.0
|
|
7249
7400
|
*/
|
|
7250
7401
|
<Tag extends string, const Fields extends Struct.Fields>(tag: Tag, fields: Fields, annotations?: Annotations.Declaration<Self, readonly [TaggedStruct<Tag, Fields>]>): [Self] extends [never] ? MissingSelfGeneric<"Schema.TaggedClass"> : Class<Self, TaggedStruct<Tag, Fields>, Brand>;
|
|
7251
7402
|
/**
|
|
@@ -7270,8 +7421,8 @@ export declare const TaggedClass: {
|
|
|
7270
7421
|
* console.log(c.radius) // 5
|
|
7271
7422
|
* ```
|
|
7272
7423
|
*
|
|
7273
|
-
* @category
|
|
7274
|
-
* @since
|
|
7424
|
+
* @category constructors
|
|
7425
|
+
* @since 3.10.0
|
|
7275
7426
|
*/
|
|
7276
7427
|
<Tag extends string, S extends Struct<Struct.Fields>>(tag: Tag, schema: S, annotations?: Annotations.Declaration<Self, readonly [Struct<Simplify<{
|
|
7277
7428
|
readonly _tag: tag<Tag>;
|
|
@@ -7300,7 +7451,7 @@ export declare const TaggedClass: {
|
|
|
7300
7451
|
* })
|
|
7301
7452
|
* ```
|
|
7302
7453
|
*
|
|
7303
|
-
* @category
|
|
7454
|
+
* @category constructors
|
|
7304
7455
|
* @since 4.0.0
|
|
7305
7456
|
*/
|
|
7306
7457
|
export declare const ErrorClass: {
|
|
@@ -7324,7 +7475,7 @@ export declare const ErrorClass: {
|
|
|
7324
7475
|
* })
|
|
7325
7476
|
* ```
|
|
7326
7477
|
*
|
|
7327
|
-
* @category
|
|
7478
|
+
* @category constructors
|
|
7328
7479
|
* @since 4.0.0
|
|
7329
7480
|
*/
|
|
7330
7481
|
<Self = never, Brand = {}>(identifier: string): {
|
|
@@ -7348,7 +7499,7 @@ export declare const ErrorClass: {
|
|
|
7348
7499
|
* })
|
|
7349
7500
|
* ```
|
|
7350
7501
|
*
|
|
7351
|
-
* @category
|
|
7502
|
+
* @category constructors
|
|
7352
7503
|
* @since 4.0.0
|
|
7353
7504
|
*/
|
|
7354
7505
|
<const Fields extends Struct.Fields>(fields: Fields, annotations?: Annotations.Declaration<Self, readonly [Struct<Fields>]>): [Self] extends [never] ? MissingSelfGeneric<"Schema.ErrorClass"> : Class<Self, Struct<Fields>, Cause_.YieldableError & Brand>;
|
|
@@ -7372,7 +7523,7 @@ export declare const ErrorClass: {
|
|
|
7372
7523
|
* })
|
|
7373
7524
|
* ```
|
|
7374
7525
|
*
|
|
7375
|
-
* @category
|
|
7526
|
+
* @category constructors
|
|
7376
7527
|
* @since 4.0.0
|
|
7377
7528
|
*/
|
|
7378
7529
|
<S extends Struct<Struct.Fields>>(schema: S, annotations?: Annotations.Declaration<Self, readonly [S]>): [Self] extends [never] ? MissingSelfGeneric<"Schema.ErrorClass"> : Class<Self, S, Cause_.YieldableError & Brand>;
|
|
@@ -7397,8 +7548,8 @@ export declare const ErrorClass: {
|
|
|
7397
7548
|
* })
|
|
7398
7549
|
* ```
|
|
7399
7550
|
*
|
|
7400
|
-
* @category
|
|
7401
|
-
* @since
|
|
7551
|
+
* @category constructors
|
|
7552
|
+
* @since 3.10.0
|
|
7402
7553
|
*/
|
|
7403
7554
|
export declare const TaggedErrorClass: {
|
|
7404
7555
|
/**
|
|
@@ -7420,8 +7571,8 @@ export declare const TaggedErrorClass: {
|
|
|
7420
7571
|
* })
|
|
7421
7572
|
* ```
|
|
7422
7573
|
*
|
|
7423
|
-
* @category
|
|
7424
|
-
* @since
|
|
7574
|
+
* @category constructors
|
|
7575
|
+
* @since 3.10.0
|
|
7425
7576
|
*/
|
|
7426
7577
|
<Self = never, Brand = {}>(identifier?: string): {
|
|
7427
7578
|
/**
|
|
@@ -7443,8 +7594,8 @@ export declare const TaggedErrorClass: {
|
|
|
7443
7594
|
* })
|
|
7444
7595
|
* ```
|
|
7445
7596
|
*
|
|
7446
|
-
* @category
|
|
7447
|
-
* @since
|
|
7597
|
+
* @category constructors
|
|
7598
|
+
* @since 3.10.0
|
|
7448
7599
|
*/
|
|
7449
7600
|
<Tag extends string, const Fields extends Struct.Fields>(tag: Tag, fields: Fields, annotations?: Annotations.Declaration<Self, readonly [TaggedStruct<Tag, Fields>]>): [Self] extends [never] ? MissingSelfGeneric<"Schema.TaggedErrorClass"> : Class<Self, TaggedStruct<Tag, Fields>, Cause_.YieldableError & Brand>;
|
|
7450
7601
|
/**
|
|
@@ -7466,8 +7617,8 @@ export declare const TaggedErrorClass: {
|
|
|
7466
7617
|
* })
|
|
7467
7618
|
* ```
|
|
7468
7619
|
*
|
|
7469
|
-
* @category
|
|
7470
|
-
* @since
|
|
7620
|
+
* @category constructors
|
|
7621
|
+
* @since 3.10.0
|
|
7471
7622
|
*/
|
|
7472
7623
|
<Tag extends string, S extends Struct<Struct.Fields>>(tag: Tag, schema: S, annotations?: Annotations.Declaration<Self, readonly [Struct<Simplify<{
|
|
7473
7624
|
readonly _tag: tag<Tag>;
|
|
@@ -7584,6 +7735,7 @@ export declare function toRepresentation(schema: Top): SchemaRepresentation.Docu
|
|
|
7584
7735
|
/**
|
|
7585
7736
|
* Options for {@link toJsonSchemaDocument}.
|
|
7586
7737
|
*
|
|
7738
|
+
* @category models
|
|
7587
7739
|
* @since 4.0.0
|
|
7588
7740
|
*/
|
|
7589
7741
|
export interface ToJsonSchemaOptions {
|
|
@@ -7868,7 +8020,7 @@ export declare function resolveAnnotationsKey<S extends Top>(schema: S): Annotat
|
|
|
7868
8020
|
* Use {@link resolveAnnotations} to read the annotations attached to a schema at
|
|
7869
8021
|
* runtime.
|
|
7870
8022
|
*
|
|
7871
|
-
* @since
|
|
8023
|
+
* @since 3.10.0
|
|
7872
8024
|
*/
|
|
7873
8025
|
export declare namespace Annotations {
|
|
7874
8026
|
/**
|
|
@@ -7909,8 +8061,8 @@ export declare namespace Annotations {
|
|
|
7909
8061
|
* }
|
|
7910
8062
|
* ```
|
|
7911
8063
|
*
|
|
7912
|
-
* @category
|
|
7913
|
-
* @since
|
|
8064
|
+
* @category models
|
|
8065
|
+
* @since 3.10.0
|
|
7914
8066
|
*/
|
|
7915
8067
|
interface Annotations {
|
|
7916
8068
|
readonly [x: string]: unknown;
|
|
@@ -7919,6 +8071,7 @@ export declare namespace Annotations {
|
|
|
7919
8071
|
* Annotations shared by all schema nodes. These map to common JSON Schema /
|
|
7920
8072
|
* OpenAPI fields: `title`, `description`, `format`, etc.
|
|
7921
8073
|
*
|
|
8074
|
+
* @category models
|
|
7922
8075
|
* @since 4.0.0
|
|
7923
8076
|
*/
|
|
7924
8077
|
interface Augment extends Annotations {
|
|
@@ -7944,6 +8097,7 @@ export declare namespace Annotations {
|
|
|
7944
8097
|
/**
|
|
7945
8098
|
* Extends {@link Augment} with type-parametric `default` and `examples` fields.
|
|
7946
8099
|
*
|
|
8100
|
+
* @category models
|
|
7947
8101
|
* @since 4.0.0
|
|
7948
8102
|
*/
|
|
7949
8103
|
interface Documentation<T> extends Augment {
|
|
@@ -7955,7 +8109,7 @@ export declare namespace Annotations {
|
|
|
7955
8109
|
* with an optional `messageMissingKey` to override the error message when
|
|
7956
8110
|
* the property key is absent during decoding.
|
|
7957
8111
|
*
|
|
7958
|
-
* @category
|
|
8112
|
+
* @category models
|
|
7959
8113
|
* @since 4.0.0
|
|
7960
8114
|
*/
|
|
7961
8115
|
interface Key<T> extends Documentation<T> {
|
|
@@ -7970,7 +8124,7 @@ export declare namespace Annotations {
|
|
|
7970
8124
|
* arbitrary generation hooks. {@link Declaration} and other annotation
|
|
7971
8125
|
* interfaces build on top of this.
|
|
7972
8126
|
*
|
|
7973
|
-
* @category
|
|
8127
|
+
* @category models
|
|
7974
8128
|
* @since 4.0.0
|
|
7975
8129
|
*/
|
|
7976
8130
|
interface Bottom<T, TypeParameters extends ReadonlyArray<Top>> extends Documentation<T> {
|
|
@@ -8023,7 +8177,8 @@ export declare namespace Annotations {
|
|
|
8023
8177
|
* Maps declaration type-parameter schemas to codecs for their decoded `Type`
|
|
8024
8178
|
* values.
|
|
8025
8179
|
*
|
|
8026
|
-
* @
|
|
8180
|
+
* @category utility types
|
|
8181
|
+
* @since 3.10.0
|
|
8027
8182
|
*/
|
|
8028
8183
|
type Type<TypeParameters extends ReadonlyArray<Top>> = {
|
|
8029
8184
|
readonly [K in keyof TypeParameters]: Codec<TypeParameters[K]["Type"]>;
|
|
@@ -8031,7 +8186,8 @@ export declare namespace Annotations {
|
|
|
8031
8186
|
/**
|
|
8032
8187
|
* Maps declaration type-parameter schemas to codecs for their `Encoded` values.
|
|
8033
8188
|
*
|
|
8034
|
-
* @
|
|
8189
|
+
* @category utility types
|
|
8190
|
+
* @since 3.10.0
|
|
8035
8191
|
*/
|
|
8036
8192
|
type Encoded<TypeParameters extends ReadonlyArray<Top>> = {
|
|
8037
8193
|
readonly [K in keyof TypeParameters]: Codec<TypeParameters[K]["Encoded"]>;
|
|
@@ -8044,7 +8200,7 @@ export declare namespace Annotations {
|
|
|
8044
8200
|
* derived capabilities (JSON encoding, property testing, etc.) can be
|
|
8045
8201
|
* provided for the custom type.
|
|
8046
8202
|
*
|
|
8047
|
-
* @category
|
|
8203
|
+
* @category models
|
|
8048
8204
|
* @since 4.0.0
|
|
8049
8205
|
*/
|
|
8050
8206
|
interface Declaration<T, TypeParameters extends ReadonlyArray<Top> = readonly []> extends Bottom<T, TypeParameters> {
|
|
@@ -8069,8 +8225,8 @@ export declare namespace Annotations {
|
|
|
8069
8225
|
* {@link Augment} with an optional error message, identifier, and metadata.
|
|
8070
8226
|
* Filters are intentionally non-parametric to keep them covariant.
|
|
8071
8227
|
*
|
|
8072
|
-
* @category
|
|
8073
|
-
* @since
|
|
8228
|
+
* @category models
|
|
8229
|
+
* @since 3.10.0
|
|
8074
8230
|
*/
|
|
8075
8231
|
interface Filter extends Augment {
|
|
8076
8232
|
/**
|
|
@@ -8114,6 +8270,7 @@ export declare namespace Annotations {
|
|
|
8114
8270
|
* fast-check string constraints plus optional regular-expression pattern strings
|
|
8115
8271
|
* used when deriving string arbitraries from schema checks.
|
|
8116
8272
|
*
|
|
8273
|
+
* @category models
|
|
8117
8274
|
* @since 4.0.0
|
|
8118
8275
|
*/
|
|
8119
8276
|
interface StringConstraints extends FastCheck.StringSharedConstraints {
|
|
@@ -8123,6 +8280,7 @@ export declare namespace Annotations {
|
|
|
8123
8280
|
* fast-check floating-point constraints plus `isInteger`, which switches
|
|
8124
8281
|
* derived number arbitraries to integer generation.
|
|
8125
8282
|
*
|
|
8283
|
+
* @category models
|
|
8126
8284
|
* @since 4.0.0
|
|
8127
8285
|
*/
|
|
8128
8286
|
interface NumberConstraints extends FastCheck.FloatConstraints {
|
|
@@ -8132,6 +8290,7 @@ export declare namespace Annotations {
|
|
|
8132
8290
|
* fast-check bigint constraints used when deriving arbitraries for bigint
|
|
8133
8291
|
* schemas.
|
|
8134
8292
|
*
|
|
8293
|
+
* @category models
|
|
8135
8294
|
* @since 4.0.0
|
|
8136
8295
|
*/
|
|
8137
8296
|
interface BigIntConstraints extends FastCheck.BigIntConstraints {
|
|
@@ -8140,6 +8299,7 @@ export declare namespace Annotations {
|
|
|
8140
8299
|
* fast-check array constraints plus an optional comparator used when deriving
|
|
8141
8300
|
* unique-array arbitraries.
|
|
8142
8301
|
*
|
|
8302
|
+
* @category models
|
|
8143
8303
|
* @since 4.0.0
|
|
8144
8304
|
*/
|
|
8145
8305
|
interface ArrayConstraints extends FastCheck.ArrayConstraints {
|
|
@@ -8149,6 +8309,7 @@ export declare namespace Annotations {
|
|
|
8149
8309
|
* fast-check date constraints used when deriving arbitraries for `Date` and
|
|
8150
8310
|
* DateTime schemas.
|
|
8151
8311
|
*
|
|
8312
|
+
* @category models
|
|
8152
8313
|
* @since 4.0.0
|
|
8153
8314
|
*/
|
|
8154
8315
|
interface DateConstraints extends FastCheck.DateConstraints {
|
|
@@ -8157,6 +8318,7 @@ export declare namespace Annotations {
|
|
|
8157
8318
|
* Grouped arbitrary-generation constraints accumulated from schema checks and
|
|
8158
8319
|
* passed to `toArbitrary` derivation.
|
|
8159
8320
|
*
|
|
8321
|
+
* @category models
|
|
8160
8322
|
* @since 4.0.0
|
|
8161
8323
|
*/
|
|
8162
8324
|
interface Constraint {
|
|
@@ -8171,7 +8333,8 @@ export declare namespace Annotations {
|
|
|
8171
8333
|
* constraints and an `isSuspend` flag used to limit recursion for suspended
|
|
8172
8334
|
* schemas.
|
|
8173
8335
|
*
|
|
8174
|
-
* @
|
|
8336
|
+
* @category models
|
|
8337
|
+
* @since 3.10.0
|
|
8175
8338
|
*/
|
|
8176
8339
|
interface Context {
|
|
8177
8340
|
/**
|
|
@@ -8188,6 +8351,7 @@ export declare namespace Annotations {
|
|
|
8188
8351
|
* Given arbitraries for any type parameters, returns a function that receives the
|
|
8189
8352
|
* fast-check module and derivation context and produces an arbitrary for `T`.
|
|
8190
8353
|
*
|
|
8354
|
+
* @category models
|
|
8191
8355
|
* @since 4.0.0
|
|
8192
8356
|
*/
|
|
8193
8357
|
interface Declaration<T, TypeParameters extends ReadonlyArray<Top>> {
|
|
@@ -8208,6 +8372,7 @@ export declare namespace Annotations {
|
|
|
8208
8372
|
*
|
|
8209
8373
|
* Given formatters for any type parameters, returns a formatter for `T`.
|
|
8210
8374
|
*
|
|
8375
|
+
* @category models
|
|
8211
8376
|
* @since 4.0.0
|
|
8212
8377
|
*/
|
|
8213
8378
|
interface Declaration<T, TypeParameters extends ReadonlyArray<Top>> {
|
|
@@ -8228,6 +8393,7 @@ export declare namespace Annotations {
|
|
|
8228
8393
|
*
|
|
8229
8394
|
* Given equivalences for any type parameters, returns an `Equivalence` for `T`.
|
|
8230
8395
|
*
|
|
8396
|
+
* @category models
|
|
8231
8397
|
* @since 4.0.0
|
|
8232
8398
|
*/
|
|
8233
8399
|
interface Declaration<T, TypeParameters extends ReadonlyArray<Top>> {
|
|
@@ -8241,7 +8407,7 @@ export declare namespace Annotations {
|
|
|
8241
8407
|
*
|
|
8242
8408
|
* The optional `message` field overrides the default issue message.
|
|
8243
8409
|
*
|
|
8244
|
-
* @category
|
|
8410
|
+
* @category models
|
|
8245
8411
|
* @since 4.0.0
|
|
8246
8412
|
*/
|
|
8247
8413
|
interface Issue extends Annotations {
|
|
@@ -8253,6 +8419,7 @@ export declare namespace Annotations {
|
|
|
8253
8419
|
* Do not augment this interface with custom metadata; extend `MetaDefinitions`
|
|
8254
8420
|
* instead.
|
|
8255
8421
|
*
|
|
8422
|
+
* @category models
|
|
8256
8423
|
* @since 4.0.0
|
|
8257
8424
|
*/
|
|
8258
8425
|
interface BuiltInMetaDefinitions {
|
|
@@ -8456,6 +8623,7 @@ export declare namespace Annotations {
|
|
|
8456
8623
|
/**
|
|
8457
8624
|
* Union of all metadata payloads defined by `BuiltInMetaDefinitions`.
|
|
8458
8625
|
*
|
|
8626
|
+
* @category utility types
|
|
8459
8627
|
* @since 4.0.0
|
|
8460
8628
|
*/
|
|
8461
8629
|
type BuiltInMeta = BuiltInMetaDefinitions[keyof BuiltInMetaDefinitions];
|
|
@@ -8465,6 +8633,7 @@ export declare namespace Annotations {
|
|
|
8465
8633
|
* Extend this interface to add custom values accepted by annotation `meta`
|
|
8466
8634
|
* fields.
|
|
8467
8635
|
*
|
|
8636
|
+
* @category models
|
|
8468
8637
|
* @since 4.0.0
|
|
8469
8638
|
*/
|
|
8470
8639
|
interface MetaDefinitions extends BuiltInMetaDefinitions {
|
|
@@ -8472,6 +8641,7 @@ export declare namespace Annotations {
|
|
|
8472
8641
|
/**
|
|
8473
8642
|
* Union of built-in and user-augmented schema filter metadata payloads.
|
|
8474
8643
|
*
|
|
8644
|
+
* @category utility types
|
|
8475
8645
|
* @since 4.0.0
|
|
8476
8646
|
*/
|
|
8477
8647
|
type Meta = MetaDefinitions[keyof MetaDefinitions];
|