effect 4.0.1 → 4.0.3
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/ai-docs/package.json +2 -2
- package/ai-docs/tsconfig.json +2 -1
- package/dist/Array.d.ts +339 -0
- package/dist/Array.d.ts.map +1 -1
- package/dist/Array.js +143 -3
- package/dist/Array.js.map +1 -1
- package/dist/BigDecimal.d.ts +88 -0
- package/dist/BigDecimal.d.ts.map +1 -1
- package/dist/BigDecimal.js +44 -0
- package/dist/BigDecimal.js.map +1 -1
- package/dist/BigInt.d.ts +68 -0
- package/dist/BigInt.d.ts.map +1 -1
- package/dist/BigInt.js +36 -0
- package/dist/BigInt.js.map +1 -1
- package/dist/Boolean.d.ts +34 -0
- package/dist/Boolean.d.ts.map +1 -1
- package/dist/Boolean.js +18 -0
- package/dist/Boolean.js.map +1 -1
- package/dist/Brand.d.ts +9 -0
- package/dist/Brand.d.ts.map +1 -1
- package/dist/Brand.js +6 -0
- package/dist/Brand.js.map +1 -1
- package/dist/ByteSize.d.ts +86 -0
- package/dist/ByteSize.d.ts.map +1 -1
- package/dist/ByteSize.js +51 -0
- package/dist/ByteSize.js.map +1 -1
- package/dist/Cache.d.ts +38 -1
- package/dist/Cache.d.ts.map +1 -1
- package/dist/Cache.js +27 -7
- package/dist/Cache.js.map +1 -1
- package/dist/Cause.d.ts +82 -0
- package/dist/Cause.d.ts.map +1 -1
- package/dist/Cause.js +60 -0
- package/dist/Cause.js.map +1 -1
- package/dist/Channel.d.ts +327 -4
- package/dist/Channel.d.ts.map +1 -1
- package/dist/Channel.js +168 -8
- package/dist/Channel.js.map +1 -1
- package/dist/ChannelSchema.d.ts +11 -0
- package/dist/ChannelSchema.d.ts.map +1 -1
- package/dist/ChannelSchema.js +6 -0
- package/dist/ChannelSchema.js.map +1 -1
- package/dist/Chunk.d.ts +192 -0
- package/dist/Chunk.d.ts.map +1 -1
- package/dist/Chunk.js +78 -0
- package/dist/Chunk.js.map +1 -1
- package/dist/Clock.d.ts +7 -0
- package/dist/Clock.d.ts.map +1 -1
- package/dist/Clock.js +5 -0
- package/dist/Clock.js.map +1 -1
- package/dist/Combiner.d.ts +10 -0
- 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 +52 -12
- package/dist/Config.d.ts.map +1 -1
- package/dist/Config.js +55 -5
- package/dist/Config.js.map +1 -1
- package/dist/ConfigProvider.d.ts +28 -0
- package/dist/ConfigProvider.d.ts.map +1 -1
- package/dist/ConfigProvider.js +19 -0
- package/dist/ConfigProvider.js.map +1 -1
- package/dist/Console.d.ts +22 -0
- package/dist/Console.d.ts.map +1 -1
- package/dist/Console.js +20 -0
- package/dist/Console.js.map +1 -1
- package/dist/Context.d.ts +50 -0
- package/dist/Context.d.ts.map +1 -1
- package/dist/Context.js +24 -3
- package/dist/Context.js.map +1 -1
- package/dist/Cron.d.ts +16 -0
- package/dist/Cron.d.ts.map +1 -1
- package/dist/Cron.js +26 -1
- package/dist/Cron.js.map +1 -1
- package/dist/Crypto.d.ts +38 -5
- package/dist/Crypto.d.ts.map +1 -1
- package/dist/Crypto.js +11 -2
- package/dist/Crypto.js.map +1 -1
- package/dist/Data.d.ts +13 -0
- package/dist/Data.d.ts.map +1 -1
- package/dist/Data.js +5 -0
- package/dist/Data.js.map +1 -1
- package/dist/DateTime.d.ts +180 -6
- package/dist/DateTime.d.ts.map +1 -1
- package/dist/DateTime.js +98 -6
- package/dist/DateTime.js.map +1 -1
- package/dist/Deferred.d.ts +51 -0
- package/dist/Deferred.d.ts.map +1 -1
- package/dist/Deferred.js +22 -0
- package/dist/Deferred.js.map +1 -1
- package/dist/Differ.d.ts +2 -0
- package/dist/Differ.d.ts.map +1 -1
- package/dist/Differ.js +1 -0
- package/dist/Duration.d.ts +96 -6
- package/dist/Duration.d.ts.map +1 -1
- package/dist/Duration.js +80 -8
- package/dist/Duration.js.map +1 -1
- package/dist/Effect.d.ts +527 -0
- package/dist/Effect.d.ts.map +1 -1
- package/dist/Effect.js +240 -5
- package/dist/Effect.js.map +1 -1
- package/dist/Effectable.d.ts +4 -0
- package/dist/Effectable.d.ts.map +1 -1
- package/dist/Effectable.js +3 -0
- package/dist/Effectable.js.map +1 -1
- package/dist/Equal.d.ts +8 -0
- package/dist/Equal.d.ts.map +1 -1
- package/dist/Equal.js +9 -1
- package/dist/Equal.js.map +1 -1
- package/dist/Equivalence.d.ts +21 -0
- package/dist/Equivalence.d.ts.map +1 -1
- package/dist/Equivalence.js +16 -0
- package/dist/Equivalence.js.map +1 -1
- package/dist/ErrorReporter.d.ts +36 -0
- package/dist/ErrorReporter.d.ts.map +1 -1
- package/dist/ErrorReporter.js +11 -0
- package/dist/ErrorReporter.js.map +1 -1
- package/dist/ExecutionPlan.d.ts +49 -8
- package/dist/ExecutionPlan.d.ts.map +1 -1
- package/dist/ExecutionPlan.js +7 -0
- package/dist/ExecutionPlan.js.map +1 -1
- package/dist/Exit.d.ts +40 -0
- package/dist/Exit.d.ts.map +1 -1
- package/dist/Exit.js +27 -0
- package/dist/Exit.js.map +1 -1
- package/dist/Fiber.d.ts +20 -0
- package/dist/Fiber.d.ts.map +1 -1
- package/dist/Fiber.js +11 -0
- package/dist/Fiber.js.map +1 -1
- package/dist/FiberHandle.d.ts +21 -0
- package/dist/FiberHandle.d.ts.map +1 -1
- package/dist/FiberHandle.js +21 -4
- package/dist/FiberHandle.js.map +1 -1
- package/dist/FiberMap.d.ts +35 -0
- package/dist/FiberMap.d.ts.map +1 -1
- package/dist/FiberMap.js +19 -0
- package/dist/FiberMap.js.map +1 -1
- package/dist/FiberSet.d.ts +20 -0
- package/dist/FiberSet.d.ts.map +1 -1
- package/dist/FiberSet.js +14 -0
- package/dist/FiberSet.js.map +1 -1
- package/dist/FileSystem.d.ts +59 -2
- package/dist/FileSystem.d.ts.map +1 -1
- package/dist/FileSystem.js +8 -0
- package/dist/FileSystem.js.map +1 -1
- package/dist/Filter.d.ts +55 -0
- package/dist/Filter.d.ts.map +1 -1
- package/dist/Filter.js +28 -0
- package/dist/Filter.js.map +1 -1
- package/dist/Formatter.d.ts +3 -0
- package/dist/Formatter.d.ts.map +1 -1
- package/dist/Formatter.js +39 -1
- package/dist/Formatter.js.map +1 -1
- package/dist/Function.d.ts +30 -0
- package/dist/Function.d.ts.map +1 -1
- package/dist/Function.js +20 -0
- package/dist/Function.js.map +1 -1
- package/dist/Graph.d.ts +247 -12
- package/dist/Graph.d.ts.map +1 -1
- package/dist/Graph.js +149 -28
- package/dist/Graph.js.map +1 -1
- package/dist/HKT.d.ts +5 -0
- package/dist/HKT.d.ts.map +1 -1
- package/dist/Hash.d.ts +14 -0
- package/dist/Hash.d.ts.map +1 -1
- package/dist/Hash.js +12 -0
- package/dist/Hash.js.map +1 -1
- package/dist/HashMap.d.ts +91 -0
- package/dist/HashMap.d.ts.map +1 -1
- package/dist/HashMap.js +39 -0
- package/dist/HashMap.js.map +1 -1
- package/dist/HashRing.d.ts +17 -0
- package/dist/HashRing.d.ts.map +1 -1
- package/dist/HashRing.js +9 -0
- package/dist/HashRing.js.map +1 -1
- package/dist/HashSet.d.ts +49 -0
- package/dist/HashSet.d.ts.map +1 -1
- package/dist/HashSet.js +19 -0
- package/dist/HashSet.js.map +1 -1
- package/dist/Inspectable.d.ts +7 -0
- package/dist/Inspectable.d.ts.map +1 -1
- package/dist/Inspectable.js +6 -0
- package/dist/Inspectable.js.map +1 -1
- package/dist/Iterable.d.ts +127 -0
- package/dist/Iterable.d.ts.map +1 -1
- package/dist/Iterable.js +51 -0
- package/dist/Iterable.js.map +1 -1
- package/dist/JsonPatch.d.ts +4 -0
- package/dist/JsonPatch.d.ts.map +1 -1
- package/dist/JsonPatch.js +3 -0
- package/dist/JsonPatch.js.map +1 -1
- package/dist/JsonPointer.d.ts +5 -0
- package/dist/JsonPointer.d.ts.map +1 -1
- package/dist/JsonPointer.js +5 -0
- 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 +11 -0
- package/dist/JsonSchema.js.map +1 -1
- package/dist/Latch.d.ts +14 -0
- package/dist/Latch.d.ts.map +1 -1
- package/dist/Latch.js +10 -0
- package/dist/Latch.js.map +1 -1
- package/dist/Layer.d.ts +100 -0
- package/dist/Layer.d.ts.map +1 -1
- package/dist/Layer.js +45 -1
- package/dist/Layer.js.map +1 -1
- package/dist/LayerMap.d.ts +7 -0
- package/dist/LayerMap.d.ts.map +1 -1
- package/dist/LayerMap.js +4 -0
- package/dist/LayerMap.js.map +1 -1
- package/dist/LayerRef.d.ts +5 -0
- package/dist/LayerRef.d.ts.map +1 -1
- package/dist/LayerRef.js +3 -0
- package/dist/LayerRef.js.map +1 -1
- package/dist/LogLevel.d.ts +20 -0
- package/dist/LogLevel.d.ts.map +1 -1
- package/dist/LogLevel.js +9 -0
- package/dist/LogLevel.js.map +1 -1
- package/dist/Logger.d.ts +25 -0
- package/dist/Logger.d.ts.map +1 -1
- package/dist/Logger.js +30 -4
- package/dist/Logger.js.map +1 -1
- package/dist/ManagedRuntime.d.ts +5 -0
- package/dist/ManagedRuntime.d.ts.map +1 -1
- package/dist/ManagedRuntime.js +9 -1
- package/dist/ManagedRuntime.js.map +1 -1
- package/dist/Match.d.ts +51 -0
- package/dist/Match.d.ts.map +1 -1
- package/dist/Match.js +39 -0
- package/dist/Match.js.map +1 -1
- package/dist/Metric.d.ts +59 -0
- package/dist/Metric.d.ts.map +1 -1
- package/dist/Metric.js +31 -0
- package/dist/Metric.js.map +1 -1
- package/dist/MutableHashMap.d.ts +32 -0
- package/dist/MutableHashMap.d.ts.map +1 -1
- package/dist/MutableHashMap.js +16 -0
- package/dist/MutableHashMap.js.map +1 -1
- package/dist/MutableHashSet.d.ts +16 -0
- package/dist/MutableHashSet.d.ts.map +1 -1
- package/dist/MutableHashSet.js +10 -0
- package/dist/MutableHashSet.js.map +1 -1
- package/dist/MutableList.d.ts +20 -0
- package/dist/MutableList.d.ts.map +1 -1
- package/dist/MutableList.js +18 -0
- package/dist/MutableList.js.map +1 -1
- package/dist/MutableRef.d.ts +31 -0
- package/dist/MutableRef.d.ts.map +1 -1
- package/dist/MutableRef.js +17 -0
- package/dist/MutableRef.js.map +1 -1
- package/dist/Newtype.d.ts +9 -0
- package/dist/Newtype.d.ts.map +1 -1
- package/dist/Newtype.js +6 -0
- package/dist/Newtype.js.map +1 -1
- package/dist/NonEmptyIterable.d.ts +4 -0
- package/dist/NonEmptyIterable.d.ts.map +1 -1
- package/dist/NonEmptyIterable.js +2 -0
- package/dist/NonEmptyIterable.js.map +1 -1
- package/dist/Number.d.ts +61 -0
- package/dist/Number.d.ts.map +1 -1
- package/dist/Number.js +31 -0
- package/dist/Number.js.map +1 -1
- package/dist/Optic.d.ts +41 -0
- package/dist/Optic.d.ts.map +1 -1
- package/dist/Optic.js +20 -0
- package/dist/Optic.js.map +1 -1
- package/dist/Option.d.ts +134 -0
- package/dist/Option.d.ts.map +1 -1
- package/dist/Option.js +61 -0
- package/dist/Option.js.map +1 -1
- package/dist/Order.d.ts +29 -0
- package/dist/Order.d.ts.map +1 -1
- package/dist/Order.js +24 -0
- package/dist/Order.js.map +1 -1
- package/dist/Ordering.d.ts +7 -0
- package/dist/Ordering.d.ts.map +1 -1
- package/dist/Ordering.js +3 -0
- package/dist/Ordering.js.map +1 -1
- package/dist/PartitionedSemaphore.d.ts +24 -0
- package/dist/PartitionedSemaphore.d.ts.map +1 -1
- package/dist/PartitionedSemaphore.js +47 -21
- package/dist/PartitionedSemaphore.js.map +1 -1
- package/dist/Path.d.ts +6 -0
- package/dist/Path.d.ts.map +1 -1
- package/dist/Path.js +4 -0
- package/dist/Path.js.map +1 -1
- package/dist/Pipeable.d.ts +7 -0
- package/dist/Pipeable.d.ts.map +1 -1
- package/dist/Pipeable.js +5 -0
- package/dist/Pipeable.js.map +1 -1
- package/dist/PlatformError.d.ts +8 -0
- package/dist/PlatformError.d.ts.map +1 -1
- package/dist/PlatformError.js +7 -0
- package/dist/PlatformError.js.map +1 -1
- package/dist/Pool.d.ts +19 -0
- package/dist/Pool.d.ts.map +1 -1
- package/dist/Pool.js +8 -1
- package/dist/Pool.js.map +1 -1
- package/dist/Predicate.d.ts +84 -0
- package/dist/Predicate.d.ts.map +1 -1
- package/dist/Predicate.js +48 -0
- package/dist/Predicate.js.map +1 -1
- package/dist/PrimaryKey.d.ts +5 -0
- package/dist/PrimaryKey.d.ts.map +1 -1
- package/dist/PrimaryKey.js +4 -0
- package/dist/PrimaryKey.js.map +1 -1
- package/dist/PubSub.d.ts +67 -5
- package/dist/PubSub.d.ts.map +1 -1
- package/dist/PubSub.js +60 -8
- package/dist/PubSub.js.map +1 -1
- package/dist/Pull.d.ts +20 -0
- package/dist/Pull.d.ts.map +1 -1
- package/dist/Pull.js +10 -0
- package/dist/Pull.js.map +1 -1
- package/dist/Queue.d.ts +60 -0
- package/dist/Queue.d.ts.map +1 -1
- package/dist/Queue.js +58 -8
- package/dist/Queue.js.map +1 -1
- package/dist/Random.d.ts +13 -0
- package/dist/Random.d.ts.map +1 -1
- package/dist/Random.js +9 -0
- package/dist/Random.js.map +1 -1
- package/dist/RcMap.d.ts +23 -0
- package/dist/RcMap.d.ts.map +1 -1
- package/dist/RcMap.js +8 -0
- package/dist/RcMap.js.map +1 -1
- package/dist/RcRef.d.ts +6 -0
- package/dist/RcRef.d.ts.map +1 -1
- package/dist/RcRef.js +3 -0
- package/dist/RcRef.js.map +1 -1
- package/dist/Record.d.ts +100 -0
- package/dist/Record.d.ts.map +1 -1
- package/dist/Record.js +43 -0
- package/dist/Record.js.map +1 -1
- package/dist/Redactable.d.ts +6 -0
- package/dist/Redactable.d.ts.map +1 -1
- package/dist/Redactable.js +4 -0
- package/dist/Redactable.js.map +1 -1
- package/dist/Redacted.d.ts +8 -0
- package/dist/Redacted.d.ts.map +1 -1
- package/dist/Redacted.js +6 -0
- package/dist/Redacted.js.map +1 -1
- package/dist/Reducer.d.ts +4 -0
- package/dist/Reducer.d.ts.map +1 -1
- package/dist/Reducer.js +3 -0
- package/dist/Reducer.js.map +1 -1
- package/dist/Ref.d.ts +20 -0
- package/dist/Ref.d.ts.map +1 -1
- package/dist/Ref.js +16 -0
- package/dist/Ref.js.map +1 -1
- package/dist/References.d.ts +21 -0
- package/dist/References.d.ts.map +1 -1
- package/dist/References.js +19 -0
- package/dist/References.js.map +1 -1
- package/dist/RegExp.d.ts +3 -0
- package/dist/RegExp.d.ts.map +1 -1
- package/dist/RegExp.js +4 -0
- package/dist/RegExp.js.map +1 -1
- package/dist/Request.d.ts +32 -0
- package/dist/Request.d.ts.map +1 -1
- package/dist/Request.js +12 -0
- package/dist/Request.js.map +1 -1
- package/dist/RequestResolver.d.ts +42 -0
- package/dist/RequestResolver.d.ts.map +1 -1
- package/dist/RequestResolver.js +27 -6
- package/dist/RequestResolver.js.map +1 -1
- package/dist/Resource.d.ts +6 -0
- package/dist/Resource.d.ts.map +1 -1
- package/dist/Resource.js +6 -0
- package/dist/Resource.js.map +1 -1
- package/dist/Result.d.ts +91 -0
- package/dist/Result.d.ts.map +1 -1
- package/dist/Result.js +41 -0
- package/dist/Result.js.map +1 -1
- package/dist/Runtime.d.ts +9 -0
- package/dist/Runtime.d.ts.map +1 -1
- package/dist/Runtime.js +7 -0
- package/dist/Runtime.js.map +1 -1
- package/dist/Schedule.d.ts +57 -0
- package/dist/Schedule.d.ts.map +1 -1
- package/dist/Schedule.js +32 -0
- package/dist/Schedule.js.map +1 -1
- package/dist/Scheduler.d.ts +7 -0
- package/dist/Scheduler.d.ts.map +1 -1
- package/dist/Scheduler.js +5 -0
- package/dist/Scheduler.js.map +1 -1
- package/dist/Schema.d.ts +969 -2
- package/dist/Schema.d.ts.map +1 -1
- package/dist/Schema.js +635 -5
- package/dist/Schema.js.map +1 -1
- package/dist/SchemaAST.d.ts +107 -0
- package/dist/SchemaAST.d.ts.map +1 -1
- package/dist/SchemaAST.js +81 -1
- package/dist/SchemaAST.js.map +1 -1
- package/dist/SchemaGetter.d.ts +69 -2
- package/dist/SchemaGetter.d.ts.map +1 -1
- package/dist/SchemaGetter.js +63 -4
- package/dist/SchemaGetter.js.map +1 -1
- package/dist/SchemaIssue.d.ts +33 -0
- package/dist/SchemaIssue.d.ts.map +1 -1
- package/dist/SchemaIssue.js +18 -0
- package/dist/SchemaIssue.js.map +1 -1
- package/dist/SchemaParser.d.ts +25 -0
- package/dist/SchemaParser.d.ts.map +1 -1
- package/dist/SchemaParser.js +26 -0
- package/dist/SchemaParser.js.map +1 -1
- package/dist/SchemaRepresentation.d.ts +147 -0
- package/dist/SchemaRepresentation.d.ts.map +1 -1
- package/dist/SchemaRepresentation.js +99 -0
- package/dist/SchemaRepresentation.js.map +1 -1
- package/dist/SchemaTransformation.d.ts +53 -0
- package/dist/SchemaTransformation.d.ts.map +1 -1
- package/dist/SchemaTransformation.js +46 -0
- package/dist/SchemaTransformation.js.map +1 -1
- package/dist/Scope.d.ts +19 -0
- package/dist/Scope.d.ts.map +1 -1
- package/dist/Scope.js +12 -0
- package/dist/Scope.js.map +1 -1
- package/dist/ScopedCache.d.ts +34 -0
- package/dist/ScopedCache.d.ts.map +1 -1
- package/dist/ScopedCache.js +26 -3
- package/dist/ScopedCache.js.map +1 -1
- package/dist/ScopedRef.d.ts +9 -0
- package/dist/ScopedRef.d.ts.map +1 -1
- package/dist/ScopedRef.js +6 -0
- package/dist/ScopedRef.js.map +1 -1
- package/dist/Semaphore.d.ts +26 -0
- package/dist/Semaphore.d.ts.map +1 -1
- package/dist/Semaphore.js +10 -0
- package/dist/Semaphore.js.map +1 -1
- package/dist/Sink.d.ts +125 -1
- package/dist/Sink.d.ts.map +1 -1
- package/dist/Sink.js +75 -1
- package/dist/Sink.js.map +1 -1
- package/dist/StandardSchema.d.ts +1 -0
- package/dist/StandardSchema.d.ts.map +1 -1
- package/dist/StandardSchema.js +1 -0
- package/dist/Stdio.d.ts +14 -1
- package/dist/Stdio.d.ts.map +1 -1
- package/dist/Stdio.js +6 -0
- package/dist/Stdio.js.map +1 -1
- package/dist/Stream.d.ts +569 -11
- package/dist/Stream.d.ts.map +1 -1
- package/dist/Stream.js +266 -18
- package/dist/Stream.js.map +1 -1
- package/dist/String.d.ts +87 -0
- package/dist/String.d.ts.map +1 -1
- package/dist/String.js +61 -0
- package/dist/String.js.map +1 -1
- package/dist/Struct.d.ts +46 -0
- package/dist/Struct.d.ts.map +1 -1
- package/dist/Struct.js +19 -0
- package/dist/Struct.js.map +1 -1
- package/dist/SubscriptionRef.d.ts +65 -0
- package/dist/SubscriptionRef.d.ts.map +1 -1
- package/dist/SubscriptionRef.js +25 -0
- package/dist/SubscriptionRef.js.map +1 -1
- package/dist/Symbol.d.ts +2 -0
- package/dist/Symbol.d.ts.map +1 -1
- package/dist/Symbol.js +2 -0
- package/dist/Symbol.js.map +1 -1
- package/dist/SynchronizedRef.d.ts +63 -0
- package/dist/SynchronizedRef.d.ts.map +1 -1
- package/dist/SynchronizedRef.js +24 -0
- package/dist/SynchronizedRef.js.map +1 -1
- package/dist/Take.d.ts +3 -0
- package/dist/Take.d.ts.map +1 -1
- package/dist/Take.js +1 -0
- package/dist/Take.js.map +1 -1
- package/dist/Terminal.d.ts +8 -0
- package/dist/Terminal.d.ts.map +1 -1
- package/dist/Terminal.js +4 -0
- package/dist/Terminal.js.map +1 -1
- package/dist/Tracer.d.ts +23 -0
- package/dist/Tracer.d.ts.map +1 -1
- package/dist/Tracer.js +12 -0
- package/dist/Tracer.js.map +1 -1
- package/dist/Trie.d.ts +68 -0
- package/dist/Trie.d.ts.map +1 -1
- package/dist/Trie.js +28 -0
- package/dist/Trie.js.map +1 -1
- package/dist/Tuple.d.ts +38 -0
- package/dist/Tuple.d.ts.map +1 -1
- package/dist/Tuple.js +18 -0
- package/dist/Tuple.js.map +1 -1
- package/dist/TxChunk.d.ts +52 -0
- package/dist/TxChunk.d.ts.map +1 -1
- package/dist/TxChunk.js +23 -0
- package/dist/TxChunk.js.map +1 -1
- package/dist/TxDeferred.d.ts +15 -0
- package/dist/TxDeferred.d.ts.map +1 -1
- package/dist/TxDeferred.js +8 -0
- package/dist/TxDeferred.js.map +1 -1
- package/dist/TxHashMap.d.ts +83 -0
- package/dist/TxHashMap.d.ts.map +1 -1
- package/dist/TxHashMap.js +52 -7
- package/dist/TxHashMap.js.map +1 -1
- package/dist/TxHashSet.d.ts +51 -0
- package/dist/TxHashSet.d.ts.map +1 -1
- package/dist/TxHashSet.js +29 -4
- package/dist/TxHashSet.js.map +1 -1
- package/dist/TxPriorityQueue.d.ts +30 -0
- package/dist/TxPriorityQueue.d.ts.map +1 -1
- package/dist/TxPriorityQueue.js +22 -1
- package/dist/TxPriorityQueue.js.map +1 -1
- package/dist/TxPubSub.d.ts +25 -0
- package/dist/TxPubSub.d.ts.map +1 -1
- package/dist/TxPubSub.js +19 -0
- package/dist/TxPubSub.js.map +1 -1
- package/dist/TxQueue.d.ts +51 -0
- package/dist/TxQueue.d.ts.map +1 -1
- package/dist/TxQueue.js +30 -0
- package/dist/TxQueue.js.map +1 -1
- package/dist/TxReentrantLock.d.ts +24 -0
- package/dist/TxReentrantLock.d.ts.map +1 -1
- package/dist/TxReentrantLock.js +32 -18
- package/dist/TxReentrantLock.js.map +1 -1
- package/dist/TxRef.d.ts +14 -0
- package/dist/TxRef.d.ts.map +1 -1
- package/dist/TxRef.js +7 -0
- package/dist/TxRef.js.map +1 -1
- package/dist/TxSemaphore.d.ts +25 -0
- package/dist/TxSemaphore.d.ts.map +1 -1
- package/dist/TxSemaphore.js +29 -13
- package/dist/TxSemaphore.js.map +1 -1
- package/dist/TxSubscriptionRef.d.ts +25 -0
- package/dist/TxSubscriptionRef.d.ts.map +1 -1
- package/dist/TxSubscriptionRef.js +12 -0
- package/dist/TxSubscriptionRef.js.map +1 -1
- package/dist/Types.d.ts +36 -0
- package/dist/Types.d.ts.map +1 -1
- package/dist/Types.js +1 -0
- package/dist/UndefinedOr.d.ts +15 -0
- package/dist/UndefinedOr.d.ts.map +1 -1
- package/dist/UndefinedOr.js +9 -0
- package/dist/UndefinedOr.js.map +1 -1
- package/dist/Unify.d.ts +15 -0
- package/dist/Unify.d.ts.map +1 -1
- package/dist/Unify.js +2 -0
- package/dist/Unify.js.map +1 -1
- package/dist/Utils.d.ts +4 -0
- package/dist/Utils.d.ts.map +1 -1
- package/dist/Utils.js +1 -0
- package/dist/Utils.js.map +1 -1
- package/dist/Version.d.ts +26 -0
- package/dist/Version.d.ts.map +1 -0
- package/dist/Version.js +36 -0
- package/dist/Version.js.map +1 -0
- package/dist/ai/Chat.js +1 -1
- package/dist/ai/Chat.js.map +1 -1
- package/dist/ai/DecisionModel.d.ts +22 -0
- package/dist/ai/DecisionModel.d.ts.map +1 -1
- package/dist/ai/DecisionModel.js +22 -4
- package/dist/ai/DecisionModel.js.map +1 -1
- package/dist/ai/LanguageModel.d.ts.map +1 -1
- package/dist/ai/LanguageModel.js +14 -13
- package/dist/ai/LanguageModel.js.map +1 -1
- package/dist/ai/McpServer.d.ts +38 -11
- package/dist/ai/McpServer.d.ts.map +1 -1
- package/dist/ai/McpServer.js +276 -190
- package/dist/ai/McpServer.js.map +1 -1
- package/dist/ai/Telemetry.d.ts +49 -41
- package/dist/ai/Telemetry.d.ts.map +1 -1
- package/dist/ai/Telemetry.js +6 -8
- package/dist/ai/Telemetry.js.map +1 -1
- package/dist/ai/internal/mcpProtocol/v2026_07_28.js +5 -0
- package/dist/ai/internal/mcpProtocol/v2026_07_28.js.map +1 -1
- package/dist/ai/internal/mcpProtocol.js.map +1 -1
- package/dist/ai/internal/mcpRuntime.js +80 -46
- package/dist/ai/internal/mcpRuntime.js.map +1 -1
- package/dist/ai/internal/mcpStatefulRuntime.js +1 -0
- package/dist/ai/internal/mcpStatefulRuntime.js.map +1 -1
- package/dist/cli/CliOutput.d.ts +27 -0
- package/dist/cli/CliOutput.d.ts.map +1 -1
- package/dist/cli/CliOutput.js +33 -10
- package/dist/cli/CliOutput.js.map +1 -1
- package/dist/cli/Command.d.ts.map +1 -1
- package/dist/cli/Command.js +6 -3
- package/dist/cli/Command.js.map +1 -1
- package/dist/cli/Completions.d.ts +3 -3
- package/dist/cli/Completions.d.ts.map +1 -1
- package/dist/cli/Completions.js +8 -5
- package/dist/cli/Completions.js.map +1 -1
- package/dist/cli/GlobalFlag.d.ts +5 -4
- package/dist/cli/GlobalFlag.d.ts.map +1 -1
- package/dist/cli/GlobalFlag.js +3 -3
- package/dist/cli/GlobalFlag.js.map +1 -1
- package/dist/cli/Prompt.d.ts +17 -1
- package/dist/cli/Prompt.d.ts.map +1 -1
- package/dist/cli/Prompt.js +119 -114
- package/dist/cli/Prompt.js.map +1 -1
- package/dist/cli/internal/ansi.d.ts +0 -1
- package/dist/cli/internal/ansi.d.ts.map +1 -1
- package/dist/cli/internal/ansi.js +20 -3
- package/dist/cli/internal/ansi.js.map +1 -1
- package/dist/cli/internal/completions/powershell.d.ts +2 -0
- package/dist/cli/internal/completions/powershell.d.ts.map +1 -0
- package/dist/cli/internal/completions/powershell.js +273 -0
- package/dist/cli/internal/completions/powershell.js.map +1 -0
- package/dist/cli/internal/completions/zsh.js +3 -2
- package/dist/cli/internal/completions/zsh.js.map +1 -1
- package/dist/cli/internal/wizard.d.ts +3 -3
- package/dist/cli/internal/wizard.d.ts.map +1 -1
- package/dist/cli/internal/wizard.js +21 -18
- package/dist/cli/internal/wizard.js.map +1 -1
- package/dist/cluster/ClusterSchema.d.ts +28 -0
- package/dist/cluster/ClusterSchema.d.ts.map +1 -1
- package/dist/cluster/ClusterSchema.js +30 -0
- package/dist/cluster/ClusterSchema.js.map +1 -1
- package/dist/cluster/ClusterWorkflowEngine.d.ts.map +1 -1
- package/dist/cluster/ClusterWorkflowEngine.js +10 -18
- package/dist/cluster/ClusterWorkflowEngine.js.map +1 -1
- package/dist/cluster/K8sHttpClient.d.ts.map +1 -1
- package/dist/cluster/K8sHttpClient.js +5 -2
- package/dist/cluster/K8sHttpClient.js.map +1 -1
- package/dist/cluster/MessageStorage.d.ts +18 -3
- package/dist/cluster/MessageStorage.d.ts.map +1 -1
- package/dist/cluster/MessageStorage.js +31 -11
- package/dist/cluster/MessageStorage.js.map +1 -1
- package/dist/cluster/Runners.d.ts.map +1 -1
- package/dist/cluster/Runners.js +8 -2
- package/dist/cluster/Runners.js.map +1 -1
- package/dist/cluster/Sharding.d.ts.map +1 -1
- package/dist/cluster/Sharding.js +181 -62
- package/dist/cluster/Sharding.js.map +1 -1
- package/dist/cluster/SqlMessageStorage.d.ts +59 -19
- package/dist/cluster/SqlMessageStorage.d.ts.map +1 -1
- package/dist/cluster/SqlMessageStorage.js +84 -55
- package/dist/cluster/SqlMessageStorage.js.map +1 -1
- package/dist/cluster/SqlRunnerStorage.d.ts +68 -19
- package/dist/cluster/SqlRunnerStorage.d.ts.map +1 -1
- package/dist/cluster/SqlRunnerStorage.js +191 -113
- package/dist/cluster/SqlRunnerStorage.js.map +1 -1
- package/dist/cluster/internal/entityManager.js +104 -37
- package/dist/cluster/internal/entityManager.js.map +1 -1
- package/dist/encoding/Base64.d.ts +4 -0
- package/dist/encoding/Base64.d.ts.map +1 -1
- package/dist/encoding/Base64.js +4 -0
- package/dist/encoding/Base64.js.map +1 -1
- package/dist/encoding/Base64Url.d.ts +4 -0
- package/dist/encoding/Base64Url.d.ts.map +1 -1
- package/dist/encoding/Base64Url.js +4 -0
- package/dist/encoding/Base64Url.js.map +1 -1
- package/dist/encoding/EncodingError.d.ts +4 -0
- package/dist/encoding/EncodingError.d.ts.map +1 -1
- package/dist/encoding/EncodingError.js +4 -0
- package/dist/encoding/EncodingError.js.map +1 -1
- package/dist/encoding/Hex.d.ts +5 -0
- package/dist/encoding/Hex.d.ts.map +1 -1
- package/dist/encoding/Hex.js +5 -0
- package/dist/encoding/Hex.js.map +1 -1
- package/dist/encoding/Toml.js +2 -2
- package/dist/encoding/Toml.js.map +1 -1
- package/dist/encoding/Yaml.d.ts.map +1 -1
- package/dist/encoding/Yaml.js +6 -4
- package/dist/encoding/Yaml.js.map +1 -1
- package/dist/encoding/index.d.ts +4 -0
- package/dist/encoding/index.d.ts.map +1 -1
- package/dist/encoding/index.js +4 -0
- package/dist/encoding/index.js.map +1 -1
- package/dist/eventlog/SqlEventJournal.js +8 -4
- package/dist/eventlog/SqlEventJournal.js.map +1 -1
- package/dist/eventlog/SqlEventLogServerUnencrypted.d.ts +27 -10
- package/dist/eventlog/SqlEventLogServerUnencrypted.d.ts.map +1 -1
- package/dist/eventlog/SqlEventLogServerUnencrypted.js +49 -7
- package/dist/eventlog/SqlEventLogServerUnencrypted.js.map +1 -1
- package/dist/http/FindMyWay/internal/router.js +3 -6
- package/dist/http/FindMyWay/internal/router.js.map +1 -1
- package/dist/http/Headers.d.ts +3 -1
- package/dist/http/Headers.d.ts.map +1 -1
- package/dist/http/Headers.js +4 -2
- package/dist/http/Headers.js.map +1 -1
- package/dist/http/HttpClient.d.ts +15 -0
- package/dist/http/HttpClient.d.ts.map +1 -1
- package/dist/http/HttpClient.js +79 -23
- package/dist/http/HttpClient.js.map +1 -1
- package/dist/http/HttpClientResponse.js +3 -1
- package/dist/http/HttpClientResponse.js.map +1 -1
- package/dist/http/HttpEffect.d.ts +3 -0
- package/dist/http/HttpEffect.d.ts.map +1 -1
- package/dist/http/HttpEffect.js +5 -2
- package/dist/http/HttpEffect.js.map +1 -1
- package/dist/http/HttpMiddleware.d.ts +17 -0
- package/dist/http/HttpMiddleware.d.ts.map +1 -1
- package/dist/http/HttpMiddleware.js +56 -39
- package/dist/http/HttpMiddleware.js.map +1 -1
- package/dist/http/HttpServer.d.ts +1 -1
- package/dist/http/HttpServer.d.ts.map +1 -1
- package/dist/http/HttpTraceContext.d.ts.map +1 -1
- package/dist/http/HttpTraceContext.js +4 -2
- package/dist/http/HttpTraceContext.js.map +1 -1
- package/dist/http/internal/tracing.d.ts +2 -0
- package/dist/http/internal/tracing.d.ts.map +1 -0
- package/dist/http/internal/tracing.js +37 -0
- package/dist/http/internal/tracing.js.map +1 -0
- package/dist/http-api/HttpApiBuilder.js +2 -1
- package/dist/http-api/HttpApiBuilder.js.map +1 -1
- package/dist/http-api/HttpApiClient.d.ts +12 -3
- package/dist/http-api/HttpApiClient.d.ts.map +1 -1
- package/dist/http-api/HttpApiClient.js.map +1 -1
- package/dist/http-api/HttpApiError.d.ts +4 -3
- package/dist/http-api/HttpApiError.d.ts.map +1 -1
- package/dist/http-api/HttpApiError.js +7 -4
- package/dist/http-api/HttpApiError.js.map +1 -1
- package/dist/http-api/HttpApiSecurity.d.ts +8 -8
- package/dist/http-api/HttpApiSecurity.js +8 -8
- package/dist/index.d.ts +155 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +155 -0
- package/dist/index.js.map +1 -1
- package/dist/internal/arbitrary/array.js +3 -3
- package/dist/internal/arbitrary/array.js.map +1 -1
- package/dist/internal/arbitrary/model.js +26 -11
- package/dist/internal/arbitrary/model.js.map +1 -1
- package/dist/internal/arbitrary/runner.js +8 -8
- package/dist/internal/arbitrary/runner.js.map +1 -1
- package/dist/internal/arbitrary/schema.js +4 -5
- package/dist/internal/arbitrary/schema.js.map +1 -1
- package/dist/internal/effect.js +53 -46
- package/dist/internal/effect.js.map +1 -1
- package/dist/internal/schedule.js +7 -5
- package/dist/internal/schedule.js.map +1 -1
- package/dist/internal/schema/standardSchema.js +2 -2
- package/dist/internal/schema/standardSchema.js.map +1 -1
- package/dist/internal/version.d.ts +2 -0
- package/dist/internal/version.d.ts.map +1 -0
- package/dist/internal/version.js +3 -0
- package/dist/internal/version.js.map +1 -0
- package/dist/net/AddressResolver.d.ts +145 -0
- package/dist/net/AddressResolver.d.ts.map +1 -0
- package/dist/net/AddressResolver.js +114 -0
- package/dist/net/AddressResolver.js.map +1 -0
- package/dist/net/Dns.d.ts +596 -0
- package/dist/net/Dns.d.ts.map +1 -0
- package/dist/net/Dns.js +549 -0
- package/dist/net/Dns.js.map +1 -0
- package/dist/net/Host.d.ts +320 -0
- package/dist/net/Host.d.ts.map +1 -0
- package/dist/net/Host.js +342 -0
- package/dist/net/Host.js.map +1 -0
- package/dist/net/IpInterface.d.ts +76 -3
- package/dist/net/IpInterface.d.ts.map +1 -1
- package/dist/net/IpInterface.js +53 -4
- package/dist/net/IpInterface.js.map +1 -1
- package/dist/net/IpNetwork.d.ts +82 -8
- package/dist/net/IpNetwork.d.ts.map +1 -1
- package/dist/net/IpNetwork.js +60 -4
- package/dist/net/IpNetwork.js.map +1 -1
- package/dist/net/NetAddress.d.ts +388 -35
- package/dist/net/NetAddress.d.ts.map +1 -1
- package/dist/net/NetAddress.js +350 -34
- package/dist/net/NetAddress.js.map +1 -1
- package/dist/net/index.d.ts +15 -0
- package/dist/net/index.d.ts.map +1 -1
- package/dist/net/index.js +15 -0
- package/dist/net/index.js.map +1 -1
- package/dist/observability/OtlpExporter.d.ts.map +1 -1
- package/dist/observability/OtlpExporter.js +5 -6
- package/dist/observability/OtlpExporter.js.map +1 -1
- package/dist/observability/OtlpLogger.d.ts.map +1 -1
- package/dist/observability/OtlpLogger.js +23 -27
- package/dist/observability/OtlpLogger.js.map +1 -1
- package/dist/observability/OtlpMetrics.d.ts +5 -3
- package/dist/observability/OtlpMetrics.d.ts.map +1 -1
- package/dist/observability/OtlpMetrics.js +36 -115
- package/dist/observability/OtlpMetrics.js.map +1 -1
- package/dist/observability/OtlpResource.d.ts +4 -3
- package/dist/observability/OtlpResource.d.ts.map +1 -1
- package/dist/observability/OtlpResource.js +20 -23
- package/dist/observability/OtlpResource.js.map +1 -1
- package/dist/observability/OtlpTracer.d.ts +1 -0
- package/dist/observability/OtlpTracer.d.ts.map +1 -1
- package/dist/observability/OtlpTracer.js +32 -36
- package/dist/observability/OtlpTracer.js.map +1 -1
- package/dist/observability/PrometheusMetrics.js +1 -0
- package/dist/observability/PrometheusMetrics.js.map +1 -1
- package/dist/observability/internal/otlpProtobuf.js +32 -1
- package/dist/observability/internal/otlpProtobuf.js.map +1 -1
- package/dist/persistence/PersistedQueue.d.ts +32 -3
- package/dist/persistence/PersistedQueue.d.ts.map +1 -1
- package/dist/persistence/PersistedQueue.js +75 -16
- package/dist/persistence/PersistedQueue.js.map +1 -1
- package/dist/reactivity/AsyncResult.d.ts +1 -1
- package/dist/reactivity/Atom.d.ts +5 -5
- package/dist/reactivity/Atom.d.ts.map +1 -1
- package/dist/reactivity/Atom.js +9 -5
- package/dist/reactivity/Atom.js.map +1 -1
- package/dist/reactivity/AtomHttpApi.d.ts +2 -2
- package/dist/reactivity/AtomHttpApi.d.ts.map +1 -1
- package/dist/reactivity/AtomRegistry.d.ts +8 -0
- package/dist/reactivity/AtomRegistry.d.ts.map +1 -1
- package/dist/reactivity/AtomRegistry.js.map +1 -1
- package/dist/rpc/RpcClient.d.ts +41 -7
- package/dist/rpc/RpcClient.d.ts.map +1 -1
- package/dist/rpc/RpcClient.js +50 -25
- package/dist/rpc/RpcClient.js.map +1 -1
- package/dist/rpc/RpcServer.d.ts +6 -0
- package/dist/rpc/RpcServer.d.ts.map +1 -1
- package/dist/rpc/RpcServer.js +59 -40
- package/dist/rpc/RpcServer.js.map +1 -1
- package/dist/rpc/internal/tracing.d.ts +2 -0
- package/dist/rpc/internal/tracing.d.ts.map +1 -0
- package/dist/rpc/internal/tracing.js +18 -0
- package/dist/rpc/internal/tracing.js.map +1 -0
- package/dist/schema/SchemaCompiler/runtime.js +9 -1
- package/dist/schema/SchemaCompiler/runtime.js.map +1 -1
- package/dist/socket/DatagramSocket.d.ts +456 -0
- package/dist/socket/DatagramSocket.d.ts.map +1 -0
- package/dist/socket/DatagramSocket.js +535 -0
- package/dist/socket/DatagramSocket.js.map +1 -0
- package/dist/socket/Socket.d.ts +14 -1
- package/dist/socket/Socket.d.ts.map +1 -1
- package/dist/socket/Socket.js +9 -1
- package/dist/socket/Socket.js.map +1 -1
- package/dist/socket/index.d.ts +5 -0
- package/dist/socket/index.d.ts.map +1 -1
- package/dist/socket/index.js +5 -0
- package/dist/socket/index.js.map +1 -1
- package/dist/sql/Migrator.d.ts.map +1 -1
- package/dist/sql/Migrator.js +7 -2
- package/dist/sql/Migrator.js.map +1 -1
- package/dist/sql/SqlClient.d.ts +7 -1
- package/dist/sql/SqlClient.d.ts.map +1 -1
- package/dist/sql/SqlClient.js +35 -10
- package/dist/sql/SqlClient.js.map +1 -1
- package/dist/sql/Statement.d.ts +21 -1
- package/dist/sql/Statement.d.ts.map +1 -1
- package/dist/sql/Statement.js +55 -7
- package/dist/sql/Statement.js.map +1 -1
- package/dist/testing/TestClock.d.ts +8 -0
- package/dist/testing/TestClock.d.ts.map +1 -1
- package/dist/testing/TestClock.js +7 -0
- package/dist/testing/TestClock.js.map +1 -1
- package/dist/testing/TestConsole.d.ts +7 -0
- package/dist/testing/TestConsole.d.ts.map +1 -1
- package/dist/testing/TestConsole.js +6 -0
- package/dist/testing/TestConsole.js.map +1 -1
- package/dist/testing/TestCrypto.d.ts +73 -0
- package/dist/testing/TestCrypto.d.ts.map +1 -0
- package/dist/testing/TestCrypto.js +87 -0
- package/dist/testing/TestCrypto.js.map +1 -0
- package/dist/testing/index.d.ts +8 -0
- package/dist/testing/index.d.ts.map +1 -1
- package/dist/testing/index.js +8 -0
- package/dist/testing/index.js.map +1 -1
- package/dist/workflow/DurableDeferred.d.ts +54 -0
- package/dist/workflow/DurableDeferred.d.ts.map +1 -1
- package/dist/workflow/DurableDeferred.js +78 -49
- package/dist/workflow/DurableDeferred.js.map +1 -1
- package/dist/workflow/WorkflowEngine.d.ts.map +1 -1
- package/dist/workflow/WorkflowEngine.js +2 -1
- package/dist/workflow/WorkflowEngine.js.map +1 -1
- package/package.json +3 -3
- package/src/Array.ts +351 -3
- package/src/BigDecimal.ts +88 -0
- package/src/BigInt.ts +68 -0
- package/src/Boolean.ts +34 -0
- package/src/Brand.ts +10 -0
- package/src/ByteSize.ts +87 -0
- package/src/Cache.ts +50 -8
- package/src/Cause.ts +82 -0
- package/src/Channel.ts +368 -18
- package/src/ChannelSchema.ts +13 -0
- package/src/Chunk.ts +193 -0
- package/src/Clock.ts +7 -0
- package/src/Combiner.ts +10 -0
- package/src/Config.ts +82 -8
- package/src/ConfigProvider.ts +28 -0
- package/src/Console.ts +26 -0
- package/src/Context.ts +53 -3
- package/src/Cron.ts +32 -1
- package/src/Crypto.ts +48 -9
- package/src/Data.ts +13 -0
- package/src/DateTime.ts +180 -6
- package/src/Deferred.ts +51 -0
- package/src/Differ.ts +2 -0
- package/src/Duration.ts +126 -16
- package/src/Effect.ts +539 -5
- package/src/Effectable.ts +4 -0
- package/src/Equal.ts +12 -1
- package/src/Equivalence.ts +22 -0
- package/src/ErrorReporter.ts +36 -0
- package/src/ExecutionPlan.ts +58 -14
- package/src/Exit.ts +40 -0
- package/src/Fiber.ts +20 -0
- package/src/FiberHandle.ts +29 -4
- package/src/FiberMap.ts +38 -0
- package/src/FiberSet.ts +21 -0
- package/src/FileSystem.ts +64 -2
- package/src/Filter.ts +55 -0
- package/src/Formatter.ts +42 -1
- package/src/Function.ts +30 -0
- package/src/Graph.ts +317 -36
- package/src/HKT.ts +5 -0
- package/src/Hash.ts +15 -0
- package/src/HashMap.ts +91 -0
- package/src/HashRing.ts +18 -0
- package/src/HashSet.ts +53 -0
- package/src/Inspectable.ts +8 -0
- package/src/Iterable.ts +127 -0
- package/src/JsonPatch.ts +5 -0
- package/src/JsonPointer.ts +5 -0
- package/src/JsonSchema.ts +17 -0
- package/src/Latch.ts +14 -0
- package/src/Layer.ts +101 -1
- package/src/LayerMap.ts +7 -0
- package/src/LayerRef.ts +5 -0
- package/src/LogLevel.ts +20 -0
- package/src/Logger.ts +41 -5
- package/src/ManagedRuntime.ts +12 -1
- package/src/Match.ts +52 -0
- package/src/Metric.ts +69 -0
- package/src/MutableHashMap.ts +44 -0
- package/src/MutableHashSet.ts +17 -0
- package/src/MutableList.ts +21 -0
- package/src/MutableRef.ts +32 -0
- package/src/Newtype.ts +9 -0
- package/src/NonEmptyIterable.ts +4 -0
- package/src/Number.ts +61 -0
- package/src/Optic.ts +57 -0
- package/src/Option.ts +134 -0
- package/src/Order.ts +30 -0
- package/src/Ordering.ts +7 -0
- package/src/PartitionedSemaphore.ts +61 -22
- package/src/Path.ts +6 -0
- package/src/Pipeable.ts +7 -0
- package/src/PlatformError.ts +8 -0
- package/src/Pool.ts +20 -1
- package/src/Predicate.ts +85 -0
- package/src/PrimaryKey.ts +5 -0
- package/src/PubSub.ts +90 -9
- package/src/Pull.ts +20 -0
- package/src/Queue.ts +80 -10
- package/src/Random.ts +13 -0
- package/src/RcMap.ts +23 -0
- package/src/RcRef.ts +6 -0
- package/src/Record.ts +100 -0
- package/src/Redactable.ts +6 -0
- package/src/Redacted.ts +8 -0
- package/src/Reducer.ts +4 -0
- package/src/Ref.ts +42 -0
- package/src/References.ts +21 -0
- package/src/RegExp.ts +4 -0
- package/src/Request.ts +32 -0
- package/src/RequestResolver.ts +59 -10
- package/src/Resource.ts +7 -0
- package/src/Result.ts +93 -0
- package/src/Runtime.ts +10 -0
- package/src/Schedule.ts +61 -0
- package/src/Scheduler.ts +7 -0
- package/src/Schema.ts +1168 -9
- package/src/SchemaAST.ts +115 -1
- package/src/SchemaGetter.ts +80 -4
- package/src/SchemaIssue.ts +34 -0
- package/src/SchemaParser.ts +26 -0
- package/src/SchemaRepresentation.ts +148 -0
- package/src/SchemaTransformation.ts +53 -0
- package/src/Scope.ts +19 -0
- package/src/ScopedCache.ts +55 -3
- package/src/ScopedRef.ts +9 -0
- package/src/Semaphore.ts +26 -0
- package/src/Sink.ts +126 -2
- package/src/StandardSchema.ts +1 -0
- package/src/Stdio.ts +16 -2
- package/src/Stream.ts +633 -26
- package/src/String.ts +87 -0
- package/src/Struct.ts +46 -0
- package/src/SubscriptionRef.ts +65 -0
- package/src/Symbol.ts +2 -0
- package/src/SynchronizedRef.ts +63 -0
- package/src/Take.ts +3 -0
- package/src/Terminal.ts +8 -0
- package/src/Tracer.ts +23 -0
- package/src/Trie.ts +68 -0
- package/src/Tuple.ts +38 -0
- package/src/TxChunk.ts +52 -0
- package/src/TxDeferred.ts +15 -0
- package/src/TxHashMap.ts +97 -6
- package/src/TxHashSet.ts +83 -3
- package/src/TxPriorityQueue.ts +34 -2
- package/src/TxPubSub.ts +26 -0
- package/src/TxQueue.ts +51 -0
- package/src/TxReentrantLock.ts +53 -36
- package/src/TxRef.ts +14 -0
- package/src/TxSemaphore.ts +47 -31
- package/src/TxSubscriptionRef.ts +25 -0
- package/src/Types.ts +36 -0
- package/src/UndefinedOr.ts +15 -0
- package/src/Unify.ts +15 -0
- package/src/Utils.ts +4 -0
- package/src/Version.ts +38 -0
- package/src/ai/Chat.ts +1 -1
- package/src/ai/DecisionModel.ts +42 -1
- package/src/ai/LanguageModel.ts +16 -19
- package/src/ai/McpServer.ts +169 -58
- package/src/ai/Telemetry.ts +62 -58
- package/src/ai/internal/mcpProtocol/v2026_07_28.ts +5 -0
- package/src/ai/internal/mcpProtocol.ts +3 -0
- package/src/ai/internal/mcpRuntime.ts +86 -43
- package/src/ai/internal/mcpStatefulRuntime.ts +2 -0
- package/src/cli/CliOutput.ts +33 -16
- package/src/cli/Command.ts +4 -3
- package/src/cli/Completions.ts +9 -6
- package/src/cli/GlobalFlag.ts +19 -11
- package/src/cli/Prompt.ts +159 -149
- package/src/cli/internal/ansi.ts +26 -3
- package/src/cli/internal/completions/powershell.ts +322 -0
- package/src/cli/internal/completions/zsh.ts +4 -2
- package/src/cli/internal/wizard.ts +34 -26
- package/src/cluster/ClusterSchema.ts +32 -0
- package/src/cluster/ClusterWorkflowEngine.ts +13 -24
- package/src/cluster/K8sHttpClient.ts +12 -2
- package/src/cluster/MessageStorage.ts +45 -14
- package/src/cluster/Runners.ts +8 -2
- package/src/cluster/Sharding.ts +207 -49
- package/src/cluster/SqlMessageStorage.ts +118 -84
- package/src/cluster/SqlRunnerStorage.ts +224 -128
- package/src/cluster/internal/entityManager.ts +151 -55
- package/src/encoding/Base64.ts +4 -0
- package/src/encoding/Base64Url.ts +4 -0
- package/src/encoding/EncodingError.ts +5 -0
- package/src/encoding/Hex.ts +5 -0
- package/src/encoding/Toml.ts +2 -2
- package/src/encoding/Yaml.ts +8 -4
- package/src/encoding/index.ts +4 -0
- package/src/eventlog/SqlEventJournal.ts +18 -4
- package/src/eventlog/SqlEventLogServerUnencrypted.ts +282 -235
- package/src/http/FindMyWay/internal/router.ts +4 -7
- package/src/http/Headers.ts +8 -2
- package/src/http/HttpClient.ts +100 -29
- package/src/http/HttpClientResponse.ts +3 -1
- package/src/http/HttpEffect.ts +11 -2
- package/src/http/HttpMiddleware.ts +60 -45
- package/src/http/HttpServer.ts +1 -1
- package/src/http/HttpTraceContext.ts +8 -2
- package/src/http/internal/tracing.ts +52 -0
- package/src/http-api/HttpApiBuilder.ts +5 -1
- package/src/http-api/HttpApiClient.ts +13 -4
- package/src/http-api/HttpApiError.ts +8 -4
- package/src/http-api/HttpApiSecurity.ts +8 -8
- package/src/index.ts +156 -0
- package/src/internal/arbitrary/array.ts +3 -3
- package/src/internal/arbitrary/model.ts +37 -14
- package/src/internal/arbitrary/runner.ts +7 -7
- package/src/internal/arbitrary/schema.ts +4 -3
- package/src/internal/effect.ts +62 -58
- package/src/internal/schedule.ts +23 -17
- package/src/internal/schema/standardSchema.ts +2 -2
- package/src/internal/version.ts +2 -0
- package/src/net/AddressResolver.ts +222 -0
- package/src/net/Dns.ts +1035 -0
- package/src/net/Host.ts +472 -0
- package/src/net/IpInterface.ts +117 -7
- package/src/net/IpNetwork.ts +116 -17
- package/src/net/NetAddress.ts +611 -76
- package/src/net/index.ts +18 -0
- package/src/observability/OtlpExporter.ts +9 -6
- package/src/observability/OtlpLogger.ts +20 -21
- package/src/observability/OtlpMetrics.ts +46 -116
- package/src/observability/OtlpResource.ts +18 -27
- package/src/observability/OtlpTracer.ts +34 -40
- package/src/observability/PrometheusMetrics.ts +1 -0
- package/src/observability/internal/otlpProtobuf.ts +60 -0
- package/src/persistence/PersistedQueue.ts +146 -53
- package/src/reactivity/AsyncResult.ts +1 -1
- package/src/reactivity/Atom.ts +10 -6
- package/src/reactivity/AtomHttpApi.ts +2 -4
- package/src/reactivity/AtomRegistry.ts +7 -0
- package/src/rpc/RpcClient.ts +87 -41
- package/src/rpc/RpcServer.ts +85 -48
- package/src/rpc/internal/tracing.ts +22 -0
- package/src/schema/SchemaCompiler/runtime.ts +4 -1
- package/src/socket/DatagramSocket.ts +919 -0
- package/src/socket/Socket.ts +22 -2
- package/src/socket/index.ts +6 -0
- package/src/sql/Migrator.ts +21 -5
- package/src/sql/SqlClient.ts +43 -19
- package/src/sql/Statement.ts +59 -7
- package/src/testing/TestClock.ts +9 -0
- package/src/testing/TestConsole.ts +8 -0
- package/src/testing/TestCrypto.ts +94 -0
- package/src/testing/index.ts +9 -0
- package/src/workflow/DurableDeferred.ts +123 -48
- package/src/workflow/WorkflowEngine.ts +2 -1
package/src/Schema.ts
CHANGED
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
* generation, formatting, equivalence, optics, and differs derived from schema
|
|
10
10
|
* definitions.
|
|
11
11
|
*
|
|
12
|
+
* @stability stable
|
|
12
13
|
* @since 4.0.0
|
|
13
14
|
*/
|
|
14
15
|
|
|
@@ -36,6 +37,7 @@ import * as HashSet_ from "./HashSet.ts"
|
|
|
36
37
|
import * as Cookies_ from "./http/Cookies.ts"
|
|
37
38
|
import * as Headers_ from "./http/Headers.ts"
|
|
38
39
|
import * as UrlParams_ from "./http/UrlParams.ts"
|
|
40
|
+
import { NodeInspectSymbol } from "./Inspectable.ts"
|
|
39
41
|
import * as core from "./internal/core.ts"
|
|
40
42
|
import { effectIsExit } from "./internal/effect.ts"
|
|
41
43
|
import * as InternalGraph from "./internal/graph.ts"
|
|
@@ -55,6 +57,8 @@ import { isSchemaError as isSchemaErrorInternal, SchemaErrorTypeId } from "./int
|
|
|
55
57
|
import { getStackTraceLimit, setStackTraceLimit } from "./internal/stackTraceLimit.ts"
|
|
56
58
|
import type * as JsonPatch from "./JsonPatch.ts"
|
|
57
59
|
import type * as JsonSchema from "./JsonSchema.ts"
|
|
60
|
+
import * as Dns_ from "./net/Dns.ts"
|
|
61
|
+
import * as Host_ from "./net/Host.ts"
|
|
58
62
|
import * as IpInterface_ from "./net/IpInterface.ts"
|
|
59
63
|
import * as IpNetwork_ from "./net/IpNetwork.ts"
|
|
60
64
|
import * as NetAddress_ from "./net/NetAddress.ts"
|
|
@@ -87,6 +91,7 @@ const TypeId = InternalMake.TypeId
|
|
|
87
91
|
* @see {@link optionalKey} — mark a struct field as optional
|
|
88
92
|
* @see {@link optional} — mark a struct field as optional with `| undefined`
|
|
89
93
|
*
|
|
94
|
+
* @stability stable
|
|
90
95
|
* @category models
|
|
91
96
|
* @since 4.0.0
|
|
92
97
|
*/
|
|
@@ -96,6 +101,7 @@ export type Optionality = "required" | "optional"
|
|
|
96
101
|
*
|
|
97
102
|
* @see {@link mutableKey} — mark a struct field as mutable
|
|
98
103
|
*
|
|
104
|
+
* @stability stable
|
|
99
105
|
* @category models
|
|
100
106
|
* @since 4.0.0
|
|
101
107
|
*/
|
|
@@ -106,6 +112,7 @@ export type Mutability = "readonly" | "mutable"
|
|
|
106
112
|
* @see {@link withConstructorDefault} — add a default to a schema field
|
|
107
113
|
* @see {@link tag} — creates a literal field with a constructor default
|
|
108
114
|
*
|
|
115
|
+
* @stability stable
|
|
109
116
|
* @category models
|
|
110
117
|
* @since 4.0.0
|
|
111
118
|
*/
|
|
@@ -121,6 +128,7 @@ export type ConstructorDefault = "no-default" | "with-default"
|
|
|
121
128
|
* @see {@link BottomWithoutNew.makeEffect}
|
|
122
129
|
* @see {@link BottomWithoutNew.make}
|
|
123
130
|
*
|
|
131
|
+
* @stability stable
|
|
124
132
|
* @category options
|
|
125
133
|
* @since 3.13.4
|
|
126
134
|
*/
|
|
@@ -150,6 +158,7 @@ export interface MakeOptions {
|
|
|
150
158
|
* Use as the base for schema interfaces that provide a specialized construct
|
|
151
159
|
* signature.
|
|
152
160
|
*
|
|
161
|
+
* @stability stable
|
|
153
162
|
* @category models
|
|
154
163
|
* @since 4.0.0
|
|
155
164
|
*/
|
|
@@ -286,6 +295,7 @@ export interface BottomWithoutNew<
|
|
|
286
295
|
*
|
|
287
296
|
* @see {@link BottomWithoutNew} for the schema protocol without a construct signature
|
|
288
297
|
*
|
|
298
|
+
* @stability stable
|
|
289
299
|
* @category utility types
|
|
290
300
|
* @since 4.0.0
|
|
291
301
|
*/
|
|
@@ -347,6 +357,7 @@ export interface Bottom<
|
|
|
347
357
|
* @see {@link BottomWithoutNew} for the fully parameterized schema interface when every
|
|
348
358
|
* view must be supplied directly.
|
|
349
359
|
*
|
|
360
|
+
* @stability stable
|
|
350
361
|
* @category utility types
|
|
351
362
|
* @since 4.0.0
|
|
352
363
|
*/
|
|
@@ -395,6 +406,7 @@ export interface BottomLazyWithoutNew<
|
|
|
395
406
|
*
|
|
396
407
|
* @see {@link BottomLazyWithoutNew} for the lazy schema protocol without a construct signature
|
|
397
408
|
*
|
|
409
|
+
* @stability stable
|
|
398
410
|
* @category utility types
|
|
399
411
|
* @since 4.0.0
|
|
400
412
|
*/
|
|
@@ -424,6 +436,7 @@ export interface BottomLazy<
|
|
|
424
436
|
/**
|
|
425
437
|
* Type-level representation returned by {@link declareConstructor}.
|
|
426
438
|
*
|
|
439
|
+
* @stability stable
|
|
427
440
|
* @category constructors
|
|
428
441
|
* @since 4.0.0
|
|
429
442
|
*/
|
|
@@ -492,6 +505,7 @@ export interface declareConstructor<T, E, TypeParameters extends ReadonlyArray<C
|
|
|
492
505
|
* Effect.runSync(Schema.decodeUnknownEffect(schema)({ value: 1 })) // => { value: 1 }
|
|
493
506
|
* ```
|
|
494
507
|
*
|
|
508
|
+
* @stability stable
|
|
495
509
|
* @category constructors
|
|
496
510
|
* @since 4.0.0
|
|
497
511
|
*/
|
|
@@ -521,6 +535,7 @@ export function declareConstructor<T, E = T, Iso = T>() {
|
|
|
521
535
|
/**
|
|
522
536
|
* Type-level representation returned by {@link declare}.
|
|
523
537
|
*
|
|
538
|
+
* @stability stable
|
|
524
539
|
* @category constructors
|
|
525
540
|
* @since 3.13.3
|
|
526
541
|
*/
|
|
@@ -556,6 +571,7 @@ export interface declare<T, Iso = T> extends declareConstructor<T, T, readonly [
|
|
|
556
571
|
*
|
|
557
572
|
* @see {@link declareConstructor} for creating schemas for parametric types.
|
|
558
573
|
*
|
|
574
|
+
* @stability stable
|
|
559
575
|
* @category constructors
|
|
560
576
|
* @since 3.10.0
|
|
561
577
|
*/
|
|
@@ -598,6 +614,7 @@ export function declare<T, Iso = T>(
|
|
|
598
614
|
* type E = typeof bottom["Encoded"] // string
|
|
599
615
|
* ```
|
|
600
616
|
*
|
|
617
|
+
* @stability stable
|
|
601
618
|
* @category utility types
|
|
602
619
|
* @since 4.0.0
|
|
603
620
|
*/
|
|
@@ -648,6 +665,7 @@ export function revealBottom<S extends Top>(
|
|
|
648
665
|
*
|
|
649
666
|
* @see {@link annotateEncoded} to annotate the encoded side instead.
|
|
650
667
|
*
|
|
668
|
+
* @stability stable
|
|
651
669
|
* @category annotations
|
|
652
670
|
* @since 4.0.0
|
|
653
671
|
*/
|
|
@@ -680,6 +698,7 @@ export function annotate<S extends Top>(annotations: Annotations.Bottom<S["Type"
|
|
|
680
698
|
*
|
|
681
699
|
* @see {@link annotate} to annotate the type side instead.
|
|
682
700
|
*
|
|
701
|
+
* @stability stable
|
|
683
702
|
* @category annotations
|
|
684
703
|
* @since 4.0.0
|
|
685
704
|
*/
|
|
@@ -714,6 +733,7 @@ export function annotateEncoded<S extends Top>(annotations: Annotations.Bottom<S
|
|
|
714
733
|
* schema.fields.username.ast.context?.annotations?.messageMissingKey // => "Username is required"
|
|
715
734
|
* ```
|
|
716
735
|
*
|
|
736
|
+
* @stability stable
|
|
717
737
|
* @category annotations
|
|
718
738
|
* @since 4.0.0
|
|
719
739
|
*/
|
|
@@ -737,6 +757,7 @@ export function annotateKey<S extends Top>(annotations: Annotations.Key<S["Type"
|
|
|
737
757
|
* - {@link ConstraintDecoder}`<T, RD>` — for decode-only APIs
|
|
738
758
|
* - {@link ConstraintEncoder}`<E, RE>` — for encode-only APIs
|
|
739
759
|
*
|
|
760
|
+
* @stability stable
|
|
740
761
|
* @category models
|
|
741
762
|
* @since 4.0.0
|
|
742
763
|
*/
|
|
@@ -778,6 +799,7 @@ export interface Top extends
|
|
|
778
799
|
*
|
|
779
800
|
* @see {@link Top} for the complete schema protocol.
|
|
780
801
|
*
|
|
802
|
+
* @stability stable
|
|
781
803
|
* @category models
|
|
782
804
|
* @since 4.0.0
|
|
783
805
|
*/
|
|
@@ -814,6 +836,7 @@ export interface Constraint {
|
|
|
814
836
|
* @see {@link Constraint} for the generic lightweight schema constraint.
|
|
815
837
|
* @see {@link Codec} for the full schema protocol with codec type views.
|
|
816
838
|
*
|
|
839
|
+
* @stability stable
|
|
817
840
|
* @category models
|
|
818
841
|
* @since 4.0.0
|
|
819
842
|
*/
|
|
@@ -837,6 +860,7 @@ export interface ConstraintCodec<out T, out E = T, out RD = never, out RE = neve
|
|
|
837
860
|
* @see {@link ConstraintCodec} for APIs that need both decoded and encoded codec views.
|
|
838
861
|
* @see {@link Codec} for the full schema protocol with codec type views.
|
|
839
862
|
*
|
|
863
|
+
* @stability stable
|
|
840
864
|
* @category models
|
|
841
865
|
* @since 4.0.0
|
|
842
866
|
*/
|
|
@@ -855,6 +879,7 @@ export interface ConstraintDecoder<out T, out RD = never> extends ConstraintCode
|
|
|
855
879
|
* @see {@link ConstraintCodec} for APIs that need both decoded and encoded codec views.
|
|
856
880
|
* @see {@link Codec} for the full schema protocol with codec type views.
|
|
857
881
|
*
|
|
882
|
+
* @stability stable
|
|
858
883
|
* @category models
|
|
859
884
|
* @since 4.0.0
|
|
860
885
|
*/
|
|
@@ -869,6 +894,7 @@ export interface ConstraintEncoder<out E, out RE = never> extends ConstraintCode
|
|
|
869
894
|
* exposed by {@link Constraint}, but does not call methods such as `annotate`,
|
|
870
895
|
* `check`, `rebuild`, `make`, or `makeEffect`.
|
|
871
896
|
*
|
|
897
|
+
* @stability stable
|
|
872
898
|
* @category models
|
|
873
899
|
* @since 4.0.0
|
|
874
900
|
*/
|
|
@@ -878,6 +904,7 @@ export interface ConstraintRebuildable extends Constraint {
|
|
|
878
904
|
/**
|
|
879
905
|
* Namespace of type-level helpers for {@link Schema}.
|
|
880
906
|
*
|
|
907
|
+
* @stability stable
|
|
881
908
|
* @since 3.10.0
|
|
882
909
|
*/
|
|
883
910
|
export declare namespace Schema {
|
|
@@ -929,6 +956,7 @@ export declare namespace Schema {
|
|
|
929
956
|
* @see {@link Codec} — also tracks Encoded, DecodingServices, EncodingServices
|
|
930
957
|
* @see {@link Schema.Type} — extract the decoded type at the type level
|
|
931
958
|
*
|
|
959
|
+
* @stability stable
|
|
932
960
|
* @category models
|
|
933
961
|
* @since 3.10.0
|
|
934
962
|
*/
|
|
@@ -939,6 +967,7 @@ export interface Schema<out T> extends Top {
|
|
|
939
967
|
/**
|
|
940
968
|
* Namespace of type-level helpers for {@link Codec}.
|
|
941
969
|
*
|
|
970
|
+
* @stability stable
|
|
942
971
|
* @since 4.0.0
|
|
943
972
|
*/
|
|
944
973
|
export declare namespace Codec {
|
|
@@ -1034,6 +1063,7 @@ export declare namespace Codec {
|
|
|
1034
1063
|
* @see {@link Codec.EncodingServices} — extract required encoding services
|
|
1035
1064
|
* @see {@link revealCodec} — helper to make TypeScript infer the full Codec type
|
|
1036
1065
|
*
|
|
1066
|
+
* @stability stable
|
|
1037
1067
|
* @category models
|
|
1038
1068
|
* @since 4.0.0
|
|
1039
1069
|
*/
|
|
@@ -1056,6 +1086,7 @@ export interface Codec<out T, out E = T, out RD = never, out RE = never> extends
|
|
|
1056
1086
|
* @see {@link Codec} for preserving both decoded and encoded type information.
|
|
1057
1087
|
* @see {@link Encoder} for the encode-only view.
|
|
1058
1088
|
*
|
|
1089
|
+
* @stability stable
|
|
1059
1090
|
* @category models
|
|
1060
1091
|
* @since 4.0.0
|
|
1061
1092
|
*/
|
|
@@ -1078,6 +1109,7 @@ export interface Decoder<out T, out RD = never> extends Schema<T> {
|
|
|
1078
1109
|
* @see {@link Codec} for preserving both decoded and encoded type information.
|
|
1079
1110
|
* @see {@link Decoder} for the decode-only view.
|
|
1080
1111
|
*
|
|
1112
|
+
* @stability stable
|
|
1081
1113
|
* @category models
|
|
1082
1114
|
* @since 4.0.0
|
|
1083
1115
|
*/
|
|
@@ -1109,6 +1141,7 @@ export interface Encoder<out E, out RE = never> extends Schema<unknown> {
|
|
|
1109
1141
|
* type Enc = typeof codec["Encoded"] // string
|
|
1110
1142
|
* ```
|
|
1111
1143
|
*
|
|
1144
|
+
* @stability stable
|
|
1112
1145
|
* @category utility types
|
|
1113
1146
|
* @since 4.0.0
|
|
1114
1147
|
*/
|
|
@@ -1130,6 +1163,7 @@ export function revealCodec<T, E, RD, RE>(codec: Codec<T, E, RD, RE>) {
|
|
|
1130
1163
|
* `Optic` automatically. You normally interact with this interface through
|
|
1131
1164
|
* {@link Optic_} utilities rather than constructing it directly.
|
|
1132
1165
|
*
|
|
1166
|
+
* @stability stable
|
|
1133
1167
|
* @category models
|
|
1134
1168
|
* @since 4.0.0
|
|
1135
1169
|
*/
|
|
@@ -1166,6 +1200,7 @@ export interface Optic<out T, out Iso> extends Schema<T> {
|
|
|
1166
1200
|
* ```
|
|
1167
1201
|
*
|
|
1168
1202
|
* @see {@link isSchemaError} for narrowing unknown values
|
|
1203
|
+
* @stability stable
|
|
1169
1204
|
* @category errors
|
|
1170
1205
|
* @since 4.0.0
|
|
1171
1206
|
*/
|
|
@@ -1185,6 +1220,15 @@ export class SchemaError extends Data.TaggedError("SchemaError")<{
|
|
|
1185
1220
|
override get message() {
|
|
1186
1221
|
return SchemaIssue.defaultFormatter(this.issue)
|
|
1187
1222
|
}
|
|
1223
|
+
override toJSON() {
|
|
1224
|
+
return {
|
|
1225
|
+
_tag: this._tag,
|
|
1226
|
+
message: this.message
|
|
1227
|
+
}
|
|
1228
|
+
}
|
|
1229
|
+
override [NodeInspectSymbol]() {
|
|
1230
|
+
return this.toJSON()
|
|
1231
|
+
}
|
|
1188
1232
|
override toString() {
|
|
1189
1233
|
return `SchemaError(${this.message})`
|
|
1190
1234
|
}
|
|
@@ -1206,6 +1250,7 @@ export class SchemaError extends Data.TaggedError("SchemaError")<{
|
|
|
1206
1250
|
* Schema.isSchemaError(error) // => true
|
|
1207
1251
|
* ```
|
|
1208
1252
|
*
|
|
1253
|
+
* @stability stable
|
|
1209
1254
|
* @category guards
|
|
1210
1255
|
* @since 4.0.0
|
|
1211
1256
|
*/
|
|
@@ -1333,6 +1378,7 @@ function runSchemaErrorSync<A>(
|
|
|
1333
1378
|
* invalidResult.issues?.map((issue) => issue.path) // => [["name"], ["age"]]
|
|
1334
1379
|
* ```
|
|
1335
1380
|
*
|
|
1381
|
+
* @stability stable
|
|
1336
1382
|
* @category converting
|
|
1337
1383
|
* @since 4.0.0
|
|
1338
1384
|
*/
|
|
@@ -1353,6 +1399,7 @@ export function toStandardSchemaV1<S extends ConstraintDecoder<unknown>>(
|
|
|
1353
1399
|
*
|
|
1354
1400
|
* https://github.com/standard-schema/standard-schema/pull/134
|
|
1355
1401
|
*
|
|
1402
|
+
* @stability stable
|
|
1356
1403
|
* @category converting
|
|
1357
1404
|
* @since 4.0.0
|
|
1358
1405
|
*/
|
|
@@ -1395,6 +1442,7 @@ export function toStandardJSONSchemaV1<S extends Constraint>(
|
|
|
1395
1442
|
* }
|
|
1396
1443
|
* ```
|
|
1397
1444
|
*
|
|
1445
|
+
* @stability stable
|
|
1398
1446
|
* @category guards
|
|
1399
1447
|
* @since 3.10.0
|
|
1400
1448
|
*/
|
|
@@ -1444,6 +1492,7 @@ export const is: typeof SchemaParser.is = SchemaParser.is
|
|
|
1444
1492
|
* }
|
|
1445
1493
|
* ```
|
|
1446
1494
|
*
|
|
1495
|
+
* @stability stable
|
|
1447
1496
|
* @category guards
|
|
1448
1497
|
* @since 4.0.0
|
|
1449
1498
|
*/
|
|
@@ -1467,6 +1516,7 @@ export const asserts: <S extends Constraint, I>(schema: S, input: I) => asserts
|
|
|
1467
1516
|
*
|
|
1468
1517
|
* @see {@link SchemaParser.decodeUnknownEffect} for the adapter that fails with `SchemaIssue.Issue` directly
|
|
1469
1518
|
*
|
|
1519
|
+
* @stability stable
|
|
1470
1520
|
* @category decoding
|
|
1471
1521
|
* @since 4.0.0
|
|
1472
1522
|
*/
|
|
@@ -1497,6 +1547,7 @@ export function decodeUnknownEffect<S extends Constraint>(schema: S, options?: S
|
|
|
1497
1547
|
*
|
|
1498
1548
|
* @see {@link SchemaParser.decodeEffect} for the adapter that fails with `SchemaIssue.Issue` directly
|
|
1499
1549
|
*
|
|
1550
|
+
* @stability stable
|
|
1500
1551
|
* @category decoding
|
|
1501
1552
|
* @since 4.0.0
|
|
1502
1553
|
*/
|
|
@@ -1534,6 +1585,7 @@ export const decodeEffect: <S extends Constraint>(
|
|
|
1534
1585
|
*
|
|
1535
1586
|
* @see {@link SchemaParser.decodeUnknownExit} for the adapter whose failure contains `SchemaIssue.Issue` directly
|
|
1536
1587
|
*
|
|
1588
|
+
* @stability stable
|
|
1537
1589
|
* @category decoding
|
|
1538
1590
|
* @since 4.0.0
|
|
1539
1591
|
*/
|
|
@@ -1570,6 +1622,7 @@ export function decodeUnknownExit<S extends ConstraintDecoder<unknown>>(schema:
|
|
|
1570
1622
|
*
|
|
1571
1623
|
* @see {@link SchemaParser.decodeExit} for the adapter whose failure contains `SchemaIssue.Issue` directly
|
|
1572
1624
|
*
|
|
1625
|
+
* @stability stable
|
|
1573
1626
|
* @category decoding
|
|
1574
1627
|
* @since 4.0.0
|
|
1575
1628
|
*/
|
|
@@ -1600,6 +1653,7 @@ export const decodeExit: <S extends ConstraintDecoder<unknown>>(
|
|
|
1600
1653
|
* that contain defects, interruptions, or other non-schema reasons throw
|
|
1601
1654
|
* instead.
|
|
1602
1655
|
*
|
|
1656
|
+
* @stability stable
|
|
1603
1657
|
* @category decoding
|
|
1604
1658
|
* @since 3.10.0
|
|
1605
1659
|
*/
|
|
@@ -1629,6 +1683,7 @@ export const decodeUnknownOption: <S extends ConstraintDecoder<unknown>>(
|
|
|
1629
1683
|
* that contain defects, interruptions, or other non-schema reasons throw
|
|
1630
1684
|
* instead.
|
|
1631
1685
|
*
|
|
1686
|
+
* @stability stable
|
|
1632
1687
|
* @category decoding
|
|
1633
1688
|
* @since 3.10.0
|
|
1634
1689
|
*/
|
|
@@ -1662,6 +1717,7 @@ export const decodeOption: <S extends ConstraintDecoder<unknown>>(
|
|
|
1662
1717
|
*
|
|
1663
1718
|
* @see {@link SchemaParser.decodeUnknownResult} for the adapter that fails with `SchemaIssue.Issue` directly
|
|
1664
1719
|
*
|
|
1720
|
+
* @stability stable
|
|
1665
1721
|
* @category decoding
|
|
1666
1722
|
* @since 4.0.0
|
|
1667
1723
|
*/
|
|
@@ -1696,6 +1752,7 @@ export function decodeUnknownResult<S extends ConstraintDecoder<unknown>>(schema
|
|
|
1696
1752
|
*
|
|
1697
1753
|
* @see {@link SchemaParser.decodeResult} for the adapter that fails with `SchemaIssue.Issue` directly
|
|
1698
1754
|
*
|
|
1755
|
+
* @stability stable
|
|
1699
1756
|
* @category decoding
|
|
1700
1757
|
* @since 4.0.0
|
|
1701
1758
|
*/
|
|
@@ -1728,6 +1785,7 @@ export const decodeResult: <S extends ConstraintDecoder<unknown>>(
|
|
|
1728
1785
|
*
|
|
1729
1786
|
* @see {@link SchemaParser.decodeUnknownPromise} for the adapter that rejects with an `Error` whose cause is `SchemaIssue.Issue`
|
|
1730
1787
|
*
|
|
1788
|
+
* @stability stable
|
|
1731
1789
|
* @category decoding
|
|
1732
1790
|
* @since 3.10.0
|
|
1733
1791
|
*/
|
|
@@ -1764,6 +1822,7 @@ export function decodeUnknownPromise<S extends ConstraintDecoder<unknown>>(
|
|
|
1764
1822
|
*
|
|
1765
1823
|
* @see {@link SchemaParser.decodePromise} for the adapter that rejects with an `Error` whose cause is `SchemaIssue.Issue`
|
|
1766
1824
|
*
|
|
1825
|
+
* @stability stable
|
|
1767
1826
|
* @category decoding
|
|
1768
1827
|
* @since 3.10.0
|
|
1769
1828
|
*/
|
|
@@ -1805,6 +1864,7 @@ export const decodePromise: <S extends ConstraintDecoder<unknown>>(
|
|
|
1805
1864
|
*
|
|
1806
1865
|
* @see {@link SchemaParser.decodeUnknownSync} for the adapter that throws an `Error` whose cause is `SchemaIssue.Issue`
|
|
1807
1866
|
*
|
|
1867
|
+
* @stability stable
|
|
1808
1868
|
* @category decoding
|
|
1809
1869
|
* @since 4.0.0
|
|
1810
1870
|
*/
|
|
@@ -1837,6 +1897,7 @@ export function decodeUnknownSync<S extends ConstraintDecoder<unknown>>(schema:
|
|
|
1837
1897
|
*
|
|
1838
1898
|
* @see {@link SchemaParser.decodeSync} for the adapter that throws an `Error` whose cause is `SchemaIssue.Issue`
|
|
1839
1899
|
*
|
|
1900
|
+
* @stability stable
|
|
1840
1901
|
* @category decoding
|
|
1841
1902
|
* @since 4.0.0
|
|
1842
1903
|
*/
|
|
@@ -1872,6 +1933,7 @@ export const decodeSync: <S extends ConstraintDecoder<unknown>>(
|
|
|
1872
1933
|
*
|
|
1873
1934
|
* @see {@link SchemaParser.encodeUnknownEffect} for the adapter that fails with `SchemaIssue.Issue` directly
|
|
1874
1935
|
*
|
|
1936
|
+
* @stability stable
|
|
1875
1937
|
* @category encoding
|
|
1876
1938
|
* @since 4.0.0
|
|
1877
1939
|
*/
|
|
@@ -1902,6 +1964,7 @@ export function encodeUnknownEffect<S extends Constraint>(schema: S, options?: S
|
|
|
1902
1964
|
*
|
|
1903
1965
|
* @see {@link SchemaParser.encodeEffect} for the adapter that fails with `SchemaIssue.Issue` directly
|
|
1904
1966
|
*
|
|
1967
|
+
* @stability stable
|
|
1905
1968
|
* @category encoding
|
|
1906
1969
|
* @since 4.0.0
|
|
1907
1970
|
*/
|
|
@@ -1938,6 +2001,7 @@ export const encodeEffect: <S extends Constraint>(
|
|
|
1938
2001
|
*
|
|
1939
2002
|
* @see {@link SchemaParser.encodeUnknownExit} for the adapter whose failure contains `SchemaIssue.Issue` directly
|
|
1940
2003
|
*
|
|
2004
|
+
* @stability stable
|
|
1941
2005
|
* @category encoding
|
|
1942
2006
|
* @since 4.0.0
|
|
1943
2007
|
*/
|
|
@@ -1974,6 +2038,7 @@ export function encodeUnknownExit<S extends ConstraintEncoder<unknown>>(schema:
|
|
|
1974
2038
|
*
|
|
1975
2039
|
* @see {@link SchemaParser.encodeExit} for the adapter whose failure contains `SchemaIssue.Issue` directly
|
|
1976
2040
|
*
|
|
2041
|
+
* @stability stable
|
|
1977
2042
|
* @category encoding
|
|
1978
2043
|
* @since 4.0.0
|
|
1979
2044
|
*/
|
|
@@ -2004,6 +2069,7 @@ export const encodeExit: <S extends ConstraintEncoder<unknown>>(
|
|
|
2004
2069
|
* that contain defects, interruptions, or other non-schema reasons throw
|
|
2005
2070
|
* instead.
|
|
2006
2071
|
*
|
|
2072
|
+
* @stability stable
|
|
2007
2073
|
* @category encoding
|
|
2008
2074
|
* @since 3.10.0
|
|
2009
2075
|
*/
|
|
@@ -2034,6 +2100,7 @@ export const encodeUnknownOption: <S extends ConstraintEncoder<unknown>>(
|
|
|
2034
2100
|
* that contain defects, interruptions, or other non-schema reasons throw
|
|
2035
2101
|
* instead.
|
|
2036
2102
|
*
|
|
2103
|
+
* @stability stable
|
|
2037
2104
|
* @category encoding
|
|
2038
2105
|
* @since 3.10.0
|
|
2039
2106
|
*/
|
|
@@ -2066,6 +2133,7 @@ export const encodeOption: <S extends ConstraintEncoder<unknown>>(
|
|
|
2066
2133
|
*
|
|
2067
2134
|
* @see {@link SchemaParser.encodeUnknownResult} for the adapter that fails with `SchemaIssue.Issue` directly
|
|
2068
2135
|
*
|
|
2136
|
+
* @stability stable
|
|
2069
2137
|
* @category encoding
|
|
2070
2138
|
* @since 4.0.0
|
|
2071
2139
|
*/
|
|
@@ -2100,6 +2168,7 @@ export function encodeUnknownResult<S extends ConstraintEncoder<unknown>>(schema
|
|
|
2100
2168
|
*
|
|
2101
2169
|
* @see {@link SchemaParser.encodeResult} for the adapter that fails with `SchemaIssue.Issue` directly
|
|
2102
2170
|
*
|
|
2171
|
+
* @stability stable
|
|
2103
2172
|
* @category encoding
|
|
2104
2173
|
* @since 4.0.0
|
|
2105
2174
|
*/
|
|
@@ -2131,6 +2200,7 @@ export const encodeResult: <S extends ConstraintEncoder<unknown>>(
|
|
|
2131
2200
|
*
|
|
2132
2201
|
* @see {@link SchemaParser.encodeUnknownPromise} for the adapter that rejects with an `Error` whose cause is `SchemaIssue.Issue`
|
|
2133
2202
|
*
|
|
2203
|
+
* @stability stable
|
|
2134
2204
|
* @category encoding
|
|
2135
2205
|
* @since 3.10.0
|
|
2136
2206
|
*/
|
|
@@ -2167,6 +2237,7 @@ export function encodeUnknownPromise<S extends ConstraintEncoder<unknown>>(
|
|
|
2167
2237
|
*
|
|
2168
2238
|
* @see {@link SchemaParser.encodePromise} for the adapter that rejects with an `Error` whose cause is `SchemaIssue.Issue`
|
|
2169
2239
|
*
|
|
2240
|
+
* @stability stable
|
|
2170
2241
|
* @category encoding
|
|
2171
2242
|
* @since 3.10.0
|
|
2172
2243
|
*/
|
|
@@ -2197,6 +2268,7 @@ export const encodePromise: <S extends ConstraintEncoder<unknown>>(
|
|
|
2197
2268
|
*
|
|
2198
2269
|
* @see {@link SchemaParser.encodeUnknownSync} for the adapter that throws an `Error` whose cause is `SchemaIssue.Issue`
|
|
2199
2270
|
*
|
|
2271
|
+
* @stability stable
|
|
2200
2272
|
* @category encoding
|
|
2201
2273
|
* @since 4.0.0
|
|
2202
2274
|
*/
|
|
@@ -2227,6 +2299,7 @@ export function encodeUnknownSync<S extends ConstraintEncoder<unknown>>(schema:
|
|
|
2227
2299
|
*
|
|
2228
2300
|
* @see {@link SchemaParser.encodeSync} for the adapter that throws an `Error` whose cause is `SchemaIssue.Issue`
|
|
2229
2301
|
*
|
|
2302
|
+
* @stability stable
|
|
2230
2303
|
* @category encoding
|
|
2231
2304
|
* @since 4.0.0
|
|
2232
2305
|
*/
|
|
@@ -2248,6 +2321,7 @@ export const encodeSync: <S extends ConstraintEncoder<unknown>>(
|
|
|
2248
2321
|
* the bridge between the untyped AST representation and the strongly-typed
|
|
2249
2322
|
* schema.
|
|
2250
2323
|
*
|
|
2324
|
+
* @stability stable
|
|
2251
2325
|
* @category constructors
|
|
2252
2326
|
* @since 3.10.0
|
|
2253
2327
|
*/
|
|
@@ -2255,6 +2329,7 @@ export const make: <S extends Constraint>(ast: S["ast"], options?: object) => S
|
|
|
2255
2329
|
/**
|
|
2256
2330
|
* Checks whether a value is a `Schema`.
|
|
2257
2331
|
*
|
|
2332
|
+
* @stability stable
|
|
2258
2333
|
* @category guards
|
|
2259
2334
|
* @since 3.10.0
|
|
2260
2335
|
*/
|
|
@@ -2264,6 +2339,7 @@ export function isSchema(u: unknown): u is Top {
|
|
|
2264
2339
|
/**
|
|
2265
2340
|
* Type-level representation returned by {@link optionalKey}.
|
|
2266
2341
|
*
|
|
2342
|
+
* @stability stable
|
|
2267
2343
|
* @category models
|
|
2268
2344
|
* @since 4.0.0
|
|
2269
2345
|
*/
|
|
@@ -2311,6 +2387,7 @@ interface optionalKeyLambda extends Lambda {
|
|
|
2311
2387
|
* type Person = typeof schema["Type"]
|
|
2312
2388
|
* ```
|
|
2313
2389
|
*
|
|
2390
|
+
* @stability stable
|
|
2314
2391
|
* @category combinators
|
|
2315
2392
|
* @since 4.0.0
|
|
2316
2393
|
*/
|
|
@@ -2330,6 +2407,7 @@ interface requiredKeyLambda extends Lambda {
|
|
|
2330
2407
|
* Use to remove optional-key wrapping from a schema field that was previously
|
|
2331
2408
|
* wrapped with {@link optionalKey}.
|
|
2332
2409
|
*
|
|
2410
|
+
* @stability stable
|
|
2333
2411
|
* @category combinators
|
|
2334
2412
|
* @since 4.0.0
|
|
2335
2413
|
*/
|
|
@@ -2337,6 +2415,7 @@ export const requiredKey: requiredKeyLambda = Struct_.lambda<requiredKeyLambda>(
|
|
|
2337
2415
|
/**
|
|
2338
2416
|
* Type-level representation returned by {@link optional}.
|
|
2339
2417
|
*
|
|
2418
|
+
* @stability stable
|
|
2340
2419
|
* @category models
|
|
2341
2420
|
* @since 3.10.0
|
|
2342
2421
|
*/
|
|
@@ -2373,6 +2452,7 @@ interface optionalLambda extends Lambda {
|
|
|
2373
2452
|
* type Person = typeof schema.Type
|
|
2374
2453
|
* ```
|
|
2375
2454
|
*
|
|
2455
|
+
* @stability stable
|
|
2376
2456
|
* @category combinators
|
|
2377
2457
|
* @since 3.10.0
|
|
2378
2458
|
*/
|
|
@@ -2397,6 +2477,7 @@ interface requiredLambda extends Lambda {
|
|
|
2397
2477
|
*
|
|
2398
2478
|
* This also unwraps the `UndefinedOr` member added by `optional`.
|
|
2399
2479
|
*
|
|
2480
|
+
* @stability stable
|
|
2400
2481
|
* @category combinators
|
|
2401
2482
|
* @since 3.10.0
|
|
2402
2483
|
*/
|
|
@@ -2404,6 +2485,7 @@ export const required: requiredLambda = Struct_.lambda<requiredLambda>((self) =>
|
|
|
2404
2485
|
/**
|
|
2405
2486
|
* Type-level representation returned by {@link mutableKey}.
|
|
2406
2487
|
*
|
|
2488
|
+
* @stability stable
|
|
2407
2489
|
* @category models
|
|
2408
2490
|
* @since 4.0.0
|
|
2409
2491
|
*/
|
|
@@ -2436,6 +2518,7 @@ interface mutableKeyLambda extends Lambda {
|
|
|
2436
2518
|
* Makes a struct field mutable (removes the `readonly` modifier on the property).
|
|
2437
2519
|
* Use {@link readonlyKey} to reverse.
|
|
2438
2520
|
*
|
|
2521
|
+
* @stability stable
|
|
2439
2522
|
* @category combinators
|
|
2440
2523
|
* @since 4.0.0
|
|
2441
2524
|
*/
|
|
@@ -2455,6 +2538,7 @@ interface readonlyKeyLambda extends Lambda {
|
|
|
2455
2538
|
* Use to remove mutable-key wrapping from a schema field that was previously
|
|
2456
2539
|
* wrapped with {@link mutableKey}.
|
|
2457
2540
|
*
|
|
2541
|
+
* @stability stable
|
|
2458
2542
|
* @category combinators
|
|
2459
2543
|
* @since 4.0.0
|
|
2460
2544
|
*/
|
|
@@ -2462,6 +2546,7 @@ export const readonlyKey: readonlyKeyLambda = Struct_.lambda<readonlyKeyLambda>(
|
|
|
2462
2546
|
/**
|
|
2463
2547
|
* Type-level representation returned by {@link toType}.
|
|
2464
2548
|
*
|
|
2549
|
+
* @stability stable
|
|
2465
2550
|
* @category transforming
|
|
2466
2551
|
* @since 4.0.0
|
|
2467
2552
|
*/
|
|
@@ -2494,6 +2579,7 @@ interface toTypeLambda extends Lambda {
|
|
|
2494
2579
|
* Extracts the type-side schema: sets `Encoded` to equal the decoded `Type`,
|
|
2495
2580
|
* discarding the encoding transformation path.
|
|
2496
2581
|
*
|
|
2582
|
+
* @stability stable
|
|
2497
2583
|
* @category transforming
|
|
2498
2584
|
* @since 4.0.0
|
|
2499
2585
|
*/
|
|
@@ -2503,6 +2589,7 @@ export const toType: toTypeLambda = Struct_.lambda<toTypeLambda>((schema) =>
|
|
|
2503
2589
|
/**
|
|
2504
2590
|
* Type-level representation returned by {@link toEncoded}.
|
|
2505
2591
|
*
|
|
2592
|
+
* @stability stable
|
|
2506
2593
|
* @category transforming
|
|
2507
2594
|
* @since 4.0.0
|
|
2508
2595
|
*/
|
|
@@ -2535,6 +2622,7 @@ interface toEncodedLambda extends Lambda {
|
|
|
2535
2622
|
* Extracts the encoded-side schema: sets `Type` to equal the `Encoded`,
|
|
2536
2623
|
* discarding the decoding transformation path.
|
|
2537
2624
|
*
|
|
2625
|
+
* @stability stable
|
|
2538
2626
|
* @category transforming
|
|
2539
2627
|
* @since 4.0.0
|
|
2540
2628
|
*/
|
|
@@ -2545,6 +2633,7 @@ const FlipTypeId = "~effect/Schema/flip"
|
|
|
2545
2633
|
/**
|
|
2546
2634
|
* Type-level representation returned by {@link flip}.
|
|
2547
2635
|
*
|
|
2636
|
+
* @stability stable
|
|
2548
2637
|
* @category transforming
|
|
2549
2638
|
* @since 4.0.0
|
|
2550
2639
|
*/
|
|
@@ -2595,6 +2684,7 @@ function isFlip$(schema: Top): schema is flip<any> {
|
|
|
2595
2684
|
* Schema.decodeSync(flipped)(42) // => "42"
|
|
2596
2685
|
* ```
|
|
2597
2686
|
*
|
|
2687
|
+
* @stability stable
|
|
2598
2688
|
* @category transforming
|
|
2599
2689
|
* @since 4.0.0
|
|
2600
2690
|
*/
|
|
@@ -2608,6 +2698,7 @@ export function flip<S extends Top>(schema: S): flip<S> {
|
|
|
2608
2698
|
/**
|
|
2609
2699
|
* Type-level representation returned by {@link Literal}.
|
|
2610
2700
|
*
|
|
2701
|
+
* @stability stable
|
|
2611
2702
|
* @category models
|
|
2612
2703
|
* @since 3.10.0
|
|
2613
2704
|
*/
|
|
@@ -2633,6 +2724,7 @@ export interface Literal<L extends SchemaAST.LiteralValue>
|
|
|
2633
2724
|
* @see {@link Literals} for a schema that represents a union of literals.
|
|
2634
2725
|
* @see {@link tag} for a schema that represents a literal value that can be
|
|
2635
2726
|
* used as a discriminator field in tagged unions and has a constructor default.
|
|
2727
|
+
* @stability stable
|
|
2636
2728
|
* @category constructors
|
|
2637
2729
|
* @since 3.10.0
|
|
2638
2730
|
*/
|
|
@@ -2651,6 +2743,7 @@ export function Literal<L extends SchemaAST.LiteralValue>(literal: L): Literal<L
|
|
|
2651
2743
|
/**
|
|
2652
2744
|
* Namespace for {@link TemplateLiteral} helper types.
|
|
2653
2745
|
*
|
|
2746
|
+
* @stability stable
|
|
2654
2747
|
* @since 3.10.0
|
|
2655
2748
|
*/
|
|
2656
2749
|
export declare namespace TemplateLiteral {
|
|
@@ -2708,6 +2801,7 @@ export declare namespace TemplateLiteral {
|
|
|
2708
2801
|
/**
|
|
2709
2802
|
* Type-level representation returned by {@link TemplateLiteral}.
|
|
2710
2803
|
*
|
|
2804
|
+
* @stability stable
|
|
2711
2805
|
* @category models
|
|
2712
2806
|
* @since 3.10.0
|
|
2713
2807
|
*/
|
|
@@ -2759,6 +2853,7 @@ function templateLiteralParts(parts: TemplateLiteral.Parts) {
|
|
|
2759
2853
|
* ```
|
|
2760
2854
|
*
|
|
2761
2855
|
* @see {@link TemplateLiteralParser} for a schema that also parses matched parts into a tuple.
|
|
2856
|
+
* @stability stable
|
|
2762
2857
|
* @category constructors
|
|
2763
2858
|
* @since 3.10.0
|
|
2764
2859
|
*/
|
|
@@ -2768,6 +2863,7 @@ export function TemplateLiteral<const Parts extends TemplateLiteral.Parts>(parts
|
|
|
2768
2863
|
/**
|
|
2769
2864
|
* Namespace for {@link TemplateLiteralParser} helper types.
|
|
2770
2865
|
*
|
|
2866
|
+
* @stability stable
|
|
2771
2867
|
* @since 3.10.0
|
|
2772
2868
|
*/
|
|
2773
2869
|
export declare namespace TemplateLiteralParser {
|
|
@@ -2791,6 +2887,7 @@ export declare namespace TemplateLiteralParser {
|
|
|
2791
2887
|
/**
|
|
2792
2888
|
* Type-level representation returned by {@link TemplateLiteralParser}.
|
|
2793
2889
|
*
|
|
2890
|
+
* @stability stable
|
|
2794
2891
|
* @category models
|
|
2795
2892
|
* @since 3.10.0
|
|
2796
2893
|
*/
|
|
@@ -2841,6 +2938,7 @@ export interface TemplateLiteralParser<Parts extends TemplateLiteral.Parts> exte
|
|
|
2841
2938
|
* ```
|
|
2842
2939
|
*
|
|
2843
2940
|
* @see {@link TemplateLiteral} for a validation-only version that keeps the string encoded.
|
|
2941
|
+
* @stability stable
|
|
2844
2942
|
* @category constructors
|
|
2845
2943
|
* @since 3.10.0
|
|
2846
2944
|
*/
|
|
@@ -2852,6 +2950,7 @@ export function TemplateLiteralParser<const Parts extends TemplateLiteral.Parts>
|
|
|
2852
2950
|
/**
|
|
2853
2951
|
* Type-level representation returned by {@link Enum}.
|
|
2854
2952
|
*
|
|
2953
|
+
* @stability stable
|
|
2855
2954
|
* @category models
|
|
2856
2955
|
* @since 4.0.0
|
|
2857
2956
|
*/
|
|
@@ -2882,6 +2981,7 @@ export interface Enum<A extends { [x: string]: string | number }>
|
|
|
2882
2981
|
* Schema.decodeSync(schema)(Direction.Up) // => "Up"
|
|
2883
2982
|
* ```
|
|
2884
2983
|
*
|
|
2984
|
+
* @stability stable
|
|
2885
2985
|
* @category constructors
|
|
2886
2986
|
* @since 4.0.0
|
|
2887
2987
|
*/
|
|
@@ -2898,6 +2998,7 @@ export function Enum<A extends { [x: string]: string | number }>(enums: A): Enum
|
|
|
2898
2998
|
/**
|
|
2899
2999
|
* Type-level representation of {@link Never}.
|
|
2900
3000
|
*
|
|
3001
|
+
* @stability stable
|
|
2901
3002
|
* @category models
|
|
2902
3003
|
* @since 3.10.0
|
|
2903
3004
|
*/
|
|
@@ -2905,6 +3006,7 @@ export interface Never extends Bottom<never, never, never, never, SchemaAST.Neve
|
|
|
2905
3006
|
/**
|
|
2906
3007
|
* Schema for the `never` type. Always fails validation — no value satisfies it.
|
|
2907
3008
|
*
|
|
3009
|
+
* @stability stable
|
|
2908
3010
|
* @category schemas
|
|
2909
3011
|
* @since 3.10.0
|
|
2910
3012
|
*/
|
|
@@ -2912,6 +3014,7 @@ export const Never: Never = make(SchemaAST.never)
|
|
|
2912
3014
|
/**
|
|
2913
3015
|
* Type-level representation of {@link Any}.
|
|
2914
3016
|
*
|
|
3017
|
+
* @stability stable
|
|
2915
3018
|
* @category models
|
|
2916
3019
|
* @since 3.10.0
|
|
2917
3020
|
*/
|
|
@@ -2920,6 +3023,7 @@ export interface Any extends Bottom<any, any, never, never, SchemaAST.Any, Any>
|
|
|
2920
3023
|
* Schema for the `any` type. Accepts any value without validation.
|
|
2921
3024
|
*
|
|
2922
3025
|
* @see {@link Unknown} for a safer alternative that uses `unknown`.
|
|
3026
|
+
* @stability stable
|
|
2923
3027
|
* @category schemas
|
|
2924
3028
|
* @since 3.10.0
|
|
2925
3029
|
*/
|
|
@@ -2927,6 +3031,7 @@ export const Any: Any = make(SchemaAST.any)
|
|
|
2927
3031
|
/**
|
|
2928
3032
|
* Type-level representation of {@link Unknown}.
|
|
2929
3033
|
*
|
|
3034
|
+
* @stability stable
|
|
2930
3035
|
* @category models
|
|
2931
3036
|
* @since 3.10.0
|
|
2932
3037
|
*/
|
|
@@ -2940,6 +3045,7 @@ export interface Unknown extends Bottom<unknown, unknown, never, never, SchemaAS
|
|
|
2940
3045
|
* TypeScript's `unknown` safety at use sites.
|
|
2941
3046
|
*
|
|
2942
3047
|
* @see {@link Any} for the `any` variant.
|
|
3048
|
+
* @stability stable
|
|
2943
3049
|
* @category schemas
|
|
2944
3050
|
* @since 3.10.0
|
|
2945
3051
|
*/
|
|
@@ -2947,6 +3053,7 @@ export const Unknown: Unknown = make(SchemaAST.unknown)
|
|
|
2947
3053
|
/**
|
|
2948
3054
|
* Type-level representation of {@link Null}.
|
|
2949
3055
|
*
|
|
3056
|
+
* @stability stable
|
|
2950
3057
|
* @category models
|
|
2951
3058
|
* @since 3.10.0
|
|
2952
3059
|
*/
|
|
@@ -2955,6 +3062,7 @@ export interface Null extends Bottom<null, null, never, never, SchemaAST.Null, N
|
|
|
2955
3062
|
* Schema for the `null` literal. Validates that the input is strictly `null`.
|
|
2956
3063
|
*
|
|
2957
3064
|
* @see {@link NullOr} for a union with another schema.
|
|
3065
|
+
* @stability stable
|
|
2958
3066
|
* @category schemas
|
|
2959
3067
|
* @since 3.10.0
|
|
2960
3068
|
*/
|
|
@@ -2962,6 +3070,7 @@ export const Null: Null = make(SchemaAST.null)
|
|
|
2962
3070
|
/**
|
|
2963
3071
|
* Type-level representation of {@link Undefined}.
|
|
2964
3072
|
*
|
|
3073
|
+
* @stability stable
|
|
2965
3074
|
* @category models
|
|
2966
3075
|
* @since 3.10.0
|
|
2967
3076
|
*/
|
|
@@ -2970,6 +3079,7 @@ export interface Undefined extends Bottom<undefined, undefined, never, never, Sc
|
|
|
2970
3079
|
* Schema for the `undefined` literal. Validates that the input is strictly `undefined`.
|
|
2971
3080
|
*
|
|
2972
3081
|
* @see {@link UndefinedOr} for a union with another schema.
|
|
3082
|
+
* @stability stable
|
|
2973
3083
|
* @category schemas
|
|
2974
3084
|
* @since 3.10.0
|
|
2975
3085
|
*/
|
|
@@ -2977,6 +3087,7 @@ export const Undefined: Undefined = make(SchemaAST.undefined)
|
|
|
2977
3087
|
/**
|
|
2978
3088
|
* Type-level representation of {@link String}.
|
|
2979
3089
|
*
|
|
3090
|
+
* @stability stable
|
|
2980
3091
|
* @category models
|
|
2981
3092
|
* @since 4.0.0
|
|
2982
3093
|
*/
|
|
@@ -2984,6 +3095,7 @@ export interface String extends Bottom<string, string, never, never, SchemaAST.S
|
|
|
2984
3095
|
/**
|
|
2985
3096
|
* Schema for `string` values. Validates that the input is `typeof` `"string"`.
|
|
2986
3097
|
*
|
|
3098
|
+
* @stability stable
|
|
2987
3099
|
* @category schemas
|
|
2988
3100
|
* @since 4.0.0
|
|
2989
3101
|
*/
|
|
@@ -2992,6 +3104,7 @@ export const String: String = make(SchemaAST.string)
|
|
|
2992
3104
|
/**
|
|
2993
3105
|
* Type-level representation of {@link StringForLiteralAutocomplete}.
|
|
2994
3106
|
*
|
|
3107
|
+
* @stability stable
|
|
2995
3108
|
* @category models
|
|
2996
3109
|
* @since 4.0.0
|
|
2997
3110
|
*/
|
|
@@ -3036,6 +3149,7 @@ export interface StringForLiteralAutocomplete extends
|
|
|
3036
3149
|
*
|
|
3037
3150
|
* @see {@link String} for a schema whose type is plain `string`.
|
|
3038
3151
|
* @see {@link Literals} for the known literals to include in the union.
|
|
3152
|
+
* @stability stable
|
|
3039
3153
|
* @category schemas
|
|
3040
3154
|
* @since 4.0.0
|
|
3041
3155
|
*/
|
|
@@ -3043,6 +3157,7 @@ export const StringForLiteralAutocomplete: StringForLiteralAutocomplete = String
|
|
|
3043
3157
|
/**
|
|
3044
3158
|
* Type-level representation of {@link Number}.
|
|
3045
3159
|
*
|
|
3160
|
+
* @stability stable
|
|
3046
3161
|
* @category models
|
|
3047
3162
|
* @since 4.0.0
|
|
3048
3163
|
*/
|
|
@@ -3058,6 +3173,7 @@ export interface Number extends Bottom<number, number, never, never, SchemaAST.N
|
|
|
3058
3173
|
* - Non-finite values are serialized as strings (`"NaN"`, `"Infinity"`, `"-Infinity"`).
|
|
3059
3174
|
*
|
|
3060
3175
|
* @see {@link Finite} for a schema that excludes non-finite values.
|
|
3176
|
+
* @stability stable
|
|
3061
3177
|
* @category schemas
|
|
3062
3178
|
* @since 4.0.0
|
|
3063
3179
|
*/
|
|
@@ -3065,6 +3181,7 @@ export const Number: Number = make(SchemaAST.number)
|
|
|
3065
3181
|
/**
|
|
3066
3182
|
* Type-level representation of {@link Boolean}.
|
|
3067
3183
|
*
|
|
3184
|
+
* @stability stable
|
|
3068
3185
|
* @category models
|
|
3069
3186
|
* @since 4.0.0
|
|
3070
3187
|
*/
|
|
@@ -3078,6 +3195,7 @@ export interface Boolean extends Bottom<boolean, boolean, never, never, SchemaAS
|
|
|
3078
3195
|
*
|
|
3079
3196
|
* @see {@link BooleanFromBit} for a schema that decodes bit literals `0` or `1` into a boolean
|
|
3080
3197
|
*
|
|
3198
|
+
* @stability stable
|
|
3081
3199
|
* @category schemas
|
|
3082
3200
|
* @since 4.0.0
|
|
3083
3201
|
*/
|
|
@@ -3085,6 +3203,7 @@ export const Boolean: Boolean = make(SchemaAST.boolean)
|
|
|
3085
3203
|
/**
|
|
3086
3204
|
* Type-level representation of {@link Symbol}.
|
|
3087
3205
|
*
|
|
3206
|
+
* @stability stable
|
|
3088
3207
|
* @category models
|
|
3089
3208
|
* @since 4.0.0
|
|
3090
3209
|
*/
|
|
@@ -3093,6 +3212,7 @@ export interface Symbol extends Bottom<symbol, symbol, never, never, SchemaAST.S
|
|
|
3093
3212
|
* Schema for `symbol` values. Validates that the input is `typeof` `"symbol"`.
|
|
3094
3213
|
*
|
|
3095
3214
|
* @see {@link UniqueSymbol} for a schema that matches a specific symbol.
|
|
3215
|
+
* @stability stable
|
|
3096
3216
|
* @category schemas
|
|
3097
3217
|
* @since 4.0.0
|
|
3098
3218
|
*/
|
|
@@ -3100,6 +3220,7 @@ export const Symbol: Symbol = make(SchemaAST.symbol)
|
|
|
3100
3220
|
/**
|
|
3101
3221
|
* Type-level representation of {@link BigInt}.
|
|
3102
3222
|
*
|
|
3223
|
+
* @stability stable
|
|
3103
3224
|
* @category models
|
|
3104
3225
|
* @since 4.0.0
|
|
3105
3226
|
*/
|
|
@@ -3114,6 +3235,7 @@ export interface BigInt extends Bottom<bigint, bigint, never, never, SchemaAST.B
|
|
|
3114
3235
|
*
|
|
3115
3236
|
* @see {@link BigIntFromString} for parsing string input into a bigint
|
|
3116
3237
|
*
|
|
3238
|
+
* @stability stable
|
|
3117
3239
|
* @category schemas
|
|
3118
3240
|
* @since 4.0.0
|
|
3119
3241
|
*/
|
|
@@ -3121,6 +3243,7 @@ export const BigInt: BigInt = make(SchemaAST.bigInt)
|
|
|
3121
3243
|
/**
|
|
3122
3244
|
* Type-level representation of {@link Void}.
|
|
3123
3245
|
*
|
|
3246
|
+
* @stability stable
|
|
3124
3247
|
* @category models
|
|
3125
3248
|
* @since 3.10.0
|
|
3126
3249
|
*/
|
|
@@ -3141,6 +3264,7 @@ export interface Void extends Bottom<void, void, never, never, SchemaAST.Void, V
|
|
|
3141
3264
|
* as `void`.
|
|
3142
3265
|
*
|
|
3143
3266
|
* @see {@link Undefined} for a schema that matches only the exact `undefined` value.
|
|
3267
|
+
* @stability stable
|
|
3144
3268
|
* @category schemas
|
|
3145
3269
|
* @since 3.10.0
|
|
3146
3270
|
*/
|
|
@@ -3148,6 +3272,7 @@ export const Void: Void = make(SchemaAST.void)
|
|
|
3148
3272
|
/**
|
|
3149
3273
|
* Type-level representation of {@link ObjectKeyword}.
|
|
3150
3274
|
*
|
|
3275
|
+
* @stability stable
|
|
3151
3276
|
* @category models
|
|
3152
3277
|
* @since 4.0.0
|
|
3153
3278
|
*/
|
|
@@ -3156,6 +3281,7 @@ export interface ObjectKeyword extends Bottom<object, object, never, never, Sche
|
|
|
3156
3281
|
* Schema for the `object` type. Validates that the input is a non-null object or function
|
|
3157
3282
|
* (i.e. `typeof value === "object" && value !== null || typeof value === "function"`).
|
|
3158
3283
|
*
|
|
3284
|
+
* @stability stable
|
|
3159
3285
|
* @category schemas
|
|
3160
3286
|
* @since 4.0.0
|
|
3161
3287
|
*/
|
|
@@ -3163,6 +3289,7 @@ export const ObjectKeyword: ObjectKeyword = make(SchemaAST.objectKeyword)
|
|
|
3163
3289
|
/**
|
|
3164
3290
|
* Type-level representation returned by {@link UniqueSymbol}.
|
|
3165
3291
|
*
|
|
3292
|
+
* @stability stable
|
|
3166
3293
|
* @category models
|
|
3167
3294
|
* @since 4.0.0
|
|
3168
3295
|
*/
|
|
@@ -3189,6 +3316,7 @@ export interface UniqueSymbol<sym extends symbol>
|
|
|
3189
3316
|
* ```
|
|
3190
3317
|
*
|
|
3191
3318
|
* @see {@link Symbol} for a schema that accepts any symbol.
|
|
3319
|
+
* @stability stable
|
|
3192
3320
|
* @category constructors
|
|
3193
3321
|
* @since 4.0.0
|
|
3194
3322
|
*/
|
|
@@ -3210,6 +3338,7 @@ export function UniqueSymbol<const sym extends symbol>(symbol: sym): UniqueSymbo
|
|
|
3210
3338
|
* - `Struct.MakeIn<F>` — constructor input (optional/defaulted fields may be omitted)
|
|
3211
3339
|
* - `Struct.DecodingServices<F>` / `Struct.EncodingServices<F>` — required services
|
|
3212
3340
|
*
|
|
3341
|
+
* @stability stable
|
|
3213
3342
|
* @since 3.10.0
|
|
3214
3343
|
*/
|
|
3215
3344
|
export declare namespace Struct {
|
|
@@ -3344,6 +3473,7 @@ export declare namespace Struct {
|
|
|
3344
3473
|
/**
|
|
3345
3474
|
* Type-level representation returned by {@link Struct}.
|
|
3346
3475
|
*
|
|
3476
|
+
* @stability stable
|
|
3347
3477
|
* @category models
|
|
3348
3478
|
* @since 3.10.0
|
|
3349
3479
|
*/
|
|
@@ -3448,6 +3578,7 @@ function makeStruct<const Fields extends Struct.Fields>(ast: SchemaAST.Objects,
|
|
|
3448
3578
|
* Schema.decodeUnknownSync(Person)({ name: "Alice", age: 30 }) // => { name: "Alice", age: 30 }
|
|
3449
3579
|
* ```
|
|
3450
3580
|
*
|
|
3581
|
+
* @stability stable
|
|
3451
3582
|
* @category constructors
|
|
3452
3583
|
* @since 3.10.0
|
|
3453
3584
|
*/
|
|
@@ -3487,6 +3618,7 @@ interface fieldsAssign<NewFields extends Struct.Fields> extends Lambda {
|
|
|
3487
3618
|
* Schema.decodeSync(schema)({ a: "a", c: 1 }) // => { a: "a", c: 1 }
|
|
3488
3619
|
* ```
|
|
3489
3620
|
*
|
|
3621
|
+
* @stability stable
|
|
3490
3622
|
* @category combinators
|
|
3491
3623
|
* @since 4.0.0
|
|
3492
3624
|
*/
|
|
@@ -3496,6 +3628,7 @@ export function fieldsAssign<const NewFields extends Struct.Fields>(fields: NewF
|
|
|
3496
3628
|
/**
|
|
3497
3629
|
* Type-level representation returned by {@link encodeKeys}.
|
|
3498
3630
|
*
|
|
3631
|
+
* @stability stable
|
|
3499
3632
|
* @category transforming
|
|
3500
3633
|
* @since 4.0.0
|
|
3501
3634
|
*/
|
|
@@ -3540,6 +3673,7 @@ const canonicalPropertyKey = (key: PropertyKey): string | symbol =>
|
|
|
3540
3673
|
* Schema.decodeUnknownSync(Encoded)({ full_name: "Alice", age: 30 }) // => { name: "Alice", age: 30 }
|
|
3541
3674
|
* ```
|
|
3542
3675
|
*
|
|
3676
|
+
* @stability stable
|
|
3543
3677
|
* @category transforming
|
|
3544
3678
|
* @since 4.0.0
|
|
3545
3679
|
*/
|
|
@@ -3603,6 +3737,7 @@ export function encodeKeys<
|
|
|
3603
3737
|
* alice.fullName // => "Alice Smith"
|
|
3604
3738
|
* ```
|
|
3605
3739
|
*
|
|
3740
|
+
* @stability stable
|
|
3606
3741
|
* @category transforming
|
|
3607
3742
|
* @since 4.0.0
|
|
3608
3743
|
*/
|
|
@@ -3649,6 +3784,7 @@ export function extendTo<S extends Struct<Struct.Fields>, const Fields extends S
|
|
|
3649
3784
|
* - `Record.Type<K, V>` — decoded type of the record
|
|
3650
3785
|
* - `Record.Encoded<K, V>` — encoded type of the record
|
|
3651
3786
|
*
|
|
3787
|
+
* @stability stable
|
|
3652
3788
|
* @since 3.10.0
|
|
3653
3789
|
*/
|
|
3654
3790
|
export declare namespace Record {
|
|
@@ -3807,6 +3943,7 @@ export declare namespace Record {
|
|
|
3807
3943
|
/**
|
|
3808
3944
|
* Type-level representation returned by {@link Record}.
|
|
3809
3945
|
*
|
|
3946
|
+
* @stability stable
|
|
3810
3947
|
* @category models
|
|
3811
3948
|
* @since 4.0.0
|
|
3812
3949
|
*/
|
|
@@ -3861,6 +3998,7 @@ export interface $Record<Key extends Record.Key, Value extends Constraint> exten
|
|
|
3861
3998
|
* Schema.decodeUnknownSync(schema)({ a: 1, b: 2 }) // => { a: 1, b: 2 }
|
|
3862
3999
|
* ```
|
|
3863
4000
|
*
|
|
4001
|
+
* @stability stable
|
|
3864
4002
|
* @category constructors
|
|
3865
4003
|
* @since 3.10.0
|
|
3866
4004
|
*/
|
|
@@ -3878,6 +4016,7 @@ export function Record<Key extends Record.Key, Value extends Constraint>(
|
|
|
3878
4016
|
* - `StructWithRest.Type<S, R>` — decoded type (struct type intersected with record types)
|
|
3879
4017
|
* - `StructWithRest.Encoded<S, R>` — encoded type
|
|
3880
4018
|
*
|
|
4019
|
+
* @stability stable
|
|
3881
4020
|
* @since 4.0.0
|
|
3882
4021
|
*/
|
|
3883
4022
|
export declare namespace StructWithRest {
|
|
@@ -4030,6 +4169,7 @@ export declare namespace StructWithRest {
|
|
|
4030
4169
|
/**
|
|
4031
4170
|
* Type-level representation returned by {@link StructWithRest}.
|
|
4032
4171
|
*
|
|
4172
|
+
* @stability stable
|
|
4033
4173
|
* @category models
|
|
4034
4174
|
* @since 4.0.0
|
|
4035
4175
|
*/
|
|
@@ -4077,6 +4217,7 @@ export interface StructWithRest<
|
|
|
4077
4217
|
* type T = typeof schema.Type
|
|
4078
4218
|
* ```
|
|
4079
4219
|
*
|
|
4220
|
+
* @stability stable
|
|
4080
4221
|
* @category constructors
|
|
4081
4222
|
* @since 4.0.0
|
|
4082
4223
|
*/
|
|
@@ -4099,6 +4240,7 @@ export function StructWithRest<
|
|
|
4099
4240
|
* - `Tuple.Encoded<E>` — encoded tuple type
|
|
4100
4241
|
* - `Tuple.MakeIn<E>` — constructor input tuple
|
|
4101
4242
|
*
|
|
4243
|
+
* @stability stable
|
|
4102
4244
|
* @since 3.10.0
|
|
4103
4245
|
*/
|
|
4104
4246
|
export declare namespace Tuple {
|
|
@@ -4212,6 +4354,7 @@ export declare namespace Tuple {
|
|
|
4212
4354
|
/**
|
|
4213
4355
|
* Type-level representation returned by {@link Tuple}.
|
|
4214
4356
|
*
|
|
4357
|
+
* @stability stable
|
|
4215
4358
|
* @category models
|
|
4216
4359
|
* @since 3.10.0
|
|
4217
4360
|
*/
|
|
@@ -4281,6 +4424,7 @@ function makeTuple<Elements extends Tuple.Elements>(ast: SchemaAST.Arrays, eleme
|
|
|
4281
4424
|
* Schema.decodeUnknownSync(schema)(["hello", 42]) // => ["hello", 42]
|
|
4282
4425
|
* ```
|
|
4283
4426
|
*
|
|
4427
|
+
* @stability stable
|
|
4284
4428
|
* @category constructors
|
|
4285
4429
|
* @since 3.10.0
|
|
4286
4430
|
*/
|
|
@@ -4297,6 +4441,7 @@ export function Tuple<const Elements extends ReadonlyArray<Constraint>>(elements
|
|
|
4297
4441
|
* - `TupleWithRest.Type<T, R>` — decoded type (fixed elements + rest)
|
|
4298
4442
|
* - `TupleWithRest.Encoded<T, R>` — encoded type
|
|
4299
4443
|
*
|
|
4444
|
+
* @stability stable
|
|
4300
4445
|
* @since 4.0.0
|
|
4301
4446
|
*/
|
|
4302
4447
|
export declare namespace TupleWithRest {
|
|
@@ -4414,6 +4559,7 @@ export declare namespace TupleWithRest {
|
|
|
4414
4559
|
/**
|
|
4415
4560
|
* Type-level representation returned by {@link TupleWithRest}.
|
|
4416
4561
|
*
|
|
4562
|
+
* @stability stable
|
|
4417
4563
|
* @category models
|
|
4418
4564
|
* @since 4.0.0
|
|
4419
4565
|
*/
|
|
@@ -4461,6 +4607,7 @@ export interface TupleWithRest<
|
|
|
4461
4607
|
* Schema.decodeUnknownSync(schema)(["hello", 1, true, false]) // => ["hello", 1, true, false]
|
|
4462
4608
|
* ```
|
|
4463
4609
|
*
|
|
4610
|
+
* @stability stable
|
|
4464
4611
|
* @category constructors
|
|
4465
4612
|
* @since 4.0.0
|
|
4466
4613
|
*/
|
|
@@ -4473,6 +4620,7 @@ export function TupleWithRest<S extends Tuple<Tuple.Elements>, const Rest extend
|
|
|
4473
4620
|
/**
|
|
4474
4621
|
* Type-level representation returned by {@link Array}.
|
|
4475
4622
|
*
|
|
4623
|
+
* @stability stable
|
|
4476
4624
|
* @category models
|
|
4477
4625
|
* @since 4.0.0
|
|
4478
4626
|
*/
|
|
@@ -4516,6 +4664,7 @@ export {
|
|
|
4516
4664
|
* Schema.decodeUnknownSync(schema)(["a", "b", "c"]) // => ["a", "b", "c"]
|
|
4517
4665
|
* ```
|
|
4518
4666
|
*
|
|
4667
|
+
* @stability stable
|
|
4519
4668
|
* @category constructors
|
|
4520
4669
|
* @since 4.0.0
|
|
4521
4670
|
*/
|
|
@@ -4538,6 +4687,7 @@ export function withArrayLengthConstraints<Item extends Constraint>(
|
|
|
4538
4687
|
/**
|
|
4539
4688
|
* Type-level representation returned by {@link NonEmptyArray}.
|
|
4540
4689
|
*
|
|
4690
|
+
* @stability stable
|
|
4541
4691
|
* @category models
|
|
4542
4692
|
* @since 3.10.0
|
|
4543
4693
|
*/
|
|
@@ -4574,6 +4724,7 @@ interface NonEmptyArrayLambda extends Lambda {
|
|
|
4574
4724
|
* Schema.decodeUnknownSync(schema)([1, 2, 3]) // => [1, 2, 3]
|
|
4575
4725
|
* ```
|
|
4576
4726
|
*
|
|
4727
|
+
* @stability stable
|
|
4577
4728
|
* @category constructors
|
|
4578
4729
|
* @since 3.10.0
|
|
4579
4730
|
*/
|
|
@@ -4583,6 +4734,7 @@ export const NonEmptyArray: NonEmptyArrayLambda = Struct_.lambda<NonEmptyArrayLa
|
|
|
4583
4734
|
/**
|
|
4584
4735
|
* Type-level representation returned by {@link ArrayEnsure}.
|
|
4585
4736
|
*
|
|
4737
|
+
* @stability stable
|
|
4586
4738
|
* @category constructors
|
|
4587
4739
|
* @since 3.10.0
|
|
4588
4740
|
*/
|
|
@@ -4612,6 +4764,7 @@ export interface ArrayEnsure<S extends Constraint> extends decodeTo<$Array<toTyp
|
|
|
4612
4764
|
* @see {@link Array} for accepting only array input
|
|
4613
4765
|
* @see {@link NonEmptyArray} for requiring at least one decoded element
|
|
4614
4766
|
*
|
|
4767
|
+
* @stability stable
|
|
4615
4768
|
* @category constructors
|
|
4616
4769
|
* @since 3.10.0
|
|
4617
4770
|
*/
|
|
@@ -4630,6 +4783,7 @@ export function ArrayEnsure<S extends Constraint>(schema: S): ArrayEnsure<S> {
|
|
|
4630
4783
|
/**
|
|
4631
4784
|
* Type-level representation returned by {@link UniqueArray}.
|
|
4632
4785
|
*
|
|
4786
|
+
* @stability stable
|
|
4633
4787
|
* @category models
|
|
4634
4788
|
* @since 4.0.0
|
|
4635
4789
|
*/
|
|
@@ -4644,6 +4798,7 @@ export interface UniqueArray<S extends Constraint> extends $Array<S> {
|
|
|
4644
4798
|
* The equivalence used to determine uniqueness is the one provided by
|
|
4645
4799
|
* `Schema.toEquivalence(item)`.
|
|
4646
4800
|
*
|
|
4801
|
+
* @stability stable
|
|
4647
4802
|
* @category constructors
|
|
4648
4803
|
* @since 4.0.0
|
|
4649
4804
|
*/
|
|
@@ -4653,6 +4808,7 @@ export function UniqueArray<S extends Constraint>(item: S): UniqueArray<S> {
|
|
|
4653
4808
|
/**
|
|
4654
4809
|
* Type-level representation returned by {@link mutable}.
|
|
4655
4810
|
*
|
|
4811
|
+
* @stability stable
|
|
4656
4812
|
* @category transforming
|
|
4657
4813
|
* @since 3.10.0
|
|
4658
4814
|
*/
|
|
@@ -4710,6 +4866,7 @@ interface mutableLambda extends Lambda {
|
|
|
4710
4866
|
* value // => [1, 2, 3]
|
|
4711
4867
|
* ```
|
|
4712
4868
|
*
|
|
4869
|
+
* @stability stable
|
|
4713
4870
|
* @category transforming
|
|
4714
4871
|
* @since 3.10.0
|
|
4715
4872
|
*/
|
|
@@ -4719,6 +4876,7 @@ export const mutable: mutableLambda = Struct_.lambda<mutableLambda>((schema) =>
|
|
|
4719
4876
|
/**
|
|
4720
4877
|
* Type-level representation returned by {@link Union}.
|
|
4721
4878
|
*
|
|
4879
|
+
* @stability stable
|
|
4722
4880
|
* @category models
|
|
4723
4881
|
* @since 3.10.0
|
|
4724
4882
|
*/
|
|
@@ -4802,6 +4960,7 @@ function makeUnion<Members extends ReadonlyArray<Constraint>>(
|
|
|
4802
4960
|
* Schema.decodeUnknownSync(schema)(42) // => 42
|
|
4803
4961
|
* ```
|
|
4804
4962
|
*
|
|
4963
|
+
* @stability stable
|
|
4805
4964
|
* @category constructors
|
|
4806
4965
|
* @since 3.10.0
|
|
4807
4966
|
*/
|
|
@@ -4814,6 +4973,7 @@ export function Union<const Members extends ReadonlyArray<Constraint>>(
|
|
|
4814
4973
|
/**
|
|
4815
4974
|
* Type-level representation returned by {@link Literals}.
|
|
4816
4975
|
*
|
|
4976
|
+
* @stability stable
|
|
4817
4977
|
* @category models
|
|
4818
4978
|
* @since 4.0.0
|
|
4819
4979
|
*/
|
|
@@ -4846,6 +5006,7 @@ export interface Literals<L extends ReadonlyArray<SchemaAST.LiteralValue>>
|
|
|
4846
5006
|
* ```
|
|
4847
5007
|
*
|
|
4848
5008
|
* @see {@link Literal} for a schema that represents a single literal.
|
|
5009
|
+
* @stability stable
|
|
4849
5010
|
* @category constructors
|
|
4850
5011
|
* @since 4.0.0
|
|
4851
5012
|
*/
|
|
@@ -4873,6 +5034,7 @@ export function Literals<const L extends ReadonlyArray<SchemaAST.LiteralValue>>(
|
|
|
4873
5034
|
/**
|
|
4874
5035
|
* Type-level representation returned by {@link NullOr}.
|
|
4875
5036
|
*
|
|
5037
|
+
* @stability stable
|
|
4876
5038
|
* @category models
|
|
4877
5039
|
* @since 3.10.0
|
|
4878
5040
|
*/
|
|
@@ -4886,6 +5048,7 @@ interface NullOrLambda extends Lambda {
|
|
|
4886
5048
|
/**
|
|
4887
5049
|
* Creates a union schema of `S | null`.
|
|
4888
5050
|
*
|
|
5051
|
+
* @stability stable
|
|
4889
5052
|
* @category constructors
|
|
4890
5053
|
* @since 3.10.0
|
|
4891
5054
|
*/
|
|
@@ -4893,6 +5056,7 @@ export const NullOr: NullOrLambda = Struct_.lambda<NullOrLambda>((self) => Union
|
|
|
4893
5056
|
/**
|
|
4894
5057
|
* Type-level representation returned by {@link UndefinedOr}.
|
|
4895
5058
|
*
|
|
5059
|
+
* @stability stable
|
|
4896
5060
|
* @category models
|
|
4897
5061
|
* @since 3.10.0
|
|
4898
5062
|
*/
|
|
@@ -4906,6 +5070,7 @@ interface UndefinedOrLambda extends Lambda {
|
|
|
4906
5070
|
/**
|
|
4907
5071
|
* Creates a union schema of `S | undefined`.
|
|
4908
5072
|
*
|
|
5073
|
+
* @stability stable
|
|
4909
5074
|
* @category constructors
|
|
4910
5075
|
* @since 3.10.0
|
|
4911
5076
|
*/
|
|
@@ -4913,6 +5078,7 @@ export const UndefinedOr: UndefinedOrLambda = Struct_.lambda<UndefinedOrLambda>(
|
|
|
4913
5078
|
/**
|
|
4914
5079
|
* Type-level representation returned by {@link NullishOr}.
|
|
4915
5080
|
*
|
|
5081
|
+
* @stability stable
|
|
4916
5082
|
* @category models
|
|
4917
5083
|
* @since 3.10.0
|
|
4918
5084
|
*/
|
|
@@ -4926,6 +5092,7 @@ interface NullishOrLambda extends Lambda {
|
|
|
4926
5092
|
/**
|
|
4927
5093
|
* Creates a union schema of `S | null | undefined`.
|
|
4928
5094
|
*
|
|
5095
|
+
* @stability stable
|
|
4929
5096
|
* @category constructors
|
|
4930
5097
|
* @since 3.10.0
|
|
4931
5098
|
*/
|
|
@@ -4933,6 +5100,7 @@ export const NullishOr: NullishOrLambda = Struct_.lambda<NullishOrLambda>((self)
|
|
|
4933
5100
|
/**
|
|
4934
5101
|
* Type-level representation returned by {@link suspend}.
|
|
4935
5102
|
*
|
|
5103
|
+
* @stability stable
|
|
4936
5104
|
* @category models
|
|
4937
5105
|
* @since 3.10.0
|
|
4938
5106
|
*/
|
|
@@ -4978,6 +5146,7 @@ export interface suspend<S extends Constraint> extends
|
|
|
4978
5146
|
* Schema.decodeSync(Tree)({ value: 1, children: [] }) // => { value: 1, children: [] }
|
|
4979
5147
|
* ```
|
|
4980
5148
|
*
|
|
5149
|
+
* @stability stable
|
|
4981
5150
|
* @category constructors
|
|
4982
5151
|
* @since 3.10.0
|
|
4983
5152
|
*/
|
|
@@ -5000,6 +5169,7 @@ export function suspend<S extends Constraint>(f: () => S): suspend<S> {
|
|
|
5000
5169
|
* Schema.is(AgeSchema)(121) // => false
|
|
5001
5170
|
* ```
|
|
5002
5171
|
*
|
|
5172
|
+
* @stability stable
|
|
5003
5173
|
* @category filtering
|
|
5004
5174
|
* @since 4.0.0
|
|
5005
5175
|
*/
|
|
@@ -5011,6 +5181,7 @@ export function check<S extends Top>(
|
|
|
5011
5181
|
/**
|
|
5012
5182
|
* Type-level representation returned by {@link refine}.
|
|
5013
5183
|
*
|
|
5184
|
+
* @stability stable
|
|
5014
5185
|
* @category filtering
|
|
5015
5186
|
* @since 3.10.0
|
|
5016
5187
|
*/
|
|
@@ -5047,6 +5218,7 @@ export interface refine<T extends S["Type"], S extends Constraint> extends
|
|
|
5047
5218
|
* names type-level failures before the refinement runs; it does not name the
|
|
5048
5219
|
* failed refinement itself.
|
|
5049
5220
|
*
|
|
5221
|
+
* @stability stable
|
|
5050
5222
|
* @category filtering
|
|
5051
5223
|
* @since 3.10.0
|
|
5052
5224
|
*/
|
|
@@ -5066,6 +5238,7 @@ type FromBrandKeys<A extends Brand.Brand<any>> = A extends unknown ? Brand.Brand
|
|
|
5066
5238
|
/**
|
|
5067
5239
|
* Type-level representation returned by {@link brand}.
|
|
5068
5240
|
*
|
|
5241
|
+
* @stability stable
|
|
5069
5242
|
* @category branding
|
|
5070
5243
|
* @since 3.10.0
|
|
5071
5244
|
*/
|
|
@@ -5112,6 +5285,7 @@ export interface brand<S extends Constraint, B extends string> extends
|
|
|
5112
5285
|
*
|
|
5113
5286
|
* @see {@link fromBrand} for applying a Brand constructor's checks along with its branded type
|
|
5114
5287
|
*
|
|
5288
|
+
* @stability stable
|
|
5115
5289
|
* @category branding
|
|
5116
5290
|
* @since 3.10.0
|
|
5117
5291
|
*/
|
|
@@ -5135,6 +5309,7 @@ export function brand<B extends string>(identifier: B & EnsureSingleBrandKey<B>)
|
|
|
5135
5309
|
*
|
|
5136
5310
|
* @see {@link brand} for adding a brand without constructor checks
|
|
5137
5311
|
*
|
|
5312
|
+
* @stability stable
|
|
5138
5313
|
* @category branding
|
|
5139
5314
|
* @since 3.10.0
|
|
5140
5315
|
*/
|
|
@@ -5152,6 +5327,7 @@ export function fromBrand<A extends Brand.Brand<any>>(
|
|
|
5152
5327
|
/**
|
|
5153
5328
|
* Type-level representation returned by {@link middlewareDecoding}.
|
|
5154
5329
|
*
|
|
5330
|
+
* @stability stable
|
|
5155
5331
|
* @category decoding
|
|
5156
5332
|
* @since 4.0.0
|
|
5157
5333
|
*/
|
|
@@ -5201,6 +5377,7 @@ export interface middlewareDecoding<S extends Constraint, RD> extends
|
|
|
5201
5377
|
* ```
|
|
5202
5378
|
*
|
|
5203
5379
|
* @see {@link catchDecoding} for a simpler error-recovery variant
|
|
5380
|
+
* @stability stable
|
|
5204
5381
|
* @category decoding
|
|
5205
5382
|
* @since 4.0.0
|
|
5206
5383
|
*/
|
|
@@ -5219,6 +5396,7 @@ export function middlewareDecoding<S extends Constraint, RD>(
|
|
|
5219
5396
|
/**
|
|
5220
5397
|
* Type-level representation returned by {@link middlewareEncoding}.
|
|
5221
5398
|
*
|
|
5399
|
+
* @stability stable
|
|
5222
5400
|
* @category encoding
|
|
5223
5401
|
* @since 4.0.0
|
|
5224
5402
|
*/
|
|
@@ -5268,6 +5446,7 @@ export interface middlewareEncoding<S extends Constraint, RE> extends
|
|
|
5268
5446
|
* ```
|
|
5269
5447
|
*
|
|
5270
5448
|
* @see {@link catchEncoding} for a simpler error-recovery variant
|
|
5449
|
+
* @stability stable
|
|
5271
5450
|
* @category encoding
|
|
5272
5451
|
* @since 4.0.0
|
|
5273
5452
|
*/
|
|
@@ -5303,6 +5482,7 @@ export function middlewareEncoding<S extends Constraint, RE>(
|
|
|
5303
5482
|
* ```
|
|
5304
5483
|
*
|
|
5305
5484
|
* @see {@link catchDecodingWithContext} to add service requirements to the handler
|
|
5485
|
+
* @stability stable
|
|
5306
5486
|
* @category error handling
|
|
5307
5487
|
* @since 4.0.0
|
|
5308
5488
|
*/
|
|
@@ -5328,6 +5508,7 @@ export function catchDecoding<S extends Constraint>(
|
|
|
5328
5508
|
* @see {@link catchDecoding} for recovery handlers that do not require services
|
|
5329
5509
|
* @see {@link middlewareDecoding} for intercepting or replacing the full decoding pipeline
|
|
5330
5510
|
*
|
|
5511
|
+
* @stability stable
|
|
5331
5512
|
* @category error handling
|
|
5332
5513
|
* @since 4.0.0
|
|
5333
5514
|
*/
|
|
@@ -5346,6 +5527,7 @@ export function catchDecodingWithContext<S extends Constraint, R = never>(
|
|
|
5346
5527
|
* succeeds with a fallback value or re-fails with a (possibly different) issue.
|
|
5347
5528
|
*
|
|
5348
5529
|
* @see {@link catchEncodingWithContext} to add service requirements to the handler
|
|
5530
|
+
* @stability stable
|
|
5349
5531
|
* @category error handling
|
|
5350
5532
|
* @since 4.0.0
|
|
5351
5533
|
*/
|
|
@@ -5371,6 +5553,7 @@ export function catchEncoding<S extends Constraint>(
|
|
|
5371
5553
|
* @see {@link catchEncoding} for recovery handlers that do not require services
|
|
5372
5554
|
* @see {@link middlewareEncoding} for intercepting or replacing the full encoding pipeline
|
|
5373
5555
|
*
|
|
5556
|
+
* @stability stable
|
|
5374
5557
|
* @category error handling
|
|
5375
5558
|
* @since 4.0.0
|
|
5376
5559
|
*/
|
|
@@ -5383,6 +5566,7 @@ export function catchEncodingWithContext<S extends Constraint, R = never>(
|
|
|
5383
5566
|
/**
|
|
5384
5567
|
* Type-level representation returned by {@link decodeTo}.
|
|
5385
5568
|
*
|
|
5569
|
+
* @stability stable
|
|
5386
5570
|
* @category transforming
|
|
5387
5571
|
* @since 4.0.0
|
|
5388
5572
|
*/
|
|
@@ -5411,6 +5595,7 @@ export interface decodeTo<To extends Constraint, From extends Constraint, RD = n
|
|
|
5411
5595
|
/**
|
|
5412
5596
|
* Type-level representation returned by {@link decodeTo} without a custom transformation.
|
|
5413
5597
|
*
|
|
5598
|
+
* @stability stable
|
|
5414
5599
|
* @category transforming
|
|
5415
5600
|
* @since 3.10.0
|
|
5416
5601
|
*/
|
|
@@ -5459,6 +5644,7 @@ export interface compose<To extends Constraint, From extends Constraint> extends
|
|
|
5459
5644
|
* Schema.decodeUnknownSync(NumberFromString)("123") // => 123
|
|
5460
5645
|
* ```
|
|
5461
5646
|
*
|
|
5647
|
+
* @stability stable
|
|
5462
5648
|
* @category transforming
|
|
5463
5649
|
* @since 4.0.0
|
|
5464
5650
|
*/
|
|
@@ -5562,6 +5748,7 @@ export const BooleanLiterals = Literals([...TrueLiterals.literals, ...FalseLiter
|
|
|
5562
5748
|
* Schema.decodeUnknownSync(Trimmed)(" hello ") // => "hello"
|
|
5563
5749
|
* ```
|
|
5564
5750
|
*
|
|
5751
|
+
* @stability stable
|
|
5565
5752
|
* @category transforming
|
|
5566
5753
|
* @since 4.0.0
|
|
5567
5754
|
*/
|
|
@@ -5600,6 +5787,7 @@ export function decode<S extends Constraint, RD = never, RE = never>(transformat
|
|
|
5600
5787
|
* Schema.decodeSync(NumberFromString)("42") // => 42
|
|
5601
5788
|
* ```
|
|
5602
5789
|
*
|
|
5790
|
+
* @stability stable
|
|
5603
5791
|
* @category transforming
|
|
5604
5792
|
* @since 4.0.0
|
|
5605
5793
|
*/
|
|
@@ -5649,6 +5837,7 @@ export function encodeTo<To extends Constraint, From extends Constraint, RD = ne
|
|
|
5649
5837
|
* Schema.encodeSync(UpperFromLower)("hello") // => "HELLO"
|
|
5650
5838
|
* ```
|
|
5651
5839
|
*
|
|
5840
|
+
* @stability stable
|
|
5652
5841
|
* @category transforming
|
|
5653
5842
|
* @since 4.0.0
|
|
5654
5843
|
*/
|
|
@@ -5667,6 +5856,7 @@ export function encode<S extends Constraint, RD = never, RE = never>(transformat
|
|
|
5667
5856
|
*
|
|
5668
5857
|
* Only schemas that satisfy this constraint can be passed to {@link withConstructorDefault}.
|
|
5669
5858
|
*
|
|
5859
|
+
* @stability stable
|
|
5670
5860
|
* @category models
|
|
5671
5861
|
* @since 4.0.0
|
|
5672
5862
|
*/
|
|
@@ -5676,6 +5866,7 @@ export interface WithoutConstructorDefault {
|
|
|
5676
5866
|
/**
|
|
5677
5867
|
* Type-level representation returned by {@link withConstructorDefault}.
|
|
5678
5868
|
*
|
|
5869
|
+
* @stability stable
|
|
5679
5870
|
* @category constructors
|
|
5680
5871
|
* @since 3.10.0
|
|
5681
5872
|
*/
|
|
@@ -5723,6 +5914,7 @@ export interface withConstructorDefault<S extends Constraint & WithoutConstructo
|
|
|
5723
5914
|
* MySchema.make({}).name // => "anonymous"
|
|
5724
5915
|
* ```
|
|
5725
5916
|
*
|
|
5917
|
+
* @stability stable
|
|
5726
5918
|
* @category constructors
|
|
5727
5919
|
* @since 3.10.0
|
|
5728
5920
|
*/
|
|
@@ -5737,6 +5929,7 @@ export function withConstructorDefault<S extends Constraint & WithoutConstructor
|
|
|
5737
5929
|
/**
|
|
5738
5930
|
* Type-level representation returned by {@link withDecodingDefaultKey}.
|
|
5739
5931
|
*
|
|
5932
|
+
* @stability stable
|
|
5740
5933
|
* @category decoding
|
|
5741
5934
|
* @since 4.0.0
|
|
5742
5935
|
*/
|
|
@@ -5754,6 +5947,7 @@ export interface withDecodingDefaultKey<S extends Constraint, R = never>
|
|
|
5754
5947
|
* - `"passthrough"` (default): pass the value through during encoding
|
|
5755
5948
|
* - `"omit"`: omit the key from the encoded output
|
|
5756
5949
|
*
|
|
5950
|
+
* @stability stable
|
|
5757
5951
|
* @category options
|
|
5758
5952
|
* @since 4.0.0
|
|
5759
5953
|
*/
|
|
@@ -5796,6 +5990,7 @@ function toIssueEffect<A, R>(
|
|
|
5796
5990
|
*
|
|
5797
5991
|
* @see {@link withDecodingDefault} for the value-level variant (key absent **or** `undefined`)
|
|
5798
5992
|
* @see {@link withDecodingDefaultTypeKey} for the variant where the default is a `Type` value
|
|
5993
|
+
* @stability stable
|
|
5799
5994
|
* @category decoding
|
|
5800
5995
|
* @since 4.0.0
|
|
5801
5996
|
*/
|
|
@@ -5814,6 +6009,7 @@ export function withDecodingDefaultKey<S extends Constraint, R = never>(
|
|
|
5814
6009
|
/**
|
|
5815
6010
|
* Type-level representation returned by {@link withDecodingDefaultTypeKey}.
|
|
5816
6011
|
*
|
|
6012
|
+
* @stability stable
|
|
5817
6013
|
* @category decoding
|
|
5818
6014
|
* @since 4.0.0
|
|
5819
6015
|
*/
|
|
@@ -5841,6 +6037,7 @@ export interface withDecodingDefaultTypeKey<S extends Constraint, R = never>
|
|
|
5841
6037
|
*
|
|
5842
6038
|
* @see {@link withDecodingDefaultKey} for the variant where the default is an `Encoded` value
|
|
5843
6039
|
* @see {@link withDecodingDefaultType} for the value-level variant
|
|
6040
|
+
* @stability stable
|
|
5844
6041
|
* @category decoding
|
|
5845
6042
|
* @since 4.0.0
|
|
5846
6043
|
*/
|
|
@@ -5858,6 +6055,7 @@ export function withDecodingDefaultTypeKey<S extends Constraint, R = never>(
|
|
|
5858
6055
|
/**
|
|
5859
6056
|
* Type-level representation returned by {@link withDecodingDefault}.
|
|
5860
6057
|
*
|
|
6058
|
+
* @stability stable
|
|
5861
6059
|
* @category decoding
|
|
5862
6060
|
* @since 3.10.0
|
|
5863
6061
|
*/
|
|
@@ -5899,6 +6097,7 @@ export interface withDecodingDefault<S extends Constraint, R = never> extends de
|
|
|
5899
6097
|
*
|
|
5900
6098
|
* @see {@link withDecodingDefaultKey} for the key-level variant (key absent only, not `undefined`)
|
|
5901
6099
|
* @see {@link withDecodingDefaultType} for the variant where the default is a `Type` value
|
|
6100
|
+
* @stability stable
|
|
5902
6101
|
* @category decoding
|
|
5903
6102
|
* @since 3.10.0
|
|
5904
6103
|
*/
|
|
@@ -5917,6 +6116,7 @@ export function withDecodingDefault<S extends Constraint, R = never>(
|
|
|
5917
6116
|
/**
|
|
5918
6117
|
* Type-level representation returned by {@link withDecodingDefaultType}.
|
|
5919
6118
|
*
|
|
6119
|
+
* @stability stable
|
|
5920
6120
|
* @category decoding
|
|
5921
6121
|
* @since 4.0.0
|
|
5922
6122
|
*/
|
|
@@ -5949,6 +6149,7 @@ export interface withDecodingDefaultType<S extends Constraint, R = never>
|
|
|
5949
6149
|
*
|
|
5950
6150
|
* @see {@link withDecodingDefault} for the variant where the default is an `Encoded` value
|
|
5951
6151
|
* @see {@link withDecodingDefaultTypeKey} for the key-level variant
|
|
6152
|
+
* @stability stable
|
|
5952
6153
|
* @category decoding
|
|
5953
6154
|
* @since 4.0.0
|
|
5954
6155
|
*/
|
|
@@ -5966,6 +6167,7 @@ export function withDecodingDefaultType<S extends Constraint, R = never>(
|
|
|
5966
6167
|
/**
|
|
5967
6168
|
* Type-level representation returned by {@link tag}.
|
|
5968
6169
|
*
|
|
6170
|
+
* @stability stable
|
|
5969
6171
|
* @category constructors
|
|
5970
6172
|
* @since 3.10.0
|
|
5971
6173
|
*/
|
|
@@ -5989,6 +6191,7 @@ export interface tag<Tag extends SchemaAST.LiteralValue> extends withConstructor
|
|
|
5989
6191
|
*
|
|
5990
6192
|
* @see {@link tagDefaultOmit} to also omit the tag during encoding
|
|
5991
6193
|
* @see {@link TaggedStruct} for a shorthand that adds `_tag` automatically
|
|
6194
|
+
* @stability stable
|
|
5992
6195
|
* @category constructors
|
|
5993
6196
|
* @since 3.10.0
|
|
5994
6197
|
*/
|
|
@@ -6023,6 +6226,7 @@ export function tag<Tag extends SchemaAST.LiteralValue>(literal: Tag): tag<Tag>
|
|
|
6023
6226
|
* ```
|
|
6024
6227
|
*
|
|
6025
6228
|
* @see {@link tag} for the variant that keeps the tag during encoding
|
|
6229
|
+
* @stability stable
|
|
6026
6230
|
* @category constructors
|
|
6027
6231
|
* @since 4.0.0
|
|
6028
6232
|
*/
|
|
@@ -6032,6 +6236,7 @@ export function tagDefaultOmit<Tag extends SchemaAST.LiteralValue>(literal: Tag)
|
|
|
6032
6236
|
/**
|
|
6033
6237
|
* Type-level representation returned by {@link TaggedStruct}.
|
|
6034
6238
|
*
|
|
6239
|
+
* @stability stable
|
|
6035
6240
|
* @category models
|
|
6036
6241
|
* @since 3.10.0
|
|
6037
6242
|
*/
|
|
@@ -6082,6 +6287,7 @@ export type TaggedStruct<Tag extends SchemaAST.LiteralValue, Fields extends Stru
|
|
|
6082
6287
|
* tagged.fields._tag.schema.literal // => "A"
|
|
6083
6288
|
* ```
|
|
6084
6289
|
*
|
|
6290
|
+
* @stability stable
|
|
6085
6291
|
* @category constructors
|
|
6086
6292
|
* @since 3.10.0
|
|
6087
6293
|
*/
|
|
@@ -6111,6 +6317,10 @@ type TaggedUnionUtils<
|
|
|
6111
6317
|
Members
|
|
6112
6318
|
>
|
|
6113
6319
|
> = {
|
|
6320
|
+
/**
|
|
6321
|
+
* Property key used to discriminate union members.
|
|
6322
|
+
*/
|
|
6323
|
+
readonly tag: Tag
|
|
6114
6324
|
/**
|
|
6115
6325
|
* Discriminant values in flattened member order.
|
|
6116
6326
|
*/
|
|
@@ -6164,6 +6374,7 @@ type TaggedUnionUtils<
|
|
|
6164
6374
|
/**
|
|
6165
6375
|
* Type-level representation returned by {@link toTaggedUnion}.
|
|
6166
6376
|
*
|
|
6377
|
+
* @stability stable
|
|
6167
6378
|
* @category combinators
|
|
6168
6379
|
* @since 4.0.0
|
|
6169
6380
|
*/
|
|
@@ -6198,6 +6409,7 @@ export type toTaggedUnion<
|
|
|
6198
6409
|
* ```
|
|
6199
6410
|
*
|
|
6200
6411
|
* @see {@link TaggedUnion} for a shorthand that builds the union from scratch
|
|
6412
|
+
* @stability stable
|
|
6201
6413
|
* @category combinators
|
|
6202
6414
|
* @since 4.0.0
|
|
6203
6415
|
*/
|
|
@@ -6213,7 +6425,7 @@ export function toTaggedUnion<const Tag extends PropertyKey>(tag: Tag) {
|
|
|
6213
6425
|
|
|
6214
6426
|
walk(self)
|
|
6215
6427
|
|
|
6216
|
-
return Object.assign(self, { cases, discriminants, isAnyOf, guards, match, matchOrElse }) as any
|
|
6428
|
+
return Object.assign(self, { tag, cases, discriminants, isAnyOf, guards, match, matchOrElse }) as any
|
|
6217
6429
|
|
|
6218
6430
|
function walk(schema: Constraint) {
|
|
6219
6431
|
const ast = schema.ast
|
|
@@ -6282,6 +6494,7 @@ export function toTaggedUnion<const Tag extends PropertyKey>(tag: Tag) {
|
|
|
6282
6494
|
/**
|
|
6283
6495
|
* Type-level representation returned by {@link TaggedUnion}.
|
|
6284
6496
|
*
|
|
6497
|
+
* @stability stable
|
|
6285
6498
|
* @category models
|
|
6286
6499
|
* @since 4.0.0
|
|
6287
6500
|
*/
|
|
@@ -6298,6 +6511,7 @@ export interface TaggedUnion<Cases extends Record<string, Constraint>> extends
|
|
|
6298
6511
|
readonly "~type.make.in": { [K in keyof Cases]: Cases[K]["~type.make"] }[keyof Cases]
|
|
6299
6512
|
readonly "~type.make": { [K in keyof Cases]: Cases[K]["~type.make"] }[keyof Cases]
|
|
6300
6513
|
readonly "Iso": { [K in keyof Cases]: Cases[K]["Type"] }[keyof Cases]
|
|
6514
|
+
readonly tag: "_tag"
|
|
6301
6515
|
readonly cases: Cases
|
|
6302
6516
|
readonly isAnyOf: <const Keys>(
|
|
6303
6517
|
keys: ReadonlyArray<Keys>
|
|
@@ -6327,7 +6541,7 @@ export interface TaggedUnion<Cases extends Record<string, Constraint>> extends
|
|
|
6327
6541
|
/**
|
|
6328
6542
|
* Builds a discriminated union from a record of field sets, one per variant.
|
|
6329
6543
|
* Each key becomes the `_tag` literal and the value is passed to {@link TaggedStruct}.
|
|
6330
|
-
* The result includes `cases`, `guards`, `isAnyOf`, `match`, and `matchOrElse` utilities.
|
|
6544
|
+
* The result includes `tag`, `cases`, `guards`, `isAnyOf`, `match`, and `matchOrElse` utilities.
|
|
6331
6545
|
*
|
|
6332
6546
|
* **Example** (Pattern matching a discriminated union)
|
|
6333
6547
|
*
|
|
@@ -6348,6 +6562,7 @@ export interface TaggedUnion<Cases extends Record<string, Constraint>> extends
|
|
|
6348
6562
|
* ```
|
|
6349
6563
|
*
|
|
6350
6564
|
* @see {@link toTaggedUnion} to augment an existing union instead
|
|
6565
|
+
* @stability stable
|
|
6351
6566
|
* @category constructors
|
|
6352
6567
|
* @since 4.0.0
|
|
6353
6568
|
*/
|
|
@@ -6362,12 +6577,13 @@ export function TaggedUnion<const CasesByTag extends Record<string, Struct.Field
|
|
|
6362
6577
|
members.push(member)
|
|
6363
6578
|
}
|
|
6364
6579
|
const union = Union(members)
|
|
6365
|
-
const { guards, isAnyOf, match, matchOrElse } = toTaggedUnion("_tag")(union)
|
|
6366
|
-
return make(union.ast, { cases, isAnyOf, guards, match, matchOrElse })
|
|
6580
|
+
const { tag, guards, isAnyOf, match, matchOrElse } = toTaggedUnion("_tag")(union)
|
|
6581
|
+
return make(union.ast, { tag, cases, isAnyOf, guards, match, matchOrElse })
|
|
6367
6582
|
}
|
|
6368
6583
|
/**
|
|
6369
6584
|
* Type-level representation returned by {@link Opaque}.
|
|
6370
6585
|
*
|
|
6586
|
+
* @stability stable
|
|
6371
6587
|
* @category models
|
|
6372
6588
|
* @since 4.0.0
|
|
6373
6589
|
*/
|
|
@@ -6413,6 +6629,7 @@ export interface Opaque<Self, S extends Top, Brand> extends
|
|
|
6413
6629
|
* person.name // => "Alice"
|
|
6414
6630
|
* ```
|
|
6415
6631
|
*
|
|
6632
|
+
* @stability stable
|
|
6416
6633
|
* @category constructors
|
|
6417
6634
|
* @since 4.0.0
|
|
6418
6635
|
*/
|
|
@@ -6424,6 +6641,7 @@ export function Opaque<Self, Brand = {}>() {
|
|
|
6424
6641
|
/**
|
|
6425
6642
|
* Type-level representation returned by {@link instanceOf}.
|
|
6426
6643
|
*
|
|
6644
|
+
* @stability stable
|
|
6427
6645
|
* @category models
|
|
6428
6646
|
* @since 3.10.0
|
|
6429
6647
|
*/
|
|
@@ -6445,6 +6663,7 @@ export interface instanceOf<T, Iso = T> extends declare<T, Iso> {
|
|
|
6445
6663
|
* decoded.toISOString() // => "2024-01-01T00:00:00.000Z"
|
|
6446
6664
|
* ```
|
|
6447
6665
|
*
|
|
6666
|
+
* @stability stable
|
|
6448
6667
|
* @category constructors
|
|
6449
6668
|
* @since 3.10.0
|
|
6450
6669
|
*/
|
|
@@ -6458,6 +6677,7 @@ export function instanceOf<C extends abstract new(...args: any) => any, Iso = In
|
|
|
6458
6677
|
* Constructs an `SchemaAST.Link` that describes how a value of type `T` encodes to and decodes from a `To` schema.
|
|
6459
6678
|
* Used when building low-level AST transformations that bridge two schema types.
|
|
6460
6679
|
*
|
|
6680
|
+
* @stability stable
|
|
6461
6681
|
* @category transforming
|
|
6462
6682
|
* @since 4.0.0
|
|
6463
6683
|
*/
|
|
@@ -6527,6 +6747,7 @@ export function link<T>() {
|
|
|
6527
6747
|
* }
|
|
6528
6748
|
* ```
|
|
6529
6749
|
*
|
|
6750
|
+
* @stability stable
|
|
6530
6751
|
* @category constructors
|
|
6531
6752
|
* @since 4.0.0
|
|
6532
6753
|
*/
|
|
@@ -6551,6 +6772,7 @@ export const makeFilter: <T>(
|
|
|
6551
6772
|
* `reportInput`) or a full {@link SchemaIssue.Issue} (returned unchanged);
|
|
6552
6773
|
* the result is wrapped in an {@link SchemaIssue.Pointer} at the given `path`.
|
|
6553
6774
|
*
|
|
6775
|
+
* @stability stable
|
|
6554
6776
|
* @category models
|
|
6555
6777
|
* @since 3.10.0
|
|
6556
6778
|
*/
|
|
@@ -6578,6 +6800,7 @@ export type FilterIssue = string | SchemaIssue.Issue | {
|
|
|
6578
6800
|
* to returning that element directly; otherwise the entries are grouped
|
|
6579
6801
|
* into an {@link SchemaIssue.Composite}.
|
|
6580
6802
|
*
|
|
6803
|
+
* @stability stable
|
|
6581
6804
|
* @category models
|
|
6582
6805
|
* @since 3.10.0
|
|
6583
6806
|
*/
|
|
@@ -6586,6 +6809,7 @@ export type FilterOutput = undefined | boolean | FilterIssue | ReadonlyArray<Fil
|
|
|
6586
6809
|
* Groups multiple checks into a single {@link SchemaAST.FilterGroup}, applying
|
|
6587
6810
|
* optional shared annotations to the group as a whole.
|
|
6588
6811
|
*
|
|
6812
|
+
* @stability stable
|
|
6589
6813
|
* @category constructors
|
|
6590
6814
|
* @since 4.0.0
|
|
6591
6815
|
*/
|
|
@@ -6612,6 +6836,7 @@ const TRIMMED_PATTERN = "^\\S[\\s\\S]*\\S$|^\\S$|^$"
|
|
|
6612
6836
|
* During arbitrary generation, this applies a `patterns`
|
|
6613
6837
|
* constraint to ensure generated strings match the trimmed pattern.
|
|
6614
6838
|
*
|
|
6839
|
+
* @stability stable
|
|
6615
6840
|
* @category validation
|
|
6616
6841
|
* @since 4.0.0
|
|
6617
6842
|
*/
|
|
@@ -6650,6 +6875,7 @@ export function isTrimmed(annotations?: Annotations.Filter) {
|
|
|
6650
6875
|
* During arbitrary generation, this applies a `patterns`
|
|
6651
6876
|
* constraint to ensure generated strings match the specified RegExp pattern.
|
|
6652
6877
|
*
|
|
6878
|
+
* @stability stable
|
|
6653
6879
|
* @category validation
|
|
6654
6880
|
* @since 4.0.0
|
|
6655
6881
|
*/
|
|
@@ -6684,6 +6910,7 @@ export function isPattern(
|
|
|
6684
6910
|
* During arbitrary generation, this applies a `patterns`
|
|
6685
6911
|
* constraint to ensure generated strings match the number string pattern.
|
|
6686
6912
|
*
|
|
6913
|
+
* @stability stable
|
|
6687
6914
|
* @category validation
|
|
6688
6915
|
* @since 4.0.0
|
|
6689
6916
|
*/
|
|
@@ -6707,6 +6934,7 @@ export function isStringFinite(annotations?: Annotations.Filter): SchemaAST.Filt
|
|
|
6707
6934
|
* This check corresponds to a `pattern` constraint with the same signed
|
|
6708
6935
|
* base-10 integer pattern.
|
|
6709
6936
|
*
|
|
6937
|
+
* @stability stable
|
|
6710
6938
|
* @category validation
|
|
6711
6939
|
* @since 4.0.0
|
|
6712
6940
|
*/
|
|
@@ -6725,6 +6953,7 @@ export function isStringBigInt(annotations?: Annotations.Filter): SchemaAST.Filt
|
|
|
6725
6953
|
* The check uses the pattern `^Symbol\((.*)\)$`. It is not a general test for
|
|
6726
6954
|
* whether a string can be passed to JavaScript's `Symbol()` function.
|
|
6727
6955
|
*
|
|
6956
|
+
* @stability stable
|
|
6728
6957
|
* @category validation
|
|
6729
6958
|
* @since 4.0.0
|
|
6730
6959
|
*/
|
|
@@ -6770,6 +6999,7 @@ const getUUIDRegExp = (version?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8): globalThis.RegE
|
|
|
6770
6999
|
* constraint to ensure generated strings match the UUID pattern.
|
|
6771
7000
|
*
|
|
6772
7001
|
* @see {@link isGUID} for shape-only GUID validation.
|
|
7002
|
+
* @stability stable
|
|
6773
7003
|
* @category validation
|
|
6774
7004
|
* @since 4.0.0
|
|
6775
7005
|
*/
|
|
@@ -6812,6 +7042,7 @@ const GUID_REGEXP = /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{
|
|
|
6812
7042
|
* constraint to ensure generated strings match the GUID pattern.
|
|
6813
7043
|
*
|
|
6814
7044
|
* @see {@link isUUID} for strict UUID validation.
|
|
7045
|
+
* @stability stable
|
|
6815
7046
|
* @category validation
|
|
6816
7047
|
* @since 4.0.0
|
|
6817
7048
|
*/
|
|
@@ -6846,6 +7077,7 @@ export function isGUID(annotations?: Annotations.Filter) {
|
|
|
6846
7077
|
* During arbitrary generation, this applies a `patterns`
|
|
6847
7078
|
* constraint to ensure generated strings match the ULID pattern.
|
|
6848
7079
|
*
|
|
7080
|
+
* @stability stable
|
|
6849
7081
|
* @category validation
|
|
6850
7082
|
* @since 4.0.0
|
|
6851
7083
|
*/
|
|
@@ -6879,6 +7111,7 @@ export function isULID(annotations?: Annotations.Filter) {
|
|
|
6879
7111
|
* During arbitrary generation, this applies a `patterns`
|
|
6880
7112
|
* constraint to ensure generated strings match the Base64 pattern.
|
|
6881
7113
|
*
|
|
7114
|
+
* @stability stable
|
|
6882
7115
|
* @category validation
|
|
6883
7116
|
* @since 4.0.0
|
|
6884
7117
|
*/
|
|
@@ -6914,6 +7147,7 @@ export function isBase64(annotations?: Annotations.Filter) {
|
|
|
6914
7147
|
* During arbitrary generation, this applies a `patterns`
|
|
6915
7148
|
* constraint to ensure generated strings match the Base64URL pattern.
|
|
6916
7149
|
*
|
|
7150
|
+
* @stability stable
|
|
6917
7151
|
* @category validation
|
|
6918
7152
|
* @since 4.0.0
|
|
6919
7153
|
*/
|
|
@@ -6953,6 +7187,7 @@ function literalToJsonSchema(
|
|
|
6953
7187
|
* metadata. If the prefix ends with a high surrogate, the JSON Schema pattern
|
|
6954
7188
|
* omits that code unit so Unicode matching cannot reject a valid string.
|
|
6955
7189
|
*
|
|
7190
|
+
* @stability stable
|
|
6956
7191
|
* @category validation
|
|
6957
7192
|
* @since 4.0.0
|
|
6958
7193
|
*/
|
|
@@ -6986,6 +7221,7 @@ export function isStartingWith(startsWith: string, annotations?: Annotations.Fil
|
|
|
6986
7221
|
* metadata. If the suffix begins with a low surrogate, the JSON Schema pattern
|
|
6987
7222
|
* omits that code unit so Unicode matching cannot reject a valid string.
|
|
6988
7223
|
*
|
|
7224
|
+
* @stability stable
|
|
6989
7225
|
* @category validation
|
|
6990
7226
|
* @since 4.0.0
|
|
6991
7227
|
*/
|
|
@@ -7020,6 +7256,7 @@ export function isEndingWith(endsWith: string, annotations?: Annotations.Filter)
|
|
|
7020
7256
|
* omitted from the JSON Schema pattern so Unicode matching cannot reject a
|
|
7021
7257
|
* valid string.
|
|
7022
7258
|
*
|
|
7259
|
+
* @stability stable
|
|
7023
7260
|
* @category validation
|
|
7024
7261
|
* @since 4.0.0
|
|
7025
7262
|
*/
|
|
@@ -7055,6 +7292,7 @@ const UPPERCASED_PATTERN = "^[^a-z]*$"
|
|
|
7055
7292
|
* such as digits, punctuation, and whitespace. It rejects strings that would
|
|
7056
7293
|
* change when uppercased.
|
|
7057
7294
|
*
|
|
7295
|
+
* @stability stable
|
|
7058
7296
|
* @category validation
|
|
7059
7297
|
* @since 4.0.0
|
|
7060
7298
|
*/
|
|
@@ -7088,6 +7326,7 @@ const LOWERCASED_PATTERN = "^[^A-Z]*$"
|
|
|
7088
7326
|
* such as digits, punctuation, and whitespace. It rejects strings that would
|
|
7089
7327
|
* change when lowercased.
|
|
7090
7328
|
*
|
|
7329
|
+
* @stability stable
|
|
7091
7330
|
* @category validation
|
|
7092
7331
|
* @since 4.0.0
|
|
7093
7332
|
*/
|
|
@@ -7121,6 +7360,7 @@ const CAPITALIZED_PATTERN = "^(?:[^a-z][\\s\\S]*)?$"
|
|
|
7121
7360
|
* Empty strings pass. Strings whose first character has no lowercase form, such
|
|
7122
7361
|
* as a digit, punctuation mark, or whitespace, also pass.
|
|
7123
7362
|
*
|
|
7363
|
+
* @stability stable
|
|
7124
7364
|
* @category validation
|
|
7125
7365
|
* @since 4.0.0
|
|
7126
7366
|
*/
|
|
@@ -7154,6 +7394,7 @@ const UNCAPITALIZED_PATTERN = "^(?:[^A-Z][\\s\\S]*)?$"
|
|
|
7154
7394
|
* Empty strings pass. Strings whose first character has no uppercase form, such
|
|
7155
7395
|
* as a digit, punctuation mark, or whitespace, also pass.
|
|
7156
7396
|
*
|
|
7397
|
+
* @stability stable
|
|
7157
7398
|
* @category validation
|
|
7158
7399
|
* @since 4.0.0
|
|
7159
7400
|
*/
|
|
@@ -7179,6 +7420,7 @@ export function isUncapitalized(annotations?: Annotations.Filter) {
|
|
|
7179
7420
|
/**
|
|
7180
7421
|
* Type-level representation of {@link Finite}.
|
|
7181
7422
|
*
|
|
7423
|
+
* @stability stable
|
|
7182
7424
|
* @category models
|
|
7183
7425
|
* @since 3.10.0
|
|
7184
7426
|
*/
|
|
@@ -7188,6 +7430,7 @@ export interface Finite extends Number {
|
|
|
7188
7430
|
/**
|
|
7189
7431
|
* Schema for finite numbers, rejecting `NaN`, `Infinity`, and `-Infinity`.
|
|
7190
7432
|
*
|
|
7433
|
+
* @stability stable
|
|
7191
7434
|
* @category schemas
|
|
7192
7435
|
* @since 3.10.0
|
|
7193
7436
|
*/
|
|
@@ -7206,6 +7449,7 @@ export const Finite: Finite = make(SchemaAST.finite)
|
|
|
7206
7449
|
*
|
|
7207
7450
|
* During arbitrary generation, this applies a finite-number constraint.
|
|
7208
7451
|
*
|
|
7452
|
+
* @stability stable
|
|
7209
7453
|
* @category validation
|
|
7210
7454
|
* @since 4.0.0
|
|
7211
7455
|
*/
|
|
@@ -7214,6 +7458,7 @@ export const isFinite: (annotations?: Annotations.Filter) => SchemaAST.Filter<nu
|
|
|
7214
7458
|
* Creates a greater-than (`>`) check for any ordered type from an
|
|
7215
7459
|
* `Order.Order` instance.
|
|
7216
7460
|
*
|
|
7461
|
+
* @stability stable
|
|
7217
7462
|
* @category validation
|
|
7218
7463
|
* @since 4.0.0
|
|
7219
7464
|
*/
|
|
@@ -7244,6 +7489,7 @@ export function makeIsGreaterThan<T>(options: {
|
|
|
7244
7489
|
* Creates a greater-than-or-equal-to (`>=`) check for any ordered type from an
|
|
7245
7490
|
* `Order.Order` instance.
|
|
7246
7491
|
*
|
|
7492
|
+
* @stability stable
|
|
7247
7493
|
* @category validation
|
|
7248
7494
|
* @since 4.0.0
|
|
7249
7495
|
*/
|
|
@@ -7273,6 +7519,7 @@ export function makeIsGreaterThanOrEqualTo<T>(options: {
|
|
|
7273
7519
|
* Creates a less-than (`<`) check for any ordered type from an `Order.Order`
|
|
7274
7520
|
* instance.
|
|
7275
7521
|
*
|
|
7522
|
+
* @stability stable
|
|
7276
7523
|
* @category validation
|
|
7277
7524
|
* @since 4.0.0
|
|
7278
7525
|
*/
|
|
@@ -7303,6 +7550,7 @@ export function makeIsLessThan<T>(options: {
|
|
|
7303
7550
|
* Creates a less-than-or-equal-to (`<=`) check for any ordered type from an
|
|
7304
7551
|
* `Order.Order` instance.
|
|
7305
7552
|
*
|
|
7553
|
+
* @stability stable
|
|
7306
7554
|
* @category validation
|
|
7307
7555
|
* @since 4.0.0
|
|
7308
7556
|
*/
|
|
@@ -7332,6 +7580,7 @@ export function makeIsLessThanOrEqualTo<T>(options: {
|
|
|
7332
7580
|
* Creates an inclusive or exclusive range check for any ordered type from an
|
|
7333
7581
|
* `Order.Order` instance.
|
|
7334
7582
|
*
|
|
7583
|
+
* @stability stable
|
|
7335
7584
|
* @category validation
|
|
7336
7585
|
* @since 4.0.0
|
|
7337
7586
|
*/
|
|
@@ -7383,6 +7632,7 @@ export function makeIsBetween<T>(deriveOptions: {
|
|
|
7383
7632
|
* Creates a divisibility check for any numeric type from a remainder function
|
|
7384
7633
|
* and a zero value.
|
|
7385
7634
|
*
|
|
7635
|
+
* @stability stable
|
|
7386
7636
|
* @category validation
|
|
7387
7637
|
* @since 4.0.0
|
|
7388
7638
|
*/
|
|
@@ -7426,6 +7676,7 @@ function encodeNumberPayload(number: number): number {
|
|
|
7426
7676
|
* `exclusiveMinimum` constraint to ensure generated numbers are greater than
|
|
7427
7677
|
* the specified value.
|
|
7428
7678
|
*
|
|
7679
|
+
* @stability stable
|
|
7429
7680
|
* @category validation
|
|
7430
7681
|
* @since 4.0.0
|
|
7431
7682
|
*/
|
|
@@ -7456,6 +7707,7 @@ export const isGreaterThan: (exclusiveMinimum: number, annotations?: Annotations
|
|
|
7456
7707
|
* During arbitrary generation, this applies a `minimum` constraint
|
|
7457
7708
|
* to ensure generated numbers are greater than or equal to the specified value.
|
|
7458
7709
|
*
|
|
7710
|
+
* @stability stable
|
|
7459
7711
|
* @category validation
|
|
7460
7712
|
* @since 4.0.0
|
|
7461
7713
|
*/
|
|
@@ -7486,6 +7738,7 @@ export const isGreaterThanOrEqualTo: (minimum: number, annotations?: Annotations
|
|
|
7486
7738
|
* `exclusiveMaximum` constraint to ensure generated numbers are less than the
|
|
7487
7739
|
* specified value.
|
|
7488
7740
|
*
|
|
7741
|
+
* @stability stable
|
|
7489
7742
|
* @category validation
|
|
7490
7743
|
* @since 4.0.0
|
|
7491
7744
|
*/
|
|
@@ -7516,6 +7769,7 @@ export const isLessThan: (exclusiveMaximum: number, annotations?: Annotations.Fi
|
|
|
7516
7769
|
* During arbitrary generation, this applies a `maximum` constraint
|
|
7517
7770
|
* to ensure generated numbers are less than or equal to the specified value.
|
|
7518
7771
|
*
|
|
7772
|
+
* @stability stable
|
|
7519
7773
|
* @category validation
|
|
7520
7774
|
* @since 4.0.0
|
|
7521
7775
|
*/
|
|
@@ -7549,6 +7803,7 @@ export const isLessThanOrEqualTo: (maximum: number, annotations?: Annotations.Fi
|
|
|
7549
7803
|
* `exclusiveMaximum` flags to ensure generated numbers fall within the
|
|
7550
7804
|
* specified range.
|
|
7551
7805
|
*
|
|
7806
|
+
* @stability stable
|
|
7552
7807
|
* @category validation
|
|
7553
7808
|
* @since 4.0.0
|
|
7554
7809
|
*/
|
|
@@ -7600,6 +7855,7 @@ export const isBetween: (options: {
|
|
|
7600
7855
|
*
|
|
7601
7856
|
* Throws a `RangeError` when `divisor` is zero or is not finite.
|
|
7602
7857
|
*
|
|
7858
|
+
* @stability stable
|
|
7603
7859
|
* @category validation
|
|
7604
7860
|
* @since 4.0.0
|
|
7605
7861
|
*/
|
|
@@ -7633,12 +7889,14 @@ export function isMultipleOf(
|
|
|
7633
7889
|
*
|
|
7634
7890
|
* JSON Schema:
|
|
7635
7891
|
*
|
|
7636
|
-
* This check corresponds to
|
|
7892
|
+
* This check corresponds to `type: "integer"` with `minimum: Number.MIN_SAFE_INTEGER`
|
|
7893
|
+
* and `maximum: Number.MAX_SAFE_INTEGER` in JSON Schema.
|
|
7637
7894
|
*
|
|
7638
7895
|
* Arbitrary:
|
|
7639
7896
|
*
|
|
7640
7897
|
* During arbitrary generation, this applies an integer constraint.
|
|
7641
7898
|
*
|
|
7899
|
+
* @stability stable
|
|
7642
7900
|
* @category validation
|
|
7643
7901
|
* @since 4.0.0
|
|
7644
7902
|
*/
|
|
@@ -7651,7 +7909,11 @@ export function isInt(annotations?: Annotations.Filter) {
|
|
|
7651
7909
|
id: "effect/schema/isInt",
|
|
7652
7910
|
payload: null
|
|
7653
7911
|
},
|
|
7654
|
-
toJsonSchema: () =>
|
|
7912
|
+
toJsonSchema: () => ({
|
|
7913
|
+
type: "integer",
|
|
7914
|
+
minimum: globalThis.Number.MIN_SAFE_INTEGER,
|
|
7915
|
+
maximum: globalThis.Number.MAX_SAFE_INTEGER
|
|
7916
|
+
}),
|
|
7655
7917
|
toCode: () => ({ runtime: "Schema.isInt()" }),
|
|
7656
7918
|
arbitraryConstraint: {
|
|
7657
7919
|
number: "integer"
|
|
@@ -7663,6 +7925,7 @@ export function isInt(annotations?: Annotations.Filter) {
|
|
|
7663
7925
|
/**
|
|
7664
7926
|
* Type-level representation of {@link Int}.
|
|
7665
7927
|
*
|
|
7928
|
+
* @stability stable
|
|
7666
7929
|
* @category models
|
|
7667
7930
|
* @since 3.10.0
|
|
7668
7931
|
*/
|
|
@@ -7672,6 +7935,7 @@ export interface Int extends Number {
|
|
|
7672
7935
|
/**
|
|
7673
7936
|
* Schema for integers, rejecting `NaN`, `Infinity`, and `-Infinity`.
|
|
7674
7937
|
*
|
|
7938
|
+
* @stability stable
|
|
7675
7939
|
* @category schemas
|
|
7676
7940
|
* @since 3.10.0
|
|
7677
7941
|
*/
|
|
@@ -7679,6 +7943,7 @@ export const Int: Int = Number.check(isInt())
|
|
|
7679
7943
|
/**
|
|
7680
7944
|
* Type-level representation of {@link Natural}.
|
|
7681
7945
|
*
|
|
7946
|
+
* @stability stable
|
|
7682
7947
|
* @category models
|
|
7683
7948
|
* @since 4.0.0
|
|
7684
7949
|
*/
|
|
@@ -7694,6 +7959,7 @@ export interface Natural extends Int {
|
|
|
7694
7959
|
*
|
|
7695
7960
|
* @see {@link Int} for safe integers that may be negative
|
|
7696
7961
|
*
|
|
7962
|
+
* @stability stable
|
|
7697
7963
|
* @category schemas
|
|
7698
7964
|
* @since 4.0.0
|
|
7699
7965
|
*/
|
|
@@ -7714,6 +7980,7 @@ export const Natural: Natural = Int.check(isGreaterThanOrEqualTo(0))
|
|
|
7714
7980
|
* During arbitrary generation, this applies integer and range
|
|
7715
7981
|
* constraints to ensure generated numbers are 32-bit signed integers.
|
|
7716
7982
|
*
|
|
7983
|
+
* @stability stable
|
|
7717
7984
|
* @category validation
|
|
7718
7985
|
* @since 4.0.0
|
|
7719
7986
|
*/
|
|
@@ -7745,6 +8012,7 @@ export function isInt32(annotations?: Annotations.Filter) {
|
|
|
7745
8012
|
* During arbitrary generation, this applies integer and range
|
|
7746
8013
|
* constraints to ensure generated numbers are 32-bit unsigned integers.
|
|
7747
8014
|
*
|
|
8015
|
+
* @stability stable
|
|
7748
8016
|
* @category validation
|
|
7749
8017
|
* @since 4.0.0
|
|
7750
8018
|
*/
|
|
@@ -7780,6 +8048,7 @@ function formatDateRuntime(date: globalThis.Date): string {
|
|
|
7780
8048
|
*
|
|
7781
8049
|
* During arbitrary generation, this applies an exclusive lower bound.
|
|
7782
8050
|
*
|
|
8051
|
+
* @stability stable
|
|
7783
8052
|
* @category validation
|
|
7784
8053
|
* @since 4.0.0
|
|
7785
8054
|
*/
|
|
@@ -7815,6 +8084,7 @@ export const isGreaterThanDate: (
|
|
|
7815
8084
|
*
|
|
7816
8085
|
* During arbitrary generation, this applies an inclusive lower bound.
|
|
7817
8086
|
*
|
|
8087
|
+
* @stability stable
|
|
7818
8088
|
* @category validation
|
|
7819
8089
|
* @since 4.0.0
|
|
7820
8090
|
*/
|
|
@@ -7844,6 +8114,7 @@ export const isGreaterThanOrEqualToDate: (
|
|
|
7844
8114
|
*
|
|
7845
8115
|
* During arbitrary generation, this applies an exclusive upper bound.
|
|
7846
8116
|
*
|
|
8117
|
+
* @stability stable
|
|
7847
8118
|
* @category validation
|
|
7848
8119
|
* @since 4.0.0
|
|
7849
8120
|
*/
|
|
@@ -7879,6 +8150,7 @@ export const isLessThanDate: (
|
|
|
7879
8150
|
*
|
|
7880
8151
|
* During arbitrary generation, this applies an inclusive upper bound.
|
|
7881
8152
|
*
|
|
8153
|
+
* @stability stable
|
|
7882
8154
|
* @category validation
|
|
7883
8155
|
* @since 4.0.0
|
|
7884
8156
|
*/
|
|
@@ -7914,6 +8186,7 @@ export const isLessThanOrEqualToDate: (
|
|
|
7914
8186
|
*
|
|
7915
8187
|
* During arbitrary generation, this applies the specified lower and upper bounds.
|
|
7916
8188
|
*
|
|
8189
|
+
* @stability stable
|
|
7917
8190
|
* @category validation
|
|
7918
8191
|
* @since 4.0.0
|
|
7919
8192
|
*/
|
|
@@ -7956,6 +8229,7 @@ export const isBetweenDate: (options: {
|
|
|
7956
8229
|
*
|
|
7957
8230
|
* During arbitrary generation, this applies an exclusive lower bound.
|
|
7958
8231
|
*
|
|
8232
|
+
* @stability stable
|
|
7959
8233
|
* @category validation
|
|
7960
8234
|
* @since 4.0.0
|
|
7961
8235
|
*/
|
|
@@ -7986,6 +8260,7 @@ export const isGreaterThanBigInt: (
|
|
|
7986
8260
|
*
|
|
7987
8261
|
* During arbitrary generation, this applies an inclusive lower bound.
|
|
7988
8262
|
*
|
|
8263
|
+
* @stability stable
|
|
7989
8264
|
* @category validation
|
|
7990
8265
|
* @since 4.0.0
|
|
7991
8266
|
*/
|
|
@@ -8015,6 +8290,7 @@ export const isGreaterThanOrEqualToBigInt: (
|
|
|
8015
8290
|
*
|
|
8016
8291
|
* During arbitrary generation, this applies an exclusive upper bound.
|
|
8017
8292
|
*
|
|
8293
|
+
* @stability stable
|
|
8018
8294
|
* @category validation
|
|
8019
8295
|
* @since 4.0.0
|
|
8020
8296
|
*/
|
|
@@ -8045,6 +8321,7 @@ export const isLessThanBigInt: (
|
|
|
8045
8321
|
*
|
|
8046
8322
|
* During arbitrary generation, this applies an inclusive upper bound.
|
|
8047
8323
|
*
|
|
8324
|
+
* @stability stable
|
|
8048
8325
|
* @category validation
|
|
8049
8326
|
* @since 4.0.0
|
|
8050
8327
|
*/
|
|
@@ -8075,6 +8352,7 @@ export const isLessThanOrEqualToBigInt: (
|
|
|
8075
8352
|
*
|
|
8076
8353
|
* During arbitrary generation, this applies the specified lower and upper bounds.
|
|
8077
8354
|
*
|
|
8355
|
+
* @stability stable
|
|
8078
8356
|
* @category validation
|
|
8079
8357
|
* @since 4.0.0
|
|
8080
8358
|
*/
|
|
@@ -8140,6 +8418,7 @@ export const isBetweenBigInt: (options: {
|
|
|
8140
8418
|
* Schema.is(NonEmptyArraySchema)([1]) // => true
|
|
8141
8419
|
* ```
|
|
8142
8420
|
*
|
|
8421
|
+
* @stability stable
|
|
8143
8422
|
* @category validation
|
|
8144
8423
|
* @since 4.0.0
|
|
8145
8424
|
*/
|
|
@@ -8192,6 +8471,7 @@ function makeIsMinLength(minLength: number, minCodePoints: number, annotations?:
|
|
|
8192
8471
|
* During arbitrary generation, this applies a `minLength: 1`
|
|
8193
8472
|
* constraint to ensure generated strings or arrays are non-empty.
|
|
8194
8473
|
*
|
|
8474
|
+
* @stability stable
|
|
8195
8475
|
* @category validation
|
|
8196
8476
|
* @since 4.0.0
|
|
8197
8477
|
*/
|
|
@@ -8217,6 +8497,7 @@ export function isNonEmpty(annotations?: Annotations.Filter) {
|
|
|
8217
8497
|
* constraint to ensure generated strings or arrays have at most the required
|
|
8218
8498
|
* length.
|
|
8219
8499
|
*
|
|
8500
|
+
* @stability stable
|
|
8220
8501
|
* @category validation
|
|
8221
8502
|
* @since 4.0.0
|
|
8222
8503
|
*/
|
|
@@ -8267,6 +8548,7 @@ export function isMaxLength(maxLength: number, annotations?: Annotations.Filter)
|
|
|
8267
8548
|
* `maxLength` constraints to ensure generated strings or arrays have a length
|
|
8268
8549
|
* within the specified range.
|
|
8269
8550
|
*
|
|
8551
|
+
* @stability stable
|
|
8270
8552
|
* @category validation
|
|
8271
8553
|
* @since 4.0.0
|
|
8272
8554
|
*/
|
|
@@ -8327,6 +8609,7 @@ export function isBetweenLength(minimum: number, maximum: number, annotations?:
|
|
|
8327
8609
|
* @see {@link isMinLength} for counting UTF-16 code units
|
|
8328
8610
|
* @see {@link isMaxCodePoints}
|
|
8329
8611
|
* @see {@link isBetweenCodePoints}
|
|
8612
|
+
* @stability stable
|
|
8330
8613
|
* @category validation
|
|
8331
8614
|
* @since 4.0.0
|
|
8332
8615
|
*/
|
|
@@ -8365,6 +8648,7 @@ export function isMinCodePoints(minCodePoints: number, annotations?: Annotations
|
|
|
8365
8648
|
* @see {@link isMaxLength} for counting UTF-16 code units
|
|
8366
8649
|
* @see {@link isMinCodePoints}
|
|
8367
8650
|
* @see {@link isBetweenCodePoints}
|
|
8651
|
+
* @stability stable
|
|
8368
8652
|
* @category validation
|
|
8369
8653
|
* @since 4.0.0
|
|
8370
8654
|
*/
|
|
@@ -8403,6 +8687,7 @@ export function isMaxCodePoints(maxCodePoints: number, annotations?: Annotations
|
|
|
8403
8687
|
* @see {@link isBetweenLength} for counting UTF-16 code units
|
|
8404
8688
|
* @see {@link isMinCodePoints}
|
|
8405
8689
|
* @see {@link isMaxCodePoints}
|
|
8690
|
+
* @stability stable
|
|
8406
8691
|
* @category validation
|
|
8407
8692
|
* @since 4.0.0
|
|
8408
8693
|
*/
|
|
@@ -8463,6 +8748,7 @@ function normalizeCardinality(value: number): number {
|
|
|
8463
8748
|
*
|
|
8464
8749
|
* During arbitrary generation, this applies a node-local `minSize` constraint.
|
|
8465
8750
|
*
|
|
8751
|
+
* @stability stable
|
|
8466
8752
|
* @category validation
|
|
8467
8753
|
* @since 4.0.0
|
|
8468
8754
|
*/
|
|
@@ -8503,6 +8789,7 @@ export function isMinSize(minSize: number, annotations?: Annotations.Filter) {
|
|
|
8503
8789
|
*
|
|
8504
8790
|
* During arbitrary generation, this applies a node-local `maxSize` constraint.
|
|
8505
8791
|
*
|
|
8792
|
+
* @stability stable
|
|
8506
8793
|
* @category validation
|
|
8507
8794
|
* @since 4.0.0
|
|
8508
8795
|
*/
|
|
@@ -8543,6 +8830,7 @@ export function isMaxSize(maxSize: number, annotations?: Annotations.Filter) {
|
|
|
8543
8830
|
*
|
|
8544
8831
|
* During arbitrary generation, this applies node-local `minSize` and `maxSize` constraints.
|
|
8545
8832
|
*
|
|
8833
|
+
* @stability stable
|
|
8546
8834
|
* @category validation
|
|
8547
8835
|
* @since 4.0.0
|
|
8548
8836
|
*/
|
|
@@ -8591,6 +8879,7 @@ export function isBetweenSize(minimum: number, maximum: number, annotations?: An
|
|
|
8591
8879
|
*
|
|
8592
8880
|
* During arbitrary generation, this applies a node-local `minProperties` constraint.
|
|
8593
8881
|
*
|
|
8882
|
+
* @stability stable
|
|
8594
8883
|
* @category validation
|
|
8595
8884
|
* @since 4.0.0
|
|
8596
8885
|
*/
|
|
@@ -8633,6 +8922,7 @@ export function isMinProperties(minProperties: number, annotations?: Annotations
|
|
|
8633
8922
|
*
|
|
8634
8923
|
* During arbitrary generation, this applies a node-local `maxProperties` constraint.
|
|
8635
8924
|
*
|
|
8925
|
+
* @stability stable
|
|
8636
8926
|
* @category validation
|
|
8637
8927
|
* @since 4.0.0
|
|
8638
8928
|
*/
|
|
@@ -8675,6 +8965,7 @@ export function isMaxProperties(maxProperties: number, annotations?: Annotations
|
|
|
8675
8965
|
*
|
|
8676
8966
|
* During arbitrary generation, this applies node-local `minProperties` and `maxProperties` constraints.
|
|
8677
8967
|
*
|
|
8968
|
+
* @stability stable
|
|
8678
8969
|
* @category validation
|
|
8679
8970
|
* @since 4.0.0
|
|
8680
8971
|
*/
|
|
@@ -8721,6 +9012,7 @@ export function isBetweenProperties(minimum: number, maximum: number, annotation
|
|
|
8721
9012
|
* names in the original input. Property transformations and excess-property
|
|
8722
9013
|
* handling can therefore produce different results.
|
|
8723
9014
|
*
|
|
9015
|
+
* @stability stable
|
|
8724
9016
|
* @category validation
|
|
8725
9017
|
* @since 4.0.0
|
|
8726
9018
|
*/
|
|
@@ -8770,6 +9062,7 @@ export function isPropertyNames(keySchema: Constraint, annotations?: Annotations
|
|
|
8770
9062
|
* During arbitrary generation, this applies a node-local identity selector
|
|
8771
9063
|
* for constructive uniqueness using Effect equality.
|
|
8772
9064
|
*
|
|
9065
|
+
* @stability stable
|
|
8773
9066
|
* @category validation
|
|
8774
9067
|
* @since 4.0.0
|
|
8775
9068
|
*/
|
|
@@ -8803,6 +9096,7 @@ export function isUnique<T>(annotations?: Annotations.Filter) {
|
|
|
8803
9096
|
* JSON Schema has no equivalent constraint, so this check is omitted from generated documents.
|
|
8804
9097
|
*
|
|
8805
9098
|
* @see {@link isUnique} for validating uniqueness of complete array elements
|
|
9099
|
+
* @stability stable
|
|
8806
9100
|
* @category validation
|
|
8807
9101
|
* @since 4.0.0
|
|
8808
9102
|
*/
|
|
@@ -8826,6 +9120,7 @@ export function isUniqueKey<Key, Value>(annotations?: Annotations.Filter) {
|
|
|
8826
9120
|
/**
|
|
8827
9121
|
* Type-level representation of {@link NonEmptyString}.
|
|
8828
9122
|
*
|
|
9123
|
+
* @stability stable
|
|
8829
9124
|
* @category models
|
|
8830
9125
|
* @since 3.10.0
|
|
8831
9126
|
*/
|
|
@@ -8836,6 +9131,7 @@ export interface NonEmptyString extends String {
|
|
|
8836
9131
|
* Schema for non-empty strings. Validates that a string has at least one
|
|
8837
9132
|
* character.
|
|
8838
9133
|
*
|
|
9134
|
+
* @stability stable
|
|
8839
9135
|
* @category schemas
|
|
8840
9136
|
* @since 3.10.0
|
|
8841
9137
|
*/
|
|
@@ -8843,6 +9139,7 @@ export const NonEmptyString: NonEmptyString = String.check(isNonEmpty())
|
|
|
8843
9139
|
/**
|
|
8844
9140
|
* Type-level representation of {@link Char}.
|
|
8845
9141
|
*
|
|
9142
|
+
* @stability stable
|
|
8846
9143
|
* @category models
|
|
8847
9144
|
* @since 3.10.0
|
|
8848
9145
|
*/
|
|
@@ -8865,6 +9162,7 @@ export interface Char extends String {
|
|
|
8865
9162
|
* @see {@link NonEmptyString} for strings with length greater than zero
|
|
8866
9163
|
* @see {@link isBetweenLength} for the underlying length check
|
|
8867
9164
|
*
|
|
9165
|
+
* @stability stable
|
|
8868
9166
|
* @category schemas
|
|
8869
9167
|
* @since 3.10.0
|
|
8870
9168
|
*/
|
|
@@ -8872,6 +9170,7 @@ export const Char: Char = String.check(isBetweenLength(1, 1))
|
|
|
8872
9170
|
/**
|
|
8873
9171
|
* Type-level representation of {@link ErrorInstance}.
|
|
8874
9172
|
*
|
|
9173
|
+
* @stability stable
|
|
8875
9174
|
* @category models
|
|
8876
9175
|
* @since 4.0.0
|
|
8877
9176
|
*/
|
|
@@ -8881,6 +9180,7 @@ export interface ErrorInstance extends instanceOf<globalThis.Error> {
|
|
|
8881
9180
|
/**
|
|
8882
9181
|
* Options for {@link ErrorInstance} and {@link Defect}.
|
|
8883
9182
|
*
|
|
9183
|
+
* @stability stable
|
|
8884
9184
|
* @category options
|
|
8885
9185
|
* @since 4.0.0
|
|
8886
9186
|
*/
|
|
@@ -8937,6 +9237,7 @@ const errorSchemaCache: Array<ErrorInstance | undefined> = []
|
|
|
8937
9237
|
* traces are omitted by default for security. Pass `{ includeStack: true }` to
|
|
8938
9238
|
* include stack traces, or `{ excludeCause: true }` to omit causes.
|
|
8939
9239
|
*
|
|
9240
|
+
* @stability stable
|
|
8940
9241
|
* @category schemas
|
|
8941
9242
|
* @since 4.0.0
|
|
8942
9243
|
*/
|
|
@@ -8967,6 +9268,7 @@ export function ErrorInstance(options?: ErrorOptions): ErrorInstance {
|
|
|
8967
9268
|
/**
|
|
8968
9269
|
* Type-level representation of {@link Defect}.
|
|
8969
9270
|
*
|
|
9271
|
+
* @stability stable
|
|
8970
9272
|
* @category models
|
|
8971
9273
|
* @since 3.10.0
|
|
8972
9274
|
*/
|
|
@@ -9013,6 +9315,7 @@ const defectSchemaCache: Array<Defect | undefined> = []
|
|
|
9013
9315
|
* string representation.
|
|
9014
9316
|
*
|
|
9015
9317
|
* @see {@link ErrorInstance} for a schema that only accepts JavaScript `Error` values.
|
|
9318
|
+
* @stability stable
|
|
9016
9319
|
* @category schemas
|
|
9017
9320
|
* @since 4.0.0
|
|
9018
9321
|
*/
|
|
@@ -9029,6 +9332,7 @@ export function Defect(options?: ErrorOptions): Defect {
|
|
|
9029
9332
|
/**
|
|
9030
9333
|
* Type-level representation returned by {@link ReadonlyMap}.
|
|
9031
9334
|
*
|
|
9335
|
+
* @stability stable
|
|
9032
9336
|
* @category models
|
|
9033
9337
|
* @since 4.0.0
|
|
9034
9338
|
*/
|
|
@@ -9048,6 +9352,7 @@ export interface $ReadonlyMap<Key extends Constraint, Value extends Constraint>
|
|
|
9048
9352
|
* Iso representation used for `ReadonlyMap` schemas: an array of readonly
|
|
9049
9353
|
* `[key, value]` tuples using each entry schema's `Iso` type.
|
|
9050
9354
|
*
|
|
9355
|
+
* @stability stable
|
|
9051
9356
|
* @category utility types
|
|
9052
9357
|
* @since 4.0.0
|
|
9053
9358
|
*/
|
|
@@ -9058,6 +9363,7 @@ export type ReadonlyMapIso<Key extends Constraint, Value extends Constraint> = R
|
|
|
9058
9363
|
* Schema for readonly maps whose keys and values conform to the provided
|
|
9059
9364
|
* schemas.
|
|
9060
9365
|
*
|
|
9366
|
+
* @stability stable
|
|
9061
9367
|
* @category schemas
|
|
9062
9368
|
* @since 3.10.0
|
|
9063
9369
|
*/
|
|
@@ -9111,6 +9417,7 @@ export function ReadonlyMap<Key extends Constraint, Value extends Constraint>(
|
|
|
9111
9417
|
/**
|
|
9112
9418
|
* Type-level representation returned by {@link ReadonlySet}.
|
|
9113
9419
|
*
|
|
9420
|
+
* @stability stable
|
|
9114
9421
|
* @category models
|
|
9115
9422
|
* @since 4.0.0
|
|
9116
9423
|
*/
|
|
@@ -9129,6 +9436,7 @@ export interface $ReadonlySet<Value extends Constraint> extends
|
|
|
9129
9436
|
* Iso representation used for `ReadonlySet` schemas: an array of element values
|
|
9130
9437
|
* using the element schema's `Iso` type.
|
|
9131
9438
|
*
|
|
9439
|
+
* @stability stable
|
|
9132
9440
|
* @category utility types
|
|
9133
9441
|
* @since 4.0.0
|
|
9134
9442
|
*/
|
|
@@ -9136,6 +9444,7 @@ export type ReadonlySetIso<Value extends Constraint> = ReadonlyArray<Value["Iso"
|
|
|
9136
9444
|
/**
|
|
9137
9445
|
* Schema for readonly sets whose values conform to the provided element schema.
|
|
9138
9446
|
*
|
|
9447
|
+
* @stability stable
|
|
9139
9448
|
* @category schemas
|
|
9140
9449
|
* @since 3.10.0
|
|
9141
9450
|
*/
|
|
@@ -9186,6 +9495,7 @@ export function ReadonlySet<Value extends Constraint>(value: Value): $ReadonlySe
|
|
|
9186
9495
|
/**
|
|
9187
9496
|
* Type-level representation of {@link RegExp}.
|
|
9188
9497
|
*
|
|
9498
|
+
* @stability stable
|
|
9189
9499
|
* @category models
|
|
9190
9500
|
* @since 4.0.0
|
|
9191
9501
|
*/
|
|
@@ -9199,6 +9509,7 @@ export interface RegExp extends instanceOf<globalThis.RegExp> {
|
|
|
9199
9509
|
*
|
|
9200
9510
|
* The default JSON serializer encodes a `RegExp` as `{ source, flags }`.
|
|
9201
9511
|
*
|
|
9512
|
+
* @stability stable
|
|
9202
9513
|
* @category schemas
|
|
9203
9514
|
* @since 4.0.0
|
|
9204
9515
|
*/
|
|
@@ -9243,6 +9554,7 @@ export const RegExp: RegExp = instanceOf(
|
|
|
9243
9554
|
/**
|
|
9244
9555
|
* Type-level representation of {@link URL}.
|
|
9245
9556
|
*
|
|
9557
|
+
* @stability stable
|
|
9246
9558
|
* @category models
|
|
9247
9559
|
* @since 4.0.0
|
|
9248
9560
|
*/
|
|
@@ -9260,6 +9572,7 @@ const URLString = String.annotate({ expected: "a string that will be decoded as
|
|
|
9260
9572
|
*
|
|
9261
9573
|
* - encodes `URL` as a `string`
|
|
9262
9574
|
*
|
|
9575
|
+
* @stability stable
|
|
9263
9576
|
* @category schemas
|
|
9264
9577
|
* @since 4.0.0
|
|
9265
9578
|
*/
|
|
@@ -9285,6 +9598,7 @@ export const URL: URL = instanceOf(
|
|
|
9285
9598
|
/**
|
|
9286
9599
|
* Type-level representation of {@link URLFromString}.
|
|
9287
9600
|
*
|
|
9601
|
+
* @stability stable
|
|
9288
9602
|
* @category models
|
|
9289
9603
|
* @since 4.0.0
|
|
9290
9604
|
*/
|
|
@@ -9302,6 +9616,7 @@ export interface URLFromString extends decodeTo<URL, String> {
|
|
|
9302
9616
|
* Encoding:
|
|
9303
9617
|
* - A `URL` is encoded as a `string`
|
|
9304
9618
|
*
|
|
9619
|
+
* @stability stable
|
|
9305
9620
|
* @category schemas
|
|
9306
9621
|
* @since 4.0.0
|
|
9307
9622
|
*/
|
|
@@ -9309,6 +9624,7 @@ export const URLFromString: URLFromString = URLString.pipe(decodeTo(URL, SchemaT
|
|
|
9309
9624
|
/**
|
|
9310
9625
|
* Type-level representation of {@link Date}.
|
|
9311
9626
|
*
|
|
9627
|
+
* @stability stable
|
|
9312
9628
|
* @category models
|
|
9313
9629
|
* @since 4.0.0
|
|
9314
9630
|
*/
|
|
@@ -9342,6 +9658,7 @@ const DateString = String.annotate({ expected: "a string that will be decoded as
|
|
|
9342
9658
|
* @see {@link DateFromString} for decoding strings into Date instances
|
|
9343
9659
|
* @see {@link DateFromMillis} for decoding epoch milliseconds into Date instances
|
|
9344
9660
|
*
|
|
9661
|
+
* @stability stable
|
|
9345
9662
|
* @category schemas
|
|
9346
9663
|
* @since 4.0.0
|
|
9347
9664
|
*/
|
|
@@ -9367,6 +9684,7 @@ export const Date: Date = declare(
|
|
|
9367
9684
|
/**
|
|
9368
9685
|
* Type-level representation of {@link DateFromString}.
|
|
9369
9686
|
*
|
|
9687
|
+
* @stability stable
|
|
9370
9688
|
* @category models
|
|
9371
9689
|
* @since 3.10.0
|
|
9372
9690
|
*/
|
|
@@ -9395,6 +9713,7 @@ export interface DateFromString extends decodeTo<Date, String> {
|
|
|
9395
9713
|
* @see {@link DateTimeUtcFromString} for decoding date-time strings into UTC values
|
|
9396
9714
|
* @see {@link Date} for accepting Date instances directly
|
|
9397
9715
|
*
|
|
9716
|
+
* @stability stable
|
|
9398
9717
|
* @category schemas
|
|
9399
9718
|
* @since 3.10.0
|
|
9400
9719
|
*/
|
|
@@ -9402,6 +9721,7 @@ export const DateFromString: DateFromString = DateString.pipe(decodeTo(Date, Sch
|
|
|
9402
9721
|
/**
|
|
9403
9722
|
* Type-level representation of {@link DateFromMillis}.
|
|
9404
9723
|
*
|
|
9724
|
+
* @stability stable
|
|
9405
9725
|
* @category models
|
|
9406
9726
|
* @since 4.0.0
|
|
9407
9727
|
*/
|
|
@@ -9433,6 +9753,7 @@ export interface DateFromMillis extends decodeTo<Date, Int> {
|
|
|
9433
9753
|
* @see {@link DateFromString} for decoding string-encoded dates
|
|
9434
9754
|
* @see {@link DateTimeUtcFromMillis} for decoding epoch milliseconds into UTC values
|
|
9435
9755
|
*
|
|
9756
|
+
* @stability stable
|
|
9436
9757
|
* @category schemas
|
|
9437
9758
|
* @since 4.0.0
|
|
9438
9759
|
*/
|
|
@@ -9442,6 +9763,7 @@ export const DateFromMillis: DateFromMillis = Int.pipe(
|
|
|
9442
9763
|
/**
|
|
9443
9764
|
* Type-level representation returned by {@link fromJsonString}.
|
|
9444
9765
|
*
|
|
9766
|
+
* @stability stable
|
|
9445
9767
|
* @category models
|
|
9446
9768
|
* @since 4.0.0
|
|
9447
9769
|
*/
|
|
@@ -9479,6 +9801,7 @@ const JsonString = String.annotate({
|
|
|
9479
9801
|
* Schema.encodeSync(schemaFromJsonString)({ a: 1 }) // => "{\n \"a\": 1\n}"
|
|
9480
9802
|
* ```
|
|
9481
9803
|
*
|
|
9804
|
+
* @stability stable
|
|
9482
9805
|
* @category schemas
|
|
9483
9806
|
* @since 4.0.0
|
|
9484
9807
|
*/
|
|
@@ -9497,6 +9820,7 @@ export const UnknownFromJsonString: fromJsonString<Unknown> = fromJsonString(Unk
|
|
|
9497
9820
|
/**
|
|
9498
9821
|
* Type-level representation of {@link File}.
|
|
9499
9822
|
*
|
|
9823
|
+
* @stability stable
|
|
9500
9824
|
* @category models
|
|
9501
9825
|
* @since 4.0.0
|
|
9502
9826
|
*/
|
|
@@ -9511,6 +9835,7 @@ export interface File extends instanceOf<globalThis.File> {
|
|
|
9511
9835
|
* The default JSON serializer encodes a `File` as `{ data, type, name, lastModified }`
|
|
9512
9836
|
* where `data` is base64-encoded.
|
|
9513
9837
|
*
|
|
9838
|
+
* @stability stable
|
|
9514
9839
|
* @category schemas
|
|
9515
9840
|
* @since 4.0.0
|
|
9516
9841
|
*/
|
|
@@ -9574,6 +9899,7 @@ export const File: File = instanceOf(globalThis.File, {
|
|
|
9574
9899
|
/**
|
|
9575
9900
|
* Type-level representation of {@link FormData}.
|
|
9576
9901
|
*
|
|
9902
|
+
* @stability stable
|
|
9577
9903
|
* @category models
|
|
9578
9904
|
* @since 4.0.0
|
|
9579
9905
|
*/
|
|
@@ -9588,6 +9914,7 @@ export interface FormData extends instanceOf<globalThis.FormData> {
|
|
|
9588
9914
|
* The default JSON serializer encodes a `FormData` as an array of `[key, entry]`
|
|
9589
9915
|
* pairs where each entry is tagged as `"String"` or `"File"`.
|
|
9590
9916
|
*
|
|
9917
|
+
* @stability stable
|
|
9591
9918
|
* @category schemas
|
|
9592
9919
|
* @since 4.0.0
|
|
9593
9920
|
*/
|
|
@@ -9637,6 +9964,7 @@ export const FormData: FormData = instanceOf(globalThis.FormData, {
|
|
|
9637
9964
|
/**
|
|
9638
9965
|
* Type-level representation returned by {@link fromFormData}.
|
|
9639
9966
|
*
|
|
9967
|
+
* @stability stable
|
|
9640
9968
|
* @category models
|
|
9641
9969
|
* @since 4.0.0
|
|
9642
9970
|
*/
|
|
@@ -9722,6 +10050,7 @@ export interface fromFormData<S extends Constraint> extends decodeTo<S, FormData
|
|
|
9722
10050
|
* Schema.decodeUnknownSync(schema)(formData) // => { a: 1 }
|
|
9723
10051
|
* ```
|
|
9724
10052
|
*
|
|
10053
|
+
* @stability stable
|
|
9725
10054
|
* @category decoding
|
|
9726
10055
|
* @since 4.0.0
|
|
9727
10056
|
*/
|
|
@@ -9731,6 +10060,7 @@ export function fromFormData<S extends Constraint>(schema: S): fromFormData<S> {
|
|
|
9731
10060
|
/**
|
|
9732
10061
|
* Type-level representation of {@link URLSearchParams}.
|
|
9733
10062
|
*
|
|
10063
|
+
* @stability stable
|
|
9734
10064
|
* @category models
|
|
9735
10065
|
* @since 4.0.0
|
|
9736
10066
|
*/
|
|
@@ -9744,6 +10074,7 @@ export interface URLSearchParams extends instanceOf<globalThis.URLSearchParams>
|
|
|
9744
10074
|
*
|
|
9745
10075
|
* The default JSON serializer encodes a `URLSearchParams` as a query string.
|
|
9746
10076
|
*
|
|
10077
|
+
* @stability stable
|
|
9747
10078
|
* @category schemas
|
|
9748
10079
|
* @since 4.0.0
|
|
9749
10080
|
*/
|
|
@@ -9769,6 +10100,7 @@ export const URLSearchParams: URLSearchParams = instanceOf(globalThis.URLSearchP
|
|
|
9769
10100
|
/**
|
|
9770
10101
|
* Type-level representation returned by {@link fromURLSearchParams}.
|
|
9771
10102
|
*
|
|
10103
|
+
* @stability stable
|
|
9772
10104
|
* @category models
|
|
9773
10105
|
* @since 4.0.0
|
|
9774
10106
|
*/
|
|
@@ -9849,6 +10181,7 @@ export interface fromURLSearchParams<S extends Constraint> extends decodeTo<S, U
|
|
|
9849
10181
|
* Schema.decodeUnknownSync(schema)(urlSearchParams) // => { a: 1 }
|
|
9850
10182
|
* ```
|
|
9851
10183
|
*
|
|
10184
|
+
* @stability stable
|
|
9852
10185
|
* @category decoding
|
|
9853
10186
|
* @since 4.0.0
|
|
9854
10187
|
*/
|
|
@@ -9858,6 +10191,7 @@ export function fromURLSearchParams<S extends Constraint>(schema: S): fromURLSea
|
|
|
9858
10191
|
/**
|
|
9859
10192
|
* Type-level representation of {@link NumberFromString}.
|
|
9860
10193
|
*
|
|
10194
|
+
* @stability stable
|
|
9861
10195
|
* @category models
|
|
9862
10196
|
* @since 3.10.0
|
|
9863
10197
|
*/
|
|
@@ -9878,6 +10212,7 @@ export interface NumberFromString extends decodeTo<Number, String> {
|
|
|
9878
10212
|
* Encoding:
|
|
9879
10213
|
* A number is encoded as a `string`.
|
|
9880
10214
|
*
|
|
10215
|
+
* @stability stable
|
|
9881
10216
|
* @category schemas
|
|
9882
10217
|
* @since 3.10.0
|
|
9883
10218
|
*/
|
|
@@ -9887,6 +10222,7 @@ export const NumberFromString: NumberFromString = String.annotate({
|
|
|
9887
10222
|
/**
|
|
9888
10223
|
* Type-level representation of {@link FiniteFromString}.
|
|
9889
10224
|
*
|
|
10225
|
+
* @stability stable
|
|
9890
10226
|
* @category models
|
|
9891
10227
|
* @since 4.0.0
|
|
9892
10228
|
*/
|
|
@@ -9905,6 +10241,7 @@ export interface FiniteFromString extends decodeTo<Finite, String> {
|
|
|
9905
10241
|
* Encoding:
|
|
9906
10242
|
* - A finite number is encoded as a `string`.
|
|
9907
10243
|
*
|
|
10244
|
+
* @stability stable
|
|
9908
10245
|
* @category schemas
|
|
9909
10246
|
* @since 4.0.0
|
|
9910
10247
|
*/
|
|
@@ -9914,6 +10251,7 @@ export const FiniteFromString: FiniteFromString = String.annotate({
|
|
|
9914
10251
|
/**
|
|
9915
10252
|
* Type-level representation of {@link BigIntFromString}.
|
|
9916
10253
|
*
|
|
10254
|
+
* @stability stable
|
|
9917
10255
|
* @category models
|
|
9918
10256
|
* @since 4.0.0
|
|
9919
10257
|
*/
|
|
@@ -9945,6 +10283,7 @@ export interface BigIntFromString extends decodeTo<BigInt, String> {
|
|
|
9945
10283
|
* @see {@link NumberFromString} for parsing JavaScript number strings, including non-finite values
|
|
9946
10284
|
* @see {@link BigDecimalFromString} for parsing decimal number strings
|
|
9947
10285
|
*
|
|
10286
|
+
* @stability stable
|
|
9948
10287
|
* @category schemas
|
|
9949
10288
|
* @since 4.0.0
|
|
9950
10289
|
*/
|
|
@@ -9954,6 +10293,7 @@ export const BigIntFromString: BigIntFromString = make<String>(SchemaAST.bigIntS
|
|
|
9954
10293
|
/**
|
|
9955
10294
|
* Type-level representation of {@link Trimmed}.
|
|
9956
10295
|
*
|
|
10296
|
+
* @stability stable
|
|
9957
10297
|
* @category models
|
|
9958
10298
|
* @since 3.10.0
|
|
9959
10299
|
*/
|
|
@@ -9963,6 +10303,7 @@ export interface Trimmed extends String {
|
|
|
9963
10303
|
/**
|
|
9964
10304
|
* Schema for strings that contains no leading or trailing whitespaces.
|
|
9965
10305
|
*
|
|
10306
|
+
* @stability stable
|
|
9966
10307
|
* @category schemas
|
|
9967
10308
|
* @since 3.10.0
|
|
9968
10309
|
*/
|
|
@@ -9970,6 +10311,7 @@ export const Trimmed: Trimmed = String.check(isTrimmed())
|
|
|
9970
10311
|
/**
|
|
9971
10312
|
* Type-level representation of {@link Trim}.
|
|
9972
10313
|
*
|
|
10314
|
+
* @stability stable
|
|
9973
10315
|
* @category models
|
|
9974
10316
|
* @since 3.10.0
|
|
9975
10317
|
*/
|
|
@@ -9987,6 +10329,7 @@ export interface Trim extends decodeTo<Trimmed, String> {
|
|
|
9987
10329
|
* Encoding:
|
|
9988
10330
|
* - The trimmed string is encoded as is.
|
|
9989
10331
|
*
|
|
10332
|
+
* @stability stable
|
|
9990
10333
|
* @category schemas
|
|
9991
10334
|
* @since 3.10.0
|
|
9992
10335
|
*/
|
|
@@ -9996,6 +10339,7 @@ export const Trim: Trim = String.annotate({
|
|
|
9996
10339
|
/**
|
|
9997
10340
|
* Type-level representation of {@link StringFromBase64}.
|
|
9998
10341
|
*
|
|
10342
|
+
* @stability stable
|
|
9999
10343
|
* @category models
|
|
10000
10344
|
* @since 3.10.0
|
|
10001
10345
|
*/
|
|
@@ -10013,6 +10357,7 @@ export interface StringFromBase64 extends decodeTo<String, String> {
|
|
|
10013
10357
|
* Encoding:
|
|
10014
10358
|
* - A `string` is encoded as a base64-encoded string.
|
|
10015
10359
|
*
|
|
10360
|
+
* @stability stable
|
|
10016
10361
|
* @category schemas
|
|
10017
10362
|
* @since 3.10.0
|
|
10018
10363
|
*/
|
|
@@ -10024,6 +10369,7 @@ export const StringFromBase64: StringFromBase64 = String.annotate({
|
|
|
10024
10369
|
/**
|
|
10025
10370
|
* Type-level representation of {@link StringFromBase64Url}.
|
|
10026
10371
|
*
|
|
10372
|
+
* @stability stable
|
|
10027
10373
|
* @category models
|
|
10028
10374
|
* @since 3.10.0
|
|
10029
10375
|
*/
|
|
@@ -10041,6 +10387,7 @@ export interface StringFromBase64Url extends decodeTo<String, String> {
|
|
|
10041
10387
|
* Encoding:
|
|
10042
10388
|
* - A `string` is encoded as a base64 (URL) encoded string.
|
|
10043
10389
|
*
|
|
10390
|
+
* @stability stable
|
|
10044
10391
|
* @category schemas
|
|
10045
10392
|
* @since 3.10.0
|
|
10046
10393
|
*/
|
|
@@ -10052,6 +10399,7 @@ export const StringFromBase64Url: StringFromBase64Url = String.annotate({
|
|
|
10052
10399
|
/**
|
|
10053
10400
|
* Type-level representation of {@link StringFromHex}.
|
|
10054
10401
|
*
|
|
10402
|
+
* @stability stable
|
|
10055
10403
|
* @category models
|
|
10056
10404
|
* @since 3.10.0
|
|
10057
10405
|
*/
|
|
@@ -10069,6 +10417,7 @@ export interface StringFromHex extends decodeTo<String, String> {
|
|
|
10069
10417
|
* Encoding:
|
|
10070
10418
|
* - A `string` is encoded as a hex string.
|
|
10071
10419
|
*
|
|
10420
|
+
* @stability stable
|
|
10072
10421
|
* @category schemas
|
|
10073
10422
|
* @since 3.10.0
|
|
10074
10423
|
*/
|
|
@@ -10080,6 +10429,7 @@ export const StringFromHex: StringFromHex = String.annotate({
|
|
|
10080
10429
|
/**
|
|
10081
10430
|
* Type-level representation of {@link StringFromUriComponent}.
|
|
10082
10431
|
*
|
|
10432
|
+
* @stability stable
|
|
10083
10433
|
* @category models
|
|
10084
10434
|
* @since 3.12.0
|
|
10085
10435
|
*/
|
|
@@ -10115,6 +10465,7 @@ export interface StringFromUriComponent extends decodeTo<String, String> {
|
|
|
10115
10465
|
* Schema.encodeSync(UrlSchema)({ maxItemPerPage: 10, page: 1 }) // => "%7B%22maxItemPerPage%22%3A10%2C%22page%22%3A1%7D"
|
|
10116
10466
|
* ```
|
|
10117
10467
|
*
|
|
10468
|
+
* @stability stable
|
|
10118
10469
|
* @category schemas
|
|
10119
10470
|
* @since 3.12.0
|
|
10120
10471
|
*/
|
|
@@ -10127,6 +10478,7 @@ export const StringFromUriComponent: StringFromUriComponent = String.annotate({
|
|
|
10127
10478
|
* Schema for property keys accepted by Effect schemas: finite `number`,
|
|
10128
10479
|
* `symbol`, or `string`.
|
|
10129
10480
|
*
|
|
10481
|
+
* @stability stable
|
|
10130
10482
|
* @category schemas
|
|
10131
10483
|
* @since 4.0.0
|
|
10132
10484
|
*/
|
|
@@ -10139,6 +10491,7 @@ export const PropertyKey: Union<readonly [Finite, Symbol, String]> = Union([Fini
|
|
|
10139
10491
|
* The result contains an `issues` array where each issue has a message and an
|
|
10140
10492
|
* optional path made of property keys or keyed path segments.
|
|
10141
10493
|
*
|
|
10494
|
+
* @stability stable
|
|
10142
10495
|
* @category schemas
|
|
10143
10496
|
* @since 4.0.0
|
|
10144
10497
|
*/
|
|
@@ -10169,6 +10522,7 @@ export const StandardSchemaV1FailureResult: Struct<{
|
|
|
10169
10522
|
/**
|
|
10170
10523
|
* Type-level representation of {@link BooleanFromBit}.
|
|
10171
10524
|
*
|
|
10525
|
+
* @stability stable
|
|
10172
10526
|
* @category models
|
|
10173
10527
|
* @since 4.0.0
|
|
10174
10528
|
*/
|
|
@@ -10191,6 +10545,7 @@ export interface BooleanFromBit extends decodeTo<Boolean, Literals<readonly [0,
|
|
|
10191
10545
|
* @see {@link Boolean} for validating values that are already booleans
|
|
10192
10546
|
* @see {@link Literals} for keeping bit literals instead of decoding them
|
|
10193
10547
|
*
|
|
10548
|
+
* @stability stable
|
|
10194
10549
|
* @category schemas
|
|
10195
10550
|
* @since 4.0.0
|
|
10196
10551
|
*/
|
|
@@ -10206,6 +10561,7 @@ export const BooleanFromBit: BooleanFromBit = Literals([0, 1]).pipe(
|
|
|
10206
10561
|
/**
|
|
10207
10562
|
* Type-level representation of {@link Uint8Array}.
|
|
10208
10563
|
*
|
|
10564
|
+
* @stability stable
|
|
10209
10565
|
* @category models
|
|
10210
10566
|
* @since 4.0.0
|
|
10211
10567
|
*/
|
|
@@ -10227,6 +10583,7 @@ const Base64String = String.annotate({
|
|
|
10227
10583
|
*
|
|
10228
10584
|
* The default JSON serializer encodes Uint8Array as a Base64 encoded string.
|
|
10229
10585
|
*
|
|
10586
|
+
* @stability stable
|
|
10230
10587
|
* @category schemas
|
|
10231
10588
|
* @since 4.0.0
|
|
10232
10589
|
*/
|
|
@@ -10249,6 +10606,7 @@ export const Uint8Array: Uint8Array = instanceOf(globalThis.Uint8Array<ArrayBuff
|
|
|
10249
10606
|
/**
|
|
10250
10607
|
* Type-level representation of {@link Uint8ArrayFromBase64}.
|
|
10251
10608
|
*
|
|
10609
|
+
* @stability stable
|
|
10252
10610
|
* @category models
|
|
10253
10611
|
* @since 3.10.0
|
|
10254
10612
|
*/
|
|
@@ -10267,6 +10625,7 @@ export interface Uint8ArrayFromBase64 extends decodeTo<Uint8Array, String> {
|
|
|
10267
10625
|
* Encoding:
|
|
10268
10626
|
* - A `Uint8Array` is encoded as a base64-encoded string.
|
|
10269
10627
|
*
|
|
10628
|
+
* @stability stable
|
|
10270
10629
|
* @category schemas
|
|
10271
10630
|
* @since 3.10.0
|
|
10272
10631
|
*/
|
|
@@ -10276,6 +10635,7 @@ export const Uint8ArrayFromBase64: Uint8ArrayFromBase64 = Base64String.pipe(
|
|
|
10276
10635
|
/**
|
|
10277
10636
|
* Type-level representation of {@link Uint8ArrayFromBase64Url}.
|
|
10278
10637
|
*
|
|
10638
|
+
* @stability stable
|
|
10279
10639
|
* @category models
|
|
10280
10640
|
* @since 3.10.0
|
|
10281
10641
|
*/
|
|
@@ -10294,6 +10654,7 @@ export interface Uint8ArrayFromBase64Url extends decodeTo<Uint8Array, String> {
|
|
|
10294
10654
|
* Encoding:
|
|
10295
10655
|
* - A `Uint8Array` is encoded as a base64 (URL) encoded string.
|
|
10296
10656
|
*
|
|
10657
|
+
* @stability stable
|
|
10297
10658
|
* @category schemas
|
|
10298
10659
|
* @since 3.10.0
|
|
10299
10660
|
*/
|
|
@@ -10308,6 +10669,7 @@ export const Uint8ArrayFromBase64Url: Uint8ArrayFromBase64Url = String.annotate(
|
|
|
10308
10669
|
/**
|
|
10309
10670
|
* Type-level representation of {@link Uint8ArrayFromHex}.
|
|
10310
10671
|
*
|
|
10672
|
+
* @stability stable
|
|
10311
10673
|
* @category models
|
|
10312
10674
|
* @since 3.10.0
|
|
10313
10675
|
*/
|
|
@@ -10326,6 +10688,7 @@ export interface Uint8ArrayFromHex extends decodeTo<Uint8Array, String> {
|
|
|
10326
10688
|
* Encoding:
|
|
10327
10689
|
* - A `Uint8Array` is encoded as a hex encoded string.
|
|
10328
10690
|
*
|
|
10691
|
+
* @stability stable
|
|
10329
10692
|
* @category schemas
|
|
10330
10693
|
* @since 3.10.0
|
|
10331
10694
|
*/
|
|
@@ -10361,6 +10724,7 @@ const bigDecimalFromString: SchemaTransformation.Transformation<BigDecimal_.BigD
|
|
|
10361
10724
|
/**
|
|
10362
10725
|
* Validates that a BigDecimal is greater than the specified value (exclusive).
|
|
10363
10726
|
*
|
|
10727
|
+
* @stability stable
|
|
10364
10728
|
* @category validation
|
|
10365
10729
|
* @since 4.0.0
|
|
10366
10730
|
*/
|
|
@@ -10375,6 +10739,7 @@ export const isGreaterThanBigDecimal: (
|
|
|
10375
10739
|
* Validates that a BigDecimal is greater than or equal to the specified value
|
|
10376
10740
|
* (inclusive).
|
|
10377
10741
|
*
|
|
10742
|
+
* @stability stable
|
|
10378
10743
|
* @category validation
|
|
10379
10744
|
* @since 4.0.0
|
|
10380
10745
|
*/
|
|
@@ -10388,6 +10753,7 @@ export const isGreaterThanOrEqualToBigDecimal: (
|
|
|
10388
10753
|
/**
|
|
10389
10754
|
* Validates that a BigDecimal is less than the specified value (exclusive).
|
|
10390
10755
|
*
|
|
10756
|
+
* @stability stable
|
|
10391
10757
|
* @category validation
|
|
10392
10758
|
* @since 4.0.0
|
|
10393
10759
|
*/
|
|
@@ -10402,6 +10768,7 @@ export const isLessThanBigDecimal: (
|
|
|
10402
10768
|
* Validates that a BigDecimal is less than or equal to the specified value
|
|
10403
10769
|
* (inclusive).
|
|
10404
10770
|
*
|
|
10771
|
+
* @stability stable
|
|
10405
10772
|
* @category validation
|
|
10406
10773
|
* @since 4.0.0
|
|
10407
10774
|
*/
|
|
@@ -10420,6 +10787,7 @@ export const isLessThanOrEqualToBigDecimal: (
|
|
|
10420
10787
|
* The minimum and maximum boundaries are inclusive by default. Pass
|
|
10421
10788
|
* `exclusiveMinimum` or `exclusiveMaximum` to exclude either boundary.
|
|
10422
10789
|
*
|
|
10790
|
+
* @stability stable
|
|
10423
10791
|
* @category validation
|
|
10424
10792
|
* @since 4.0.0
|
|
10425
10793
|
*/
|
|
@@ -10435,6 +10803,7 @@ export const isBetweenBigDecimal: (options: {
|
|
|
10435
10803
|
/**
|
|
10436
10804
|
* Type-level representation of {@link BigDecimal}.
|
|
10437
10805
|
*
|
|
10806
|
+
* @stability stable
|
|
10438
10807
|
* @category models
|
|
10439
10808
|
* @since 3.10.0
|
|
10440
10809
|
*/
|
|
@@ -10458,6 +10827,7 @@ const BigDecimalString = String.annotate({ expected: "a string that will be deco
|
|
|
10458
10827
|
*
|
|
10459
10828
|
* @see {@link BigDecimalFromString} for parsing string input into a BigDecimal
|
|
10460
10829
|
*
|
|
10830
|
+
* @stability stable
|
|
10461
10831
|
* @category schemas
|
|
10462
10832
|
* @since 3.10.0
|
|
10463
10833
|
*/
|
|
@@ -10485,6 +10855,7 @@ export const BigDecimal: BigDecimal = declare(
|
|
|
10485
10855
|
/**
|
|
10486
10856
|
* Type-level representation of {@link BigDecimalFromString}.
|
|
10487
10857
|
*
|
|
10858
|
+
* @stability stable
|
|
10488
10859
|
* @category models
|
|
10489
10860
|
* @since 4.0.0
|
|
10490
10861
|
*/
|
|
@@ -10515,6 +10886,7 @@ export interface BigDecimalFromString extends decodeTo<BigDecimal, String> {
|
|
|
10515
10886
|
* @see {@link BigIntFromString} for parsing base-10 integer strings into bigint values
|
|
10516
10887
|
* @see {@link NumberFromString} for parsing JavaScript number strings
|
|
10517
10888
|
*
|
|
10889
|
+
* @stability stable
|
|
10518
10890
|
* @category schemas
|
|
10519
10891
|
* @since 4.0.0
|
|
10520
10892
|
*/
|
|
@@ -10529,6 +10901,7 @@ export const BigDecimalFromString: BigDecimalFromString = BigDecimalString.pipe(
|
|
|
10529
10901
|
/**
|
|
10530
10902
|
* Type-level representation of {@link ByteSize}.
|
|
10531
10903
|
*
|
|
10904
|
+
* @stability unstable
|
|
10532
10905
|
* @category models
|
|
10533
10906
|
* @since 4.0.0
|
|
10534
10907
|
*/
|
|
@@ -10544,6 +10917,7 @@ export interface ByteSize extends declare<ByteSize_.ByteSize> {
|
|
|
10544
10917
|
* beyond JavaScript's safe-integer range. The StringTree codec uses the
|
|
10545
10918
|
* human-readable byte-size syntax exposed by {@link ByteSizeFromString}.
|
|
10546
10919
|
*
|
|
10920
|
+
* @stability unstable
|
|
10547
10921
|
* @category schemas
|
|
10548
10922
|
* @since 4.0.0
|
|
10549
10923
|
*/
|
|
@@ -10579,6 +10953,7 @@ const ByteSizeString = String.annotate({ expected: "a string that will be decode
|
|
|
10579
10953
|
/**
|
|
10580
10954
|
* Type-level representation of {@link ByteSizeFromString}.
|
|
10581
10955
|
*
|
|
10956
|
+
* @stability unstable
|
|
10582
10957
|
* @category models
|
|
10583
10958
|
* @since 4.0.0
|
|
10584
10959
|
*/
|
|
@@ -10611,6 +10986,7 @@ export interface ByteSizeFromString extends decodeTo<ByteSize, String> {
|
|
|
10611
10986
|
* A unit is required. Signs, exponent notation, digit separators, and ambiguous
|
|
10612
10987
|
* unit spellings such as `KB`, `mb`, `Mb`, or `b` are rejected.
|
|
10613
10988
|
*
|
|
10989
|
+
* @stability unstable
|
|
10614
10990
|
* @category schemas
|
|
10615
10991
|
* @since 4.0.0
|
|
10616
10992
|
*/
|
|
@@ -10620,6 +10996,7 @@ export const ByteSizeFromString: ByteSizeFromString = ByteSizeString.pipe(
|
|
|
10620
10996
|
/**
|
|
10621
10997
|
* Type-level representation of {@link ByteSizeFromBigInt}.
|
|
10622
10998
|
*
|
|
10999
|
+
* @stability unstable
|
|
10623
11000
|
* @category models
|
|
10624
11001
|
* @since 4.0.0
|
|
10625
11002
|
*/
|
|
@@ -10629,6 +11006,7 @@ export interface ByteSizeFromBigInt extends decodeTo<ByteSize, BigInt> {
|
|
|
10629
11006
|
/**
|
|
10630
11007
|
* Schema that decodes non-negative bigint byte counts.
|
|
10631
11008
|
*
|
|
11009
|
+
* @stability unstable
|
|
10632
11010
|
* @category schemas
|
|
10633
11011
|
* @since 4.0.0
|
|
10634
11012
|
*/
|
|
@@ -10638,6 +11016,7 @@ export const ByteSizeFromBigInt: ByteSizeFromBigInt = BigInt.pipe(
|
|
|
10638
11016
|
/**
|
|
10639
11017
|
* Type-level representation of {@link ByteSizeFromNumber}.
|
|
10640
11018
|
*
|
|
11019
|
+
* @stability unstable
|
|
10641
11020
|
* @category models
|
|
10642
11021
|
* @since 4.0.0
|
|
10643
11022
|
*/
|
|
@@ -10651,6 +11030,7 @@ export interface ByteSizeFromNumber extends decodeTo<ByteSize, Number> {
|
|
|
10651
11030
|
*
|
|
10652
11031
|
* Encoding fails when the byte count exceeds `Number.MAX_SAFE_INTEGER`.
|
|
10653
11032
|
*
|
|
11033
|
+
* @stability unstable
|
|
10654
11034
|
* @category schemas
|
|
10655
11035
|
* @since 4.0.0
|
|
10656
11036
|
*/
|
|
@@ -10665,6 +11045,7 @@ export const ByteSizeFromNumber: ByteSizeFromNumber = Number.pipe(
|
|
|
10665
11045
|
/**
|
|
10666
11046
|
* Type-level representation returned by {@link CauseReason}.
|
|
10667
11047
|
*
|
|
11048
|
+
* @stability stable
|
|
10668
11049
|
* @category models
|
|
10669
11050
|
* @since 4.0.0
|
|
10670
11051
|
*/
|
|
@@ -10688,6 +11069,7 @@ export interface CauseReason<E extends Constraint, D extends Constraint> extends
|
|
|
10688
11069
|
* Failures are represented with a `Fail` tag and encoded error, defects with a
|
|
10689
11070
|
* `Die` tag and encoded defect, and interrupts with an optional `fiberId`.
|
|
10690
11071
|
*
|
|
11072
|
+
* @stability stable
|
|
10691
11073
|
* @category utility types
|
|
10692
11074
|
* @since 4.0.0
|
|
10693
11075
|
*/
|
|
@@ -10718,6 +11100,7 @@ export type CauseReasonIso<E extends Constraint, D extends Constraint> = {
|
|
|
10718
11100
|
* @see {@link Cause} for constructing schemas for full Cause values
|
|
10719
11101
|
* @see {@link CauseReasonIso} for the ISO shape of each cause reason
|
|
10720
11102
|
*
|
|
11103
|
+
* @stability stable
|
|
10721
11104
|
* @category schemas
|
|
10722
11105
|
* @since 4.0.0
|
|
10723
11106
|
*/
|
|
@@ -10807,6 +11190,7 @@ export function CauseReason<E extends Constraint, D extends Constraint>(
|
|
|
10807
11190
|
/**
|
|
10808
11191
|
* Type-level representation returned by {@link Cause}.
|
|
10809
11192
|
*
|
|
11193
|
+
* @stability stable
|
|
10810
11194
|
* @category models
|
|
10811
11195
|
* @since 3.10.0
|
|
10812
11196
|
*/
|
|
@@ -10834,6 +11218,7 @@ export interface Cause<E extends Constraint, D extends Constraint> extends
|
|
|
10834
11218
|
* @see {@link Cause} for constructing schemas for full Cause values
|
|
10835
11219
|
* @see {@link CauseReasonIso} for the ISO shape of each array element
|
|
10836
11220
|
*
|
|
11221
|
+
* @stability stable
|
|
10837
11222
|
* @category utility types
|
|
10838
11223
|
* @since 4.0.0
|
|
10839
11224
|
*/
|
|
@@ -10856,6 +11241,7 @@ export type CauseIso<E extends Constraint, D extends Constraint> = ReadonlyArray
|
|
|
10856
11241
|
* @see {@link CauseReason} for the schema used by each individual cause reason
|
|
10857
11242
|
* @see {@link CauseIso} for the ordered array representation used by the schema ISO
|
|
10858
11243
|
*
|
|
11244
|
+
* @stability stable
|
|
10859
11245
|
* @category schemas
|
|
10860
11246
|
* @since 3.10.0
|
|
10861
11247
|
*/
|
|
@@ -10914,6 +11300,7 @@ function chunkLink<Value>(values: Schema<ReadonlyArray<Value>>) {
|
|
|
10914
11300
|
/**
|
|
10915
11301
|
* Type-level representation returned by {@link Chunk}.
|
|
10916
11302
|
*
|
|
11303
|
+
* @stability stable
|
|
10917
11304
|
* @category models
|
|
10918
11305
|
* @since 3.10.0
|
|
10919
11306
|
*/
|
|
@@ -10939,6 +11326,7 @@ export interface Chunk<Value extends Constraint> extends
|
|
|
10939
11326
|
*
|
|
10940
11327
|
* @see {@link Chunk} for the schema interface and constructor that use this ISO representation
|
|
10941
11328
|
*
|
|
11329
|
+
* @stability stable
|
|
10942
11330
|
* @category utility types
|
|
10943
11331
|
* @since 4.0.0
|
|
10944
11332
|
*/
|
|
@@ -10946,6 +11334,7 @@ export type ChunkIso<Value extends Constraint> = ReadonlyArray<Value["Iso"]>
|
|
|
10946
11334
|
/**
|
|
10947
11335
|
* Schema for chunks whose values conform to the provided element schema.
|
|
10948
11336
|
*
|
|
11337
|
+
* @stability stable
|
|
10949
11338
|
* @category schemas
|
|
10950
11339
|
* @since 3.10.0
|
|
10951
11340
|
*/
|
|
@@ -11128,6 +11517,7 @@ function timeZoneArbitrarySchema(): Codec<number | string> {
|
|
|
11128
11517
|
/**
|
|
11129
11518
|
* Type-level representation of {@link DateTimeUtc}.
|
|
11130
11519
|
*
|
|
11520
|
+
* @stability stable
|
|
11131
11521
|
* @category models
|
|
11132
11522
|
* @since 3.10.0
|
|
11133
11523
|
*/
|
|
@@ -11152,6 +11542,7 @@ export interface DateTimeUtc extends declare<DateTime.Utc> {
|
|
|
11152
11542
|
* @see {@link DateTimeUtcFromMillis} for decoding epoch milliseconds into UTC values
|
|
11153
11543
|
* @see {@link DateTimeZoned} for preserving zoned DateTime values
|
|
11154
11544
|
*
|
|
11545
|
+
* @stability stable
|
|
11155
11546
|
* @category schemas
|
|
11156
11547
|
* @since 3.10.0
|
|
11157
11548
|
*/
|
|
@@ -11190,6 +11581,7 @@ export const DateTimeUtc: DateTimeUtc = declare(
|
|
|
11190
11581
|
/**
|
|
11191
11582
|
* Type-level representation of {@link DateTimeUtcFromDate}.
|
|
11192
11583
|
*
|
|
11584
|
+
* @stability stable
|
|
11193
11585
|
* @category models
|
|
11194
11586
|
* @since 3.12.0
|
|
11195
11587
|
*/
|
|
@@ -11217,6 +11609,7 @@ export interface DateTimeUtcFromDate extends decodeTo<DateTimeUtc, Date> {
|
|
|
11217
11609
|
* @see {@link DateTimeUtcFromMillis} for decoding epoch milliseconds into UTC values
|
|
11218
11610
|
* @see {@link Date} for validating Date instances without converting them
|
|
11219
11611
|
*
|
|
11612
|
+
* @stability stable
|
|
11220
11613
|
* @category schemas
|
|
11221
11614
|
* @since 3.12.0
|
|
11222
11615
|
*/
|
|
@@ -11229,6 +11622,7 @@ export const DateTimeUtcFromDate: DateTimeUtcFromDate = Date.pipe(
|
|
|
11229
11622
|
/**
|
|
11230
11623
|
* Type-level representation of {@link DateTimeUtcFromString}.
|
|
11231
11624
|
*
|
|
11625
|
+
* @stability stable
|
|
11232
11626
|
* @category models
|
|
11233
11627
|
* @since 4.0.0
|
|
11234
11628
|
*/
|
|
@@ -11253,6 +11647,7 @@ export interface DateTimeUtcFromString extends decodeTo<DateTimeUtc, String> {
|
|
|
11253
11647
|
* @see {@link DateTimeUtcFromMillis} for decoding epoch milliseconds into UTC values
|
|
11254
11648
|
* @see {@link DateFromString} for decoding strings into JavaScript Date instances
|
|
11255
11649
|
*
|
|
11650
|
+
* @stability stable
|
|
11256
11651
|
* @category schemas
|
|
11257
11652
|
* @since 4.0.0
|
|
11258
11653
|
*/
|
|
@@ -11267,6 +11662,7 @@ export const DateTimeUtcFromString: DateTimeUtcFromString = String.annotate({
|
|
|
11267
11662
|
/**
|
|
11268
11663
|
* Type-level representation of {@link DateTimeUtcFromMillis}.
|
|
11269
11664
|
*
|
|
11665
|
+
* @stability stable
|
|
11270
11666
|
* @category models
|
|
11271
11667
|
* @since 4.0.0
|
|
11272
11668
|
*/
|
|
@@ -11288,6 +11684,7 @@ export interface DateTimeUtcFromMillis extends decodeTo<instanceOf<DateTime.Utc>
|
|
|
11288
11684
|
* @see {@link DateTimeUtcFromString} for decoding date-time strings into UTC values
|
|
11289
11685
|
* @see {@link DateFromMillis} for decoding epoch milliseconds into JavaScript Date instances
|
|
11290
11686
|
*
|
|
11687
|
+
* @stability stable
|
|
11291
11688
|
* @category schemas
|
|
11292
11689
|
* @since 4.0.0
|
|
11293
11690
|
*/
|
|
@@ -11300,6 +11697,7 @@ export const DateTimeUtcFromMillis: DateTimeUtcFromMillis = Int.pipe(
|
|
|
11300
11697
|
/**
|
|
11301
11698
|
* Type-level representation of {@link TimeZoneOffset}.
|
|
11302
11699
|
*
|
|
11700
|
+
* @stability stable
|
|
11303
11701
|
* @category models
|
|
11304
11702
|
* @since 3.10.0
|
|
11305
11703
|
*/
|
|
@@ -11315,6 +11713,7 @@ export interface TimeZoneOffset extends declare<DateTime.TimeZone.Offset> {
|
|
|
11315
11713
|
*
|
|
11316
11714
|
* - encodes `DateTime.TimeZone.Offset` as a number (offset in milliseconds)
|
|
11317
11715
|
*
|
|
11716
|
+
* @stability stable
|
|
11318
11717
|
* @category schemas
|
|
11319
11718
|
* @since 3.10.0
|
|
11320
11719
|
*/
|
|
@@ -11342,6 +11741,7 @@ export const TimeZoneOffset: TimeZoneOffset = declare(
|
|
|
11342
11741
|
/**
|
|
11343
11742
|
* Type-level representation of {@link TimeZoneNamed}.
|
|
11344
11743
|
*
|
|
11744
|
+
* @stability stable
|
|
11345
11745
|
* @category models
|
|
11346
11746
|
* @since 3.10.0
|
|
11347
11747
|
*/
|
|
@@ -11358,6 +11758,7 @@ const TimeZoneNamedString = String.annotate({ expected: "an IANA time zone ident
|
|
|
11358
11758
|
*
|
|
11359
11759
|
* - encodes `DateTime.TimeZone.Named` as a string (IANA time zone identifier)
|
|
11360
11760
|
*
|
|
11761
|
+
* @stability stable
|
|
11361
11762
|
* @category schemas
|
|
11362
11763
|
* @since 3.10.0
|
|
11363
11764
|
*/
|
|
@@ -11390,6 +11791,7 @@ export const TimeZoneNamed: TimeZoneNamed = declare(
|
|
|
11390
11791
|
/**
|
|
11391
11792
|
* Type-level representation of {@link TimeZoneNamedFromString}.
|
|
11392
11793
|
*
|
|
11794
|
+
* @stability stable
|
|
11393
11795
|
* @category models
|
|
11394
11796
|
* @since 4.0.0
|
|
11395
11797
|
*/
|
|
@@ -11407,6 +11809,7 @@ export interface TimeZoneNamedFromString extends decodeTo<TimeZoneNamed, String>
|
|
|
11407
11809
|
* Encoding:
|
|
11408
11810
|
* - A `DateTime.TimeZone.Named` is encoded as a `string`.
|
|
11409
11811
|
*
|
|
11812
|
+
* @stability stable
|
|
11410
11813
|
* @category schemas
|
|
11411
11814
|
* @since 4.0.0
|
|
11412
11815
|
*/
|
|
@@ -11416,6 +11819,7 @@ export const TimeZoneNamedFromString: TimeZoneNamedFromString = TimeZoneNamedStr
|
|
|
11416
11819
|
/**
|
|
11417
11820
|
* Type-level representation of {@link TimeZone}.
|
|
11418
11821
|
*
|
|
11822
|
+
* @stability stable
|
|
11419
11823
|
* @category models
|
|
11420
11824
|
* @since 3.10.0
|
|
11421
11825
|
*/
|
|
@@ -11435,6 +11839,7 @@ const TimeZoneString = String.annotate({
|
|
|
11435
11839
|
* - encodes `DateTime.TimeZone` as a string (IANA identifier or offset like
|
|
11436
11840
|
* `+03:00`)
|
|
11437
11841
|
*
|
|
11842
|
+
* @stability stable
|
|
11438
11843
|
* @category schemas
|
|
11439
11844
|
* @since 3.10.0
|
|
11440
11845
|
*/
|
|
@@ -11469,6 +11874,7 @@ export const TimeZone: TimeZone = declare(
|
|
|
11469
11874
|
/**
|
|
11470
11875
|
* Type-level representation of {@link TimeZoneFromString}.
|
|
11471
11876
|
*
|
|
11877
|
+
* @stability stable
|
|
11472
11878
|
* @category models
|
|
11473
11879
|
* @since 4.0.0
|
|
11474
11880
|
*/
|
|
@@ -11486,6 +11892,7 @@ export interface TimeZoneFromString extends decodeTo<TimeZone, String> {
|
|
|
11486
11892
|
* Encoding:
|
|
11487
11893
|
* - A `DateTime.TimeZone` is encoded as a `string`.
|
|
11488
11894
|
*
|
|
11895
|
+
* @stability stable
|
|
11489
11896
|
* @category schemas
|
|
11490
11897
|
* @since 4.0.0
|
|
11491
11898
|
*/
|
|
@@ -11495,6 +11902,7 @@ export const TimeZoneFromString: TimeZoneFromString = TimeZoneString.pipe(
|
|
|
11495
11902
|
/**
|
|
11496
11903
|
* Type-level representation of {@link DateTimeZoned}.
|
|
11497
11904
|
*
|
|
11905
|
+
* @stability stable
|
|
11498
11906
|
* @category models
|
|
11499
11907
|
* @since 3.10.0
|
|
11500
11908
|
*/
|
|
@@ -11516,6 +11924,7 @@ const DateTimeZonedString = String.annotate({
|
|
|
11516
11924
|
* - encodes named zones by appending the IANA identifier in brackets, such as
|
|
11517
11925
|
* `YYYY-MM-DDTHH:mm:ss.sss+HH:MM[Time/Zone]`
|
|
11518
11926
|
*
|
|
11927
|
+
* @stability stable
|
|
11519
11928
|
* @category schemas
|
|
11520
11929
|
* @since 3.10.0
|
|
11521
11930
|
*/
|
|
@@ -11560,6 +11969,7 @@ export const DateTimeZoned: DateTimeZoned = declare(
|
|
|
11560
11969
|
/**
|
|
11561
11970
|
* Type-level representation of {@link DateTimeZonedFromString}.
|
|
11562
11971
|
*
|
|
11972
|
+
* @stability stable
|
|
11563
11973
|
* @category models
|
|
11564
11974
|
* @since 4.0.0
|
|
11565
11975
|
*/
|
|
@@ -11577,6 +11987,7 @@ export interface DateTimeZonedFromString extends decodeTo<DateTimeZoned, String>
|
|
|
11577
11987
|
* Encoding:
|
|
11578
11988
|
* - A `DateTime.Zoned` is encoded as a `string`.
|
|
11579
11989
|
*
|
|
11990
|
+
* @stability stable
|
|
11580
11991
|
* @category schemas
|
|
11581
11992
|
* @since 4.0.0
|
|
11582
11993
|
*/
|
|
@@ -11584,10 +11995,10 @@ export const DateTimeZonedFromString: DateTimeZonedFromString = DateTimeZonedStr
|
|
|
11584
11995
|
decodeTo(DateTimeZoned, dateTimeZonedFromString)
|
|
11585
11996
|
)
|
|
11586
11997
|
|
|
11587
|
-
const netAddressFromString = <S extends
|
|
11998
|
+
const netAddressFromString = <S extends Constraint, E extends { readonly message: string }>(
|
|
11588
11999
|
declaration: S,
|
|
11589
|
-
parse: (input: string) => Result_.Result<S["
|
|
11590
|
-
encode: (value: S["
|
|
12000
|
+
parse: (input: string) => Result_.Result<S["Encoded"], E>,
|
|
12001
|
+
encode: (value: S["Encoded"]) => string,
|
|
11591
12002
|
identifier: string
|
|
11592
12003
|
) =>
|
|
11593
12004
|
String.pipe(decodeTo(
|
|
@@ -12938,6 +13349,229 @@ export const SocketAddress: SocketAddress = declare(NetAddress_.isSocketAddress,
|
|
|
12938
13349
|
identifier: "SocketAddress"
|
|
12939
13350
|
})
|
|
12940
13351
|
|
|
13352
|
+
/**
|
|
13353
|
+
* Type-level representation of {@link DomainName}.
|
|
13354
|
+
*
|
|
13355
|
+
* @stability experimental
|
|
13356
|
+
* @category models
|
|
13357
|
+
* @since 4.0.0
|
|
13358
|
+
*/
|
|
13359
|
+
export interface DomainName extends brand<String, "~effect/net/Host/DomainName"> {
|
|
13360
|
+
readonly "Rebuild": DomainName
|
|
13361
|
+
}
|
|
13362
|
+
|
|
13363
|
+
/**
|
|
13364
|
+
* Schema for normalized DNS domain names.
|
|
13365
|
+
*
|
|
13366
|
+
* **Details**
|
|
13367
|
+
*
|
|
13368
|
+
* Only names already in normalized form (lowercase ASCII, with
|
|
13369
|
+
* internationalized labels in `xn--` form) are accepted. Use
|
|
13370
|
+
* {@link DomainNameFromString} to normalize arbitrary input.
|
|
13371
|
+
*
|
|
13372
|
+
* @stability experimental
|
|
13373
|
+
* @category schemas
|
|
13374
|
+
* @since 4.0.0
|
|
13375
|
+
*/
|
|
13376
|
+
export const DomainName: DomainName = String.check(
|
|
13377
|
+
makeFilter(Host_.isDomainName, { expected: "a normalized domain name" })
|
|
13378
|
+
).pipe(brand("~effect/net/Host/DomainName")).annotate({ identifier: "DomainName" })
|
|
13379
|
+
|
|
13380
|
+
/**
|
|
13381
|
+
* Type-level representation of {@link DomainNameFromString}.
|
|
13382
|
+
*
|
|
13383
|
+
* @stability experimental
|
|
13384
|
+
* @category models
|
|
13385
|
+
* @since 4.0.0
|
|
13386
|
+
*/
|
|
13387
|
+
export interface DomainNameFromString extends decodeTo<DomainName, String> {
|
|
13388
|
+
readonly "Rebuild": DomainNameFromString
|
|
13389
|
+
}
|
|
13390
|
+
|
|
13391
|
+
/**
|
|
13392
|
+
* Schema for DNS domain names decoded from strings, normalizing case and
|
|
13393
|
+
* converting internationalized names to their ASCII form.
|
|
13394
|
+
*
|
|
13395
|
+
* @stability experimental
|
|
13396
|
+
* @category schemas
|
|
13397
|
+
* @since 4.0.0
|
|
13398
|
+
*/
|
|
13399
|
+
export const DomainNameFromString: DomainNameFromString = netAddressFromString(
|
|
13400
|
+
DomainName,
|
|
13401
|
+
Host_.domainNameFromString,
|
|
13402
|
+
(name) => name,
|
|
13403
|
+
"DomainNameFromString"
|
|
13404
|
+
)
|
|
13405
|
+
|
|
13406
|
+
/**
|
|
13407
|
+
* Type-level representation of {@link ScopedIpv6Literal}.
|
|
13408
|
+
*
|
|
13409
|
+
* @stability experimental
|
|
13410
|
+
* @category models
|
|
13411
|
+
* @since 4.0.0
|
|
13412
|
+
*/
|
|
13413
|
+
export interface ScopedIpv6Literal extends brand<String, "~effect/net/NetAddress/ScopedIpv6Literal"> {
|
|
13414
|
+
readonly "Rebuild": ScopedIpv6Literal
|
|
13415
|
+
}
|
|
13416
|
+
|
|
13417
|
+
/**
|
|
13418
|
+
* Schema for canonical scoped IPv6 literals such as `fe80::1%eth0`.
|
|
13419
|
+
*
|
|
13420
|
+
* @stability experimental
|
|
13421
|
+
* @category schemas
|
|
13422
|
+
* @since 4.0.0
|
|
13423
|
+
*/
|
|
13424
|
+
export const ScopedIpv6Literal: ScopedIpv6Literal = String.check(
|
|
13425
|
+
makeFilter(NetAddress_.isScopedIpv6Literal, { expected: "a canonical scoped IPv6 literal" })
|
|
13426
|
+
).pipe(brand("~effect/net/NetAddress/ScopedIpv6Literal")).annotate({ identifier: "ScopedIpv6Literal" })
|
|
13427
|
+
|
|
13428
|
+
/**
|
|
13429
|
+
* Type-level representation of {@link ScopedIpv6LiteralFromString}.
|
|
13430
|
+
*
|
|
13431
|
+
* @stability experimental
|
|
13432
|
+
* @category models
|
|
13433
|
+
* @since 4.0.0
|
|
13434
|
+
*/
|
|
13435
|
+
export interface ScopedIpv6LiteralFromString extends decodeTo<ScopedIpv6Literal, String> {
|
|
13436
|
+
readonly "Rebuild": ScopedIpv6LiteralFromString
|
|
13437
|
+
}
|
|
13438
|
+
|
|
13439
|
+
/**
|
|
13440
|
+
* Schema for scoped IPv6 literals decoded from strings, normalizing the address
|
|
13441
|
+
* and numeric zones.
|
|
13442
|
+
*
|
|
13443
|
+
* @stability experimental
|
|
13444
|
+
* @category schemas
|
|
13445
|
+
* @since 4.0.0
|
|
13446
|
+
*/
|
|
13447
|
+
export const ScopedIpv6LiteralFromString: ScopedIpv6LiteralFromString = netAddressFromString(
|
|
13448
|
+
ScopedIpv6Literal,
|
|
13449
|
+
NetAddress_.scopedIpv6LiteralFromString,
|
|
13450
|
+
(literal) => literal,
|
|
13451
|
+
"ScopedIpv6LiteralFromString"
|
|
13452
|
+
)
|
|
13453
|
+
|
|
13454
|
+
/**
|
|
13455
|
+
* Type-level representation of {@link Host}.
|
|
13456
|
+
*
|
|
13457
|
+
* @stability experimental
|
|
13458
|
+
* @category models
|
|
13459
|
+
* @since 4.0.0
|
|
13460
|
+
*/
|
|
13461
|
+
export interface Host extends Union<readonly [IpAddress, ScopedIpv6Literal, DomainName]> {
|
|
13462
|
+
readonly "Rebuild": Host
|
|
13463
|
+
}
|
|
13464
|
+
|
|
13465
|
+
/**
|
|
13466
|
+
* Schema for hosts: numeric IP addresses, scoped IPv6 literals, or domain names.
|
|
13467
|
+
*
|
|
13468
|
+
* @stability experimental
|
|
13469
|
+
* @category schemas
|
|
13470
|
+
* @since 4.0.0
|
|
13471
|
+
*/
|
|
13472
|
+
export const Host: Host = Union([IpAddress, ScopedIpv6Literal, DomainName]).annotate({ identifier: "Host" })
|
|
13473
|
+
|
|
13474
|
+
/**
|
|
13475
|
+
* Type-level representation of {@link HostFromString}.
|
|
13476
|
+
*
|
|
13477
|
+
* @stability experimental
|
|
13478
|
+
* @category models
|
|
13479
|
+
* @since 4.0.0
|
|
13480
|
+
*/
|
|
13481
|
+
export interface HostFromString
|
|
13482
|
+
extends Union<readonly [IpAddressFromString, ScopedIpv6LiteralFromString, DomainNameFromString]>
|
|
13483
|
+
{
|
|
13484
|
+
readonly "Rebuild": HostFromString
|
|
13485
|
+
}
|
|
13486
|
+
|
|
13487
|
+
/**
|
|
13488
|
+
* Schema for hosts decoded from strings. Numeric IP strings decode to IP
|
|
13489
|
+
* addresses; other strings decode to scoped IPv6 literals or domain names.
|
|
13490
|
+
*
|
|
13491
|
+
* @stability experimental
|
|
13492
|
+
* @category schemas
|
|
13493
|
+
* @since 4.0.0
|
|
13494
|
+
*/
|
|
13495
|
+
export const HostFromString: HostFromString = Union([
|
|
13496
|
+
IpAddressFromString,
|
|
13497
|
+
ScopedIpv6LiteralFromString,
|
|
13498
|
+
DomainNameFromString
|
|
13499
|
+
]).annotate({ identifier: "HostFromString" })
|
|
13500
|
+
|
|
13501
|
+
/**
|
|
13502
|
+
* Type-level representation of {@link HostPort}.
|
|
13503
|
+
*
|
|
13504
|
+
* @stability experimental
|
|
13505
|
+
* @category models
|
|
13506
|
+
* @since 4.0.0
|
|
13507
|
+
*/
|
|
13508
|
+
export interface HostPort extends declare<Host_.HostPort> {
|
|
13509
|
+
readonly "Rebuild": HostPort
|
|
13510
|
+
}
|
|
13511
|
+
|
|
13512
|
+
/**
|
|
13513
|
+
* Schema for already-constructed unresolved host and port values.
|
|
13514
|
+
*
|
|
13515
|
+
* @stability experimental
|
|
13516
|
+
* @category schemas
|
|
13517
|
+
* @since 4.0.0
|
|
13518
|
+
*/
|
|
13519
|
+
export const HostPort: HostPort = declare(Host_.isHostPort, {
|
|
13520
|
+
identifier: "HostPort"
|
|
13521
|
+
})
|
|
13522
|
+
|
|
13523
|
+
/**
|
|
13524
|
+
* Type-level representation of {@link HostPortFromString}.
|
|
13525
|
+
*
|
|
13526
|
+
* @stability experimental
|
|
13527
|
+
* @category models
|
|
13528
|
+
* @since 4.0.0
|
|
13529
|
+
*/
|
|
13530
|
+
export interface HostPortFromString extends decodeTo<HostPort, String> {
|
|
13531
|
+
readonly "Rebuild": HostPortFromString
|
|
13532
|
+
}
|
|
13533
|
+
|
|
13534
|
+
/**
|
|
13535
|
+
* Schema for unresolved endpoints encoded as `host:port` or `[IPv6]:port`
|
|
13536
|
+
* strings.
|
|
13537
|
+
*
|
|
13538
|
+
* @stability experimental
|
|
13539
|
+
* @category schemas
|
|
13540
|
+
* @since 4.0.0
|
|
13541
|
+
*/
|
|
13542
|
+
export const HostPortFromString: HostPortFromString = netAddressFromString(
|
|
13543
|
+
HostPort,
|
|
13544
|
+
Host_.hostPortFromString,
|
|
13545
|
+
Host_.formatHostPort,
|
|
13546
|
+
"HostPortFromString"
|
|
13547
|
+
)
|
|
13548
|
+
|
|
13549
|
+
/**
|
|
13550
|
+
* Type-level representation of {@link Port}.
|
|
13551
|
+
*
|
|
13552
|
+
* @stability experimental
|
|
13553
|
+
* @category models
|
|
13554
|
+
* @since 4.0.0
|
|
13555
|
+
*/
|
|
13556
|
+
export interface Port extends Int {
|
|
13557
|
+
readonly "Rebuild": Port
|
|
13558
|
+
}
|
|
13559
|
+
|
|
13560
|
+
/**
|
|
13561
|
+
* Schema for TCP and UDP port numbers from 0 through 65535.
|
|
13562
|
+
*
|
|
13563
|
+
* **Details**
|
|
13564
|
+
*
|
|
13565
|
+
* Port 0 is accepted because it asks the operating system to choose a port
|
|
13566
|
+
* when binding, and it matches the port range of `InetAddress` and `HostPort`.
|
|
13567
|
+
* `Config.Port` accepts only 1 through 65535.
|
|
13568
|
+
*
|
|
13569
|
+
* @stability experimental
|
|
13570
|
+
* @category schemas
|
|
13571
|
+
* @since 4.0.0
|
|
13572
|
+
*/
|
|
13573
|
+
export const Port: Port = Int.check(isBetween({ minimum: 0, maximum: 65535 }, { expected: "a port number" }))
|
|
13574
|
+
|
|
12941
13575
|
// -----------------------------------------------------------------------------
|
|
12942
13576
|
// Duration schemas
|
|
12943
13577
|
// -----------------------------------------------------------------------------
|
|
@@ -12982,6 +13616,7 @@ const durationFromMillis: SchemaTransformation.Transformation<Duration_.Duration
|
|
|
12982
13616
|
/**
|
|
12983
13617
|
* Type-level representation of {@link Duration}.
|
|
12984
13618
|
*
|
|
13619
|
+
* @stability stable
|
|
12985
13620
|
* @category models
|
|
12986
13621
|
* @since 3.10.0
|
|
12987
13622
|
*/
|
|
@@ -13004,6 +13639,7 @@ export interface Duration extends declare<Duration_.Duration> {
|
|
|
13004
13639
|
* Schema.decodeUnknownSync(Schema.Duration)(Duration.seconds(5)) // => Duration.seconds(5)
|
|
13005
13640
|
* ```
|
|
13006
13641
|
*
|
|
13642
|
+
* @stability stable
|
|
13007
13643
|
* @category schemas
|
|
13008
13644
|
*
|
|
13009
13645
|
* @since 3.10.0
|
|
@@ -13062,6 +13698,7 @@ const DurationString = String.annotate({ expected: "a string that will be decode
|
|
|
13062
13698
|
/**
|
|
13063
13699
|
* Type-level representation of {@link DurationFromString}.
|
|
13064
13700
|
*
|
|
13701
|
+
* @stability stable
|
|
13065
13702
|
* @category models
|
|
13066
13703
|
* @since 4.0.0
|
|
13067
13704
|
*/
|
|
@@ -13080,6 +13717,7 @@ export interface DurationFromString extends decodeTo<Duration, String> {
|
|
|
13080
13717
|
* Encoding:
|
|
13081
13718
|
* - A `Duration` is encoded as a parseable `string`.
|
|
13082
13719
|
*
|
|
13720
|
+
* @stability stable
|
|
13083
13721
|
* @category schemas
|
|
13084
13722
|
* @since 4.0.0
|
|
13085
13723
|
*/
|
|
@@ -13089,6 +13727,7 @@ export const DurationFromString: DurationFromString = DurationString.pipe(
|
|
|
13089
13727
|
/**
|
|
13090
13728
|
* Type-level representation of {@link DurationFromNanos}.
|
|
13091
13729
|
*
|
|
13730
|
+
* @stability stable
|
|
13092
13731
|
* @category models
|
|
13093
13732
|
* @since 3.10.0
|
|
13094
13733
|
*/
|
|
@@ -13109,6 +13748,7 @@ export interface DurationFromNanos extends decodeTo<Duration, BigInt> {
|
|
|
13109
13748
|
* fails when the duration cannot be represented as nanoseconds, such as
|
|
13110
13749
|
* `Duration.infinity` or `Duration.negativeInfinity`.
|
|
13111
13750
|
*
|
|
13751
|
+
* @stability stable
|
|
13112
13752
|
* @category schemas
|
|
13113
13753
|
* @since 3.10.0
|
|
13114
13754
|
*/
|
|
@@ -13118,6 +13758,7 @@ export const DurationFromNanos: DurationFromNanos = BigInt.pipe(
|
|
|
13118
13758
|
/**
|
|
13119
13759
|
* Type-level representation of {@link DurationFromMillis}.
|
|
13120
13760
|
*
|
|
13761
|
+
* @stability stable
|
|
13121
13762
|
* @category models
|
|
13122
13763
|
* @since 3.10.0
|
|
13123
13764
|
*/
|
|
@@ -13140,6 +13781,7 @@ export interface DurationFromMillis extends decodeTo<Duration, Number> {
|
|
|
13140
13781
|
*
|
|
13141
13782
|
* `NaN` is decoded as `Duration.zero`, matching `Duration.millis`.
|
|
13142
13783
|
*
|
|
13784
|
+
* @stability stable
|
|
13143
13785
|
* @category schemas
|
|
13144
13786
|
* @since 3.10.0
|
|
13145
13787
|
*/
|
|
@@ -13147,6 +13789,426 @@ export const DurationFromMillis: DurationFromMillis = Number.pipe(
|
|
|
13147
13789
|
decodeTo(Duration, durationFromMillis)
|
|
13148
13790
|
)
|
|
13149
13791
|
|
|
13792
|
+
// -----------------------------------------------------------------------------
|
|
13793
|
+
// DNS schemas
|
|
13794
|
+
// -----------------------------------------------------------------------------
|
|
13795
|
+
|
|
13796
|
+
/**
|
|
13797
|
+
* Type-level representation of {@link DnsRecordType}.
|
|
13798
|
+
*
|
|
13799
|
+
* @stability experimental
|
|
13800
|
+
* @category models
|
|
13801
|
+
* @since 4.0.0
|
|
13802
|
+
*/
|
|
13803
|
+
export interface DnsRecordType extends Literals<ReadonlyArray<Dns_.RecordType>> {}
|
|
13804
|
+
|
|
13805
|
+
/**
|
|
13806
|
+
* Schema for supported DNS record types such as `"A"` or `"SRV"`.
|
|
13807
|
+
*
|
|
13808
|
+
* @stability experimental
|
|
13809
|
+
* @category schemas
|
|
13810
|
+
* @since 4.0.0
|
|
13811
|
+
*/
|
|
13812
|
+
export const DnsRecordType: DnsRecordType = Literals(Dns_.recordTypes)
|
|
13813
|
+
|
|
13814
|
+
// Addresses in JSON records must already be canonical; normalizing input is
|
|
13815
|
+
// left to the `*FromString` schemas.
|
|
13816
|
+
const dnsCanonicalAddress = <A extends NetAddress_.IpAddress>(
|
|
13817
|
+
schema: Codec<A>,
|
|
13818
|
+
parse: (input: string) => Result_.Result<A, NetAddress_.NetAddressError>
|
|
13819
|
+
) =>
|
|
13820
|
+
String.pipe(decodeTo(
|
|
13821
|
+
schema,
|
|
13822
|
+
SchemaTransformation.transformEffect({
|
|
13823
|
+
decode: (input, options) => {
|
|
13824
|
+
const result = parse(input)
|
|
13825
|
+
if (Result_.isFailure(result)) {
|
|
13826
|
+
return Effect.fail(new SchemaIssue.InvalidValue({ message: result.failure.message }, input, options))
|
|
13827
|
+
}
|
|
13828
|
+
return NetAddress_.formatIp(result.success) === input
|
|
13829
|
+
? Effect.succeed(result.success)
|
|
13830
|
+
: Effect.fail(new SchemaIssue.InvalidValue({ message: "expected a canonical address" }, input, options))
|
|
13831
|
+
},
|
|
13832
|
+
encode: (address) => Effect.succeed(NetAddress_.formatIp(address))
|
|
13833
|
+
})
|
|
13834
|
+
))
|
|
13835
|
+
|
|
13836
|
+
const dnsUint8 = Int.check(isBetween({ minimum: 0, maximum: 0xff }))
|
|
13837
|
+
|
|
13838
|
+
const dnsUint16 = Int.check(isBetween({ minimum: 0, maximum: 0xffff }))
|
|
13839
|
+
|
|
13840
|
+
const dnsUint32 = Int.check(isBetween({ minimum: 0, maximum: 0xffffffff }))
|
|
13841
|
+
|
|
13842
|
+
// SOA timers are written as whole seconds, as in zone files.
|
|
13843
|
+
const dnsSeconds = dnsUint32.pipe(decodeTo(
|
|
13844
|
+
Duration,
|
|
13845
|
+
SchemaTransformation.transform({ decode: Duration_.seconds, encode: Duration_.toSeconds })
|
|
13846
|
+
))
|
|
13847
|
+
|
|
13848
|
+
// Each record type is an opaque value whose JSON form is a plain object tagged
|
|
13849
|
+
// by record type, such as `{ "_tag": "MX", "exchange": "mail.example.com", "priority": 10 }`.
|
|
13850
|
+
const dnsRecordOfType = <T extends Dns_.RecordType>(
|
|
13851
|
+
type: T,
|
|
13852
|
+
fields: { readonly [K in keyof Dns_.RecordFields<T>]-?: Codec<Dns_.RecordFields<T>[K], unknown> }
|
|
13853
|
+
) =>
|
|
13854
|
+
declare((u): u is Dns_.RecordFor<T> => Dns_.isDnsRecord(u) && u._tag === type, {
|
|
13855
|
+
identifier: `Dns${type.charAt(0)}${type.slice(1).toLowerCase()}Record`,
|
|
13856
|
+
toCodecJson: () => {
|
|
13857
|
+
const json = TaggedStruct(type, fields)
|
|
13858
|
+
return link<Dns_.RecordFor<T>>()(
|
|
13859
|
+
json,
|
|
13860
|
+
SchemaTransformation.transformEffect({
|
|
13861
|
+
decode: (input, options) => {
|
|
13862
|
+
const { _tag, ...rest } = input as { readonly _tag: T }
|
|
13863
|
+
const result = Dns_.makeRecord(type, rest as Dns_.RecordFields<T>)
|
|
13864
|
+
return Result_.isSuccess(result)
|
|
13865
|
+
? Effect.succeed(result.success)
|
|
13866
|
+
: Effect.fail(new SchemaIssue.InvalidValue({ message: result.failure.message }, input, options))
|
|
13867
|
+
},
|
|
13868
|
+
// Records hold only their tag and fields as own properties.
|
|
13869
|
+
encode: (record) => Effect.succeed({ ...record } as unknown as typeof json["Type"])
|
|
13870
|
+
})
|
|
13871
|
+
)
|
|
13872
|
+
}
|
|
13873
|
+
})
|
|
13874
|
+
|
|
13875
|
+
/**
|
|
13876
|
+
* Type-level representation of {@link DnsARecord}.
|
|
13877
|
+
*
|
|
13878
|
+
* @stability experimental
|
|
13879
|
+
* @category models
|
|
13880
|
+
* @since 4.0.0
|
|
13881
|
+
*/
|
|
13882
|
+
export interface DnsARecord extends declare<Dns_.A> {
|
|
13883
|
+
readonly "Rebuild": DnsARecord
|
|
13884
|
+
}
|
|
13885
|
+
|
|
13886
|
+
/**
|
|
13887
|
+
* Schema for already-constructed IPv4 address (`A`) DNS records.
|
|
13888
|
+
*
|
|
13889
|
+
* @stability experimental
|
|
13890
|
+
* @category schemas
|
|
13891
|
+
* @since 4.0.0
|
|
13892
|
+
*/
|
|
13893
|
+
export const DnsARecord: DnsARecord = dnsRecordOfType("A", {
|
|
13894
|
+
address: dnsCanonicalAddress(Ipv4Address, NetAddress_.ipv4FromString)
|
|
13895
|
+
})
|
|
13896
|
+
|
|
13897
|
+
/**
|
|
13898
|
+
* Type-level representation of {@link DnsAaaaRecord}.
|
|
13899
|
+
*
|
|
13900
|
+
* @stability experimental
|
|
13901
|
+
* @category models
|
|
13902
|
+
* @since 4.0.0
|
|
13903
|
+
*/
|
|
13904
|
+
export interface DnsAaaaRecord extends declare<Dns_.Aaaa> {
|
|
13905
|
+
readonly "Rebuild": DnsAaaaRecord
|
|
13906
|
+
}
|
|
13907
|
+
|
|
13908
|
+
/**
|
|
13909
|
+
* Schema for already-constructed IPv6 address (`AAAA`) DNS records.
|
|
13910
|
+
*
|
|
13911
|
+
* @stability experimental
|
|
13912
|
+
* @category schemas
|
|
13913
|
+
* @since 4.0.0
|
|
13914
|
+
*/
|
|
13915
|
+
export const DnsAaaaRecord: DnsAaaaRecord = dnsRecordOfType("AAAA", {
|
|
13916
|
+
address: dnsCanonicalAddress(Ipv6Address, NetAddress_.ipv6FromString)
|
|
13917
|
+
})
|
|
13918
|
+
|
|
13919
|
+
/**
|
|
13920
|
+
* Type-level representation of {@link DnsCaaRecord}.
|
|
13921
|
+
*
|
|
13922
|
+
* @stability experimental
|
|
13923
|
+
* @category models
|
|
13924
|
+
* @since 4.0.0
|
|
13925
|
+
*/
|
|
13926
|
+
export interface DnsCaaRecord extends declare<Dns_.Caa> {
|
|
13927
|
+
readonly "Rebuild": DnsCaaRecord
|
|
13928
|
+
}
|
|
13929
|
+
|
|
13930
|
+
/**
|
|
13931
|
+
* Schema for already-constructed certification authority authorization (`CAA`) DNS records.
|
|
13932
|
+
*
|
|
13933
|
+
* @stability experimental
|
|
13934
|
+
* @category schemas
|
|
13935
|
+
* @since 4.0.0
|
|
13936
|
+
*/
|
|
13937
|
+
export const DnsCaaRecord: DnsCaaRecord = dnsRecordOfType("CAA", {
|
|
13938
|
+
critical: Boolean,
|
|
13939
|
+
tag: String.check(isPattern(/^[a-z0-9]+$/i)),
|
|
13940
|
+
value: String
|
|
13941
|
+
})
|
|
13942
|
+
|
|
13943
|
+
/**
|
|
13944
|
+
* Type-level representation of {@link DnsCnameRecord}.
|
|
13945
|
+
*
|
|
13946
|
+
* @stability experimental
|
|
13947
|
+
* @category models
|
|
13948
|
+
* @since 4.0.0
|
|
13949
|
+
*/
|
|
13950
|
+
export interface DnsCnameRecord extends declare<Dns_.Cname> {
|
|
13951
|
+
readonly "Rebuild": DnsCnameRecord
|
|
13952
|
+
}
|
|
13953
|
+
|
|
13954
|
+
/**
|
|
13955
|
+
* Schema for already-constructed canonical name (`CNAME`) DNS records.
|
|
13956
|
+
*
|
|
13957
|
+
* @stability experimental
|
|
13958
|
+
* @category schemas
|
|
13959
|
+
* @since 4.0.0
|
|
13960
|
+
*/
|
|
13961
|
+
export const DnsCnameRecord: DnsCnameRecord = dnsRecordOfType("CNAME", { target: DomainName })
|
|
13962
|
+
|
|
13963
|
+
/**
|
|
13964
|
+
* Type-level representation of {@link DnsMxRecord}.
|
|
13965
|
+
*
|
|
13966
|
+
* @stability experimental
|
|
13967
|
+
* @category models
|
|
13968
|
+
* @since 4.0.0
|
|
13969
|
+
*/
|
|
13970
|
+
export interface DnsMxRecord extends declare<Dns_.Mx> {
|
|
13971
|
+
readonly "Rebuild": DnsMxRecord
|
|
13972
|
+
}
|
|
13973
|
+
|
|
13974
|
+
/**
|
|
13975
|
+
* Schema for already-constructed mail exchange (`MX`) DNS records.
|
|
13976
|
+
*
|
|
13977
|
+
* @stability experimental
|
|
13978
|
+
* @category schemas
|
|
13979
|
+
* @since 4.0.0
|
|
13980
|
+
*/
|
|
13981
|
+
export const DnsMxRecord: DnsMxRecord = dnsRecordOfType("MX", { exchange: DomainName, priority: dnsUint16 })
|
|
13982
|
+
|
|
13983
|
+
/**
|
|
13984
|
+
* Type-level representation of {@link DnsNaptrRecord}.
|
|
13985
|
+
*
|
|
13986
|
+
* @stability experimental
|
|
13987
|
+
* @category models
|
|
13988
|
+
* @since 4.0.0
|
|
13989
|
+
*/
|
|
13990
|
+
export interface DnsNaptrRecord extends declare<Dns_.Naptr> {
|
|
13991
|
+
readonly "Rebuild": DnsNaptrRecord
|
|
13992
|
+
}
|
|
13993
|
+
|
|
13994
|
+
/**
|
|
13995
|
+
* Schema for already-constructed naming authority pointer (`NAPTR`) DNS records.
|
|
13996
|
+
*
|
|
13997
|
+
* @stability experimental
|
|
13998
|
+
* @category schemas
|
|
13999
|
+
* @since 4.0.0
|
|
14000
|
+
*/
|
|
14001
|
+
export const DnsNaptrRecord: DnsNaptrRecord = dnsRecordOfType("NAPTR", {
|
|
14002
|
+
order: dnsUint16,
|
|
14003
|
+
preference: dnsUint16,
|
|
14004
|
+
flags: String,
|
|
14005
|
+
service: String,
|
|
14006
|
+
regexp: String,
|
|
14007
|
+
replacement: DomainName
|
|
14008
|
+
})
|
|
14009
|
+
|
|
14010
|
+
/**
|
|
14011
|
+
* Type-level representation of {@link DnsNsRecord}.
|
|
14012
|
+
*
|
|
14013
|
+
* @stability experimental
|
|
14014
|
+
* @category models
|
|
14015
|
+
* @since 4.0.0
|
|
14016
|
+
*/
|
|
14017
|
+
export interface DnsNsRecord extends declare<Dns_.Ns> {
|
|
14018
|
+
readonly "Rebuild": DnsNsRecord
|
|
14019
|
+
}
|
|
14020
|
+
|
|
14021
|
+
/**
|
|
14022
|
+
* Schema for already-constructed name server (`NS`) DNS records.
|
|
14023
|
+
*
|
|
14024
|
+
* @stability experimental
|
|
14025
|
+
* @category schemas
|
|
14026
|
+
* @since 4.0.0
|
|
14027
|
+
*/
|
|
14028
|
+
export const DnsNsRecord: DnsNsRecord = dnsRecordOfType("NS", { host: DomainName })
|
|
14029
|
+
|
|
14030
|
+
/**
|
|
14031
|
+
* Type-level representation of {@link DnsPtrRecord}.
|
|
14032
|
+
*
|
|
14033
|
+
* @stability experimental
|
|
14034
|
+
* @category models
|
|
14035
|
+
* @since 4.0.0
|
|
14036
|
+
*/
|
|
14037
|
+
export interface DnsPtrRecord extends declare<Dns_.Ptr> {
|
|
14038
|
+
readonly "Rebuild": DnsPtrRecord
|
|
14039
|
+
}
|
|
14040
|
+
|
|
14041
|
+
/**
|
|
14042
|
+
* Schema for already-constructed pointer (`PTR`) DNS records.
|
|
14043
|
+
*
|
|
14044
|
+
* @stability experimental
|
|
14045
|
+
* @category schemas
|
|
14046
|
+
* @since 4.0.0
|
|
14047
|
+
*/
|
|
14048
|
+
export const DnsPtrRecord: DnsPtrRecord = dnsRecordOfType("PTR", { host: NonEmptyString })
|
|
14049
|
+
|
|
14050
|
+
/**
|
|
14051
|
+
* Type-level representation of {@link DnsSoaRecord}.
|
|
14052
|
+
*
|
|
14053
|
+
* @stability experimental
|
|
14054
|
+
* @category models
|
|
14055
|
+
* @since 4.0.0
|
|
14056
|
+
*/
|
|
14057
|
+
export interface DnsSoaRecord extends declare<Dns_.Soa> {
|
|
14058
|
+
readonly "Rebuild": DnsSoaRecord
|
|
14059
|
+
}
|
|
14060
|
+
|
|
14061
|
+
/**
|
|
14062
|
+
* Schema for already-constructed start of authority (`SOA`) DNS records.
|
|
14063
|
+
*
|
|
14064
|
+
* @stability experimental
|
|
14065
|
+
* @category schemas
|
|
14066
|
+
* @since 4.0.0
|
|
14067
|
+
*/
|
|
14068
|
+
export const DnsSoaRecord: DnsSoaRecord = dnsRecordOfType("SOA", {
|
|
14069
|
+
primary: DomainName,
|
|
14070
|
+
admin: NonEmptyString,
|
|
14071
|
+
serial: dnsUint32,
|
|
14072
|
+
refresh: dnsSeconds,
|
|
14073
|
+
retry: dnsSeconds,
|
|
14074
|
+
expire: dnsSeconds,
|
|
14075
|
+
minimum: dnsSeconds
|
|
14076
|
+
})
|
|
14077
|
+
|
|
14078
|
+
/**
|
|
14079
|
+
* Type-level representation of {@link DnsSrvRecord}.
|
|
14080
|
+
*
|
|
14081
|
+
* @stability experimental
|
|
14082
|
+
* @category models
|
|
14083
|
+
* @since 4.0.0
|
|
14084
|
+
*/
|
|
14085
|
+
export interface DnsSrvRecord extends declare<Dns_.Srv> {
|
|
14086
|
+
readonly "Rebuild": DnsSrvRecord
|
|
14087
|
+
}
|
|
14088
|
+
|
|
14089
|
+
/**
|
|
14090
|
+
* Schema for already-constructed service locator (`SRV`) DNS records.
|
|
14091
|
+
*
|
|
14092
|
+
* @stability experimental
|
|
14093
|
+
* @category schemas
|
|
14094
|
+
* @since 4.0.0
|
|
14095
|
+
*/
|
|
14096
|
+
export const DnsSrvRecord: DnsSrvRecord = dnsRecordOfType("SRV", {
|
|
14097
|
+
target: DomainName,
|
|
14098
|
+
port: dnsUint16,
|
|
14099
|
+
priority: dnsUint16,
|
|
14100
|
+
weight: dnsUint16
|
|
14101
|
+
})
|
|
14102
|
+
|
|
14103
|
+
/**
|
|
14104
|
+
* Type-level representation of {@link DnsTlsaRecord}.
|
|
14105
|
+
*
|
|
14106
|
+
* @stability experimental
|
|
14107
|
+
* @category models
|
|
14108
|
+
* @since 4.0.0
|
|
14109
|
+
*/
|
|
14110
|
+
export interface DnsTlsaRecord extends declare<Dns_.Tlsa> {
|
|
14111
|
+
readonly "Rebuild": DnsTlsaRecord
|
|
14112
|
+
}
|
|
14113
|
+
|
|
14114
|
+
/**
|
|
14115
|
+
* Schema for already-constructed TLS authentication (`TLSA`) DNS records.
|
|
14116
|
+
*
|
|
14117
|
+
* **Details**
|
|
14118
|
+
*
|
|
14119
|
+
* The default JSON serializer encodes the certificate association `data` as a
|
|
14120
|
+
* hex string.
|
|
14121
|
+
*
|
|
14122
|
+
* @stability experimental
|
|
14123
|
+
* @category schemas
|
|
14124
|
+
* @since 4.0.0
|
|
14125
|
+
*/
|
|
14126
|
+
export const DnsTlsaRecord: DnsTlsaRecord = dnsRecordOfType("TLSA", {
|
|
14127
|
+
certUsage: dnsUint8,
|
|
14128
|
+
selector: dnsUint8,
|
|
14129
|
+
matchingType: dnsUint8,
|
|
14130
|
+
data: Uint8ArrayFromHex
|
|
14131
|
+
})
|
|
14132
|
+
|
|
14133
|
+
/**
|
|
14134
|
+
* Type-level representation of {@link DnsTxtRecord}.
|
|
14135
|
+
*
|
|
14136
|
+
* @stability experimental
|
|
14137
|
+
* @category models
|
|
14138
|
+
* @since 4.0.0
|
|
14139
|
+
*/
|
|
14140
|
+
export interface DnsTxtRecord extends declare<Dns_.Txt> {
|
|
14141
|
+
readonly "Rebuild": DnsTxtRecord
|
|
14142
|
+
}
|
|
14143
|
+
|
|
14144
|
+
/**
|
|
14145
|
+
* Schema for already-constructed text (`TXT`) DNS records.
|
|
14146
|
+
*
|
|
14147
|
+
* @stability experimental
|
|
14148
|
+
* @category schemas
|
|
14149
|
+
* @since 4.0.0
|
|
14150
|
+
*/
|
|
14151
|
+
export const DnsTxtRecord: DnsTxtRecord = dnsRecordOfType("TXT", { chunks: NonEmptyArray(String) })
|
|
14152
|
+
|
|
14153
|
+
/**
|
|
14154
|
+
* Type-level representation of {@link DnsRecord}.
|
|
14155
|
+
*
|
|
14156
|
+
* @stability experimental
|
|
14157
|
+
* @category models
|
|
14158
|
+
* @since 4.0.0
|
|
14159
|
+
*/
|
|
14160
|
+
export interface DnsRecord extends
|
|
14161
|
+
Union<
|
|
14162
|
+
readonly [
|
|
14163
|
+
DnsARecord,
|
|
14164
|
+
DnsAaaaRecord,
|
|
14165
|
+
DnsCaaRecord,
|
|
14166
|
+
DnsCnameRecord,
|
|
14167
|
+
DnsMxRecord,
|
|
14168
|
+
DnsNaptrRecord,
|
|
14169
|
+
DnsNsRecord,
|
|
14170
|
+
DnsPtrRecord,
|
|
14171
|
+
DnsSoaRecord,
|
|
14172
|
+
DnsSrvRecord,
|
|
14173
|
+
DnsTlsaRecord,
|
|
14174
|
+
DnsTxtRecord
|
|
14175
|
+
]
|
|
14176
|
+
>
|
|
14177
|
+
{
|
|
14178
|
+
readonly "Rebuild": DnsRecord
|
|
14179
|
+
}
|
|
14180
|
+
|
|
14181
|
+
/**
|
|
14182
|
+
* Schema for already-constructed DNS records of any supported record type.
|
|
14183
|
+
*
|
|
14184
|
+
* **Details**
|
|
14185
|
+
*
|
|
14186
|
+
* The default JSON serializer encodes records as objects tagged by record type,
|
|
14187
|
+
* with addresses and names as canonical strings, SOA timers as whole seconds,
|
|
14188
|
+
* and TLSA data as hex, such as
|
|
14189
|
+
* `{ "_tag": "SRV", "target": "db.internal", "port": 5432, "priority": 10, "weight": 5 }`.
|
|
14190
|
+
* Decoding accepts only canonical addresses and normalized domain names, and
|
|
14191
|
+
* reports invalid fields with their path.
|
|
14192
|
+
*
|
|
14193
|
+
* @stability experimental
|
|
14194
|
+
* @category schemas
|
|
14195
|
+
* @since 4.0.0
|
|
14196
|
+
*/
|
|
14197
|
+
export const DnsRecord: DnsRecord = Union([
|
|
14198
|
+
DnsARecord,
|
|
14199
|
+
DnsAaaaRecord,
|
|
14200
|
+
DnsCaaRecord,
|
|
14201
|
+
DnsCnameRecord,
|
|
14202
|
+
DnsMxRecord,
|
|
14203
|
+
DnsNaptrRecord,
|
|
14204
|
+
DnsNsRecord,
|
|
14205
|
+
DnsPtrRecord,
|
|
14206
|
+
DnsSoaRecord,
|
|
14207
|
+
DnsSrvRecord,
|
|
14208
|
+
DnsTlsaRecord,
|
|
14209
|
+
DnsTxtRecord
|
|
14210
|
+
]).annotate({ identifier: "DnsRecord" })
|
|
14211
|
+
|
|
13150
14212
|
// -----------------------------------------------------------------------------
|
|
13151
14213
|
// Exit schemas
|
|
13152
14214
|
// -----------------------------------------------------------------------------
|
|
@@ -13154,6 +14216,7 @@ export const DurationFromMillis: DurationFromMillis = Number.pipe(
|
|
|
13154
14216
|
/**
|
|
13155
14217
|
* Type-level representation returned by {@link Exit}.
|
|
13156
14218
|
*
|
|
14219
|
+
* @stability stable
|
|
13157
14220
|
* @category models
|
|
13158
14221
|
* @since 3.10.0
|
|
13159
14222
|
*/
|
|
@@ -13178,6 +14241,7 @@ export interface Exit<A extends Constraint, E extends Constraint, D extends Cons
|
|
|
13178
14241
|
* Successful exits are represented as `{ _tag: "Success", value }`, while failed
|
|
13179
14242
|
* exits are represented as `{ _tag: "Failure", cause }`.
|
|
13180
14243
|
*
|
|
14244
|
+
* @stability stable
|
|
13181
14245
|
* @category utility types
|
|
13182
14246
|
* @since 4.0.0
|
|
13183
14247
|
*/
|
|
@@ -13197,6 +14261,7 @@ export type ExitIso<A extends Constraint, E extends Constraint, D extends Constr
|
|
|
13197
14261
|
* Use when serializing or validating an effect outcome where success, typed
|
|
13198
14262
|
* failure, and defects each need their own schema.
|
|
13199
14263
|
*
|
|
14264
|
+
* @stability stable
|
|
13200
14265
|
* @category schemas
|
|
13201
14266
|
* @since 3.10.0
|
|
13202
14267
|
*/
|
|
@@ -13284,6 +14349,7 @@ export function Exit<
|
|
|
13284
14349
|
/**
|
|
13285
14350
|
* Encoded representation of an immutable Effect graph.
|
|
13286
14351
|
*
|
|
14352
|
+
* @stability unstable
|
|
13287
14353
|
* @category models
|
|
13288
14354
|
* @since 4.0.0
|
|
13289
14355
|
*/
|
|
@@ -13291,6 +14357,7 @@ export type EncodedGraph<N, E, T extends Graph_.Kind> = Graph_.Snapshot<N, E, T>
|
|
|
13291
14357
|
/**
|
|
13292
14358
|
* Iso representation used for {@link Graph} schemas.
|
|
13293
14359
|
*
|
|
14360
|
+
* @stability unstable
|
|
13294
14361
|
* @category utility types
|
|
13295
14362
|
* @since 4.0.0
|
|
13296
14363
|
*/
|
|
@@ -13302,6 +14369,7 @@ export type GraphIso<T extends Graph_.Kind, Node extends Constraint, Edge extend
|
|
|
13302
14369
|
/**
|
|
13303
14370
|
* Type-level representation returned by {@link Graph}.
|
|
13304
14371
|
*
|
|
14372
|
+
* @stability unstable
|
|
13305
14373
|
* @category models
|
|
13306
14374
|
* @since 4.0.0
|
|
13307
14375
|
*/
|
|
@@ -13480,6 +14548,7 @@ function graphToArbitrary<N, E, T extends Graph_.Kind>(
|
|
|
13480
14548
|
* encoded.edges // => [{ index: 0, source: 0, target: 1, data: 1 }]
|
|
13481
14549
|
* ```
|
|
13482
14550
|
*
|
|
14551
|
+
* @stability unstable
|
|
13483
14552
|
* @category schemas
|
|
13484
14553
|
* @since 4.0.0
|
|
13485
14554
|
*/
|
|
@@ -13563,6 +14632,7 @@ function hashMapLink<Key, Value>(entries: Schema<ReadonlyArray<readonly [Key, Va
|
|
|
13563
14632
|
/**
|
|
13564
14633
|
* Type-level representation returned by {@link HashMap}.
|
|
13565
14634
|
*
|
|
14635
|
+
* @stability stable
|
|
13566
14636
|
* @category models
|
|
13567
14637
|
* @since 3.10.0
|
|
13568
14638
|
*/
|
|
@@ -13582,6 +14652,7 @@ export interface HashMap<Key extends Constraint, Value extends Constraint> exten
|
|
|
13582
14652
|
* Iso representation used for `HashMap` schemas: an array of readonly
|
|
13583
14653
|
* `[key, value]` tuples using each entry schema's `Iso` type.
|
|
13584
14654
|
*
|
|
14655
|
+
* @stability stable
|
|
13585
14656
|
* @category utility types
|
|
13586
14657
|
* @since 4.0.0
|
|
13587
14658
|
*/
|
|
@@ -13591,6 +14662,7 @@ export type HashMapIso<Key extends Constraint, Value extends Constraint> = Reado
|
|
|
13591
14662
|
/**
|
|
13592
14663
|
* Schema for hash maps whose keys and values conform to the provided schemas.
|
|
13593
14664
|
*
|
|
14665
|
+
* @stability stable
|
|
13594
14666
|
* @category schemas
|
|
13595
14667
|
* @since 3.10.0
|
|
13596
14668
|
*/
|
|
@@ -13658,6 +14730,7 @@ function hashSetLink<Value>(values: Schema<ReadonlyArray<Value>>) {
|
|
|
13658
14730
|
/**
|
|
13659
14731
|
* Type-level representation returned by {@link HashSet}.
|
|
13660
14732
|
*
|
|
14733
|
+
* @stability stable
|
|
13661
14734
|
* @category models
|
|
13662
14735
|
* @since 3.10.0
|
|
13663
14736
|
*/
|
|
@@ -13676,6 +14749,7 @@ export interface HashSet<Value extends Constraint> extends
|
|
|
13676
14749
|
* Iso representation used for `HashSet` schemas: an array of element values
|
|
13677
14750
|
* using the element schema's `Iso` type.
|
|
13678
14751
|
*
|
|
14752
|
+
* @stability stable
|
|
13679
14753
|
* @category utility types
|
|
13680
14754
|
* @since 4.0.0
|
|
13681
14755
|
*/
|
|
@@ -13683,6 +14757,7 @@ export type HashSetIso<Value extends Constraint> = ReadonlyArray<Value["Iso"]>
|
|
|
13683
14757
|
/**
|
|
13684
14758
|
* Schema for hash sets whose values conform to the provided element schema.
|
|
13685
14759
|
*
|
|
14760
|
+
* @stability stable
|
|
13686
14761
|
* @category schemas
|
|
13687
14762
|
* @since 3.10.0
|
|
13688
14763
|
*/
|
|
@@ -13740,6 +14815,7 @@ export function HashSet<Value extends Constraint>(value: Value): HashSet<Value>
|
|
|
13740
14815
|
/**
|
|
13741
14816
|
* Type-level representation returned by {@link Option}.
|
|
13742
14817
|
*
|
|
14818
|
+
* @stability stable
|
|
13743
14819
|
* @category models
|
|
13744
14820
|
* @since 3.10.0
|
|
13745
14821
|
*/
|
|
@@ -13762,6 +14838,7 @@ export interface Option<A extends Constraint> extends
|
|
|
13762
14838
|
* `None` is represented as `{ _tag: "None" }`, while `Some` is represented as
|
|
13763
14839
|
* `{ _tag: "Some", value }` using the wrapped schema's `Iso` type.
|
|
13764
14840
|
*
|
|
14841
|
+
* @stability stable
|
|
13765
14842
|
* @category utility types
|
|
13766
14843
|
* @since 4.0.0
|
|
13767
14844
|
*/
|
|
@@ -13774,6 +14851,7 @@ export type OptionIso<A extends Constraint> = {
|
|
|
13774
14851
|
/**
|
|
13775
14852
|
* Schema for `Option<A>` values.
|
|
13776
14853
|
*
|
|
14854
|
+
* @stability stable
|
|
13777
14855
|
* @category schemas
|
|
13778
14856
|
* @since 3.10.0
|
|
13779
14857
|
*/
|
|
@@ -13828,6 +14906,7 @@ export function Option<A extends Constraint>(value: A): Option<A> {
|
|
|
13828
14906
|
/**
|
|
13829
14907
|
* Type-level representation returned by {@link OptionFromNullOr}.
|
|
13830
14908
|
*
|
|
14909
|
+
* @stability stable
|
|
13831
14910
|
* @category models
|
|
13832
14911
|
* @since 3.10.0
|
|
13833
14912
|
*/
|
|
@@ -13842,6 +14921,7 @@ export interface OptionFromNullOr<S extends Constraint> extends decodeTo<Option<
|
|
|
13842
14921
|
* Decoding maps `null` to `None` and all other values to `Some`. Encoding maps
|
|
13843
14922
|
* `None` to `null` and maps `Some` to its value.
|
|
13844
14923
|
*
|
|
14924
|
+
* @stability stable
|
|
13845
14925
|
* @category schemas
|
|
13846
14926
|
* @since 3.10.0
|
|
13847
14927
|
*/
|
|
@@ -13854,6 +14934,7 @@ export function OptionFromNullOr<S extends Constraint>(schema: S): OptionFromNul
|
|
|
13854
14934
|
/**
|
|
13855
14935
|
* Type-level representation returned by {@link OptionFromUndefinedOr}.
|
|
13856
14936
|
*
|
|
14937
|
+
* @stability stable
|
|
13857
14938
|
* @category models
|
|
13858
14939
|
* @since 3.10.0
|
|
13859
14940
|
*/
|
|
@@ -13869,6 +14950,7 @@ export interface OptionFromUndefinedOr<S extends Constraint> extends decodeTo<Op
|
|
|
13869
14950
|
* Decoding maps `undefined` to `None` and all other values to `Some`. Encoding
|
|
13870
14951
|
* maps `None` to `undefined` and maps `Some` to its value.
|
|
13871
14952
|
*
|
|
14953
|
+
* @stability stable
|
|
13872
14954
|
* @category schemas
|
|
13873
14955
|
* @since 3.10.0
|
|
13874
14956
|
*/
|
|
@@ -13881,6 +14963,7 @@ export function OptionFromUndefinedOr<S extends Constraint>(schema: S): OptionFr
|
|
|
13881
14963
|
/**
|
|
13882
14964
|
* Type-level representation returned by {@link OptionFromNullishOr}.
|
|
13883
14965
|
*
|
|
14966
|
+
* @stability stable
|
|
13884
14967
|
* @category models
|
|
13885
14968
|
* @since 3.10.0
|
|
13886
14969
|
*/
|
|
@@ -13897,6 +14980,7 @@ export interface OptionFromNullishOr<S extends Constraint> extends decodeTo<Opti
|
|
|
13897
14980
|
* `options.onNoneEncoding`, which defaults to `undefined`, and maps `Some` to
|
|
13898
14981
|
* its value.
|
|
13899
14982
|
*
|
|
14983
|
+
* @stability stable
|
|
13900
14984
|
* @category schemas
|
|
13901
14985
|
* @since 3.10.0
|
|
13902
14986
|
*/
|
|
@@ -14260,6 +15344,7 @@ export const RecordFromUrlParams: RecordFromUrlParams = UrlParams.pipe(
|
|
|
14260
15344
|
/**
|
|
14261
15345
|
* Type-level representation returned by {@link OptionFromOptionalKey}.
|
|
14262
15346
|
*
|
|
15347
|
+
* @stability stable
|
|
14263
15348
|
* @category models
|
|
14264
15349
|
* @since 4.0.0
|
|
14265
15350
|
*/
|
|
@@ -14274,6 +15359,7 @@ export interface OptionFromOptionalKey<S extends Constraint> extends decodeTo<Op
|
|
|
14274
15359
|
* Decoding maps a missing key to `None` and a present value to `Some`.
|
|
14275
15360
|
* Encoding maps `None` to a missing key and maps `Some` to its value.
|
|
14276
15361
|
*
|
|
15362
|
+
* @stability stable
|
|
14277
15363
|
* @category schemas
|
|
14278
15364
|
* @since 4.0.0
|
|
14279
15365
|
*/
|
|
@@ -14286,6 +15372,7 @@ export function OptionFromOptionalKey<S extends Constraint>(schema: S): OptionFr
|
|
|
14286
15372
|
/**
|
|
14287
15373
|
* Type-level representation returned by {@link OptionFromOptional}.
|
|
14288
15374
|
*
|
|
15375
|
+
* @stability stable
|
|
14289
15376
|
* @category models
|
|
14290
15377
|
* @since 4.0.0
|
|
14291
15378
|
*/
|
|
@@ -14302,6 +15389,7 @@ export interface OptionFromOptional<S extends Constraint> extends decodeTo<Optio
|
|
|
14302
15389
|
* maps all other values to `Some`. Encoding maps `None` to a missing key and
|
|
14303
15390
|
* maps `Some` to its value.
|
|
14304
15391
|
*
|
|
15392
|
+
* @stability stable
|
|
14305
15393
|
* @category schemas
|
|
14306
15394
|
* @since 4.0.0
|
|
14307
15395
|
*/
|
|
@@ -14314,6 +15402,7 @@ export function OptionFromOptional<S extends Constraint>(schema: S): OptionFromO
|
|
|
14314
15402
|
/**
|
|
14315
15403
|
* Type-level representation returned by {@link OptionFromOptionalNullOr}.
|
|
14316
15404
|
*
|
|
15405
|
+
* @stability stable
|
|
14317
15406
|
* @category models
|
|
14318
15407
|
* @since 4.0.0
|
|
14319
15408
|
*/
|
|
@@ -14333,6 +15422,7 @@ export interface OptionFromOptionalNullOr<S extends Constraint>
|
|
|
14333
15422
|
* according to `options.onNoneEncoding`: `"omit"` encodes a missing key,
|
|
14334
15423
|
* `null` encodes `null`, and `undefined` encodes `undefined`.
|
|
14335
15424
|
*
|
|
15425
|
+
* @stability stable
|
|
14336
15426
|
* @category schemas
|
|
14337
15427
|
* @since 4.0.0
|
|
14338
15428
|
*/
|
|
@@ -14364,6 +15454,7 @@ export function OptionFromOptionalNullOr<S extends Constraint>(
|
|
|
14364
15454
|
/**
|
|
14365
15455
|
* Type-level representation returned by {@link Redacted}.
|
|
14366
15456
|
*
|
|
15457
|
+
* @stability stable
|
|
14367
15458
|
* @category models
|
|
14368
15459
|
* @since 3.10.0
|
|
14369
15460
|
*/
|
|
@@ -14398,6 +15489,7 @@ type NormalizedRedactedOptions =
|
|
|
14398
15489
|
* sensitive and should not be exposed in JSON.
|
|
14399
15490
|
*
|
|
14400
15491
|
* @see {@link RedactedFromValue} for decoding raw values and wrapping them in `Redacted`.
|
|
15492
|
+
* @stability stable
|
|
14401
15493
|
* @category schemas
|
|
14402
15494
|
* @since 3.10.0
|
|
14403
15495
|
*/
|
|
@@ -14485,6 +15577,7 @@ export function Redacted<S extends Constraint>(value: S, options?: {
|
|
|
14485
15577
|
/**
|
|
14486
15578
|
* Type-level representation returned by {@link RedactedFromValue}.
|
|
14487
15579
|
*
|
|
15580
|
+
* @stability stable
|
|
14488
15581
|
* @category models
|
|
14489
15582
|
* @since 4.0.0
|
|
14490
15583
|
*/
|
|
@@ -14497,6 +15590,7 @@ export interface RedactedFromValue<S extends Constraint> extends decodeTo<Redact
|
|
|
14497
15590
|
* the raw value and wraps it.
|
|
14498
15591
|
*
|
|
14499
15592
|
* @see {@link Redacted} for schemas whose input is already a `Redacted` value.
|
|
15593
|
+
* @stability stable
|
|
14500
15594
|
* @category schemas
|
|
14501
15595
|
* @since 4.0.0
|
|
14502
15596
|
*/
|
|
@@ -14528,6 +15622,7 @@ export function RedactedFromValue<S extends Constraint>(value: S, options?: {
|
|
|
14528
15622
|
/**
|
|
14529
15623
|
* Type-level representation returned by {@link Result}.
|
|
14530
15624
|
*
|
|
15625
|
+
* @stability stable
|
|
14531
15626
|
* @category models
|
|
14532
15627
|
* @since 4.0.0
|
|
14533
15628
|
*/
|
|
@@ -14551,6 +15646,7 @@ export interface Result<A extends Constraint, E extends Constraint> extends
|
|
|
14551
15646
|
* Successful results are represented as `{ _tag: "Success", success }`, while
|
|
14552
15647
|
* failed results are represented as `{ _tag: "Failure", failure }`.
|
|
14553
15648
|
*
|
|
15649
|
+
* @stability stable
|
|
14554
15650
|
* @category utility types
|
|
14555
15651
|
* @since 4.0.0
|
|
14556
15652
|
*/
|
|
@@ -14564,6 +15660,7 @@ export type ResultIso<A extends Constraint, E extends Constraint> = {
|
|
|
14564
15660
|
/**
|
|
14565
15661
|
* Schema for `Result<A, E>` values.
|
|
14566
15662
|
*
|
|
15663
|
+
* @stability stable
|
|
14567
15664
|
* @category schemas
|
|
14568
15665
|
* @since 4.0.0
|
|
14569
15666
|
*/
|
|
@@ -14628,6 +15725,7 @@ export function Result<A extends Constraint, E extends Constraint>(
|
|
|
14628
15725
|
/**
|
|
14629
15726
|
* Type-level representation returned by {@link Class}.
|
|
14630
15727
|
*
|
|
15728
|
+
* @stability stable
|
|
14631
15729
|
* @category models
|
|
14632
15730
|
* @since 3.10.0
|
|
14633
15731
|
*/
|
|
@@ -14703,6 +15801,10 @@ export interface Class<Self, S extends Constraint & { readonly fields: Struct.Fi
|
|
|
14703
15801
|
*
|
|
14704
15802
|
* **Gotchas**
|
|
14705
15803
|
*
|
|
15804
|
+
* Fields with the same name replace inherited fields. Use this to refine
|
|
15805
|
+
* validation or change encoding. Effect does not check compatibility; the
|
|
15806
|
+
* caller must ensure the replacement preserves the base class contract.
|
|
15807
|
+
*
|
|
14706
15808
|
* Checks from a `Struct` argument are evaluated against the full subclass
|
|
14707
15809
|
* value after inherited and extension fields are merged. Object-wide checks
|
|
14708
15810
|
* such as `isMaxProperties` count inherited fields too.
|
|
@@ -14967,6 +16069,7 @@ function isStruct(schema: Struct.Fields | Struct<Struct.Fields>): schema is Stru
|
|
|
14967
16069
|
* @see {@link Error} for defining schema-backed error classes
|
|
14968
16070
|
* @see {@link TaggedError} for defining tagged schema-backed error classes
|
|
14969
16071
|
*
|
|
16072
|
+
* @stability stable
|
|
14970
16073
|
* @category constructors
|
|
14971
16074
|
* @since 3.10.0
|
|
14972
16075
|
*/
|
|
@@ -15037,6 +16140,7 @@ export const Class: {
|
|
|
15037
16140
|
* @see {@link Error} for defining schema-backed error classes
|
|
15038
16141
|
* @see {@link TaggedError} for defining tagged schema-backed error classes
|
|
15039
16142
|
*
|
|
16143
|
+
* @stability stable
|
|
15040
16144
|
* @category constructors
|
|
15041
16145
|
* @since 3.10.0
|
|
15042
16146
|
*/
|
|
@@ -15107,6 +16211,7 @@ export const Class: {
|
|
|
15107
16211
|
* @see {@link Error} for defining schema-backed error classes
|
|
15108
16212
|
* @see {@link TaggedError} for defining tagged schema-backed error classes
|
|
15109
16213
|
*
|
|
16214
|
+
* @stability stable
|
|
15110
16215
|
* @category constructors
|
|
15111
16216
|
* @since 3.10.0
|
|
15112
16217
|
*/
|
|
@@ -15180,6 +16285,7 @@ export const Class: {
|
|
|
15180
16285
|
* @see {@link Error} for defining schema-backed error classes
|
|
15181
16286
|
* @see {@link TaggedError} for defining tagged schema-backed error classes
|
|
15182
16287
|
*
|
|
16288
|
+
* @stability stable
|
|
15183
16289
|
* @category constructors
|
|
15184
16290
|
* @since 3.10.0
|
|
15185
16291
|
*/
|
|
@@ -15230,6 +16336,7 @@ export const Class: {
|
|
|
15230
16336
|
* c.radius // => 5
|
|
15231
16337
|
* ```
|
|
15232
16338
|
*
|
|
16339
|
+
* @stability stable
|
|
15233
16340
|
* @category constructors
|
|
15234
16341
|
* @since 3.10.0
|
|
15235
16342
|
*/
|
|
@@ -15261,6 +16368,7 @@ export const TaggedClass: {
|
|
|
15261
16368
|
* c.radius // => 5
|
|
15262
16369
|
* ```
|
|
15263
16370
|
*
|
|
16371
|
+
* @stability stable
|
|
15264
16372
|
* @category constructors
|
|
15265
16373
|
* @since 3.10.0
|
|
15266
16374
|
*/
|
|
@@ -15292,6 +16400,7 @@ export const TaggedClass: {
|
|
|
15292
16400
|
* c.radius // => 5
|
|
15293
16401
|
* ```
|
|
15294
16402
|
*
|
|
16403
|
+
* @stability stable
|
|
15295
16404
|
* @category constructors
|
|
15296
16405
|
* @since 3.10.0
|
|
15297
16406
|
*/
|
|
@@ -15327,6 +16436,7 @@ export const TaggedClass: {
|
|
|
15327
16436
|
* c.radius // => 5
|
|
15328
16437
|
* ```
|
|
15329
16438
|
*
|
|
16439
|
+
* @stability stable
|
|
15330
16440
|
* @category constructors
|
|
15331
16441
|
* @since 3.10.0
|
|
15332
16442
|
*/
|
|
@@ -15379,6 +16489,7 @@ export const TaggedClass: {
|
|
|
15379
16489
|
* error.id // => 1
|
|
15380
16490
|
* ```
|
|
15381
16491
|
*
|
|
16492
|
+
* @stability stable
|
|
15382
16493
|
* @category constructors
|
|
15383
16494
|
* @since 4.0.0
|
|
15384
16495
|
*/
|
|
@@ -15405,6 +16516,7 @@ export const Error: {
|
|
|
15405
16516
|
* error.id // => 1
|
|
15406
16517
|
* ```
|
|
15407
16518
|
*
|
|
16519
|
+
* @stability stable
|
|
15408
16520
|
* @category constructors
|
|
15409
16521
|
* @since 4.0.0
|
|
15410
16522
|
*/
|
|
@@ -15431,6 +16543,7 @@ export const Error: {
|
|
|
15431
16543
|
* error.id // => 1
|
|
15432
16544
|
* ```
|
|
15433
16545
|
*
|
|
16546
|
+
* @stability stable
|
|
15434
16547
|
* @category constructors
|
|
15435
16548
|
* @since 4.0.0
|
|
15436
16549
|
*/
|
|
@@ -15461,6 +16574,7 @@ export const Error: {
|
|
|
15461
16574
|
* error.id // => 1
|
|
15462
16575
|
* ```
|
|
15463
16576
|
*
|
|
16577
|
+
* @stability stable
|
|
15464
16578
|
* @category constructors
|
|
15465
16579
|
* @since 4.0.0
|
|
15466
16580
|
*/
|
|
@@ -15511,6 +16625,7 @@ export const Error: {
|
|
|
15511
16625
|
* error.id // => 42
|
|
15512
16626
|
* ```
|
|
15513
16627
|
*
|
|
16628
|
+
* @stability stable
|
|
15514
16629
|
* @category constructors
|
|
15515
16630
|
* @since 3.10.0
|
|
15516
16631
|
*/
|
|
@@ -15541,6 +16656,7 @@ export const TaggedError: {
|
|
|
15541
16656
|
* error.id // => 42
|
|
15542
16657
|
* ```
|
|
15543
16658
|
*
|
|
16659
|
+
* @stability stable
|
|
15544
16660
|
* @category constructors
|
|
15545
16661
|
* @since 3.10.0
|
|
15546
16662
|
*/
|
|
@@ -15571,6 +16687,7 @@ export const TaggedError: {
|
|
|
15571
16687
|
* error.id // => 42
|
|
15572
16688
|
* ```
|
|
15573
16689
|
*
|
|
16690
|
+
* @stability stable
|
|
15574
16691
|
* @category constructors
|
|
15575
16692
|
* @since 3.10.0
|
|
15576
16693
|
*/
|
|
@@ -15606,6 +16723,7 @@ export const TaggedError: {
|
|
|
15606
16723
|
* error.id // => 42
|
|
15607
16724
|
* ```
|
|
15608
16725
|
*
|
|
16726
|
+
* @stability stable
|
|
15609
16727
|
* @category constructors
|
|
15610
16728
|
* @since 3.10.0
|
|
15611
16729
|
*/
|
|
@@ -15645,6 +16763,7 @@ export const TaggedError: {
|
|
|
15645
16763
|
* The annotation is applied through this helper because adding it directly to
|
|
15646
16764
|
* `Annotations.Bottom` would make schemas invariant.
|
|
15647
16765
|
*
|
|
16766
|
+
* @stability stable
|
|
15648
16767
|
* @category formatting
|
|
15649
16768
|
* @since 4.0.0
|
|
15650
16769
|
*/
|
|
@@ -15661,6 +16780,7 @@ export function overrideToFormatter<S extends Top>(toFormatter: () => Formatter<
|
|
|
15661
16780
|
* The optional `onBefore` hook lets you intercept specific AST nodes before
|
|
15662
16781
|
* the default formatting logic runs.
|
|
15663
16782
|
*
|
|
16783
|
+
* @stability stable
|
|
15664
16784
|
* @category formatting
|
|
15665
16785
|
* @since 4.0.0
|
|
15666
16786
|
*/
|
|
@@ -15680,6 +16800,7 @@ export function toFormatter<S extends Constraint>(schema: S, options?: {
|
|
|
15680
16800
|
* Use when you need a custom equivalence instead of the default structural
|
|
15681
16801
|
* equivalence derived by {@link toEquivalence}.
|
|
15682
16802
|
*
|
|
16803
|
+
* @stability stable
|
|
15683
16804
|
* @category instances
|
|
15684
16805
|
* @since 4.0.0
|
|
15685
16806
|
*/
|
|
@@ -15702,6 +16823,7 @@ export function overrideToEquivalence<S extends Top>(toEquivalence: () => Equiva
|
|
|
15702
16823
|
* eq({ id: 1, name: "Alice" }, { id: 2, name: "Alice" }) // => false
|
|
15703
16824
|
* ```
|
|
15704
16825
|
*
|
|
16826
|
+
* @stability stable
|
|
15705
16827
|
* @category instances
|
|
15706
16828
|
* @since 4.0.0
|
|
15707
16829
|
*/
|
|
@@ -15726,6 +16848,7 @@ export function toEquivalence<T>(schema: Schema<T>): Equivalence.Equivalence<T>
|
|
|
15726
16848
|
*
|
|
15727
16849
|
* @see {@link SchemaRepresentation.toRepresentation} for converting a `SchemaAST.AST` directly
|
|
15728
16850
|
*
|
|
16851
|
+
* @stability stable
|
|
15729
16852
|
* @category converting
|
|
15730
16853
|
* @since 4.0.0
|
|
15731
16854
|
*/
|
|
@@ -15749,6 +16872,7 @@ export function toRepresentation(
|
|
|
15749
16872
|
* `SchemaRepresentation.toJsonSchemaMultiDocument`, reference allocation has already happened and `referencePolicy`
|
|
15750
16873
|
* has no effect.
|
|
15751
16874
|
*
|
|
16875
|
+
* @stability stable
|
|
15752
16876
|
* @category options
|
|
15753
16877
|
* @since 4.0.0
|
|
15754
16878
|
*/
|
|
@@ -15888,6 +17012,7 @@ export interface ToJsonSchemaOptions extends SchemaRepresentation.ToRepresentati
|
|
|
15888
17012
|
* @see {@link toCodecJson} for decoding and encoding the canonical JSON representation
|
|
15889
17013
|
* @see {@link SchemaRepresentation.toJsonSchemaDocument} for compiling an existing live representation document
|
|
15890
17014
|
*
|
|
17015
|
+
* @stability stable
|
|
15891
17016
|
* @category converting
|
|
15892
17017
|
* @since 4.0.0
|
|
15893
17018
|
*/
|
|
@@ -15904,6 +17029,7 @@ export function toJsonSchemaDocument(
|
|
|
15904
17029
|
/**
|
|
15905
17030
|
* Type-level representation returned by {@link toCodecJson}.
|
|
15906
17031
|
*
|
|
17032
|
+
* @stability stable
|
|
15907
17033
|
* @category converting
|
|
15908
17034
|
* @since 4.0.0
|
|
15909
17035
|
*/
|
|
@@ -15949,6 +17075,7 @@ export interface toCodecJson<S extends Constraint> extends
|
|
|
15949
17075
|
* checks and annotations remain on its source node rather than being copied to
|
|
15950
17076
|
* the JSON target. Source checks still run after the transformation.
|
|
15951
17077
|
*
|
|
17078
|
+
* @stability stable
|
|
15952
17079
|
* @category converting
|
|
15953
17080
|
* @since 4.0.0
|
|
15954
17081
|
*/
|
|
@@ -15974,6 +17101,7 @@ export const toCodecJson: {
|
|
|
15974
17101
|
* checks and annotations remain on its source node rather than being copied to
|
|
15975
17102
|
* the JSON target. Source checks still run after the transformation.
|
|
15976
17103
|
*
|
|
17104
|
+
* @stability stable
|
|
15977
17105
|
* @category converting
|
|
15978
17106
|
* @since 4.0.0
|
|
15979
17107
|
*/
|
|
@@ -15993,6 +17121,7 @@ export const toCodecJson: {
|
|
|
15993
17121
|
* Links cannot require services because the returned `Codec` does not expose
|
|
15994
17122
|
* service requirements.
|
|
15995
17123
|
*
|
|
17124
|
+
* @stability stable
|
|
15996
17125
|
* @category converting
|
|
15997
17126
|
* @since 4.0.0
|
|
15998
17127
|
*/
|
|
@@ -16011,6 +17140,7 @@ export const toCodecIso: {
|
|
|
16011
17140
|
* Links cannot require services because the returned `Codec` does not expose
|
|
16012
17141
|
* service requirements.
|
|
16013
17142
|
*
|
|
17143
|
+
* @stability stable
|
|
16014
17144
|
* @category converting
|
|
16015
17145
|
* @since 4.0.0
|
|
16016
17146
|
*/
|
|
@@ -16020,6 +17150,7 @@ export const toCodecIso: {
|
|
|
16020
17150
|
* A {@link Tree} of `string | undefined` nodes. Leaf values are either a
|
|
16021
17151
|
* string representation or `undefined` for opaque/declaration types.
|
|
16022
17152
|
*
|
|
17153
|
+
* @stability stable
|
|
16023
17154
|
* @category models
|
|
16024
17155
|
* @since 4.0.0
|
|
16025
17156
|
*/
|
|
@@ -16027,6 +17158,7 @@ export type StringTree = Tree<string | undefined>
|
|
|
16027
17158
|
/**
|
|
16028
17159
|
* Type-level representation returned by {@link toCodecStringTree}.
|
|
16029
17160
|
*
|
|
17161
|
+
* @stability stable
|
|
16030
17162
|
* @category converting
|
|
16031
17163
|
* @since 4.0.0
|
|
16032
17164
|
*/
|
|
@@ -16068,6 +17200,7 @@ export interface toCodecStringTree<S extends Constraint> extends
|
|
|
16068
17200
|
* `toCodec` encoding. A callback can return `undefined` when the declaration is
|
|
16069
17201
|
* already in canonical StringTree form.
|
|
16070
17202
|
*
|
|
17203
|
+
* @stability stable
|
|
16071
17204
|
* @category converting
|
|
16072
17205
|
* @since 4.0.0
|
|
16073
17206
|
*/
|
|
@@ -16089,6 +17222,7 @@ export const toCodecStringTree: {
|
|
|
16089
17222
|
* `toCodec` encoding. A callback can return `undefined` when the declaration is
|
|
16090
17223
|
* already in canonical StringTree form.
|
|
16091
17224
|
*
|
|
17225
|
+
* @stability stable
|
|
16092
17226
|
* @category converting
|
|
16093
17227
|
* @since 4.0.0
|
|
16094
17228
|
*/
|
|
@@ -16097,6 +17231,7 @@ export const toCodecStringTree: {
|
|
|
16097
17231
|
/**
|
|
16098
17232
|
* Type-level representation returned by {@link toCodecArrayFromSingle}.
|
|
16099
17233
|
*
|
|
17234
|
+
* @stability stable
|
|
16100
17235
|
* @category converting
|
|
16101
17236
|
* @since 4.0.0
|
|
16102
17237
|
*/
|
|
@@ -16135,6 +17270,7 @@ export interface toCodecArrayFromSingle<S extends Constraint> extends
|
|
|
16135
17270
|
* decoding convenience rather than a canonical StringTree representation. It
|
|
16136
17271
|
* does not parse comma-separated strings.
|
|
16137
17272
|
*
|
|
17273
|
+
* @stability stable
|
|
16138
17274
|
* @category converting
|
|
16139
17275
|
* @since 4.0.0
|
|
16140
17276
|
*/
|
|
@@ -16154,6 +17290,7 @@ export const toCodecArrayFromSingle: {
|
|
|
16154
17290
|
* decoding convenience rather than a canonical StringTree representation. It
|
|
16155
17291
|
* does not parse comma-separated strings.
|
|
16156
17292
|
*
|
|
17293
|
+
* @stability stable
|
|
16157
17294
|
* @category converting
|
|
16158
17295
|
* @since 4.0.0
|
|
16159
17296
|
*/
|
|
@@ -16180,6 +17317,7 @@ type XmlEncoderOptions = {
|
|
|
16180
17317
|
* an `Effect` that succeeds with the XML string or fails with a
|
|
16181
17318
|
* {@link SchemaIssue.Issue} if codec encoding fails.
|
|
16182
17319
|
*
|
|
17320
|
+
* @stability stable
|
|
16183
17321
|
* @category encoding
|
|
16184
17322
|
* @since 4.0.0
|
|
16185
17323
|
*/
|
|
@@ -16206,6 +17344,7 @@ export function toEncoderXml<T, RE>(
|
|
|
16206
17344
|
* `SchemaIssue.makeFormatterDefault()`. Consume {@link toCodecIso} with an
|
|
16207
17345
|
* effectful parser for asynchronous execution or explicit failure handling.
|
|
16208
17346
|
*
|
|
17347
|
+
* @stability stable
|
|
16209
17348
|
* @category converting
|
|
16210
17349
|
* @since 4.0.0
|
|
16211
17350
|
*/
|
|
@@ -16215,6 +17354,7 @@ export function toIso<S extends Constraint>(schema: S): Optic_.Iso<S["Type"], S[
|
|
|
16215
17354
|
/**
|
|
16216
17355
|
* Returns an identity `Iso` over the schema's source (`Type`) side.
|
|
16217
17356
|
*
|
|
17357
|
+
* @stability stable
|
|
16218
17358
|
* @category constructors
|
|
16219
17359
|
* @since 4.0.0
|
|
16220
17360
|
*/
|
|
@@ -16224,6 +17364,7 @@ export function toIsoSource<S extends Constraint>(schema: S): Optic_.Iso<S["Type
|
|
|
16224
17364
|
/**
|
|
16225
17365
|
* Returns an identity `Iso` over the schema's focus (`Iso`) side.
|
|
16226
17366
|
*
|
|
17367
|
+
* @stability stable
|
|
16227
17368
|
* @category constructors
|
|
16228
17369
|
* @since 4.0.0
|
|
16229
17370
|
*/
|
|
@@ -16233,6 +17374,7 @@ export function toIsoFocus<S extends Constraint>(schema: S): Optic_.Iso<S["Iso"]
|
|
|
16233
17374
|
/**
|
|
16234
17375
|
* Type-level representation returned by {@link overrideToCodecIso}.
|
|
16235
17376
|
*
|
|
17377
|
+
* @stability stable
|
|
16236
17378
|
* @category transforming
|
|
16237
17379
|
* @since 4.0.0
|
|
16238
17380
|
*/
|
|
@@ -16271,6 +17413,7 @@ export interface overrideToCodecIso<S extends Constraint, Iso> extends
|
|
|
16271
17413
|
* provided `decode` and `encode` getters to transform between the schema type
|
|
16272
17414
|
* and the target codec.
|
|
16273
17415
|
*
|
|
17416
|
+
* @stability stable
|
|
16274
17417
|
* @category transforming
|
|
16275
17418
|
* @since 4.0.0
|
|
16276
17419
|
*/
|
|
@@ -16308,6 +17451,7 @@ export function overrideToCodecIso<S extends Constraint, Iso>(
|
|
|
16308
17451
|
* `SchemaIssue.makeFormatterDefault()`. Invalid patch operations instead produce
|
|
16309
17452
|
* {@link JsonPatch.apply} errors.
|
|
16310
17453
|
*
|
|
17454
|
+
* @stability stable
|
|
16311
17455
|
* @category converting
|
|
16312
17456
|
* @since 4.0.0
|
|
16313
17457
|
*/
|
|
@@ -16318,6 +17462,7 @@ export function toDifferJsonPatch<T>(schema: ConstraintCodec<T, unknown>): Diffe
|
|
|
16318
17462
|
* Recursive tree type whose leaves are `Node` values and whose branches are
|
|
16319
17463
|
* readonly arrays or string-keyed records of child trees.
|
|
16320
17464
|
*
|
|
17465
|
+
* @stability stable
|
|
16321
17466
|
* @category models
|
|
16322
17467
|
* @since 4.0.0
|
|
16323
17468
|
*/
|
|
@@ -16326,6 +17471,7 @@ export type Tree<Node> = Node | TreeRecord<Node> | ReadonlyArray<Tree<Node>>
|
|
|
16326
17471
|
* A record node in a {@link Tree}: an object mapping string keys to child
|
|
16327
17472
|
* `Tree` nodes.
|
|
16328
17473
|
*
|
|
17474
|
+
* @stability stable
|
|
16329
17475
|
* @category models
|
|
16330
17476
|
* @since 4.0.0
|
|
16331
17477
|
*/
|
|
@@ -16337,6 +17483,7 @@ export interface TreeRecord<A> {
|
|
|
16337
17483
|
* The resulting schema accepts a single node value, an array of trees, or an
|
|
16338
17484
|
* object whose values are trees.
|
|
16339
17485
|
*
|
|
17486
|
+
* @stability stable
|
|
16340
17487
|
* @category schemas
|
|
16341
17488
|
* @since 4.0.0
|
|
16342
17489
|
*/
|
|
@@ -16360,6 +17507,7 @@ export function Tree<S extends Constraint>(node: S) {
|
|
|
16360
17507
|
* readonly record of `string → Json`. For the corresponding schema, see the
|
|
16361
17508
|
* {@link Json} const.
|
|
16362
17509
|
*
|
|
17510
|
+
* @stability stable
|
|
16363
17511
|
* @category models
|
|
16364
17512
|
* @since 4.0.0
|
|
16365
17513
|
*/
|
|
@@ -16367,6 +17515,7 @@ export type Json = null | number | boolean | string | JsonArray | JsonObject
|
|
|
16367
17515
|
/**
|
|
16368
17516
|
* A readonly array of {@link Json} values.
|
|
16369
17517
|
*
|
|
17518
|
+
* @stability stable
|
|
16370
17519
|
* @category models
|
|
16371
17520
|
* @since 4.0.0
|
|
16372
17521
|
*/
|
|
@@ -16374,6 +17523,7 @@ export interface JsonArray extends ReadonlyArray<Json> {}
|
|
|
16374
17523
|
/**
|
|
16375
17524
|
* A readonly record whose values are {@link Json} values.
|
|
16376
17525
|
*
|
|
17526
|
+
* @stability stable
|
|
16377
17527
|
* @category models
|
|
16378
17528
|
* @since 4.0.0
|
|
16379
17529
|
*/
|
|
@@ -16391,6 +17541,7 @@ export interface JsonObject {
|
|
|
16391
17541
|
* Schema.decodeUnknownOption(Schema.Json)({ key: [1, true, null] }) // => Option.some({ key: [1, true, null] })
|
|
16392
17542
|
* ```
|
|
16393
17543
|
*
|
|
17544
|
+
* @stability stable
|
|
16394
17545
|
* @category schemas
|
|
16395
17546
|
* @since 4.0.0
|
|
16396
17547
|
*/
|
|
@@ -16417,6 +17568,7 @@ export const Json: Codec<Json> = make(SchemaAST.annotate(SchemaAST.Json, {
|
|
|
16417
17568
|
* ```
|
|
16418
17569
|
*
|
|
16419
17570
|
* @see {@link Json} for a schema that also accepts JSON arrays and primitive values
|
|
17571
|
+
* @stability stable
|
|
16420
17572
|
* @category schemas
|
|
16421
17573
|
* @since 4.0.0
|
|
16422
17574
|
*/
|
|
@@ -16425,6 +17577,7 @@ export const JsonObject: $Record<String, Codec<Json, Json, never, never>> = Reco
|
|
|
16425
17577
|
* Recursive TypeScript type for mutable JSON values: `null`, `number`,
|
|
16426
17578
|
* `boolean`, `string`, mutable arrays, or mutable string-keyed records.
|
|
16427
17579
|
*
|
|
17580
|
+
* @stability stable
|
|
16428
17581
|
* @category models
|
|
16429
17582
|
* @since 4.0.0
|
|
16430
17583
|
*/
|
|
@@ -16432,6 +17585,7 @@ export type MutableJson = null | number | boolean | string | MutableJsonArray |
|
|
|
16432
17585
|
/**
|
|
16433
17586
|
* A mutable array of {@link MutableJson} values.
|
|
16434
17587
|
*
|
|
17588
|
+
* @stability stable
|
|
16435
17589
|
* @category models
|
|
16436
17590
|
* @since 4.0.0
|
|
16437
17591
|
*/
|
|
@@ -16439,6 +17593,7 @@ export interface MutableJsonArray extends Array<MutableJson> {}
|
|
|
16439
17593
|
/**
|
|
16440
17594
|
* A mutable record whose values are {@link MutableJson} values.
|
|
16441
17595
|
*
|
|
17596
|
+
* @stability stable
|
|
16442
17597
|
* @category models
|
|
16443
17598
|
* @since 4.0.0
|
|
16444
17599
|
*/
|
|
@@ -16456,6 +17611,7 @@ const JsonError = Struct({
|
|
|
16456
17611
|
* Schema that accepts any mutable JSON-compatible value. See {@link Json} for
|
|
16457
17612
|
* the immutable variant.
|
|
16458
17613
|
*
|
|
17614
|
+
* @stability stable
|
|
16459
17615
|
* @category schemas
|
|
16460
17616
|
* @since 4.0.0
|
|
16461
17617
|
*/
|
|
@@ -16471,6 +17627,7 @@ export const MutableJson: Codec<MutableJson> = make(SchemaAST.annotate(SchemaAST
|
|
|
16471
17627
|
* annotations are taken from the last check; otherwise they are taken from
|
|
16472
17628
|
* the base schema instance.
|
|
16473
17629
|
*
|
|
17630
|
+
* @stability stable
|
|
16474
17631
|
* @category getters
|
|
16475
17632
|
* @since 4.0.0
|
|
16476
17633
|
*/
|
|
@@ -16484,6 +17641,7 @@ export function resolveAnnotations<S extends Constraint>(
|
|
|
16484
17641
|
* annotations are those attached via `annotateKey` and live on the AST's
|
|
16485
17642
|
* `context` rather than on the schema node itself.
|
|
16486
17643
|
*
|
|
17644
|
+
* @stability stable
|
|
16487
17645
|
* @category getters
|
|
16488
17646
|
* @since 4.0.0
|
|
16489
17647
|
*/
|
|
@@ -16500,6 +17658,7 @@ export function resolveAnnotationsKey<S extends Constraint>(schema: S): Annotati
|
|
|
16500
17658
|
* Use {@link resolveAnnotations} to read the annotations attached to a schema at
|
|
16501
17659
|
* runtime.
|
|
16502
17660
|
*
|
|
17661
|
+
* @stability stable
|
|
16503
17662
|
* @category models
|
|
16504
17663
|
* @since 4.0.0
|
|
16505
17664
|
*/
|