effect 4.0.0-beta.66 → 4.0.0-beta.68
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Array.d.ts +151 -106
- package/dist/Array.d.ts.map +1 -1
- package/dist/Array.js +50 -40
- package/dist/Array.js.map +1 -1
- package/dist/BigDecimal.d.ts +620 -553
- package/dist/BigDecimal.d.ts.map +1 -1
- package/dist/BigDecimal.js +298 -254
- package/dist/BigDecimal.js.map +1 -1
- package/dist/BigInt.d.ts +342 -274
- package/dist/BigInt.d.ts.map +1 -1
- package/dist/BigInt.js +168 -126
- package/dist/BigInt.js.map +1 -1
- package/dist/Boolean.d.ts +189 -156
- package/dist/Boolean.d.ts.map +1 -1
- package/dist/Boolean.js +85 -68
- package/dist/Boolean.js.map +1 -1
- package/dist/Brand.d.ts +30 -5
- package/dist/Brand.d.ts.map +1 -1
- package/dist/Brand.js +19 -2
- package/dist/Brand.js.map +1 -1
- package/dist/Cache.d.ts +239 -135
- package/dist/Cache.d.ts.map +1 -1
- package/dist/Cache.js +135 -59
- package/dist/Cache.js.map +1 -1
- package/dist/Cause.d.ts +84 -73
- package/dist/Cause.d.ts.map +1 -1
- package/dist/Cause.js +51 -44
- package/dist/Cause.js.map +1 -1
- package/dist/Channel.d.ts +1568 -632
- package/dist/Channel.d.ts.map +1 -1
- package/dist/Channel.js +685 -315
- package/dist/Channel.js.map +1 -1
- package/dist/ChannelSchema.d.ts +119 -10
- package/dist/ChannelSchema.d.ts.map +1 -1
- package/dist/ChannelSchema.js +45 -6
- package/dist/ChannelSchema.js.map +1 -1
- package/dist/Chunk.d.ts +574 -428
- package/dist/Chunk.d.ts.map +1 -1
- package/dist/Chunk.js +250 -191
- package/dist/Chunk.js.map +1 -1
- package/dist/Clock.d.ts +16 -9
- package/dist/Clock.d.ts.map +1 -1
- package/dist/Clock.js +9 -5
- package/dist/Clock.js.map +1 -1
- package/dist/Combiner.d.ts +11 -5
- package/dist/Combiner.d.ts.map +1 -1
- package/dist/Combiner.js +10 -4
- package/dist/Combiner.js.map +1 -1
- package/dist/Config.d.ts +80 -68
- package/dist/Config.d.ts.map +1 -1
- package/dist/Config.js +53 -49
- package/dist/Config.js.map +1 -1
- package/dist/ConfigProvider.d.ts +33 -32
- package/dist/ConfigProvider.d.ts.map +1 -1
- package/dist/ConfigProvider.js +19 -18
- package/dist/ConfigProvider.js.map +1 -1
- package/dist/Console.d.ts +76 -50
- package/dist/Console.d.ts.map +1 -1
- package/dist/Console.js +69 -46
- package/dist/Console.js.map +1 -1
- package/dist/Context.d.ts +400 -189
- package/dist/Context.d.ts.map +1 -1
- package/dist/Context.js +143 -77
- package/dist/Context.js.map +1 -1
- package/dist/Cron.d.ts +67 -48
- package/dist/Cron.d.ts.map +1 -1
- package/dist/Cron.js +94 -36
- package/dist/Cron.js.map +1 -1
- package/dist/Crypto.d.ts +208 -0
- package/dist/Crypto.d.ts.map +1 -0
- package/dist/Crypto.js +157 -0
- package/dist/Crypto.js.map +1 -0
- package/dist/Data.d.ts +9 -3
- package/dist/Data.d.ts.map +1 -1
- package/dist/Data.js.map +1 -1
- package/dist/DateTime.d.ts +893 -464
- package/dist/DateTime.d.ts.map +1 -1
- package/dist/DateTime.js +387 -228
- package/dist/DateTime.js.map +1 -1
- package/dist/Deferred.d.ts +367 -175
- package/dist/Deferred.d.ts.map +1 -1
- package/dist/Deferred.js +146 -72
- package/dist/Deferred.js.map +1 -1
- package/dist/Differ.d.ts +44 -2
- package/dist/Differ.d.ts.map +1 -1
- package/dist/Differ.js +36 -0
- package/dist/Duration.d.ts +333 -186
- package/dist/Duration.d.ts.map +1 -1
- package/dist/Duration.js +178 -107
- package/dist/Duration.js.map +1 -1
- package/dist/Effect.d.ts +2181 -2275
- package/dist/Effect.d.ts.map +1 -1
- package/dist/Effect.js +935 -850
- package/dist/Effect.js.map +1 -1
- package/dist/Effectable.d.ts +38 -3
- package/dist/Effectable.d.ts.map +1 -1
- package/dist/Effectable.js +3 -3
- package/dist/Effectable.js.map +1 -1
- package/dist/Encoding.d.ts +78 -28
- package/dist/Encoding.d.ts.map +1 -1
- package/dist/Encoding.js +75 -27
- package/dist/Encoding.js.map +1 -1
- package/dist/Equal.d.ts +4 -3
- package/dist/Equal.d.ts.map +1 -1
- package/dist/Equal.js +4 -3
- package/dist/Equal.js.map +1 -1
- package/dist/Equivalence.d.ts +18 -24
- package/dist/Equivalence.d.ts.map +1 -1
- package/dist/Equivalence.js +16 -21
- package/dist/Equivalence.js.map +1 -1
- package/dist/ErrorReporter.d.ts +66 -82
- package/dist/ErrorReporter.d.ts.map +1 -1
- package/dist/ErrorReporter.js +38 -29
- package/dist/ErrorReporter.js.map +1 -1
- package/dist/ExecutionPlan.d.ts +106 -12
- package/dist/ExecutionPlan.d.ts.map +1 -1
- package/dist/ExecutionPlan.js +23 -6
- package/dist/ExecutionPlan.js.map +1 -1
- package/dist/Exit.d.ts +6 -5
- package/dist/Exit.d.ts.map +1 -1
- package/dist/Exit.js.map +1 -1
- package/dist/Fiber.d.ts +71 -40
- package/dist/Fiber.d.ts.map +1 -1
- package/dist/Fiber.js +39 -21
- package/dist/Fiber.js.map +1 -1
- package/dist/FiberHandle.d.ts +118 -57
- package/dist/FiberHandle.d.ts.map +1 -1
- package/dist/FiberHandle.js +121 -39
- package/dist/FiberHandle.js.map +1 -1
- package/dist/FiberMap.d.ts +287 -159
- package/dist/FiberMap.d.ts.map +1 -1
- package/dist/FiberMap.js +175 -73
- package/dist/FiberMap.js.map +1 -1
- package/dist/FiberSet.d.ts +93 -52
- package/dist/FiberSet.d.ts.map +1 -1
- package/dist/FiberSet.js +97 -34
- package/dist/FiberSet.js.map +1 -1
- package/dist/FileSystem.d.ts +102 -73
- package/dist/FileSystem.d.ts.map +1 -1
- package/dist/FileSystem.js +53 -39
- package/dist/FileSystem.js.map +1 -1
- package/dist/Filter.d.ts +166 -88
- package/dist/Filter.d.ts.map +1 -1
- package/dist/Filter.js +68 -42
- package/dist/Filter.js.map +1 -1
- package/dist/Formatter.d.ts +4 -2
- package/dist/Formatter.d.ts.map +1 -1
- package/dist/Formatter.js +3 -69
- package/dist/Formatter.js.map +1 -1
- package/dist/Function.d.ts +218 -151
- package/dist/Function.d.ts.map +1 -1
- package/dist/Function.js +94 -78
- package/dist/Function.js.map +1 -1
- package/dist/Graph.d.ts +714 -415
- package/dist/Graph.d.ts.map +1 -1
- package/dist/Graph.js +325 -182
- package/dist/Graph.js.map +1 -1
- package/dist/HKT.d.ts +29 -13
- package/dist/HKT.d.ts.map +1 -1
- package/dist/Hash.d.ts +35 -24
- package/dist/Hash.d.ts.map +1 -1
- package/dist/Hash.js +27 -17
- package/dist/Hash.js.map +1 -1
- package/dist/HashMap.d.ts +540 -388
- package/dist/HashMap.d.ts.map +1 -1
- package/dist/HashMap.js +262 -156
- package/dist/HashMap.js.map +1 -1
- package/dist/HashRing.d.ts +53 -34
- package/dist/HashRing.d.ts.map +1 -1
- package/dist/HashRing.js +83 -16
- package/dist/HashRing.js.map +1 -1
- package/dist/HashSet.d.ts +239 -153
- package/dist/HashSet.d.ts.map +1 -1
- package/dist/HashSet.js +110 -56
- package/dist/HashSet.js.map +1 -1
- package/dist/Inspectable.d.ts +26 -13
- package/dist/Inspectable.d.ts.map +1 -1
- package/dist/Inspectable.js +22 -10
- package/dist/Inspectable.js.map +1 -1
- package/dist/Iterable.d.ts +336 -222
- package/dist/Iterable.d.ts.map +1 -1
- package/dist/Iterable.js +146 -100
- package/dist/Iterable.js.map +1 -1
- package/dist/JsonPatch.d.ts +12 -9
- package/dist/JsonPatch.d.ts.map +1 -1
- package/dist/JsonPatch.js +9 -6
- package/dist/JsonPatch.js.map +1 -1
- package/dist/JsonPointer.d.ts +13 -11
- package/dist/JsonPointer.d.ts.map +1 -1
- package/dist/JsonPointer.js +13 -11
- package/dist/JsonPointer.js.map +1 -1
- package/dist/JsonSchema.d.ts +16 -0
- package/dist/JsonSchema.d.ts.map +1 -1
- package/dist/JsonSchema.js +10 -0
- package/dist/JsonSchema.js.map +1 -1
- package/dist/Latch.d.ts +97 -26
- package/dist/Latch.d.ts.map +1 -1
- package/dist/Latch.js +39 -20
- package/dist/Latch.js.map +1 -1
- package/dist/Layer.d.ts +472 -410
- package/dist/Layer.d.ts.map +1 -1
- package/dist/Layer.js +290 -226
- package/dist/Layer.js.map +1 -1
- package/dist/LayerMap.d.ts +99 -26
- package/dist/LayerMap.d.ts.map +1 -1
- package/dist/LayerMap.js +58 -14
- package/dist/LayerMap.js.map +1 -1
- package/dist/LogLevel.d.ts +92 -131
- package/dist/LogLevel.d.ts.map +1 -1
- package/dist/LogLevel.js +25 -15
- package/dist/LogLevel.js.map +1 -1
- package/dist/Logger.d.ts +159 -104
- package/dist/Logger.d.ts.map +1 -1
- package/dist/Logger.js +215 -189
- package/dist/Logger.js.map +1 -1
- package/dist/ManagedRuntime.d.ts +78 -19
- package/dist/ManagedRuntime.d.ts.map +1 -1
- package/dist/ManagedRuntime.js +24 -17
- package/dist/ManagedRuntime.js.map +1 -1
- package/dist/Match.d.ts +135 -161
- package/dist/Match.d.ts.map +1 -1
- package/dist/Match.js +86 -78
- package/dist/Match.js.map +1 -1
- package/dist/Metric.d.ts +330 -291
- package/dist/Metric.d.ts.map +1 -1
- package/dist/Metric.js +219 -214
- package/dist/Metric.js.map +1 -1
- package/dist/MutableHashMap.d.ts +146 -87
- package/dist/MutableHashMap.d.ts.map +1 -1
- package/dist/MutableHashMap.js +67 -43
- package/dist/MutableHashMap.js.map +1 -1
- package/dist/MutableHashSet.d.ts +52 -30
- package/dist/MutableHashSet.d.ts.map +1 -1
- package/dist/MutableHashSet.js +92 -38
- package/dist/MutableHashSet.js.map +1 -1
- package/dist/MutableList.d.ts +110 -68
- package/dist/MutableList.d.ts.map +1 -1
- package/dist/MutableList.js +135 -85
- package/dist/MutableList.js.map +1 -1
- package/dist/MutableRef.d.ts +99 -62
- package/dist/MutableRef.d.ts.map +1 -1
- package/dist/MutableRef.js +78 -60
- package/dist/MutableRef.js.map +1 -1
- package/dist/Newtype.d.ts +15 -2
- package/dist/Newtype.d.ts.map +1 -1
- package/dist/Newtype.js +8 -2
- package/dist/Newtype.js.map +1 -1
- package/dist/NonEmptyIterable.d.ts +38 -48
- package/dist/NonEmptyIterable.d.ts.map +1 -1
- package/dist/NonEmptyIterable.js +34 -25
- package/dist/NonEmptyIterable.js.map +1 -1
- package/dist/Number.d.ts +261 -205
- package/dist/Number.d.ts.map +1 -1
- package/dist/Number.js +119 -91
- package/dist/Number.js.map +1 -1
- package/dist/Optic.d.ts +6 -7
- package/dist/Optic.d.ts.map +1 -1
- package/dist/Optic.js +5 -6
- package/dist/Optic.js.map +1 -1
- package/dist/Option.d.ts +133 -156
- package/dist/Option.d.ts.map +1 -1
- package/dist/Option.js +64 -64
- package/dist/Option.js.map +1 -1
- package/dist/Order.d.ts +6 -6
- package/dist/Order.js +6 -6
- package/dist/Ordering.d.ts +56 -45
- package/dist/Ordering.d.ts.map +1 -1
- package/dist/Ordering.js +10 -8
- package/dist/Ordering.js.map +1 -1
- package/dist/PartitionedSemaphore.d.ts +225 -40
- package/dist/PartitionedSemaphore.d.ts.map +1 -1
- package/dist/PartitionedSemaphore.js +113 -17
- package/dist/PartitionedSemaphore.js.map +1 -1
- package/dist/Path.d.ts +77 -13
- package/dist/Path.d.ts.map +1 -1
- package/dist/Path.js +49 -4
- package/dist/Path.js.map +1 -1
- package/dist/Pipeable.d.ts +77 -18
- package/dist/Pipeable.d.ts.map +1 -1
- package/dist/Pipeable.js +63 -14
- package/dist/Pipeable.js.map +1 -1
- package/dist/PlatformError.d.ts +74 -6
- package/dist/PlatformError.d.ts.map +1 -1
- package/dist/PlatformError.js +68 -5
- package/dist/PlatformError.js.map +1 -1
- package/dist/Pool.d.ts +66 -31
- package/dist/Pool.d.ts.map +1 -1
- package/dist/Pool.js +26 -24
- package/dist/Pool.js.map +1 -1
- package/dist/Predicate.d.ts +16 -23
- package/dist/Predicate.d.ts.map +1 -1
- package/dist/Predicate.js +12 -17
- package/dist/Predicate.js.map +1 -1
- package/dist/PrimaryKey.d.ts +11 -3
- package/dist/PrimaryKey.d.ts.map +1 -1
- package/dist/PrimaryKey.js +9 -2
- package/dist/PrimaryKey.js.map +1 -1
- package/dist/PubSub.d.ts +385 -309
- package/dist/PubSub.d.ts.map +1 -1
- package/dist/PubSub.js +260 -207
- package/dist/PubSub.js.map +1 -1
- package/dist/Pull.d.ts +94 -25
- package/dist/Pull.d.ts.map +1 -1
- package/dist/Pull.js +61 -13
- package/dist/Pull.js.map +1 -1
- package/dist/Queue.d.ts +303 -184
- package/dist/Queue.d.ts.map +1 -1
- package/dist/Queue.js +231 -134
- package/dist/Queue.js.map +1 -1
- package/dist/Random.d.ts +65 -57
- package/dist/Random.d.ts.map +1 -1
- package/dist/Random.js +41 -66
- package/dist/Random.js.map +1 -1
- package/dist/RcMap.d.ts +151 -141
- package/dist/RcMap.d.ts.map +1 -1
- package/dist/RcMap.js +66 -20
- package/dist/RcMap.js.map +1 -1
- package/dist/RcRef.d.ts +68 -32
- package/dist/RcRef.d.ts.map +1 -1
- package/dist/RcRef.js +33 -16
- package/dist/RcRef.js.map +1 -1
- package/dist/Record.d.ts +282 -137
- package/dist/Record.d.ts.map +1 -1
- package/dist/Record.js +124 -62
- package/dist/Record.js.map +1 -1
- package/dist/Redactable.d.ts +7 -5
- package/dist/Redactable.d.ts.map +1 -1
- package/dist/Redactable.js +5 -3
- package/dist/Redactable.js.map +1 -1
- package/dist/Redacted.d.ts +63 -34
- package/dist/Redacted.d.ts.map +1 -1
- package/dist/Redacted.js +31 -15
- package/dist/Redacted.js.map +1 -1
- package/dist/Reducer.d.ts +3 -1
- package/dist/Reducer.d.ts.map +1 -1
- package/dist/Reducer.js +2 -0
- package/dist/Reducer.js.map +1 -1
- package/dist/Ref.d.ts +85 -66
- package/dist/Ref.d.ts.map +1 -1
- package/dist/Ref.js +57 -45
- package/dist/Ref.js.map +1 -1
- package/dist/References.d.ts +73 -31
- package/dist/References.d.ts.map +1 -1
- package/dist/References.js +66 -30
- package/dist/References.js.map +1 -1
- package/dist/RegExp.d.ts +12 -6
- package/dist/RegExp.d.ts.map +1 -1
- package/dist/RegExp.js +12 -6
- package/dist/RegExp.js.map +1 -1
- package/dist/Request.d.ts +159 -34
- package/dist/Request.d.ts.map +1 -1
- package/dist/Request.js +68 -12
- package/dist/Request.js.map +1 -1
- package/dist/RequestResolver.d.ts +262 -118
- package/dist/RequestResolver.d.ts.map +1 -1
- package/dist/RequestResolver.js +78 -42
- package/dist/RequestResolver.js.map +1 -1
- package/dist/Resource.d.ts +13 -7
- package/dist/Resource.d.ts.map +1 -1
- package/dist/Resource.js +44 -6
- package/dist/Resource.js.map +1 -1
- package/dist/Result.d.ts +135 -151
- package/dist/Result.d.ts.map +1 -1
- package/dist/Result.js +56 -68
- package/dist/Result.js.map +1 -1
- package/dist/Runtime.d.ts +40 -20
- package/dist/Runtime.d.ts.map +1 -1
- package/dist/Runtime.js +34 -17
- package/dist/Runtime.js.map +1 -1
- package/dist/Schedule.d.ts +556 -590
- package/dist/Schedule.d.ts.map +1 -1
- package/dist/Schedule.js +265 -253
- package/dist/Schedule.js.map +1 -1
- package/dist/Scheduler.d.ts +44 -7
- package/dist/Scheduler.d.ts.map +1 -1
- package/dist/Scheduler.js +34 -5
- package/dist/Scheduler.js.map +1 -1
- package/dist/Schema.d.ts +1293 -602
- package/dist/Schema.d.ts.map +1 -1
- package/dist/Schema.js +501 -361
- package/dist/Schema.js.map +1 -1
- package/dist/SchemaAST.d.ts +122 -92
- package/dist/SchemaAST.d.ts.map +1 -1
- package/dist/SchemaAST.js +102 -77
- package/dist/SchemaAST.js.map +1 -1
- package/dist/SchemaGetter.d.ts +49 -36
- package/dist/SchemaGetter.d.ts.map +1 -1
- package/dist/SchemaGetter.js +42 -29
- package/dist/SchemaGetter.js.map +1 -1
- package/dist/SchemaIssue.d.ts +19 -24
- package/dist/SchemaIssue.d.ts.map +1 -1
- package/dist/SchemaIssue.js +16 -14
- package/dist/SchemaIssue.js.map +1 -1
- package/dist/SchemaParser.d.ts +231 -63
- package/dist/SchemaParser.d.ts.map +1 -1
- package/dist/SchemaParser.js +266 -75
- package/dist/SchemaParser.js.map +1 -1
- package/dist/SchemaRepresentation.d.ts +89 -77
- package/dist/SchemaRepresentation.d.ts.map +1 -1
- package/dist/SchemaRepresentation.js +47 -37
- package/dist/SchemaRepresentation.js.map +1 -1
- package/dist/SchemaTransformation.d.ts +97 -46
- package/dist/SchemaTransformation.d.ts.map +1 -1
- package/dist/SchemaTransformation.js +89 -38
- package/dist/SchemaTransformation.js.map +1 -1
- package/dist/SchemaUtils.d.ts +8 -1
- package/dist/SchemaUtils.d.ts.map +1 -1
- package/dist/SchemaUtils.js +24 -1
- package/dist/SchemaUtils.js.map +1 -1
- package/dist/Scope.d.ts +107 -65
- package/dist/Scope.d.ts.map +1 -1
- package/dist/Scope.js +61 -32
- package/dist/Scope.js.map +1 -1
- package/dist/ScopedCache.d.ts +141 -49
- package/dist/ScopedCache.d.ts.map +1 -1
- package/dist/ScopedCache.js +82 -21
- package/dist/ScopedCache.js.map +1 -1
- package/dist/ScopedRef.d.ts +28 -8
- package/dist/ScopedRef.d.ts.map +1 -1
- package/dist/ScopedRef.js +25 -5
- package/dist/ScopedRef.js.map +1 -1
- package/dist/Semaphore.d.ts +61 -37
- package/dist/Semaphore.d.ts.map +1 -1
- package/dist/Semaphore.js +18 -21
- package/dist/Semaphore.js.map +1 -1
- package/dist/Sink.d.ts +461 -206
- package/dist/Sink.d.ts.map +1 -1
- package/dist/Sink.js +241 -90
- package/dist/Sink.js.map +1 -1
- package/dist/Stdio.d.ts +43 -6
- package/dist/Stdio.d.ts.map +1 -1
- package/dist/Stdio.js +33 -4
- package/dist/Stdio.js.map +1 -1
- package/dist/Stream.d.ts +2117 -1541
- package/dist/Stream.d.ts.map +1 -1
- package/dist/Stream.js +951 -682
- package/dist/Stream.js.map +1 -1
- package/dist/String.d.ts +174 -97
- package/dist/String.d.ts.map +1 -1
- package/dist/String.js +128 -69
- package/dist/String.js.map +1 -1
- package/dist/Struct.d.ts +20 -18
- package/dist/Struct.d.ts.map +1 -1
- package/dist/Struct.js +10 -8
- package/dist/Struct.js.map +1 -1
- package/dist/SubscriptionRef.d.ts +309 -204
- package/dist/SubscriptionRef.d.ts.map +1 -1
- package/dist/SubscriptionRef.js +126 -77
- package/dist/SubscriptionRef.js.map +1 -1
- package/dist/Symbol.d.ts +13 -5
- package/dist/Symbol.d.ts.map +1 -1
- package/dist/Symbol.js +13 -5
- package/dist/Symbol.js.map +1 -1
- package/dist/SynchronizedRef.d.ts +278 -62
- package/dist/SynchronizedRef.d.ts.map +1 -1
- package/dist/SynchronizedRef.js +116 -23
- package/dist/SynchronizedRef.js.map +1 -1
- package/dist/Take.d.ts +26 -2
- package/dist/Take.d.ts.map +1 -1
- package/dist/Take.js +4 -1
- package/dist/Take.js.map +1 -1
- package/dist/Terminal.d.ts +39 -7
- package/dist/Terminal.d.ts.map +1 -1
- package/dist/Terminal.js +10 -4
- package/dist/Terminal.js.map +1 -1
- package/dist/Tracer.d.ts +233 -59
- package/dist/Tracer.d.ts.map +1 -1
- package/dist/Tracer.js +94 -18
- package/dist/Tracer.js.map +1 -1
- package/dist/Trie.d.ts +280 -245
- package/dist/Trie.d.ts.map +1 -1
- package/dist/Trie.js +116 -102
- package/dist/Trie.js.map +1 -1
- package/dist/Tuple.d.ts +34 -32
- package/dist/Tuple.d.ts.map +1 -1
- package/dist/Tuple.js +16 -14
- package/dist/Tuple.js.map +1 -1
- package/dist/TxChunk.d.ts +200 -155
- package/dist/TxChunk.d.ts.map +1 -1
- package/dist/TxChunk.js +83 -61
- package/dist/TxChunk.js.map +1 -1
- package/dist/TxDeferred.d.ts +43 -29
- package/dist/TxDeferred.d.ts.map +1 -1
- package/dist/TxDeferred.js +22 -15
- package/dist/TxDeferred.js.map +1 -1
- package/dist/TxHashMap.d.ts +362 -223
- package/dist/TxHashMap.d.ts.map +1 -1
- package/dist/TxHashMap.js +171 -98
- package/dist/TxHashMap.js.map +1 -1
- package/dist/TxHashSet.d.ts +181 -111
- package/dist/TxHashSet.d.ts.map +1 -1
- package/dist/TxHashSet.js +87 -49
- package/dist/TxHashSet.js.map +1 -1
- package/dist/TxPriorityQueue.d.ts +94 -63
- package/dist/TxPriorityQueue.d.ts.map +1 -1
- package/dist/TxPriorityQueue.js +55 -37
- package/dist/TxPriorityQueue.js.map +1 -1
- package/dist/TxPubSub.d.ts +77 -49
- package/dist/TxPubSub.d.ts.map +1 -1
- package/dist/TxPubSub.js +60 -37
- package/dist/TxPubSub.js.map +1 -1
- package/dist/TxQueue.d.ts +277 -242
- package/dist/TxQueue.d.ts.map +1 -1
- package/dist/TxQueue.js +147 -101
- package/dist/TxQueue.js.map +1 -1
- package/dist/TxReentrantLock.d.ts +69 -46
- package/dist/TxReentrantLock.d.ts.map +1 -1
- package/dist/TxReentrantLock.js +48 -32
- package/dist/TxReentrantLock.js.map +1 -1
- package/dist/TxRef.d.ts +69 -40
- package/dist/TxRef.d.ts.map +1 -1
- package/dist/TxRef.js +34 -19
- package/dist/TxRef.js.map +1 -1
- package/dist/TxSemaphore.d.ts +101 -115
- package/dist/TxSemaphore.d.ts.map +1 -1
- package/dist/TxSemaphore.js +76 -77
- package/dist/TxSemaphore.js.map +1 -1
- package/dist/TxSubscriptionRef.d.ts +74 -50
- package/dist/TxSubscriptionRef.d.ts.map +1 -1
- package/dist/TxSubscriptionRef.js +34 -23
- package/dist/TxSubscriptionRef.js.map +1 -1
- package/dist/Types.d.ts +31 -34
- package/dist/Types.d.ts.map +1 -1
- package/dist/UndefinedOr.d.ts +62 -25
- package/dist/UndefinedOr.d.ts.map +1 -1
- package/dist/UndefinedOr.js +36 -25
- package/dist/UndefinedOr.js.map +1 -1
- package/dist/Unify.d.ts +72 -117
- package/dist/Unify.d.ts.map +1 -1
- package/dist/Unify.js +20 -6
- package/dist/Unify.js.map +1 -1
- package/dist/Utils.d.ts +5 -2
- package/dist/Utils.d.ts.map +1 -1
- package/dist/Utils.js +4 -0
- package/dist/Utils.js.map +1 -1
- package/dist/index.d.ts +1973 -418
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1973 -418
- package/dist/index.js.map +1 -1
- package/dist/internal/schema/schema.js +1 -1
- package/dist/internal/schema/schema.js.map +1 -1
- package/dist/testing/FastCheck.d.ts +9 -6
- package/dist/testing/FastCheck.d.ts.map +1 -1
- package/dist/testing/FastCheck.js +9 -6
- package/dist/testing/FastCheck.js.map +1 -1
- package/dist/testing/TestClock.d.ts +39 -35
- package/dist/testing/TestClock.d.ts.map +1 -1
- package/dist/testing/TestClock.js +42 -12
- package/dist/testing/TestClock.js.map +1 -1
- package/dist/testing/TestConsole.d.ts +44 -36
- package/dist/testing/TestConsole.d.ts.map +1 -1
- package/dist/testing/TestConsole.js +30 -15
- package/dist/testing/TestConsole.js.map +1 -1
- package/dist/testing/TestSchema.d.ts +2 -0
- package/dist/testing/TestSchema.d.ts.map +1 -1
- package/dist/testing/TestSchema.js +9 -7
- package/dist/testing/TestSchema.js.map +1 -1
- package/dist/testing/index.d.ts +34 -0
- package/dist/testing/index.d.ts.map +1 -1
- package/dist/testing/index.js +34 -0
- package/dist/testing/index.js.map +1 -1
- package/dist/unstable/ai/AiError.d.ts +205 -147
- package/dist/unstable/ai/AiError.d.ts.map +1 -1
- package/dist/unstable/ai/AiError.js +164 -109
- package/dist/unstable/ai/AiError.js.map +1 -1
- package/dist/unstable/ai/AnthropicStructuredOutput.d.ts +1 -1
- package/dist/unstable/ai/AnthropicStructuredOutput.js +2 -2
- package/dist/unstable/ai/Chat.d.ts +64 -41
- package/dist/unstable/ai/Chat.d.ts.map +1 -1
- package/dist/unstable/ai/Chat.js +51 -33
- package/dist/unstable/ai/Chat.js.map +1 -1
- package/dist/unstable/ai/EmbeddingModel.d.ts +12 -11
- package/dist/unstable/ai/EmbeddingModel.d.ts.map +1 -1
- package/dist/unstable/ai/EmbeddingModel.js +9 -8
- package/dist/unstable/ai/EmbeddingModel.js.map +1 -1
- package/dist/unstable/ai/IdGenerator.d.ts +28 -18
- package/dist/unstable/ai/IdGenerator.d.ts.map +1 -1
- package/dist/unstable/ai/IdGenerator.js +18 -11
- package/dist/unstable/ai/IdGenerator.js.map +1 -1
- package/dist/unstable/ai/LanguageModel.d.ts +31 -25
- package/dist/unstable/ai/LanguageModel.d.ts.map +1 -1
- package/dist/unstable/ai/LanguageModel.js +20 -14
- package/dist/unstable/ai/LanguageModel.js.map +1 -1
- package/dist/unstable/ai/McpSchema.d.ts +342 -119
- package/dist/unstable/ai/McpSchema.d.ts.map +1 -1
- package/dist/unstable/ai/McpSchema.js +266 -98
- package/dist/unstable/ai/McpSchema.js.map +1 -1
- package/dist/unstable/ai/McpServer.d.ts +56 -20
- package/dist/unstable/ai/McpServer.d.ts.map +1 -1
- package/dist/unstable/ai/McpServer.js +64 -16
- package/dist/unstable/ai/McpServer.js.map +1 -1
- package/dist/unstable/ai/Model.d.ts +10 -12
- package/dist/unstable/ai/Model.d.ts.map +1 -1
- package/dist/unstable/ai/Model.js +9 -7
- package/dist/unstable/ai/Model.js.map +1 -1
- package/dist/unstable/ai/OpenAiStructuredOutput.d.ts +1 -1
- package/dist/unstable/ai/OpenAiStructuredOutput.js +2 -2
- package/dist/unstable/ai/Prompt.d.ts +200 -176
- package/dist/unstable/ai/Prompt.d.ts.map +1 -1
- package/dist/unstable/ai/Prompt.js +77 -68
- package/dist/unstable/ai/Prompt.js.map +1 -1
- package/dist/unstable/ai/Response.d.ts +173 -160
- package/dist/unstable/ai/Response.d.ts.map +1 -1
- package/dist/unstable/ai/Response.js +43 -48
- package/dist/unstable/ai/Response.js.map +1 -1
- package/dist/unstable/ai/ResponseIdTracker.d.ts +43 -4
- package/dist/unstable/ai/ResponseIdTracker.d.ts.map +1 -1
- package/dist/unstable/ai/ResponseIdTracker.js +27 -2
- package/dist/unstable/ai/ResponseIdTracker.js.map +1 -1
- package/dist/unstable/ai/Telemetry.d.ts +43 -33
- package/dist/unstable/ai/Telemetry.d.ts.map +1 -1
- package/dist/unstable/ai/Telemetry.js +15 -11
- package/dist/unstable/ai/Telemetry.js.map +1 -1
- package/dist/unstable/ai/Tokenizer.d.ts +14 -9
- package/dist/unstable/ai/Tokenizer.d.ts.map +1 -1
- package/dist/unstable/ai/Tokenizer.js +10 -6
- package/dist/unstable/ai/Tokenizer.js.map +1 -1
- package/dist/unstable/ai/Tool.d.ts +167 -96
- package/dist/unstable/ai/Tool.d.ts.map +1 -1
- package/dist/unstable/ai/Tool.js +107 -53
- package/dist/unstable/ai/Tool.js.map +1 -1
- package/dist/unstable/ai/Toolkit.d.ts +32 -39
- package/dist/unstable/ai/Toolkit.d.ts.map +1 -1
- package/dist/unstable/ai/Toolkit.js +7 -5
- package/dist/unstable/ai/Toolkit.js.map +1 -1
- package/dist/unstable/ai/index.d.ts +121 -29
- package/dist/unstable/ai/index.d.ts.map +1 -1
- package/dist/unstable/ai/index.js +121 -29
- package/dist/unstable/ai/index.js.map +1 -1
- package/dist/unstable/cli/Argument.d.ts +226 -134
- package/dist/unstable/cli/Argument.d.ts.map +1 -1
- package/dist/unstable/cli/Argument.js +101 -65
- package/dist/unstable/cli/Argument.js.map +1 -1
- package/dist/unstable/cli/CliError.d.ts +72 -26
- package/dist/unstable/cli/CliError.d.ts.map +1 -1
- package/dist/unstable/cli/CliError.js +86 -23
- package/dist/unstable/cli/CliError.js.map +1 -1
- package/dist/unstable/cli/CliOutput.d.ts +48 -19
- package/dist/unstable/cli/CliOutput.d.ts.map +1 -1
- package/dist/unstable/cli/CliOutput.js +32 -9
- package/dist/unstable/cli/CliOutput.js.map +1 -1
- package/dist/unstable/cli/Command.d.ts +196 -115
- package/dist/unstable/cli/Command.d.ts.map +1 -1
- package/dist/unstable/cli/Command.js +45 -31
- package/dist/unstable/cli/Command.js.map +1 -1
- package/dist/unstable/cli/Completions.d.ts +7 -7
- package/dist/unstable/cli/Completions.js +1 -1
- package/dist/unstable/cli/Flag.d.ts +235 -142
- package/dist/unstable/cli/Flag.d.ts.map +1 -1
- package/dist/unstable/cli/Flag.js +111 -71
- package/dist/unstable/cli/Flag.js.map +1 -1
- package/dist/unstable/cli/GlobalFlag.d.ts +41 -13
- package/dist/unstable/cli/GlobalFlag.d.ts.map +1 -1
- package/dist/unstable/cli/GlobalFlag.js +30 -7
- package/dist/unstable/cli/GlobalFlag.js.map +1 -1
- package/dist/unstable/cli/HelpDoc.d.ts +39 -14
- package/dist/unstable/cli/HelpDoc.d.ts.map +1 -1
- package/dist/unstable/cli/HelpDoc.js +21 -0
- package/dist/unstable/cli/Param.d.ts +110 -32
- package/dist/unstable/cli/Param.d.ts.map +1 -1
- package/dist/unstable/cli/Param.js +196 -135
- package/dist/unstable/cli/Param.js.map +1 -1
- package/dist/unstable/cli/Primitive.d.ts +79 -42
- package/dist/unstable/cli/Primitive.d.ts.map +1 -1
- package/dist/unstable/cli/Primitive.js +66 -35
- package/dist/unstable/cli/Primitive.js.map +1 -1
- package/dist/unstable/cli/Prompt.d.ts +183 -59
- package/dist/unstable/cli/Prompt.d.ts.map +1 -1
- package/dist/unstable/cli/Prompt.js +105 -23
- package/dist/unstable/cli/Prompt.js.map +1 -1
- package/dist/unstable/cli/index.d.ts +182 -0
- package/dist/unstable/cli/index.d.ts.map +1 -1
- package/dist/unstable/cli/index.js +205 -6
- package/dist/unstable/cli/index.js.map +1 -1
- package/dist/unstable/cli/internal/ansi.d.ts.map +1 -1
- package/dist/unstable/cli/internal/ansi.js +13 -0
- package/dist/unstable/cli/internal/ansi.js.map +1 -1
- package/dist/unstable/cli/internal/command.d.ts +5 -1
- package/dist/unstable/cli/internal/command.d.ts.map +1 -1
- package/dist/unstable/cli/internal/command.js +5 -1
- package/dist/unstable/cli/internal/command.js.map +1 -1
- package/dist/unstable/cli/internal/config.d.ts +3 -0
- package/dist/unstable/cli/internal/config.d.ts.map +1 -1
- package/dist/unstable/cli/internal/config.js.map +1 -1
- package/dist/unstable/cli/internal/lexer.js.map +1 -1
- package/dist/unstable/cli/internal/parser.js +0 -1
- package/dist/unstable/cli/internal/parser.js.map +1 -1
- package/dist/unstable/cluster/ClusterCron.d.ts +35 -1
- package/dist/unstable/cluster/ClusterCron.d.ts.map +1 -1
- package/dist/unstable/cluster/ClusterCron.js +35 -1
- package/dist/unstable/cluster/ClusterCron.js.map +1 -1
- package/dist/unstable/cluster/ClusterError.d.ts +56 -7
- package/dist/unstable/cluster/ClusterError.d.ts.map +1 -1
- package/dist/unstable/cluster/ClusterError.js +56 -7
- package/dist/unstable/cluster/ClusterError.js.map +1 -1
- package/dist/unstable/cluster/ClusterMetrics.d.ts +39 -5
- package/dist/unstable/cluster/ClusterMetrics.d.ts.map +1 -1
- package/dist/unstable/cluster/ClusterMetrics.js +39 -5
- package/dist/unstable/cluster/ClusterMetrics.js.map +1 -1
- package/dist/unstable/cluster/ClusterSchema.d.ts +61 -8
- package/dist/unstable/cluster/ClusterSchema.d.ts.map +1 -1
- package/dist/unstable/cluster/ClusterSchema.js +61 -8
- package/dist/unstable/cluster/ClusterSchema.js.map +1 -1
- package/dist/unstable/cluster/ClusterWorkflowEngine.d.ts +14 -2
- package/dist/unstable/cluster/ClusterWorkflowEngine.d.ts.map +1 -1
- package/dist/unstable/cluster/ClusterWorkflowEngine.js +35 -2
- package/dist/unstable/cluster/ClusterWorkflowEngine.js.map +1 -1
- package/dist/unstable/cluster/DeliverAt.d.ts +39 -4
- package/dist/unstable/cluster/DeliverAt.d.ts.map +1 -1
- package/dist/unstable/cluster/DeliverAt.js +11 -3
- package/dist/unstable/cluster/DeliverAt.js.map +1 -1
- package/dist/unstable/cluster/Entity.d.ts +74 -16
- package/dist/unstable/cluster/Entity.d.ts.map +1 -1
- package/dist/unstable/cluster/Entity.js +75 -10
- package/dist/unstable/cluster/Entity.js.map +1 -1
- package/dist/unstable/cluster/EntityAddress.d.ts +30 -2
- package/dist/unstable/cluster/EntityAddress.d.ts.map +1 -1
- package/dist/unstable/cluster/EntityAddress.js +30 -2
- package/dist/unstable/cluster/EntityAddress.js.map +1 -1
- package/dist/unstable/cluster/EntityId.d.ts +18 -3
- package/dist/unstable/cluster/EntityId.d.ts.map +1 -1
- package/dist/unstable/cluster/EntityId.js +15 -2
- package/dist/unstable/cluster/EntityId.js.map +1 -1
- package/dist/unstable/cluster/EntityProxy.d.ts +42 -14
- package/dist/unstable/cluster/EntityProxy.d.ts.map +1 -1
- package/dist/unstable/cluster/EntityProxy.js +30 -14
- package/dist/unstable/cluster/EntityProxy.js.map +1 -1
- package/dist/unstable/cluster/EntityProxyServer.d.ts +18 -2
- package/dist/unstable/cluster/EntityProxyServer.d.ts.map +1 -1
- package/dist/unstable/cluster/EntityProxyServer.js +40 -8
- package/dist/unstable/cluster/EntityProxyServer.js.map +1 -1
- package/dist/unstable/cluster/EntityResource.d.ts +43 -6
- package/dist/unstable/cluster/EntityResource.d.ts.map +1 -1
- package/dist/unstable/cluster/EntityResource.js +11 -4
- package/dist/unstable/cluster/EntityResource.js.map +1 -1
- package/dist/unstable/cluster/EntityType.d.ts +27 -3
- package/dist/unstable/cluster/EntityType.d.ts.map +1 -1
- package/dist/unstable/cluster/EntityType.js +24 -2
- package/dist/unstable/cluster/EntityType.js.map +1 -1
- package/dist/unstable/cluster/Envelope.d.ts +105 -23
- package/dist/unstable/cluster/Envelope.d.ts.map +1 -1
- package/dist/unstable/cluster/Envelope.js +88 -14
- package/dist/unstable/cluster/Envelope.js.map +1 -1
- package/dist/unstable/cluster/HttpRunner.d.ts +88 -13
- package/dist/unstable/cluster/HttpRunner.d.ts.map +1 -1
- package/dist/unstable/cluster/HttpRunner.js +88 -13
- package/dist/unstable/cluster/HttpRunner.js.map +1 -1
- package/dist/unstable/cluster/K8sHttpClient.d.ts +49 -6
- package/dist/unstable/cluster/K8sHttpClient.d.ts.map +1 -1
- package/dist/unstable/cluster/K8sHttpClient.js +31 -6
- package/dist/unstable/cluster/K8sHttpClient.js.map +1 -1
- package/dist/unstable/cluster/MachineId.d.ts +24 -3
- package/dist/unstable/cluster/MachineId.d.ts.map +1 -1
- package/dist/unstable/cluster/MachineId.js +21 -2
- package/dist/unstable/cluster/MachineId.js.map +1 -1
- package/dist/unstable/cluster/Message.d.ts +102 -13
- package/dist/unstable/cluster/Message.d.ts.map +1 -1
- package/dist/unstable/cluster/Message.js +86 -10
- package/dist/unstable/cluster/Message.js.map +1 -1
- package/dist/unstable/cluster/MessageStorage.d.ts +126 -21
- package/dist/unstable/cluster/MessageStorage.d.ts.map +1 -1
- package/dist/unstable/cluster/MessageStorage.js +70 -10
- package/dist/unstable/cluster/MessageStorage.js.map +1 -1
- package/dist/unstable/cluster/Reply.d.ts +101 -12
- package/dist/unstable/cluster/Reply.d.ts.map +1 -1
- package/dist/unstable/cluster/Reply.js +64 -8
- package/dist/unstable/cluster/Reply.js.map +1 -1
- package/dist/unstable/cluster/Runner.d.ts +47 -17
- package/dist/unstable/cluster/Runner.d.ts.map +1 -1
- package/dist/unstable/cluster/Runner.js +47 -17
- package/dist/unstable/cluster/Runner.js.map +1 -1
- package/dist/unstable/cluster/RunnerAddress.d.ts +34 -2
- package/dist/unstable/cluster/RunnerAddress.d.ts.map +1 -1
- package/dist/unstable/cluster/RunnerAddress.js +34 -2
- package/dist/unstable/cluster/RunnerAddress.js.map +1 -1
- package/dist/unstable/cluster/RunnerHealth.d.ts +40 -12
- package/dist/unstable/cluster/RunnerHealth.d.ts.map +1 -1
- package/dist/unstable/cluster/RunnerHealth.js +40 -12
- package/dist/unstable/cluster/RunnerHealth.js.map +1 -1
- package/dist/unstable/cluster/RunnerServer.d.ts +7 -4
- package/dist/unstable/cluster/RunnerServer.d.ts.map +1 -1
- package/dist/unstable/cluster/RunnerServer.js +31 -4
- package/dist/unstable/cluster/RunnerServer.js.map +1 -1
- package/dist/unstable/cluster/RunnerStorage.d.ts +42 -5
- package/dist/unstable/cluster/RunnerStorage.d.ts.map +1 -1
- package/dist/unstable/cluster/RunnerStorage.js +38 -4
- package/dist/unstable/cluster/RunnerStorage.js.map +1 -1
- package/dist/unstable/cluster/Runners.d.ts +76 -13
- package/dist/unstable/cluster/Runners.d.ts.map +1 -1
- package/dist/unstable/cluster/Runners.js +73 -12
- package/dist/unstable/cluster/Runners.js.map +1 -1
- package/dist/unstable/cluster/ShardId.d.ts +53 -5
- package/dist/unstable/cluster/ShardId.d.ts.map +1 -1
- package/dist/unstable/cluster/ShardId.js +49 -4
- package/dist/unstable/cluster/ShardId.js.map +1 -1
- package/dist/unstable/cluster/Sharding.d.ts +10 -2
- package/dist/unstable/cluster/Sharding.d.ts.map +1 -1
- package/dist/unstable/cluster/Sharding.js +35 -4
- package/dist/unstable/cluster/Sharding.js.map +1 -1
- package/dist/unstable/cluster/ShardingConfig.d.ts +65 -9
- package/dist/unstable/cluster/ShardingConfig.d.ts.map +1 -1
- package/dist/unstable/cluster/ShardingConfig.js +66 -9
- package/dist/unstable/cluster/ShardingConfig.js.map +1 -1
- package/dist/unstable/cluster/ShardingRegistrationEvent.d.ts +27 -6
- package/dist/unstable/cluster/ShardingRegistrationEvent.d.ts.map +1 -1
- package/dist/unstable/cluster/ShardingRegistrationEvent.js +28 -4
- package/dist/unstable/cluster/ShardingRegistrationEvent.js.map +1 -1
- package/dist/unstable/cluster/SingleRunner.d.ts +23 -1
- package/dist/unstable/cluster/SingleRunner.d.ts.map +1 -1
- package/dist/unstable/cluster/SingleRunner.js +23 -1
- package/dist/unstable/cluster/SingleRunner.js.map +1 -1
- package/dist/unstable/cluster/Singleton.d.ts +15 -1
- package/dist/unstable/cluster/Singleton.d.ts.map +1 -1
- package/dist/unstable/cluster/Singleton.js +15 -1
- package/dist/unstable/cluster/Singleton.js.map +1 -1
- package/dist/unstable/cluster/SingletonAddress.d.ts +21 -1
- package/dist/unstable/cluster/SingletonAddress.d.ts.map +1 -1
- package/dist/unstable/cluster/SingletonAddress.js +21 -1
- package/dist/unstable/cluster/SingletonAddress.js.map +1 -1
- package/dist/unstable/cluster/Snowflake.d.ts +90 -19
- package/dist/unstable/cluster/Snowflake.d.ts.map +1 -1
- package/dist/unstable/cluster/Snowflake.js +49 -13
- package/dist/unstable/cluster/Snowflake.js.map +1 -1
- package/dist/unstable/cluster/SocketRunner.d.ts +8 -2
- package/dist/unstable/cluster/SocketRunner.d.ts.map +1 -1
- package/dist/unstable/cluster/SocketRunner.js +29 -2
- package/dist/unstable/cluster/SocketRunner.js.map +1 -1
- package/dist/unstable/cluster/SqlMessageStorage.d.ts +11 -3
- package/dist/unstable/cluster/SqlMessageStorage.d.ts.map +1 -1
- package/dist/unstable/cluster/SqlMessageStorage.js +27 -3
- package/dist/unstable/cluster/SqlMessageStorage.js.map +1 -1
- package/dist/unstable/cluster/SqlRunnerStorage.d.ts +11 -3
- package/dist/unstable/cluster/SqlRunnerStorage.d.ts.map +1 -1
- package/dist/unstable/cluster/SqlRunnerStorage.js +46 -7
- package/dist/unstable/cluster/SqlRunnerStorage.js.map +1 -1
- package/dist/unstable/cluster/TestRunner.d.ts +18 -1
- package/dist/unstable/cluster/TestRunner.d.ts.map +1 -1
- package/dist/unstable/cluster/TestRunner.js +18 -1
- package/dist/unstable/cluster/TestRunner.js.map +1 -1
- package/dist/unstable/cluster/index.d.ts +790 -0
- package/dist/unstable/cluster/index.d.ts.map +1 -1
- package/dist/unstable/cluster/index.js +790 -0
- package/dist/unstable/cluster/index.js.map +1 -1
- package/dist/unstable/cluster/internal/hash.js +12 -0
- package/dist/unstable/cluster/internal/hash.js.map +1 -1
- package/dist/unstable/devtools/DevTools.d.ts +26 -3
- package/dist/unstable/devtools/DevTools.d.ts.map +1 -1
- package/dist/unstable/devtools/DevTools.js +26 -3
- package/dist/unstable/devtools/DevTools.js.map +1 -1
- package/dist/unstable/devtools/DevToolsClient.d.ts +20 -5
- package/dist/unstable/devtools/DevToolsClient.d.ts.map +1 -1
- package/dist/unstable/devtools/DevToolsClient.js +32 -5
- package/dist/unstable/devtools/DevToolsClient.js.map +1 -1
- package/dist/unstable/devtools/DevToolsSchema.d.ts +184 -44
- package/dist/unstable/devtools/DevToolsSchema.d.ts.map +1 -1
- package/dist/unstable/devtools/DevToolsSchema.js +102 -20
- package/dist/unstable/devtools/DevToolsSchema.js.map +1 -1
- package/dist/unstable/devtools/DevToolsServer.d.ts +27 -2
- package/dist/unstable/devtools/DevToolsServer.d.ts.map +1 -1
- package/dist/unstable/devtools/DevToolsServer.js +21 -1
- package/dist/unstable/devtools/DevToolsServer.js.map +1 -1
- package/dist/unstable/devtools/index.d.ts +58 -0
- package/dist/unstable/devtools/index.d.ts.map +1 -1
- package/dist/unstable/devtools/index.js +58 -0
- package/dist/unstable/devtools/index.js.map +1 -1
- package/dist/unstable/encoding/Msgpack.d.ts +81 -12
- package/dist/unstable/encoding/Msgpack.d.ts.map +1 -1
- package/dist/unstable/encoding/Msgpack.js +75 -9
- package/dist/unstable/encoding/Msgpack.js.map +1 -1
- package/dist/unstable/encoding/Ndjson.d.ts +149 -21
- package/dist/unstable/encoding/Ndjson.d.ts.map +1 -1
- package/dist/unstable/encoding/Ndjson.js +97 -13
- package/dist/unstable/encoding/Ndjson.js.map +1 -1
- package/dist/unstable/encoding/Sse.d.ts +109 -18
- package/dist/unstable/encoding/Sse.d.ts.map +1 -1
- package/dist/unstable/encoding/Sse.js +69 -13
- package/dist/unstable/encoding/Sse.js.map +1 -1
- package/dist/unstable/encoding/index.d.ts +49 -0
- package/dist/unstable/encoding/index.d.ts.map +1 -1
- package/dist/unstable/encoding/index.js +49 -0
- package/dist/unstable/encoding/index.js.map +1 -1
- package/dist/unstable/eventlog/Event.d.ts +115 -30
- package/dist/unstable/eventlog/Event.d.ts.map +1 -1
- package/dist/unstable/eventlog/Event.js +22 -2
- package/dist/unstable/eventlog/Event.js.map +1 -1
- package/dist/unstable/eventlog/EventGroup.d.ts +50 -17
- package/dist/unstable/eventlog/EventGroup.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventGroup.js +24 -6
- package/dist/unstable/eventlog/EventGroup.js.map +1 -1
- package/dist/unstable/eventlog/EventJournal.d.ts +104 -20
- package/dist/unstable/eventlog/EventJournal.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventJournal.js +108 -16
- package/dist/unstable/eventlog/EventJournal.js.map +1 -1
- package/dist/unstable/eventlog/EventLog.d.ts +150 -31
- package/dist/unstable/eventlog/EventLog.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLog.js +111 -20
- package/dist/unstable/eventlog/EventLog.js.map +1 -1
- package/dist/unstable/eventlog/EventLogEncryption.d.ts +42 -6
- package/dist/unstable/eventlog/EventLogEncryption.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogEncryption.js +38 -5
- package/dist/unstable/eventlog/EventLogEncryption.js.map +1 -1
- package/dist/unstable/eventlog/EventLogMessage.d.ts +92 -18
- package/dist/unstable/eventlog/EventLogMessage.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogMessage.js +72 -16
- package/dist/unstable/eventlog/EventLogMessage.js.map +1 -1
- package/dist/unstable/eventlog/EventLogRemote.d.ts +35 -8
- package/dist/unstable/eventlog/EventLogRemote.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogRemote.js +54 -8
- package/dist/unstable/eventlog/EventLogRemote.js.map +1 -1
- package/dist/unstable/eventlog/EventLogServer.d.ts +17 -3
- package/dist/unstable/eventlog/EventLogServer.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogServer.js +17 -3
- package/dist/unstable/eventlog/EventLogServer.js.map +1 -1
- package/dist/unstable/eventlog/EventLogServerEncrypted.d.ts +32 -6
- package/dist/unstable/eventlog/EventLogServerEncrypted.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogServerEncrypted.js +52 -6
- package/dist/unstable/eventlog/EventLogServerEncrypted.js.map +1 -1
- package/dist/unstable/eventlog/EventLogServerUnencrypted.d.ts +74 -16
- package/dist/unstable/eventlog/EventLogServerUnencrypted.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogServerUnencrypted.js +90 -16
- package/dist/unstable/eventlog/EventLogServerUnencrypted.js.map +1 -1
- package/dist/unstable/eventlog/EventLogSessionAuth.d.ts +59 -15
- package/dist/unstable/eventlog/EventLogSessionAuth.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogSessionAuth.js +73 -14
- package/dist/unstable/eventlog/EventLogSessionAuth.js.map +1 -1
- package/dist/unstable/eventlog/SqlEventJournal.d.ts +10 -2
- package/dist/unstable/eventlog/SqlEventJournal.d.ts.map +1 -1
- package/dist/unstable/eventlog/SqlEventJournal.js +28 -2
- package/dist/unstable/eventlog/SqlEventJournal.js.map +1 -1
- package/dist/unstable/eventlog/SqlEventLogServerEncrypted.d.ts +32 -3
- package/dist/unstable/eventlog/SqlEventLogServerEncrypted.d.ts.map +1 -1
- package/dist/unstable/eventlog/SqlEventLogServerEncrypted.js +32 -3
- package/dist/unstable/eventlog/SqlEventLogServerEncrypted.js.map +1 -1
- package/dist/unstable/eventlog/SqlEventLogServerUnencrypted.d.ts +10 -2
- package/dist/unstable/eventlog/SqlEventLogServerUnencrypted.d.ts.map +1 -1
- package/dist/unstable/eventlog/SqlEventLogServerUnencrypted.js +28 -2
- package/dist/unstable/eventlog/SqlEventLogServerUnencrypted.js.map +1 -1
- package/dist/unstable/eventlog/index.d.ts +240 -0
- package/dist/unstable/eventlog/index.d.ts.map +1 -1
- package/dist/unstable/eventlog/index.js +240 -0
- package/dist/unstable/eventlog/index.js.map +1 -1
- package/dist/unstable/http/Cookies.d.ts +156 -77
- package/dist/unstable/http/Cookies.d.ts.map +1 -1
- package/dist/unstable/http/Cookies.js +93 -39
- package/dist/unstable/http/Cookies.js.map +1 -1
- package/dist/unstable/http/Etag.d.ts +40 -7
- package/dist/unstable/http/Etag.d.ts.map +1 -1
- package/dist/unstable/http/Etag.js +27 -4
- package/dist/unstable/http/Etag.js.map +1 -1
- package/dist/unstable/http/FetchHttpClient.d.ts +29 -3
- package/dist/unstable/http/FetchHttpClient.d.ts.map +1 -1
- package/dist/unstable/http/FetchHttpClient.js +33 -4
- package/dist/unstable/http/FetchHttpClient.js.map +1 -1
- package/dist/unstable/http/FindMyWay.d.ts +1 -1
- package/dist/unstable/http/FindMyWay.js +1 -1
- package/dist/unstable/http/Headers.d.ts +182 -36
- package/dist/unstable/http/Headers.d.ts.map +1 -1
- package/dist/unstable/http/Headers.js +86 -16
- package/dist/unstable/http/Headers.js.map +1 -1
- package/dist/unstable/http/HttpBody.d.ts +114 -26
- package/dist/unstable/http/HttpBody.d.ts.map +1 -1
- package/dist/unstable/http/HttpBody.js +98 -20
- package/dist/unstable/http/HttpBody.js.map +1 -1
- package/dist/unstable/http/HttpClient.d.ts +204 -96
- package/dist/unstable/http/HttpClient.d.ts.map +1 -1
- package/dist/unstable/http/HttpClient.js +85 -38
- package/dist/unstable/http/HttpClient.js.map +1 -1
- package/dist/unstable/http/HttpClientError.d.ts +68 -12
- package/dist/unstable/http/HttpClientError.d.ts.map +1 -1
- package/dist/unstable/http/HttpClientError.js +71 -9
- package/dist/unstable/http/HttpClientError.js.map +1 -1
- package/dist/unstable/http/HttpClientRequest.d.ts +318 -100
- package/dist/unstable/http/HttpClientRequest.d.ts.map +1 -1
- package/dist/unstable/http/HttpClientRequest.js +151 -45
- package/dist/unstable/http/HttpClientRequest.js.map +1 -1
- package/dist/unstable/http/HttpClientResponse.d.ts +59 -16
- package/dist/unstable/http/HttpClientResponse.d.ts.map +1 -1
- package/dist/unstable/http/HttpClientResponse.js +44 -11
- package/dist/unstable/http/HttpClientResponse.js.map +1 -1
- package/dist/unstable/http/HttpEffect.d.ts +42 -16
- package/dist/unstable/http/HttpEffect.d.ts.map +1 -1
- package/dist/unstable/http/HttpEffect.js +33 -13
- package/dist/unstable/http/HttpEffect.js.map +1 -1
- package/dist/unstable/http/HttpIncomingMessage.d.ts +48 -7
- package/dist/unstable/http/HttpIncomingMessage.d.ts.map +1 -1
- package/dist/unstable/http/HttpIncomingMessage.js +45 -6
- package/dist/unstable/http/HttpIncomingMessage.js.map +1 -1
- package/dist/unstable/http/HttpMethod.d.ts +38 -6
- package/dist/unstable/http/HttpMethod.d.ts.map +1 -1
- package/dist/unstable/http/HttpMethod.js +27 -2
- package/dist/unstable/http/HttpMethod.js.map +1 -1
- package/dist/unstable/http/HttpMiddleware.d.ts +38 -11
- package/dist/unstable/http/HttpMiddleware.d.ts.map +1 -1
- package/dist/unstable/http/HttpMiddleware.js +52 -10
- package/dist/unstable/http/HttpMiddleware.js.map +1 -1
- package/dist/unstable/http/HttpPlatform.d.ts +34 -3
- package/dist/unstable/http/HttpPlatform.d.ts.map +1 -1
- package/dist/unstable/http/HttpPlatform.js +34 -3
- package/dist/unstable/http/HttpPlatform.js.map +1 -1
- package/dist/unstable/http/HttpRouter.d.ts +209 -62
- package/dist/unstable/http/HttpRouter.d.ts.map +1 -1
- package/dist/unstable/http/HttpRouter.js +136 -41
- package/dist/unstable/http/HttpRouter.js.map +1 -1
- package/dist/unstable/http/HttpServer.d.ts +151 -22
- package/dist/unstable/http/HttpServer.d.ts.map +1 -1
- package/dist/unstable/http/HttpServer.js +76 -11
- package/dist/unstable/http/HttpServer.js.map +1 -1
- package/dist/unstable/http/HttpServerError.d.ts +93 -10
- package/dist/unstable/http/HttpServerError.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerError.js +85 -8
- package/dist/unstable/http/HttpServerError.js.map +1 -1
- package/dist/unstable/http/HttpServerRequest.d.ts +125 -21
- package/dist/unstable/http/HttpServerRequest.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerRequest.js +101 -20
- package/dist/unstable/http/HttpServerRequest.js.map +1 -1
- package/dist/unstable/http/HttpServerRespondable.d.ts +32 -6
- package/dist/unstable/http/HttpServerRespondable.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerRespondable.js +43 -5
- package/dist/unstable/http/HttpServerRespondable.js.map +1 -1
- package/dist/unstable/http/HttpServerResponse.d.ts +391 -67
- package/dist/unstable/http/HttpServerResponse.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerResponse.js +205 -33
- package/dist/unstable/http/HttpServerResponse.js.map +1 -1
- package/dist/unstable/http/HttpStaticServer.d.ts +24 -8
- package/dist/unstable/http/HttpStaticServer.d.ts.map +1 -1
- package/dist/unstable/http/HttpStaticServer.js +24 -8
- package/dist/unstable/http/HttpStaticServer.js.map +1 -1
- package/dist/unstable/http/HttpTraceContext.d.ts +53 -6
- package/dist/unstable/http/HttpTraceContext.d.ts.map +1 -1
- package/dist/unstable/http/HttpTraceContext.js +47 -5
- package/dist/unstable/http/HttpTraceContext.js.map +1 -1
- package/dist/unstable/http/Multipart.d.ts +179 -28
- package/dist/unstable/http/Multipart.d.ts.map +1 -1
- package/dist/unstable/http/Multipart.js +131 -19
- package/dist/unstable/http/Multipart.js.map +1 -1
- package/dist/unstable/http/Multipasta/HeadersParser.d.ts +1 -1
- package/dist/unstable/http/Multipasta/HeadersParser.js +1 -1
- package/dist/unstable/http/Multipasta/Node.d.ts +1 -1
- package/dist/unstable/http/Multipasta/Node.js +1 -1
- package/dist/unstable/http/Multipasta/Search.d.ts +1 -1
- package/dist/unstable/http/Multipasta/Search.js +1 -1
- package/dist/unstable/http/Multipasta/Web.d.ts +1 -1
- package/dist/unstable/http/Multipasta/Web.js +1 -1
- package/dist/unstable/http/Multipasta.d.ts +1 -1
- package/dist/unstable/http/Multipasta.js +1 -1
- package/dist/unstable/http/Template.d.ts +53 -1
- package/dist/unstable/http/Template.d.ts.map +1 -1
- package/dist/unstable/http/Template.js +26 -0
- package/dist/unstable/http/Template.js.map +1 -1
- package/dist/unstable/http/Url.d.ts +70 -56
- package/dist/unstable/http/Url.d.ts.map +1 -1
- package/dist/unstable/http/Url.js +35 -21
- package/dist/unstable/http/Url.js.map +1 -1
- package/dist/unstable/http/UrlParams.d.ts +237 -51
- package/dist/unstable/http/UrlParams.d.ts.map +1 -1
- package/dist/unstable/http/UrlParams.js +120 -25
- package/dist/unstable/http/UrlParams.js.map +1 -1
- package/dist/unstable/http/index.d.ts +452 -0
- package/dist/unstable/http/index.d.ts.map +1 -1
- package/dist/unstable/http/index.js +452 -0
- package/dist/unstable/http/index.js.map +1 -1
- package/dist/unstable/httpapi/HttpApi.d.ts +49 -14
- package/dist/unstable/httpapi/HttpApi.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApi.js +14 -8
- package/dist/unstable/httpapi/HttpApi.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiBuilder.d.ts +54 -16
- package/dist/unstable/httpapi/HttpApiBuilder.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiBuilder.js +44 -6
- package/dist/unstable/httpapi/HttpApiBuilder.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiClient.d.ts +57 -15
- package/dist/unstable/httpapi/HttpApiClient.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiClient.js +42 -6
- package/dist/unstable/httpapi/HttpApiClient.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiEndpoint.d.ts +214 -59
- package/dist/unstable/httpapi/HttpApiEndpoint.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiEndpoint.js +53 -9
- package/dist/unstable/httpapi/HttpApiEndpoint.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiError.d.ts +81 -1
- package/dist/unstable/httpapi/HttpApiError.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiError.js +98 -1
- package/dist/unstable/httpapi/HttpApiError.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiGroup.d.ts +87 -20
- package/dist/unstable/httpapi/HttpApiGroup.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiGroup.js +5 -2
- package/dist/unstable/httpapi/HttpApiGroup.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiMiddleware.d.ts +113 -22
- package/dist/unstable/httpapi/HttpApiMiddleware.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiMiddleware.js +49 -5
- package/dist/unstable/httpapi/HttpApiMiddleware.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiScalar.d.ts +19 -4
- package/dist/unstable/httpapi/HttpApiScalar.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiScalar.js +32 -2
- package/dist/unstable/httpapi/HttpApiScalar.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiSchema.d.ts +86 -38
- package/dist/unstable/httpapi/HttpApiSchema.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiSchema.js +59 -35
- package/dist/unstable/httpapi/HttpApiSchema.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiSecurity.d.ts +73 -17
- package/dist/unstable/httpapi/HttpApiSecurity.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiSecurity.js +38 -5
- package/dist/unstable/httpapi/HttpApiSecurity.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiSwagger.d.ts +4 -3
- package/dist/unstable/httpapi/HttpApiSwagger.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiSwagger.js +23 -3
- package/dist/unstable/httpapi/HttpApiSwagger.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiTest.d.ts +6 -1
- package/dist/unstable/httpapi/HttpApiTest.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiTest.js +26 -1
- package/dist/unstable/httpapi/HttpApiTest.js.map +1 -1
- package/dist/unstable/httpapi/OpenApi.d.ts +86 -15
- package/dist/unstable/httpapi/OpenApi.d.ts.map +1 -1
- package/dist/unstable/httpapi/OpenApi.js +73 -15
- package/dist/unstable/httpapi/OpenApi.js.map +1 -1
- package/dist/unstable/httpapi/index.d.ts +310 -25
- package/dist/unstable/httpapi/index.d.ts.map +1 -1
- package/dist/unstable/httpapi/index.js +310 -25
- package/dist/unstable/httpapi/index.js.map +1 -1
- package/dist/unstable/observability/Otlp.d.ts +33 -3
- package/dist/unstable/observability/Otlp.d.ts.map +1 -1
- package/dist/unstable/observability/Otlp.js +14 -3
- package/dist/unstable/observability/Otlp.js.map +1 -1
- package/dist/unstable/observability/OtlpExporter.d.ts +8 -1
- package/dist/unstable/observability/OtlpExporter.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpExporter.js +32 -1
- package/dist/unstable/observability/OtlpExporter.js.map +1 -1
- package/dist/unstable/observability/OtlpLogger.d.ts +15 -2
- package/dist/unstable/observability/OtlpLogger.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpLogger.js +29 -2
- package/dist/unstable/observability/OtlpLogger.js.map +1 -1
- package/dist/unstable/observability/OtlpMetrics.d.ts +17 -5
- package/dist/unstable/observability/OtlpMetrics.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpMetrics.js +32 -2
- package/dist/unstable/observability/OtlpMetrics.js.map +1 -1
- package/dist/unstable/observability/OtlpResource.d.ts +49 -12
- package/dist/unstable/observability/OtlpResource.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpResource.js +47 -5
- package/dist/unstable/observability/OtlpResource.js.map +1 -1
- package/dist/unstable/observability/OtlpSerialization.d.ts +28 -3
- package/dist/unstable/observability/OtlpSerialization.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpSerialization.js +28 -3
- package/dist/unstable/observability/OtlpSerialization.js.map +1 -1
- package/dist/unstable/observability/OtlpTracer.d.ts +19 -2
- package/dist/unstable/observability/OtlpTracer.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpTracer.js +32 -2
- package/dist/unstable/observability/OtlpTracer.js.map +1 -1
- package/dist/unstable/observability/PrometheusMetrics.d.ts +36 -16
- package/dist/unstable/observability/PrometheusMetrics.d.ts.map +1 -1
- package/dist/unstable/observability/PrometheusMetrics.js +9 -7
- package/dist/unstable/observability/PrometheusMetrics.js.map +1 -1
- package/dist/unstable/observability/index.d.ts +160 -3
- package/dist/unstable/observability/index.d.ts.map +1 -1
- package/dist/unstable/observability/index.js +160 -3
- package/dist/unstable/observability/index.js.map +1 -1
- package/dist/unstable/persistence/KeyValueStore.d.ts +93 -18
- package/dist/unstable/persistence/KeyValueStore.d.ts.map +1 -1
- package/dist/unstable/persistence/KeyValueStore.js +81 -21
- package/dist/unstable/persistence/KeyValueStore.js.map +1 -1
- package/dist/unstable/persistence/Persistable.d.ts +76 -15
- package/dist/unstable/persistence/Persistable.d.ts.map +1 -1
- package/dist/unstable/persistence/Persistable.js +22 -5
- package/dist/unstable/persistence/Persistable.js.map +1 -1
- package/dist/unstable/persistence/PersistedCache.d.ts +27 -2
- package/dist/unstable/persistence/PersistedCache.d.ts.map +1 -1
- package/dist/unstable/persistence/PersistedCache.js +24 -1
- package/dist/unstable/persistence/PersistedCache.js.map +1 -1
- package/dist/unstable/persistence/PersistedQueue.d.ts +73 -16
- package/dist/unstable/persistence/PersistedQueue.d.ts.map +1 -1
- package/dist/unstable/persistence/PersistedQueue.js +60 -13
- package/dist/unstable/persistence/PersistedQueue.js.map +1 -1
- package/dist/unstable/persistence/Persistence.d.ts +98 -16
- package/dist/unstable/persistence/Persistence.d.ts.map +1 -1
- package/dist/unstable/persistence/Persistence.js +91 -14
- package/dist/unstable/persistence/Persistence.js.map +1 -1
- package/dist/unstable/persistence/RateLimiter.d.ts +101 -21
- package/dist/unstable/persistence/RateLimiter.d.ts.map +1 -1
- package/dist/unstable/persistence/RateLimiter.js +85 -16
- package/dist/unstable/persistence/RateLimiter.js.map +1 -1
- package/dist/unstable/persistence/Redis.d.ts +26 -5
- package/dist/unstable/persistence/Redis.d.ts.map +1 -1
- package/dist/unstable/persistence/Redis.js +36 -4
- package/dist/unstable/persistence/Redis.js.map +1 -1
- package/dist/unstable/persistence/index.d.ts +147 -0
- package/dist/unstable/persistence/index.d.ts.map +1 -1
- package/dist/unstable/persistence/index.js +147 -0
- package/dist/unstable/persistence/index.js.map +1 -1
- package/dist/unstable/process/ChildProcess.d.ts +87 -64
- package/dist/unstable/process/ChildProcess.d.ts.map +1 -1
- package/dist/unstable/process/ChildProcess.js +25 -18
- package/dist/unstable/process/ChildProcess.js.map +1 -1
- package/dist/unstable/process/ChildProcessSpawner.d.ts +23 -12
- package/dist/unstable/process/ChildProcessSpawner.d.ts.map +1 -1
- package/dist/unstable/process/ChildProcessSpawner.js +11 -6
- package/dist/unstable/process/ChildProcessSpawner.js.map +1 -1
- package/dist/unstable/process/index.d.ts +2 -1
- package/dist/unstable/process/index.d.ts.map +1 -1
- package/dist/unstable/process/index.js +2 -1
- package/dist/unstable/process/index.js.map +1 -1
- package/dist/unstable/reactivity/AsyncResult.d.ts +198 -59
- package/dist/unstable/reactivity/AsyncResult.d.ts.map +1 -1
- package/dist/unstable/reactivity/AsyncResult.js +121 -36
- package/dist/unstable/reactivity/AsyncResult.js.map +1 -1
- package/dist/unstable/reactivity/Atom.d.ts +544 -130
- package/dist/unstable/reactivity/Atom.d.ts.map +1 -1
- package/dist/unstable/reactivity/Atom.js +252 -58
- package/dist/unstable/reactivity/Atom.js.map +1 -1
- package/dist/unstable/reactivity/AtomHttpApi.d.ts +41 -2
- package/dist/unstable/reactivity/AtomHttpApi.d.ts.map +1 -1
- package/dist/unstable/reactivity/AtomHttpApi.js +35 -1
- package/dist/unstable/reactivity/AtomHttpApi.js.map +1 -1
- package/dist/unstable/reactivity/AtomRef.d.ts +51 -7
- package/dist/unstable/reactivity/AtomRef.d.ts.map +1 -1
- package/dist/unstable/reactivity/AtomRef.js +29 -3
- package/dist/unstable/reactivity/AtomRef.js.map +1 -1
- package/dist/unstable/reactivity/AtomRegistry.d.ts +135 -21
- package/dist/unstable/reactivity/AtomRegistry.d.ts.map +1 -1
- package/dist/unstable/reactivity/AtomRegistry.js +69 -10
- package/dist/unstable/reactivity/AtomRegistry.js.map +1 -1
- package/dist/unstable/reactivity/AtomRpc.d.ts +36 -2
- package/dist/unstable/reactivity/AtomRpc.d.ts.map +1 -1
- package/dist/unstable/reactivity/AtomRpc.js +29 -1
- package/dist/unstable/reactivity/AtomRpc.js.map +1 -1
- package/dist/unstable/reactivity/Hydration.d.ts +28 -5
- package/dist/unstable/reactivity/Hydration.d.ts.map +1 -1
- package/dist/unstable/reactivity/Hydration.js +35 -3
- package/dist/unstable/reactivity/Hydration.js.map +1 -1
- package/dist/unstable/reactivity/Reactivity.d.ts +94 -13
- package/dist/unstable/reactivity/Reactivity.d.ts.map +1 -1
- package/dist/unstable/reactivity/Reactivity.js +60 -7
- package/dist/unstable/reactivity/Reactivity.js.map +1 -1
- package/dist/unstable/reactivity/index.d.ts +167 -0
- package/dist/unstable/reactivity/index.d.ts.map +1 -1
- package/dist/unstable/reactivity/index.js +167 -0
- package/dist/unstable/reactivity/index.js.map +1 -1
- package/dist/unstable/rpc/Rpc.d.ts +254 -56
- package/dist/unstable/rpc/Rpc.d.ts.map +1 -1
- package/dist/unstable/rpc/Rpc.js +44 -11
- package/dist/unstable/rpc/Rpc.js.map +1 -1
- package/dist/unstable/rpc/RpcClient.d.ts +80 -19
- package/dist/unstable/rpc/RpcClient.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcClient.js +52 -12
- package/dist/unstable/rpc/RpcClient.js.map +1 -1
- package/dist/unstable/rpc/RpcClientError.d.ts +26 -2
- package/dist/unstable/rpc/RpcClientError.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcClientError.js +26 -2
- package/dist/unstable/rpc/RpcClientError.js.map +1 -1
- package/dist/unstable/rpc/RpcGroup.d.ts +51 -8
- package/dist/unstable/rpc/RpcGroup.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcGroup.js +3 -1
- package/dist/unstable/rpc/RpcGroup.js.map +1 -1
- package/dist/unstable/rpc/RpcMessage.d.ts +128 -32
- package/dist/unstable/rpc/RpcMessage.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcMessage.js +23 -7
- package/dist/unstable/rpc/RpcMessage.js.map +1 -1
- package/dist/unstable/rpc/RpcMiddleware.d.ts +100 -20
- package/dist/unstable/rpc/RpcMiddleware.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcMiddleware.js +39 -3
- package/dist/unstable/rpc/RpcMiddleware.js.map +1 -1
- package/dist/unstable/rpc/RpcSchema.d.ts +38 -4
- package/dist/unstable/rpc/RpcSchema.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcSchema.js +34 -3
- package/dist/unstable/rpc/RpcSchema.js.map +1 -1
- package/dist/unstable/rpc/RpcSerialization.d.ts +60 -13
- package/dist/unstable/rpc/RpcSerialization.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcSerialization.js +56 -12
- package/dist/unstable/rpc/RpcSerialization.js.map +1 -1
- package/dist/unstable/rpc/RpcServer.d.ts +73 -23
- package/dist/unstable/rpc/RpcServer.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcServer.js +69 -22
- package/dist/unstable/rpc/RpcServer.js.map +1 -1
- package/dist/unstable/rpc/RpcTest.d.ts +20 -1
- package/dist/unstable/rpc/RpcTest.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcTest.js +20 -1
- package/dist/unstable/rpc/RpcTest.js.map +1 -1
- package/dist/unstable/rpc/RpcWorker.d.ts +39 -6
- package/dist/unstable/rpc/RpcWorker.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcWorker.js +16 -4
- package/dist/unstable/rpc/RpcWorker.js.map +1 -1
- package/dist/unstable/rpc/Utils.d.ts +10 -0
- package/dist/unstable/rpc/Utils.d.ts.map +1 -1
- package/dist/unstable/rpc/Utils.js +10 -0
- package/dist/unstable/rpc/Utils.js.map +1 -1
- package/dist/unstable/rpc/index.d.ts +272 -0
- package/dist/unstable/rpc/index.d.ts.map +1 -1
- package/dist/unstable/rpc/index.js +272 -0
- package/dist/unstable/rpc/index.js.map +1 -1
- package/dist/unstable/schema/Model.d.ts +192 -59
- package/dist/unstable/schema/Model.d.ts.map +1 -1
- package/dist/unstable/schema/Model.js +122 -38
- package/dist/unstable/schema/Model.js.map +1 -1
- package/dist/unstable/schema/VariantSchema.d.ts +101 -24
- package/dist/unstable/schema/VariantSchema.d.ts.map +1 -1
- package/dist/unstable/schema/VariantSchema.js +22 -6
- package/dist/unstable/schema/VariantSchema.js.map +1 -1
- package/dist/unstable/schema/index.d.ts +37 -0
- package/dist/unstable/schema/index.d.ts.map +1 -1
- package/dist/unstable/schema/index.js +37 -0
- package/dist/unstable/schema/index.js.map +1 -1
- package/dist/unstable/socket/Socket.d.ts +168 -34
- package/dist/unstable/socket/Socket.d.ts.map +1 -1
- package/dist/unstable/socket/Socket.js +124 -28
- package/dist/unstable/socket/Socket.js.map +1 -1
- package/dist/unstable/socket/SocketServer.d.ts +58 -10
- package/dist/unstable/socket/SocketServer.d.ts.map +1 -1
- package/dist/unstable/socket/SocketServer.js +43 -5
- package/dist/unstable/socket/SocketServer.js.map +1 -1
- package/dist/unstable/socket/index.d.ts +44 -0
- package/dist/unstable/socket/index.d.ts.map +1 -1
- package/dist/unstable/socket/index.js +44 -0
- package/dist/unstable/socket/index.js.map +1 -1
- package/dist/unstable/sql/Migrator.d.ts +40 -9
- package/dist/unstable/sql/Migrator.d.ts.map +1 -1
- package/dist/unstable/sql/Migrator.js +45 -5
- package/dist/unstable/sql/Migrator.js.map +1 -1
- package/dist/unstable/sql/SqlClient.d.ts +38 -2
- package/dist/unstable/sql/SqlClient.d.ts.map +1 -1
- package/dist/unstable/sql/SqlClient.js +40 -1
- package/dist/unstable/sql/SqlClient.js.map +1 -1
- package/dist/unstable/sql/SqlConnection.d.ts +34 -3
- package/dist/unstable/sql/SqlConnection.d.ts.map +1 -1
- package/dist/unstable/sql/SqlConnection.js +22 -0
- package/dist/unstable/sql/SqlConnection.js.map +1 -1
- package/dist/unstable/sql/SqlError.d.ts +117 -0
- package/dist/unstable/sql/SqlError.d.ts.map +1 -1
- package/dist/unstable/sql/SqlError.js +131 -0
- package/dist/unstable/sql/SqlError.js.map +1 -1
- package/dist/unstable/sql/SqlModel.d.ts +25 -5
- package/dist/unstable/sql/SqlModel.d.ts.map +1 -1
- package/dist/unstable/sql/SqlModel.js +8 -4
- package/dist/unstable/sql/SqlModel.js.map +1 -1
- package/dist/unstable/sql/SqlResolver.d.ts +56 -13
- package/dist/unstable/sql/SqlResolver.d.ts.map +1 -1
- package/dist/unstable/sql/SqlResolver.js +44 -10
- package/dist/unstable/sql/SqlResolver.js.map +1 -1
- package/dist/unstable/sql/SqlSchema.d.ts +29 -8
- package/dist/unstable/sql/SqlSchema.d.ts.map +1 -1
- package/dist/unstable/sql/SqlSchema.js +29 -8
- package/dist/unstable/sql/SqlSchema.js.map +1 -1
- package/dist/unstable/sql/SqlStream.d.ts +4 -0
- package/dist/unstable/sql/SqlStream.d.ts.map +1 -1
- package/dist/unstable/sql/SqlStream.js +24 -0
- package/dist/unstable/sql/SqlStream.js.map +1 -1
- package/dist/unstable/sql/Statement.d.ts +151 -24
- package/dist/unstable/sql/Statement.d.ts.map +1 -1
- package/dist/unstable/sql/Statement.js +91 -6
- package/dist/unstable/sql/Statement.js.map +1 -1
- package/dist/unstable/sql/index.d.ts +179 -1
- package/dist/unstable/sql/index.d.ts.map +1 -1
- package/dist/unstable/sql/index.js +179 -1
- package/dist/unstable/sql/index.js.map +1 -1
- package/dist/unstable/workers/Transferable.d.ts +72 -20
- package/dist/unstable/workers/Transferable.d.ts.map +1 -1
- package/dist/unstable/workers/Transferable.js +57 -14
- package/dist/unstable/workers/Transferable.js.map +1 -1
- package/dist/unstable/workers/Worker.d.ts +61 -8
- package/dist/unstable/workers/Worker.d.ts.map +1 -1
- package/dist/unstable/workers/Worker.js +44 -4
- package/dist/unstable/workers/Worker.js.map +1 -1
- package/dist/unstable/workers/WorkerError.d.ts +31 -9
- package/dist/unstable/workers/WorkerError.d.ts.map +1 -1
- package/dist/unstable/workers/WorkerError.js +44 -7
- package/dist/unstable/workers/WorkerError.js.map +1 -1
- package/dist/unstable/workers/WorkerRunner.d.ts +32 -3
- package/dist/unstable/workers/WorkerRunner.d.ts.map +1 -1
- package/dist/unstable/workers/WorkerRunner.js +24 -1
- package/dist/unstable/workers/WorkerRunner.js.map +1 -1
- package/dist/unstable/workers/index.d.ts +81 -1
- package/dist/unstable/workers/index.d.ts.map +1 -1
- package/dist/unstable/workers/index.js +81 -1
- package/dist/unstable/workers/index.js.map +1 -1
- package/dist/unstable/workflow/Activity.d.ts +61 -10
- package/dist/unstable/workflow/Activity.d.ts.map +1 -1
- package/dist/unstable/workflow/Activity.js +20 -5
- package/dist/unstable/workflow/Activity.js.map +1 -1
- package/dist/unstable/workflow/DurableClock.d.ts +12 -3
- package/dist/unstable/workflow/DurableClock.d.ts.map +1 -1
- package/dist/unstable/workflow/DurableClock.js +22 -2
- package/dist/unstable/workflow/DurableClock.js.map +1 -1
- package/dist/unstable/workflow/DurableDeferred.d.ts +128 -31
- package/dist/unstable/workflow/DurableDeferred.d.ts.map +1 -1
- package/dist/unstable/workflow/DurableDeferred.js +77 -13
- package/dist/unstable/workflow/DurableDeferred.js.map +1 -1
- package/dist/unstable/workflow/DurableQueue.d.ts +33 -8
- package/dist/unstable/workflow/DurableQueue.d.ts.map +1 -1
- package/dist/unstable/workflow/DurableQueue.js +26 -6
- package/dist/unstable/workflow/DurableQueue.js.map +1 -1
- package/dist/unstable/workflow/Workflow.d.ts +102 -31
- package/dist/unstable/workflow/Workflow.d.ts.map +1 -1
- package/dist/unstable/workflow/Workflow.js +75 -19
- package/dist/unstable/workflow/Workflow.js.map +1 -1
- package/dist/unstable/workflow/WorkflowEngine.d.ts +40 -5
- package/dist/unstable/workflow/WorkflowEngine.d.ts.map +1 -1
- package/dist/unstable/workflow/WorkflowEngine.js +16 -4
- package/dist/unstable/workflow/WorkflowEngine.js.map +1 -1
- package/dist/unstable/workflow/WorkflowProxy.d.ts +40 -12
- package/dist/unstable/workflow/WorkflowProxy.d.ts.map +1 -1
- package/dist/unstable/workflow/WorkflowProxy.js +8 -12
- package/dist/unstable/workflow/WorkflowProxy.js.map +1 -1
- package/dist/unstable/workflow/WorkflowProxyServer.d.ts +37 -2
- package/dist/unstable/workflow/WorkflowProxyServer.d.ts.map +1 -1
- package/dist/unstable/workflow/WorkflowProxyServer.js +12 -6
- package/dist/unstable/workflow/WorkflowProxyServer.js.map +1 -1
- package/dist/unstable/workflow/index.d.ts +160 -0
- package/dist/unstable/workflow/index.d.ts.map +1 -1
- package/dist/unstable/workflow/index.js +160 -0
- package/dist/unstable/workflow/index.js.map +1 -1
- package/package.json +11 -11
- package/src/Array.ts +151 -106
- package/src/BigDecimal.ts +620 -553
- package/src/BigInt.ts +342 -274
- package/src/Boolean.ts +189 -156
- package/src/Brand.ts +30 -5
- package/src/Cache.ts +334 -167
- package/src/Cause.ts +84 -73
- package/src/Channel.ts +1639 -667
- package/src/ChannelSchema.ts +137 -12
- package/src/Chunk.ts +575 -429
- package/src/Clock.ts +16 -9
- package/src/Combiner.ts +11 -5
- package/src/Config.ts +80 -68
- package/src/ConfigProvider.ts +33 -32
- package/src/Console.ts +88 -58
- package/src/Context.ts +401 -190
- package/src/Cron.ts +109 -48
- package/src/Crypto.ts +327 -0
- package/src/Data.ts +9 -3
- package/src/DateTime.ts +893 -464
- package/src/Deferred.ts +367 -175
- package/src/Differ.ts +44 -2
- package/src/Duration.ts +333 -186
- package/src/Effect.ts +2201 -2289
- package/src/Effectable.ts +38 -3
- package/src/Encoding.ts +78 -28
- package/src/Equal.ts +4 -3
- package/src/Equivalence.ts +18 -24
- package/src/ErrorReporter.ts +66 -82
- package/src/ExecutionPlan.ts +106 -12
- package/src/Exit.ts +6 -5
- package/src/Fiber.ts +71 -40
- package/src/FiberHandle.ts +157 -57
- package/src/FiberMap.ts +328 -163
- package/src/FiberSet.ts +130 -52
- package/src/FileSystem.ts +104 -74
- package/src/Filter.ts +166 -88
- package/src/Formatter.ts +4 -70
- package/src/Function.ts +218 -151
- package/src/Graph.ts +714 -415
- package/src/HKT.ts +29 -13
- package/src/Hash.ts +35 -24
- package/src/HashMap.ts +540 -388
- package/src/HashRing.ts +111 -34
- package/src/HashSet.ts +239 -153
- package/src/Inspectable.ts +30 -17
- package/src/Iterable.ts +336 -222
- package/src/JsonPatch.ts +13 -10
- package/src/JsonPointer.ts +13 -11
- package/src/JsonSchema.ts +16 -0
- package/src/Latch.ts +97 -26
- package/src/Layer.ts +547 -445
- package/src/LayerMap.ts +99 -26
- package/src/LogLevel.ts +92 -131
- package/src/Logger.ts +365 -297
- package/src/ManagedRuntime.ts +78 -19
- package/src/Match.ts +135 -161
- package/src/Metric.ts +362 -313
- package/src/MutableHashMap.ts +202 -127
- package/src/MutableHashSet.ts +120 -52
- package/src/MutableList.ts +157 -100
- package/src/MutableRef.ts +129 -90
- package/src/Newtype.ts +15 -2
- package/src/NonEmptyIterable.ts +38 -48
- package/src/Number.ts +261 -205
- package/src/Optic.ts +6 -7
- package/src/Option.ts +133 -156
- package/src/Order.ts +6 -6
- package/src/Ordering.ts +56 -45
- package/src/PartitionedSemaphore.ts +225 -40
- package/src/Path.ts +77 -13
- package/src/Pipeable.ts +82 -24
- package/src/PlatformError.ts +74 -6
- package/src/Pool.ts +94 -31
- package/src/Predicate.ts +17 -24
- package/src/PrimaryKey.ts +11 -3
- package/src/PubSub.ts +385 -309
- package/src/Pull.ts +94 -25
- package/src/Queue.ts +303 -184
- package/src/Random.ts +69 -93
- package/src/RcMap.ts +151 -141
- package/src/RcRef.ts +68 -32
- package/src/Record.ts +282 -137
- package/src/Redactable.ts +7 -5
- package/src/Redacted.ts +63 -34
- package/src/Reducer.ts +3 -1
- package/src/Ref.ts +173 -134
- package/src/References.ts +73 -31
- package/src/RegExp.ts +12 -6
- package/src/Request.ts +159 -34
- package/src/RequestResolver.ts +278 -121
- package/src/Resource.ts +45 -7
- package/src/Result.ts +137 -153
- package/src/Runtime.ts +42 -21
- package/src/Schedule.ts +585 -613
- package/src/Scheduler.ts +44 -7
- package/src/Schema.ts +1309 -615
- package/src/SchemaAST.ts +123 -93
- package/src/SchemaGetter.ts +52 -37
- package/src/SchemaIssue.ts +19 -24
- package/src/SchemaParser.ts +306 -85
- package/src/SchemaRepresentation.ts +89 -77
- package/src/SchemaTransformation.ts +97 -46
- package/src/SchemaUtils.ts +24 -1
- package/src/Scope.ts +107 -65
- package/src/ScopedCache.ts +195 -59
- package/src/ScopedRef.ts +28 -8
- package/src/Semaphore.ts +61 -37
- package/src/Sink.ts +461 -206
- package/src/Stdio.ts +43 -6
- package/src/Stream.ts +2361 -1613
- package/src/String.ts +174 -97
- package/src/Struct.ts +20 -18
- package/src/SubscriptionRef.ts +309 -204
- package/src/Symbol.ts +13 -5
- package/src/SynchronizedRef.ts +278 -62
- package/src/Take.ts +26 -2
- package/src/Terminal.ts +40 -7
- package/src/Tracer.ts +233 -59
- package/src/Trie.ts +280 -245
- package/src/Tuple.ts +34 -32
- package/src/TxChunk.ts +200 -155
- package/src/TxDeferred.ts +43 -29
- package/src/TxHashMap.ts +370 -231
- package/src/TxHashSet.ts +253 -159
- package/src/TxPriorityQueue.ts +97 -65
- package/src/TxPubSub.ts +77 -49
- package/src/TxQueue.ts +277 -242
- package/src/TxReentrantLock.ts +70 -47
- package/src/TxRef.ts +69 -40
- package/src/TxSemaphore.ts +101 -115
- package/src/TxSubscriptionRef.ts +74 -50
- package/src/Types.ts +31 -34
- package/src/UndefinedOr.ts +62 -25
- package/src/Unify.ts +72 -117
- package/src/Utils.ts +5 -2
- package/src/index.ts +1976 -420
- package/src/internal/schema/schema.ts +1 -1
- package/src/testing/FastCheck.ts +9 -6
- package/src/testing/TestClock.ts +63 -35
- package/src/testing/TestConsole.ts +54 -36
- package/src/testing/TestSchema.ts +10 -8
- package/src/testing/index.ts +34 -0
- package/src/unstable/ai/AiError.ts +195 -137
- package/src/unstable/ai/AnthropicStructuredOutput.ts +2 -2
- package/src/unstable/ai/Chat.ts +68 -43
- package/src/unstable/ai/EmbeddingModel.ts +12 -11
- package/src/unstable/ai/IdGenerator.ts +28 -18
- package/src/unstable/ai/LanguageModel.ts +35 -27
- package/src/unstable/ai/McpSchema.ts +342 -119
- package/src/unstable/ai/McpServer.ts +79 -20
- package/src/unstable/ai/Model.ts +10 -12
- package/src/unstable/ai/OpenAiStructuredOutput.ts +2 -2
- package/src/unstable/ai/Prompt.ts +216 -192
- package/src/unstable/ai/Response.ts +179 -167
- package/src/unstable/ai/ResponseIdTracker.ts +43 -4
- package/src/unstable/ai/Telemetry.ts +43 -33
- package/src/unstable/ai/Tokenizer.ts +14 -9
- package/src/unstable/ai/Tool.ts +168 -97
- package/src/unstable/ai/Toolkit.ts +51 -46
- package/src/unstable/ai/index.ts +121 -29
- package/src/unstable/cli/Argument.ts +226 -134
- package/src/unstable/cli/CliError.ts +96 -26
- package/src/unstable/cli/CliOutput.ts +48 -19
- package/src/unstable/cli/Command.ts +196 -115
- package/src/unstable/cli/Completions.ts +7 -7
- package/src/unstable/cli/Flag.ts +235 -142
- package/src/unstable/cli/GlobalFlag.ts +41 -13
- package/src/unstable/cli/HelpDoc.ts +39 -14
- package/src/unstable/cli/Param.ts +395 -260
- package/src/unstable/cli/Primitive.ts +79 -42
- package/src/unstable/cli/Prompt.ts +207 -59
- package/src/unstable/cli/index.ts +205 -6
- package/src/unstable/cli/internal/ansi.ts +13 -0
- package/src/unstable/cli/internal/command.ts +5 -1
- package/src/unstable/cli/internal/config.ts +3 -0
- package/src/unstable/cli/internal/lexer.ts +11 -0
- package/src/unstable/cli/internal/parser.ts +0 -1
- package/src/unstable/cluster/ClusterCron.ts +35 -1
- package/src/unstable/cluster/ClusterError.ts +56 -7
- package/src/unstable/cluster/ClusterMetrics.ts +39 -5
- package/src/unstable/cluster/ClusterSchema.ts +61 -8
- package/src/unstable/cluster/ClusterWorkflowEngine.ts +35 -2
- package/src/unstable/cluster/DeliverAt.ts +39 -4
- package/src/unstable/cluster/Entity.ts +106 -16
- package/src/unstable/cluster/EntityAddress.ts +30 -2
- package/src/unstable/cluster/EntityId.ts +18 -3
- package/src/unstable/cluster/EntityProxy.ts +42 -14
- package/src/unstable/cluster/EntityProxyServer.ts +45 -8
- package/src/unstable/cluster/EntityResource.ts +43 -6
- package/src/unstable/cluster/EntityType.ts +27 -3
- package/src/unstable/cluster/Envelope.ts +128 -23
- package/src/unstable/cluster/HttpRunner.ts +88 -13
- package/src/unstable/cluster/K8sHttpClient.ts +49 -6
- package/src/unstable/cluster/MachineId.ts +24 -3
- package/src/unstable/cluster/Message.ts +102 -13
- package/src/unstable/cluster/MessageStorage.ts +126 -21
- package/src/unstable/cluster/Reply.ts +101 -12
- package/src/unstable/cluster/Runner.ts +47 -17
- package/src/unstable/cluster/RunnerAddress.ts +34 -2
- package/src/unstable/cluster/RunnerHealth.ts +40 -12
- package/src/unstable/cluster/RunnerServer.ts +31 -4
- package/src/unstable/cluster/RunnerStorage.ts +42 -5
- package/src/unstable/cluster/Runners.ts +76 -13
- package/src/unstable/cluster/ShardId.ts +53 -5
- package/src/unstable/cluster/Sharding.ts +35 -4
- package/src/unstable/cluster/ShardingConfig.ts +75 -10
- package/src/unstable/cluster/ShardingRegistrationEvent.ts +31 -7
- package/src/unstable/cluster/SingleRunner.ts +23 -1
- package/src/unstable/cluster/Singleton.ts +15 -1
- package/src/unstable/cluster/SingletonAddress.ts +21 -1
- package/src/unstable/cluster/Snowflake.ts +90 -19
- package/src/unstable/cluster/SocketRunner.ts +29 -2
- package/src/unstable/cluster/SqlMessageStorage.ts +27 -3
- package/src/unstable/cluster/SqlRunnerStorage.ts +46 -7
- package/src/unstable/cluster/TestRunner.ts +18 -1
- package/src/unstable/cluster/index.ts +790 -0
- package/src/unstable/cluster/internal/hash.ts +12 -0
- package/src/unstable/devtools/DevTools.ts +26 -3
- package/src/unstable/devtools/DevToolsClient.ts +32 -5
- package/src/unstable/devtools/DevToolsSchema.ts +201 -44
- package/src/unstable/devtools/DevToolsServer.ts +27 -2
- package/src/unstable/devtools/index.ts +58 -0
- package/src/unstable/encoding/Msgpack.ts +97 -12
- package/src/unstable/encoding/Ndjson.ts +149 -21
- package/src/unstable/encoding/Sse.ts +109 -18
- package/src/unstable/encoding/index.ts +49 -0
- package/src/unstable/eventlog/Event.ts +131 -30
- package/src/unstable/eventlog/EventGroup.ts +50 -17
- package/src/unstable/eventlog/EventJournal.ts +120 -20
- package/src/unstable/eventlog/EventLog.ts +150 -31
- package/src/unstable/eventlog/EventLogEncryption.ts +42 -6
- package/src/unstable/eventlog/EventLogMessage.ts +92 -18
- package/src/unstable/eventlog/EventLogRemote.ts +54 -8
- package/src/unstable/eventlog/EventLogServer.ts +33 -3
- package/src/unstable/eventlog/EventLogServerEncrypted.ts +52 -6
- package/src/unstable/eventlog/EventLogServerUnencrypted.ts +90 -16
- package/src/unstable/eventlog/EventLogSessionAuth.ts +77 -15
- package/src/unstable/eventlog/SqlEventJournal.ts +28 -2
- package/src/unstable/eventlog/SqlEventLogServerEncrypted.ts +32 -3
- package/src/unstable/eventlog/SqlEventLogServerUnencrypted.ts +28 -2
- package/src/unstable/eventlog/index.ts +240 -0
- package/src/unstable/http/Cookies.ts +156 -77
- package/src/unstable/http/Etag.ts +40 -7
- package/src/unstable/http/FetchHttpClient.ts +33 -4
- package/src/unstable/http/FindMyWay.ts +1 -1
- package/src/unstable/http/Headers.ts +252 -50
- package/src/unstable/http/HttpBody.ts +128 -26
- package/src/unstable/http/HttpClient.ts +204 -96
- package/src/unstable/http/HttpClientError.ts +80 -12
- package/src/unstable/http/HttpClientRequest.ts +318 -100
- package/src/unstable/http/HttpClientResponse.ts +59 -16
- package/src/unstable/http/HttpEffect.ts +66 -18
- package/src/unstable/http/HttpIncomingMessage.ts +48 -7
- package/src/unstable/http/HttpMethod.ts +38 -6
- package/src/unstable/http/HttpMiddleware.ts +60 -11
- package/src/unstable/http/HttpPlatform.ts +34 -3
- package/src/unstable/http/HttpRouter.ts +232 -69
- package/src/unstable/http/HttpServer.ts +151 -22
- package/src/unstable/http/HttpServerError.ts +93 -10
- package/src/unstable/http/HttpServerRequest.ts +125 -21
- package/src/unstable/http/HttpServerRespondable.ts +49 -6
- package/src/unstable/http/HttpServerResponse.ts +391 -67
- package/src/unstable/http/HttpStaticServer.ts +24 -8
- package/src/unstable/http/HttpTraceContext.ts +53 -6
- package/src/unstable/http/Multipart.ts +179 -28
- package/src/unstable/http/Multipasta/HeadersParser.ts +1 -1
- package/src/unstable/http/Multipasta/Node.ts +1 -1
- package/src/unstable/http/Multipasta/Search.ts +1 -1
- package/src/unstable/http/Multipasta/Web.ts +1 -1
- package/src/unstable/http/Multipasta.ts +1 -1
- package/src/unstable/http/Template.ts +53 -1
- package/src/unstable/http/Url.ts +70 -56
- package/src/unstable/http/UrlParams.ts +237 -51
- package/src/unstable/http/index.ts +452 -0
- package/src/unstable/httpapi/HttpApi.ts +49 -14
- package/src/unstable/httpapi/HttpApiBuilder.ts +81 -16
- package/src/unstable/httpapi/HttpApiClient.ts +78 -15
- package/src/unstable/httpapi/HttpApiEndpoint.ts +238 -59
- package/src/unstable/httpapi/HttpApiError.ts +100 -1
- package/src/unstable/httpapi/HttpApiGroup.ts +87 -20
- package/src/unstable/httpapi/HttpApiMiddleware.ts +113 -22
- package/src/unstable/httpapi/HttpApiScalar.ts +38 -4
- package/src/unstable/httpapi/HttpApiSchema.ts +86 -38
- package/src/unstable/httpapi/HttpApiSecurity.ts +73 -17
- package/src/unstable/httpapi/HttpApiSwagger.ts +23 -3
- package/src/unstable/httpapi/HttpApiTest.ts +26 -1
- package/src/unstable/httpapi/OpenApi.ts +115 -15
- package/src/unstable/httpapi/index.ts +310 -25
- package/src/unstable/observability/Otlp.ts +33 -3
- package/src/unstable/observability/OtlpExporter.ts +32 -1
- package/src/unstable/observability/OtlpLogger.ts +32 -2
- package/src/unstable/observability/OtlpMetrics.ts +39 -5
- package/src/unstable/observability/OtlpResource.ts +68 -12
- package/src/unstable/observability/OtlpSerialization.ts +28 -3
- package/src/unstable/observability/OtlpTracer.ts +41 -2
- package/src/unstable/observability/PrometheusMetrics.ts +36 -16
- package/src/unstable/observability/index.ts +160 -3
- package/src/unstable/persistence/KeyValueStore.ts +108 -28
- package/src/unstable/persistence/Persistable.ts +76 -15
- package/src/unstable/persistence/PersistedCache.ts +27 -2
- package/src/unstable/persistence/PersistedQueue.ts +98 -16
- package/src/unstable/persistence/Persistence.ts +98 -16
- package/src/unstable/persistence/RateLimiter.ts +101 -21
- package/src/unstable/persistence/Redis.ts +42 -5
- package/src/unstable/persistence/index.ts +147 -0
- package/src/unstable/process/ChildProcess.ts +90 -66
- package/src/unstable/process/ChildProcessSpawner.ts +23 -12
- package/src/unstable/process/index.ts +2 -1
- package/src/unstable/reactivity/AsyncResult.ts +204 -61
- package/src/unstable/reactivity/Atom.ts +598 -139
- package/src/unstable/reactivity/AtomHttpApi.ts +41 -2
- package/src/unstable/reactivity/AtomRef.ts +51 -7
- package/src/unstable/reactivity/AtomRegistry.ts +141 -22
- package/src/unstable/reactivity/AtomRpc.ts +36 -2
- package/src/unstable/reactivity/Hydration.ts +45 -5
- package/src/unstable/reactivity/Reactivity.ts +94 -13
- package/src/unstable/reactivity/index.ts +167 -0
- package/src/unstable/rpc/Rpc.ts +254 -56
- package/src/unstable/rpc/RpcClient.ts +106 -19
- package/src/unstable/rpc/RpcClientError.ts +26 -2
- package/src/unstable/rpc/RpcGroup.ts +51 -8
- package/src/unstable/rpc/RpcMessage.ts +128 -32
- package/src/unstable/rpc/RpcMiddleware.ts +100 -20
- package/src/unstable/rpc/RpcSchema.ts +38 -4
- package/src/unstable/rpc/RpcSerialization.ts +60 -13
- package/src/unstable/rpc/RpcServer.ts +107 -23
- package/src/unstable/rpc/RpcTest.ts +20 -1
- package/src/unstable/rpc/RpcWorker.ts +39 -6
- package/src/unstable/rpc/Utils.ts +33 -0
- package/src/unstable/rpc/index.ts +272 -0
- package/src/unstable/schema/Model.ts +245 -61
- package/src/unstable/schema/VariantSchema.ts +101 -24
- package/src/unstable/schema/index.ts +37 -0
- package/src/unstable/socket/Socket.ts +168 -34
- package/src/unstable/socket/SocketServer.ts +58 -10
- package/src/unstable/socket/index.ts +44 -0
- package/src/unstable/sql/Migrator.ts +61 -9
- package/src/unstable/sql/SqlClient.ts +59 -2
- package/src/unstable/sql/SqlConnection.ts +34 -3
- package/src/unstable/sql/SqlError.ts +135 -0
- package/src/unstable/sql/SqlModel.ts +25 -5
- package/src/unstable/sql/SqlResolver.ts +56 -13
- package/src/unstable/sql/SqlSchema.ts +29 -8
- package/src/unstable/sql/SqlStream.ts +24 -0
- package/src/unstable/sql/Statement.ts +168 -24
- package/src/unstable/sql/index.ts +179 -1
- package/src/unstable/workers/Transferable.ts +72 -20
- package/src/unstable/workers/Worker.ts +61 -8
- package/src/unstable/workers/WorkerError.ts +50 -9
- package/src/unstable/workers/WorkerRunner.ts +32 -3
- package/src/unstable/workers/index.ts +81 -1
- package/src/unstable/workflow/Activity.ts +61 -10
- package/src/unstable/workflow/DurableClock.ts +26 -3
- package/src/unstable/workflow/DurableDeferred.ts +148 -31
- package/src/unstable/workflow/DurableQueue.ts +33 -8
- package/src/unstable/workflow/Workflow.ts +123 -31
- package/src/unstable/workflow/WorkflowEngine.ts +40 -5
- package/src/unstable/workflow/WorkflowProxy.ts +40 -12
- package/src/unstable/workflow/WorkflowProxyServer.ts +41 -6
- package/src/unstable/workflow/index.ts +160 -0
package/dist/Schema.d.ts
CHANGED
|
@@ -125,6 +125,7 @@ declare const TypeId = "~effect/Schema/Schema";
|
|
|
125
125
|
* @see {@link optionalKey} — mark a struct field as optional
|
|
126
126
|
* @see {@link optional} — mark a struct field as optional with `| undefined`
|
|
127
127
|
*
|
|
128
|
+
* @category models
|
|
128
129
|
* @since 4.0.0
|
|
129
130
|
*/
|
|
130
131
|
export type Optionality = "required" | "optional";
|
|
@@ -133,6 +134,7 @@ export type Optionality = "required" | "optional";
|
|
|
133
134
|
*
|
|
134
135
|
* @see {@link mutableKey} — mark a struct field as mutable
|
|
135
136
|
*
|
|
137
|
+
* @category models
|
|
136
138
|
* @since 4.0.0
|
|
137
139
|
*/
|
|
138
140
|
export type Mutability = "readonly" | "mutable";
|
|
@@ -142,6 +144,7 @@ export type Mutability = "readonly" | "mutable";
|
|
|
142
144
|
* @see {@link withConstructorDefault} — add a default to a schema field
|
|
143
145
|
* @see {@link tag} — creates a literal field with a constructor default
|
|
144
146
|
*
|
|
147
|
+
* @category models
|
|
145
148
|
* @since 4.0.0
|
|
146
149
|
*/
|
|
147
150
|
export type ConstructorDefault = "no-default" | "with-default";
|
|
@@ -155,7 +158,8 @@ export type ConstructorDefault = "no-default" | "with-default";
|
|
|
155
158
|
* @see {@link Bottom.makeEffect}
|
|
156
159
|
* @see {@link Bottom.make}
|
|
157
160
|
*
|
|
158
|
-
* @
|
|
161
|
+
* @category models
|
|
162
|
+
* @since 3.13.4
|
|
159
163
|
*/
|
|
160
164
|
export interface MakeOptions {
|
|
161
165
|
/**
|
|
@@ -182,6 +186,7 @@ export interface MakeOptions {
|
|
|
182
186
|
* @see {@link Schema} — tracks only the decoded Type
|
|
183
187
|
* @see {@link Codec} — tracks Type + Encoded
|
|
184
188
|
*
|
|
189
|
+
* @category models
|
|
185
190
|
* @since 4.0.0
|
|
186
191
|
*/
|
|
187
192
|
export interface Bottom<out T, out E, out RD, out RE, out Ast extends AST.AST, out Rebuild extends Top, out TypeMakeIn = T, out Iso = T, in out TypeParameters extends ReadonlyArray<Top> = readonly [], out TypeMake = TypeMakeIn, out TypeMutability extends Mutability = "readonly", out TypeOptionality extends Optionality = "required", out TypeConstructorDefault extends ConstructorDefault = "no-default", out EncodedMutability extends Mutability = "readonly", out EncodedOptionality extends Optionality = "required"> extends Pipeable.Pipeable {
|
|
@@ -206,7 +211,7 @@ export interface Bottom<out T, out E, out RD, out RE, out Ast extends AST.AST, o
|
|
|
206
211
|
check(...checks: readonly [AST.Check<this["Type"]>, ...Array<AST.Check<this["Type"]>>]): this["Rebuild"];
|
|
207
212
|
rebuild(ast: this["ast"]): this["Rebuild"];
|
|
208
213
|
/**
|
|
209
|
-
*
|
|
214
|
+
* Constructs a value from the make input representation.
|
|
210
215
|
*/
|
|
211
216
|
make(input: this["~type.make.in"], options?: MakeOptions): this["Type"];
|
|
212
217
|
makeOption(input: this["~type.make.in"], options?: MakeOptions): Option_.Option<this["Type"]>;
|
|
@@ -217,7 +222,7 @@ export interface Bottom<out T, out E, out RD, out RE, out Ast extends AST.AST, o
|
|
|
217
222
|
* type `T`, the encoded type `E`, and the list of type-parameter schemas
|
|
218
223
|
* `TypeParameters`.
|
|
219
224
|
*
|
|
220
|
-
* @category
|
|
225
|
+
* @category constructors
|
|
221
226
|
* @since 4.0.0
|
|
222
227
|
*/
|
|
223
228
|
export interface declareConstructor<T, E, TypeParameters extends ReadonlyArray<Top>, Iso = T> extends Bottom<T, E, TypeParameters[number]["DecodingServices"], TypeParameters[number]["EncodingServices"], AST.Declaration, declareConstructor<T, E, TypeParameters, Iso>, T, Iso, TypeParameters> {
|
|
@@ -239,10 +244,7 @@ export interface declareConstructor<T, E, TypeParameters extends ReadonlyArray<T
|
|
|
239
244
|
* **Example** (Schema for a parametric `Box<A>` type)
|
|
240
245
|
*
|
|
241
246
|
* ```ts
|
|
242
|
-
* import { Effect, Schema } from "effect"
|
|
243
|
-
* import * as SchemaParser from "effect/SchemaParser"
|
|
244
|
-
* import * as Issue from "effect/SchemaIssue"
|
|
245
|
-
* import * as Option from "effect/Option"
|
|
247
|
+
* import { Effect, Option, Schema, SchemaIssue as Issue, SchemaParser } from "effect"
|
|
246
248
|
*
|
|
247
249
|
* interface Box<A> {
|
|
248
250
|
* readonly value: A
|
|
@@ -269,7 +271,7 @@ export interface declareConstructor<T, E, TypeParameters extends ReadonlyArray<T
|
|
|
269
271
|
* const schema = Box(Schema.Number)
|
|
270
272
|
* ```
|
|
271
273
|
*
|
|
272
|
-
* @category
|
|
274
|
+
* @category constructors
|
|
273
275
|
* @since 4.0.0
|
|
274
276
|
*/
|
|
275
277
|
export declare function declareConstructor<T, E = T, Iso = T>(): <const TypeParameters extends ReadonlyArray<Top>>(typeParameters: TypeParameters, run: (typeParameters: { readonly [K in keyof TypeParameters]: Codec<TypeParameters[K]["Type"], TypeParameters[K]["Encoded"]>; }) => (u: unknown, self: AST.Declaration, options: AST.ParseOptions) => Effect.Effect<T, Issue.Issue>, annotations?: Annotations.Declaration<T, TypeParameters>) => declareConstructor<T, E, TypeParameters, Iso>;
|
|
@@ -277,8 +279,8 @@ export declare function declareConstructor<T, E = T, Iso = T>(): <const TypePara
|
|
|
277
279
|
* The schema type returned by {@link declare}, representing a non-parametric
|
|
278
280
|
* opaque type `T` with no type parameters.
|
|
279
281
|
*
|
|
280
|
-
* @category
|
|
281
|
-
* @since
|
|
282
|
+
* @category constructors
|
|
283
|
+
* @since 3.13.3
|
|
282
284
|
*/
|
|
283
285
|
export interface declare<T, Iso = T> extends declareConstructor<T, T, readonly [], Iso> {
|
|
284
286
|
readonly "Rebuild": declare<T, Iso>;
|
|
@@ -309,8 +311,8 @@ export interface declare<T, Iso = T> extends declareConstructor<T, T, readonly [
|
|
|
309
311
|
*
|
|
310
312
|
* @see {@link declareConstructor} for creating schemas for parametric types.
|
|
311
313
|
*
|
|
312
|
-
* @category
|
|
313
|
-
* @since
|
|
314
|
+
* @category constructors
|
|
315
|
+
* @since 3.10.0
|
|
314
316
|
*/
|
|
315
317
|
export declare function declare<T, Iso = T>(is: (u: unknown) => u is T, annotations?: Annotations.Declaration<T> | undefined): declare<T, Iso>;
|
|
316
318
|
/**
|
|
@@ -337,6 +339,7 @@ export declare function declare<T, Iso = T>(is: (u: unknown) => u is T, annotati
|
|
|
337
339
|
* type E = typeof bottom["Encoded"] // string
|
|
338
340
|
* ```
|
|
339
341
|
*
|
|
342
|
+
* @category utils
|
|
340
343
|
* @since 4.0.0
|
|
341
344
|
*/
|
|
342
345
|
export declare function revealBottom<S extends Top>(bottom: S): Bottom<S["Type"], S["Encoded"], S["DecodingServices"], S["EncodingServices"], S["ast"], S["Rebuild"], S["~type.make.in"], S["Iso"], S["~type.parameters"], S["~type.make"], S["~type.mutability"], S["~type.optionality"], S["~type.constructor.default"], S["~encoded.mutability"], S["~encoded.optionality"]>;
|
|
@@ -363,7 +366,7 @@ export declare function revealBottom<S extends Top>(bottom: S): Bottom<S["Type"]
|
|
|
363
366
|
*
|
|
364
367
|
* @see {@link annotateEncoded} to annotate the encoded side instead.
|
|
365
368
|
*
|
|
366
|
-
* @category
|
|
369
|
+
* @category annotations
|
|
367
370
|
* @since 4.0.0
|
|
368
371
|
*/
|
|
369
372
|
export declare function annotate<S extends Top>(annotations: Annotations.Bottom<S["Type"], S["~type.parameters"]>): (self: S) => S["Rebuild"];
|
|
@@ -392,7 +395,7 @@ export declare function annotate<S extends Top>(annotations: Annotations.Bottom<
|
|
|
392
395
|
*
|
|
393
396
|
* @see {@link annotate} to annotate the type side instead.
|
|
394
397
|
*
|
|
395
|
-
* @category
|
|
398
|
+
* @category annotations
|
|
396
399
|
* @since 4.0.0
|
|
397
400
|
*/
|
|
398
401
|
export declare function annotateEncoded<S extends Top>(annotations: Annotations.Bottom<S["Encoded"], readonly []>): (self: S) => S["Rebuild"];
|
|
@@ -421,7 +424,7 @@ export declare function annotateEncoded<S extends Top>(annotations: Annotations.
|
|
|
421
424
|
* })
|
|
422
425
|
* ```
|
|
423
426
|
*
|
|
424
|
-
* @category
|
|
427
|
+
* @category annotations
|
|
425
428
|
* @since 4.0.0
|
|
426
429
|
*/
|
|
427
430
|
export declare function annotateKey<S extends Top>(annotations: Annotations.Key<S["Type"]>): (self: S) => S["Rebuild"];
|
|
@@ -438,6 +441,7 @@ export declare function annotateKey<S extends Top>(annotations: Annotations.Key<
|
|
|
438
441
|
* - {@link Decoder}`<T, RD>` — for decode-only APIs
|
|
439
442
|
* - {@link Encoder}`<E, RE>` — for encode-only APIs
|
|
440
443
|
*
|
|
444
|
+
* @category models
|
|
441
445
|
* @since 4.0.0
|
|
442
446
|
*/
|
|
443
447
|
export interface Top extends Bottom<unknown, unknown, unknown, unknown, AST.AST, Top, unknown, unknown, any, // this is because TypeParameters is invariant
|
|
@@ -446,7 +450,7 @@ unknown, Mutability, Optionality, ConstructorDefault, Mutability, Optionality> {
|
|
|
446
450
|
/**
|
|
447
451
|
* Namespace of type-level helpers for {@link Schema}.
|
|
448
452
|
*
|
|
449
|
-
* @since
|
|
453
|
+
* @since 3.10.0
|
|
450
454
|
*/
|
|
451
455
|
export declare namespace Schema {
|
|
452
456
|
/**
|
|
@@ -462,7 +466,8 @@ export declare namespace Schema {
|
|
|
462
466
|
* // { readonly name: string; readonly age: number }
|
|
463
467
|
* ```
|
|
464
468
|
*
|
|
465
|
-
* @
|
|
469
|
+
* @category utility types
|
|
470
|
+
* @since 3.10.0
|
|
466
471
|
*/
|
|
467
472
|
type Type<S> = S extends Top ? S["Type"] : never;
|
|
468
473
|
}
|
|
@@ -491,7 +496,8 @@ export declare namespace Schema {
|
|
|
491
496
|
* @see {@link Codec} — also tracks Encoded, DecodingServices, EncodingServices
|
|
492
497
|
* @see {@link Schema.Type} — extract the decoded type at the type level
|
|
493
498
|
*
|
|
494
|
-
* @
|
|
499
|
+
* @category models
|
|
500
|
+
* @since 3.10.0
|
|
495
501
|
*/
|
|
496
502
|
export interface Schema<out T> extends Top {
|
|
497
503
|
readonly "Type": T;
|
|
@@ -516,7 +522,8 @@ export declare namespace Codec {
|
|
|
516
522
|
* // string
|
|
517
523
|
* ```
|
|
518
524
|
*
|
|
519
|
-
* @
|
|
525
|
+
* @category utility types
|
|
526
|
+
* @since 3.10.0
|
|
520
527
|
*/
|
|
521
528
|
type Encoded<S> = S extends Top ? S["Encoded"] : never;
|
|
522
529
|
/**
|
|
@@ -532,6 +539,7 @@ export declare namespace Codec {
|
|
|
532
539
|
* // never
|
|
533
540
|
* ```
|
|
534
541
|
*
|
|
542
|
+
* @category utility types
|
|
535
543
|
* @since 4.0.0
|
|
536
544
|
*/
|
|
537
545
|
type DecodingServices<S> = S extends Top ? S["DecodingServices"] : never;
|
|
@@ -548,19 +556,10 @@ export declare namespace Codec {
|
|
|
548
556
|
* // never
|
|
549
557
|
* ```
|
|
550
558
|
*
|
|
559
|
+
* @category utility types
|
|
551
560
|
* @since 4.0.0
|
|
552
561
|
*/
|
|
553
562
|
type EncodingServices<S> = S extends Top ? S["EncodingServices"] : never;
|
|
554
|
-
/**
|
|
555
|
-
* Converts a schema type into an assertion function signature. The resulting
|
|
556
|
-
* function narrows its argument to `I & S["Type"]`. Only schemas with
|
|
557
|
-
* `DecodingServices: never` (i.e. no required services) can be used here.
|
|
558
|
-
*
|
|
559
|
-
* Produced by {@link asserts}.
|
|
560
|
-
*
|
|
561
|
-
* @since 4.0.0
|
|
562
|
-
*/
|
|
563
|
-
type ToAsserts<S extends Top> = <I>(input: I) => asserts input is I & S["Type"];
|
|
564
563
|
}
|
|
565
564
|
/**
|
|
566
565
|
* A schema that additionally supports optic (lens/prism) operations.
|
|
@@ -575,6 +574,7 @@ export declare namespace Codec {
|
|
|
575
574
|
* `Optic` automatically. You normally interact with this interface through
|
|
576
575
|
* {@link Optic_} utilities rather than constructing it directly.
|
|
577
576
|
*
|
|
577
|
+
* @category models
|
|
578
578
|
* @since 4.0.0
|
|
579
579
|
*/
|
|
580
580
|
export interface Optic<out T, out Iso> extends Schema<T> {
|
|
@@ -611,6 +611,7 @@ export interface Optic<out T, out Iso> extends Schema<T> {
|
|
|
611
611
|
* @see {@link Codec.EncodingServices} — extract required encoding services
|
|
612
612
|
* @see {@link revealCodec} — helper to make TypeScript infer the full Codec type
|
|
613
613
|
*
|
|
614
|
+
* @category models
|
|
614
615
|
* @since 4.0.0
|
|
615
616
|
*/
|
|
616
617
|
export interface Codec<out T, out E = T, out RD = never, out RE = never> extends Schema<T> {
|
|
@@ -637,6 +638,7 @@ export interface Codec<out T, out E = T, out RD = never, out RE = never> extends
|
|
|
637
638
|
* validate(Schema.NumberFromString) // ok
|
|
638
639
|
* ```
|
|
639
640
|
*
|
|
641
|
+
* @category models
|
|
640
642
|
* @since 4.0.0
|
|
641
643
|
*/
|
|
642
644
|
export interface Decoder<out T, out RD = never> extends Codec<T, unknown, RD, unknown> {
|
|
@@ -660,6 +662,7 @@ export interface Decoder<out T, out RD = never> extends Codec<T, unknown, RD, un
|
|
|
660
662
|
* serialize(Schema.NumberFromString) // ok — encodes number to string
|
|
661
663
|
* ```
|
|
662
664
|
*
|
|
665
|
+
* @category models
|
|
663
666
|
* @since 4.0.0
|
|
664
667
|
*/
|
|
665
668
|
export interface Encoder<out E, out RE = never> extends Codec<unknown, E, unknown, RE> {
|
|
@@ -685,6 +688,7 @@ export interface Encoder<out E, out RE = never> extends Codec<unknown, E, unknow
|
|
|
685
688
|
* type Enc = typeof codec["Encoded"] // string
|
|
686
689
|
* ```
|
|
687
690
|
*
|
|
691
|
+
* @category utils
|
|
688
692
|
* @since 4.0.0
|
|
689
693
|
*/
|
|
690
694
|
export declare function revealCodec<T, E, RD, RE>(codec: Codec<T, E, RD, RE>): Codec<T, E, RD, RE>;
|
|
@@ -735,6 +739,7 @@ SchemaError };
|
|
|
735
739
|
* }
|
|
736
740
|
* ```
|
|
737
741
|
*
|
|
742
|
+
* @category guards
|
|
738
743
|
* @since 4.0.0
|
|
739
744
|
*/
|
|
740
745
|
export declare function isSchemaError(u: unknown): u is SchemaError;
|
|
@@ -811,7 +816,6 @@ export declare function toStandardSchemaV1<S extends Decoder<unknown>>(self: S,
|
|
|
811
816
|
*
|
|
812
817
|
* @category Standard Schema
|
|
813
818
|
* @since 4.0.0
|
|
814
|
-
* @experimental
|
|
815
819
|
*/
|
|
816
820
|
export declare function toStandardJSONSchemaV1<S extends Top>(self: S): StandardJSONSchemaV1<S["Encoded"], S["Type"]> & S;
|
|
817
821
|
/**
|
|
@@ -840,8 +844,8 @@ export declare function toStandardJSONSchemaV1<S extends Top>(self: S): Standard
|
|
|
840
844
|
* }
|
|
841
845
|
* ```
|
|
842
846
|
*
|
|
843
|
-
* @category
|
|
844
|
-
* @since
|
|
847
|
+
* @category guards
|
|
848
|
+
* @since 3.10.0
|
|
845
849
|
*/
|
|
846
850
|
export declare const is: typeof Parser.is;
|
|
847
851
|
/**
|
|
@@ -857,128 +861,157 @@ export declare const is: typeof Parser.is;
|
|
|
857
861
|
* ```ts
|
|
858
862
|
* import { Schema } from "effect"
|
|
859
863
|
*
|
|
860
|
-
* const
|
|
861
|
-
* Schema.String
|
|
862
|
-
* )
|
|
864
|
+
* const input: unknown = "hello"
|
|
863
865
|
*
|
|
864
|
-
* // This will pass silently (no return value)
|
|
865
|
-
*
|
|
866
|
-
*
|
|
867
|
-
* console.log("String assertion passed")
|
|
868
|
-
* } catch (error) {
|
|
869
|
-
* console.log("String assertion failed")
|
|
870
|
-
* }
|
|
866
|
+
* // This will pass silently (no return value) and narrow input to string
|
|
867
|
+
* Schema.asserts(Schema.String, input)
|
|
868
|
+
* console.log(input.toUpperCase())
|
|
871
869
|
*
|
|
872
870
|
* // This will throw an error
|
|
873
871
|
* try {
|
|
874
|
-
*
|
|
872
|
+
* const invalid: unknown = 123
|
|
873
|
+
* Schema.asserts(Schema.String, invalid)
|
|
875
874
|
* } catch (error) {
|
|
876
875
|
* console.log("Non-string assertion failed as expected")
|
|
877
876
|
* }
|
|
878
877
|
* ```
|
|
879
878
|
*
|
|
880
|
-
* @category
|
|
879
|
+
* @category guards
|
|
881
880
|
* @since 4.0.0
|
|
882
881
|
*/
|
|
883
|
-
export declare const asserts:
|
|
882
|
+
export declare const asserts: <S extends Top, I>(schema: S, input: I) => asserts input is I & S["Type"];
|
|
884
883
|
/**
|
|
885
884
|
* Decodes an `unknown` input against a schema, returning an `Effect` that
|
|
886
885
|
* succeeds with the decoded value or fails with a {@link SchemaError}. Use this
|
|
887
886
|
* when the input type is not statically known. Prefer {@link decodeEffect} when
|
|
888
887
|
* the input is already typed as the schema's `Encoded` type.
|
|
888
|
+
* Options may be provided either when creating the decoder or when applying it;
|
|
889
|
+
* application options override creation options.
|
|
889
890
|
*
|
|
890
|
-
* @category
|
|
891
|
+
* @category decoding
|
|
891
892
|
* @since 4.0.0
|
|
892
893
|
*/
|
|
893
|
-
export declare function decodeUnknownEffect<S extends Top>(schema: S): (input: unknown, options?: AST.ParseOptions) => Effect.Effect<S["Type"], SchemaError, S["DecodingServices"]>;
|
|
894
|
+
export declare function decodeUnknownEffect<S extends Top>(schema: S, options?: AST.ParseOptions): (input: unknown, options?: AST.ParseOptions) => Effect.Effect<S["Type"], SchemaError, S["DecodingServices"]>;
|
|
894
895
|
/**
|
|
895
896
|
* Decodes a typed input (the schema's `Encoded` type) against a schema,
|
|
896
897
|
* returning an `Effect` that succeeds with the decoded value or fails with a
|
|
897
898
|
* {@link SchemaError}. Use this when the input is already typed; for `unknown`
|
|
898
899
|
* input use {@link decodeUnknownEffect}.
|
|
900
|
+
* Options may be provided either when creating the decoder or when applying it;
|
|
901
|
+
* application options override creation options.
|
|
899
902
|
*
|
|
900
|
-
* @category
|
|
903
|
+
* @category decoding
|
|
901
904
|
* @since 4.0.0
|
|
902
905
|
*/
|
|
903
|
-
export declare const decodeEffect: <S extends Top>(schema: S) => (input: S["Encoded"], options?: AST.ParseOptions) => Effect.Effect<S["Type"], SchemaError, S["DecodingServices"]>;
|
|
906
|
+
export declare const decodeEffect: <S extends Top>(schema: S, options?: AST.ParseOptions) => (input: S["Encoded"], options?: AST.ParseOptions) => Effect.Effect<S["Type"], SchemaError, S["DecodingServices"]>;
|
|
904
907
|
/**
|
|
905
908
|
* Decodes an `unknown` input against a schema synchronously, returning an
|
|
906
909
|
* `Exit` that is either a `Success` with the decoded value or a `Failure` with
|
|
907
910
|
* a {@link SchemaError}. Only usable with schemas that have no
|
|
908
911
|
* `DecodingServices` requirement. Prefer {@link decodeExit} when the input is
|
|
909
912
|
* already typed as the schema's `Encoded` type.
|
|
913
|
+
* Options may be provided either when creating the decoder or when applying it;
|
|
914
|
+
* application options override creation options.
|
|
910
915
|
*
|
|
911
|
-
* @category
|
|
916
|
+
* @category decoding
|
|
912
917
|
* @since 4.0.0
|
|
913
918
|
*/
|
|
914
|
-
export declare function decodeUnknownExit<S extends Decoder<unknown>>(schema: S): (input: unknown, options?: AST.ParseOptions) => Exit_.Exit<S["Type"], SchemaError>;
|
|
919
|
+
export declare function decodeUnknownExit<S extends Decoder<unknown>>(schema: S, options?: AST.ParseOptions): (input: unknown, options?: AST.ParseOptions) => Exit_.Exit<S["Type"], SchemaError>;
|
|
915
920
|
/**
|
|
916
921
|
* Decodes a typed input (the schema's `Encoded` type) against a schema
|
|
917
922
|
* synchronously, returning an `Exit` that is either a `Success` with the
|
|
918
923
|
* decoded value or a `Failure` with a {@link SchemaError}. Only usable with
|
|
919
924
|
* schemas that have no `DecodingServices` requirement. For `unknown` input use
|
|
920
925
|
* {@link decodeUnknownExit}.
|
|
926
|
+
* Options may be provided either when creating the decoder or when applying it;
|
|
927
|
+
* application options override creation options.
|
|
921
928
|
*
|
|
922
|
-
* @category
|
|
929
|
+
* @category decoding
|
|
923
930
|
* @since 4.0.0
|
|
924
931
|
*/
|
|
925
|
-
export declare const decodeExit: <S extends Decoder<unknown>>(schema: S) => (input: S["Encoded"], options?: AST.ParseOptions) => Exit_.Exit<S["Type"], SchemaError>;
|
|
932
|
+
export declare const decodeExit: <S extends Decoder<unknown>>(schema: S, options?: AST.ParseOptions) => (input: S["Encoded"], options?: AST.ParseOptions) => Exit_.Exit<S["Type"], SchemaError>;
|
|
926
933
|
/**
|
|
927
934
|
* Decodes an `unknown` input against a schema, returning an `Option` that is
|
|
928
935
|
* `Some` with the decoded value on success or `None` on failure. Prefer this
|
|
929
936
|
* over {@link decodeUnknownExit} or {@link decodeUnknownEffect} when you only
|
|
930
937
|
* need to know whether decoding succeeded and don't need error details. For
|
|
931
938
|
* typed input use {@link decodeOption}.
|
|
939
|
+
* Options may be provided either when creating the decoder or when applying it;
|
|
940
|
+
* application options override creation options.
|
|
932
941
|
*
|
|
933
|
-
* @category
|
|
934
|
-
* @since
|
|
942
|
+
* @category decoding
|
|
943
|
+
* @since 3.10.0
|
|
935
944
|
*/
|
|
936
945
|
export declare const decodeUnknownOption: typeof Parser.decodeUnknownOption;
|
|
937
946
|
/**
|
|
938
947
|
* Decodes a typed input (the schema's `Encoded` type) against a schema,
|
|
939
948
|
* returning an `Option` that is `Some` with the decoded value on success or
|
|
940
949
|
* `None` on failure. For `unknown` input use {@link decodeUnknownOption}.
|
|
950
|
+
* Options may be provided either when creating the decoder or when applying it;
|
|
951
|
+
* application options override creation options.
|
|
941
952
|
*
|
|
942
|
-
* @category
|
|
943
|
-
* @since
|
|
953
|
+
* @category decoding
|
|
954
|
+
* @since 3.10.0
|
|
944
955
|
*/
|
|
945
|
-
export declare const decodeOption: <S extends Decoder<unknown>>(schema: S) => (input: S["Encoded"], options?: AST.ParseOptions) => Option_.Option<S["Type"]>;
|
|
956
|
+
export declare const decodeOption: <S extends Decoder<unknown>>(schema: S, options?: AST.ParseOptions) => (input: S["Encoded"], options?: AST.ParseOptions) => Option_.Option<S["Type"]>;
|
|
946
957
|
/**
|
|
947
|
-
* Decodes an `unknown` input against a schema, returning a `
|
|
948
|
-
*
|
|
949
|
-
*
|
|
950
|
-
*
|
|
958
|
+
* Decodes an `unknown` input against a schema, returning a `Result` that
|
|
959
|
+
* succeeds with the decoded value or fails with a schema issue. For typed input
|
|
960
|
+
* use {@link decodeResult}.
|
|
961
|
+
* Options may be provided either when creating the decoder or when applying it;
|
|
962
|
+
* application options override creation options.
|
|
951
963
|
*
|
|
952
|
-
* @category
|
|
964
|
+
* @category decoding
|
|
953
965
|
* @since 4.0.0
|
|
954
966
|
*/
|
|
955
967
|
export declare const decodeUnknownResult: typeof Parser.decodeUnknownResult;
|
|
956
968
|
/**
|
|
957
|
-
*
|
|
969
|
+
* Decodes a typed input (the schema's `Encoded` type) against a schema,
|
|
970
|
+
* returning a `Result` that succeeds with the decoded value or fails with a
|
|
971
|
+
* schema issue. For `unknown` input use {@link decodeUnknownResult}.
|
|
972
|
+
* Options may be provided either when creating the decoder or when applying it;
|
|
973
|
+
* application options override creation options.
|
|
974
|
+
*
|
|
975
|
+
* @category decoding
|
|
958
976
|
* @since 4.0.0
|
|
959
977
|
*/
|
|
960
|
-
export declare const decodeResult: <S extends Decoder<unknown>>(schema: S) => (input: S["Encoded"], options?: AST.ParseOptions) => Result_.Result<S["Type"], Issue.Issue>;
|
|
978
|
+
export declare const decodeResult: <S extends Decoder<unknown>>(schema: S, options?: AST.ParseOptions) => (input: S["Encoded"], options?: AST.ParseOptions) => Result_.Result<S["Type"], Issue.Issue>;
|
|
961
979
|
/**
|
|
962
|
-
*
|
|
963
|
-
*
|
|
980
|
+
* Decodes an `unknown` input against a schema, returning a `Promise` that
|
|
981
|
+
* resolves with the decoded value or rejects with a schema issue. Useful for
|
|
982
|
+
* integrating with Promise-based APIs. For typed input use
|
|
983
|
+
* {@link decodePromise}.
|
|
984
|
+
* Options may be provided either when creating the decoder or when applying it;
|
|
985
|
+
* application options override creation options.
|
|
986
|
+
*
|
|
987
|
+
* @category decoding
|
|
988
|
+
* @since 3.10.0
|
|
964
989
|
*/
|
|
965
990
|
export declare const decodeUnknownPromise: typeof Parser.decodeUnknownPromise;
|
|
966
991
|
/**
|
|
967
992
|
* Decodes a typed input (the schema's `Encoded` type) against a schema,
|
|
968
993
|
* returning a `Promise` that resolves with the decoded value or rejects with a
|
|
969
|
-
*
|
|
994
|
+
* schema issue. For `unknown` input use `decodeUnknownPromise`.
|
|
970
995
|
*
|
|
971
|
-
*
|
|
972
|
-
*
|
|
996
|
+
* **Details**
|
|
997
|
+
* Options may be provided either when creating the decoder or when applying it;
|
|
998
|
+
* application options override creation options.
|
|
999
|
+
*
|
|
1000
|
+
* @category decoding
|
|
1001
|
+
* @since 3.10.0
|
|
973
1002
|
*/
|
|
974
1003
|
export declare const decodePromise: typeof Parser.decodePromise;
|
|
975
1004
|
/**
|
|
976
|
-
* Decodes an `unknown` input against a schema synchronously,
|
|
977
|
-
*
|
|
978
|
-
*
|
|
979
|
-
*
|
|
980
|
-
*
|
|
981
|
-
*
|
|
1005
|
+
* Decodes an `unknown` input against a schema synchronously, returning the
|
|
1006
|
+
* decoded value or throwing an `Error` whose cause contains the schema issue.
|
|
1007
|
+
* Use this when you want to validate data at a boundary and treat a schema
|
|
1008
|
+
* mismatch as an exception. For typed input use `decodeSync`.
|
|
1009
|
+
*
|
|
1010
|
+
* **Details**
|
|
1011
|
+
* Only service-free schemas can be decoded synchronously. For non-throwing
|
|
1012
|
+
* alternatives see `decodeUnknownOption`, `decodeUnknownExit`, or
|
|
1013
|
+
* `decodeUnknownEffect`. Options may be provided either when creating the
|
|
1014
|
+
* decoder or when applying it; application options override creation options.
|
|
982
1015
|
*
|
|
983
1016
|
* **Example** (Decoding with a transformation schema)
|
|
984
1017
|
*
|
|
@@ -997,24 +1030,31 @@ export declare const decodePromise: typeof Parser.decodePromise;
|
|
|
997
1030
|
* // └─ Expected a numeric string, actual "not a number"
|
|
998
1031
|
* ```
|
|
999
1032
|
*
|
|
1000
|
-
* @category
|
|
1033
|
+
* @category decoding
|
|
1001
1034
|
* @since 4.0.0
|
|
1002
1035
|
*/
|
|
1003
1036
|
export declare const decodeUnknownSync: typeof Parser.decodeUnknownSync;
|
|
1004
1037
|
/**
|
|
1005
1038
|
* Decodes a typed input (the schema's `Encoded` type) against a schema
|
|
1006
|
-
* synchronously,
|
|
1007
|
-
* use
|
|
1039
|
+
* synchronously, returning the decoded value or throwing an `Error` whose cause
|
|
1040
|
+
* contains the schema issue. For `unknown` input use `decodeUnknownSync`.
|
|
1041
|
+
*
|
|
1042
|
+
* **Details**
|
|
1043
|
+
* Only service-free schemas can be decoded synchronously. Options may be
|
|
1044
|
+
* provided either when creating the decoder or when applying it; application
|
|
1045
|
+
* options override creation options.
|
|
1008
1046
|
*
|
|
1009
|
-
* @category
|
|
1047
|
+
* @category decoding
|
|
1010
1048
|
* @since 4.0.0
|
|
1011
1049
|
*/
|
|
1012
|
-
export declare const decodeSync: <S extends Decoder<unknown>>(schema: S) => (input: S["Encoded"], options?: AST.ParseOptions) => S["Type"];
|
|
1050
|
+
export declare const decodeSync: <S extends Decoder<unknown>>(schema: S, options?: AST.ParseOptions) => (input: S["Encoded"], options?: AST.ParseOptions) => S["Type"];
|
|
1013
1051
|
/**
|
|
1014
1052
|
* Encodes an `unknown` input against a schema, returning an `Effect` that
|
|
1015
1053
|
* succeeds with the encoded value or fails with a {@link SchemaError}. Use this
|
|
1016
1054
|
* when the input type is not statically known. Prefer {@link encodeEffect} when
|
|
1017
1055
|
* the input is already typed as the schema's `Type`.
|
|
1056
|
+
* Options may be provided either when creating the encoder or when applying it;
|
|
1057
|
+
* application options override creation options.
|
|
1018
1058
|
*
|
|
1019
1059
|
* **Example** (Encoding a value to a string)
|
|
1020
1060
|
*
|
|
@@ -1027,91 +1067,117 @@ export declare const decodeSync: <S extends Decoder<unknown>>(schema: S) => (inp
|
|
|
1027
1067
|
* // Output: "42"
|
|
1028
1068
|
* ```
|
|
1029
1069
|
*
|
|
1030
|
-
* @category
|
|
1070
|
+
* @category encoding
|
|
1031
1071
|
* @since 4.0.0
|
|
1032
1072
|
*/
|
|
1033
|
-
export declare function encodeUnknownEffect<S extends Top>(schema: S): (input: unknown, options?: AST.ParseOptions) => Effect.Effect<S["Encoded"], SchemaError, S["EncodingServices"]>;
|
|
1073
|
+
export declare function encodeUnknownEffect<S extends Top>(schema: S, options?: AST.ParseOptions): (input: unknown, options?: AST.ParseOptions) => Effect.Effect<S["Encoded"], SchemaError, S["EncodingServices"]>;
|
|
1034
1074
|
/**
|
|
1035
1075
|
* Encodes a typed input (the schema's `Type`) against a schema, returning an
|
|
1036
1076
|
* `Effect` that succeeds with the encoded value or fails with a
|
|
1037
1077
|
* {@link SchemaError}. Use this when the input is already typed; for `unknown`
|
|
1038
1078
|
* input use {@link encodeUnknownEffect}.
|
|
1079
|
+
* Options may be provided either when creating the encoder or when applying it;
|
|
1080
|
+
* application options override creation options.
|
|
1039
1081
|
*
|
|
1040
|
-
* @category
|
|
1082
|
+
* @category encoding
|
|
1041
1083
|
* @since 4.0.0
|
|
1042
1084
|
*/
|
|
1043
|
-
export declare const encodeEffect: <S extends Top>(schema: S) => (input: S["Type"], options?: AST.ParseOptions) => Effect.Effect<S["Encoded"], SchemaError, S["EncodingServices"]>;
|
|
1085
|
+
export declare const encodeEffect: <S extends Top>(schema: S, options?: AST.ParseOptions) => (input: S["Type"], options?: AST.ParseOptions) => Effect.Effect<S["Encoded"], SchemaError, S["EncodingServices"]>;
|
|
1044
1086
|
/**
|
|
1045
1087
|
* Encodes an `unknown` input against a schema synchronously, returning an
|
|
1046
1088
|
* `Exit` that is either a `Success` with the encoded value or a `Failure` with
|
|
1047
1089
|
* a {@link SchemaError}. Only usable with schemas that have no
|
|
1048
1090
|
* `EncodingServices` requirement. Prefer {@link encodeExit} when the input is
|
|
1049
1091
|
* already typed as the schema's `Type`.
|
|
1092
|
+
* Options may be provided either when creating the encoder or when applying it;
|
|
1093
|
+
* application options override creation options.
|
|
1050
1094
|
*
|
|
1051
|
-
* @category
|
|
1095
|
+
* @category encoding
|
|
1052
1096
|
* @since 4.0.0
|
|
1053
1097
|
*/
|
|
1054
|
-
export declare function encodeUnknownExit<S extends Encoder<unknown>>(schema: S): (input: unknown, options?: AST.ParseOptions) => Exit_.Exit<S["Encoded"], SchemaError>;
|
|
1098
|
+
export declare function encodeUnknownExit<S extends Encoder<unknown>>(schema: S, options?: AST.ParseOptions): (input: unknown, options?: AST.ParseOptions) => Exit_.Exit<S["Encoded"], SchemaError>;
|
|
1055
1099
|
/**
|
|
1056
1100
|
* Encodes a typed input (the schema's `Type`) against a schema synchronously,
|
|
1057
1101
|
* returning an `Exit` that is either a `Success` with the encoded value or a
|
|
1058
1102
|
* `Failure` with a {@link SchemaError}. Only usable with schemas that have no
|
|
1059
1103
|
* `EncodingServices` requirement. For `unknown` input use
|
|
1060
1104
|
* {@link encodeUnknownExit}.
|
|
1105
|
+
* Options may be provided either when creating the encoder or when applying it;
|
|
1106
|
+
* application options override creation options.
|
|
1061
1107
|
*
|
|
1062
|
-
* @category
|
|
1108
|
+
* @category encoding
|
|
1063
1109
|
* @since 4.0.0
|
|
1064
1110
|
*/
|
|
1065
|
-
export declare const encodeExit: <S extends Encoder<unknown>>(schema: S) => (input: S["Type"], options?: AST.ParseOptions) => Exit_.Exit<S["Encoded"], SchemaError>;
|
|
1111
|
+
export declare const encodeExit: <S extends Encoder<unknown>>(schema: S, options?: AST.ParseOptions) => (input: S["Type"], options?: AST.ParseOptions) => Exit_.Exit<S["Encoded"], SchemaError>;
|
|
1066
1112
|
/**
|
|
1067
1113
|
* Encodes an `unknown` input against a schema, returning an `Option` that is
|
|
1068
1114
|
* `Some` with the encoded value on success or `None` on failure. Prefer this
|
|
1069
1115
|
* over {@link encodeUnknownExit} or {@link encodeUnknownEffect} when you only
|
|
1070
1116
|
* need to know whether encoding succeeded and don't need error details. For
|
|
1071
1117
|
* typed input use {@link encodeOption}.
|
|
1118
|
+
* Options may be provided either when creating the encoder or when applying it;
|
|
1119
|
+
* application options override creation options.
|
|
1072
1120
|
*
|
|
1073
|
-
* @category
|
|
1074
|
-
* @since
|
|
1121
|
+
* @category encoding
|
|
1122
|
+
* @since 3.10.0
|
|
1075
1123
|
*/
|
|
1076
1124
|
export declare const encodeUnknownOption: typeof Parser.encodeUnknownOption;
|
|
1077
1125
|
/**
|
|
1078
1126
|
* Encodes a typed input (the schema's `Type`) against a schema, returning an
|
|
1079
1127
|
* `Option` that is `Some` with the encoded value on success or `None` on
|
|
1080
1128
|
* failure. For `unknown` input use {@link encodeUnknownOption}.
|
|
1129
|
+
* Options may be provided either when creating the encoder or when applying it;
|
|
1130
|
+
* application options override creation options.
|
|
1081
1131
|
*
|
|
1082
|
-
* @category
|
|
1083
|
-
* @since
|
|
1132
|
+
* @category encoding
|
|
1133
|
+
* @since 3.10.0
|
|
1084
1134
|
*/
|
|
1085
|
-
export declare const encodeOption: <S extends Encoder<unknown>>(schema: S) => (input: S["Type"], options?: AST.ParseOptions) => Option_.Option<S["Encoded"]>;
|
|
1135
|
+
export declare const encodeOption: <S extends Encoder<unknown>>(schema: S, options?: AST.ParseOptions) => (input: S["Type"], options?: AST.ParseOptions) => Option_.Option<S["Encoded"]>;
|
|
1086
1136
|
/**
|
|
1087
|
-
* Encodes an `unknown` input against a schema, returning a `
|
|
1088
|
-
*
|
|
1089
|
-
*
|
|
1090
|
-
*
|
|
1137
|
+
* Encodes an `unknown` input against a schema, returning a `Result` that
|
|
1138
|
+
* succeeds with the encoded value or fails with a schema issue. For typed input
|
|
1139
|
+
* use {@link encodeResult}.
|
|
1140
|
+
* Options may be provided either when creating the encoder or when applying it;
|
|
1141
|
+
* application options override creation options.
|
|
1091
1142
|
*
|
|
1092
|
-
* @category
|
|
1143
|
+
* @category encoding
|
|
1093
1144
|
* @since 4.0.0
|
|
1094
1145
|
*/
|
|
1095
1146
|
export declare const encodeUnknownResult: typeof Parser.encodeUnknownResult;
|
|
1096
1147
|
/**
|
|
1097
|
-
*
|
|
1148
|
+
* Encodes a typed input (the schema's `Type`) against a schema, returning a
|
|
1149
|
+
* `Result` that succeeds with the encoded value or fails with a schema issue.
|
|
1150
|
+
* For `unknown` input use {@link encodeUnknownResult}.
|
|
1151
|
+
* Options may be provided either when creating the encoder or when applying it;
|
|
1152
|
+
* application options override creation options.
|
|
1153
|
+
*
|
|
1154
|
+
* @category encoding
|
|
1098
1155
|
* @since 4.0.0
|
|
1099
1156
|
*/
|
|
1100
|
-
export declare const encodeResult: <S extends Encoder<unknown>>(schema: S) => (input: S["Type"], options?: AST.ParseOptions) => Result_.Result<S["Encoded"], Issue.Issue>;
|
|
1157
|
+
export declare const encodeResult: <S extends Encoder<unknown>>(schema: S, options?: AST.ParseOptions) => (input: S["Type"], options?: AST.ParseOptions) => Result_.Result<S["Encoded"], Issue.Issue>;
|
|
1101
1158
|
/**
|
|
1102
|
-
*
|
|
1103
|
-
*
|
|
1159
|
+
* Encodes an `unknown` input against a schema, returning a `Promise` that
|
|
1160
|
+
* resolves with the encoded value or rejects with a schema issue. Useful for
|
|
1161
|
+
* integrating with Promise-based APIs. For typed input use
|
|
1162
|
+
* {@link encodePromise}.
|
|
1163
|
+
* Options may be provided either when creating the encoder or when applying it;
|
|
1164
|
+
* application options override creation options.
|
|
1165
|
+
*
|
|
1166
|
+
* @category encoding
|
|
1167
|
+
* @since 3.10.0
|
|
1104
1168
|
*/
|
|
1105
|
-
export declare const encodeUnknownPromise: <S extends Encoder<unknown>>(schema: S) => (input: unknown, options?: AST.ParseOptions) => Promise<S["Encoded"]>;
|
|
1169
|
+
export declare const encodeUnknownPromise: <S extends Encoder<unknown>>(schema: S, options?: AST.ParseOptions) => (input: unknown, options?: AST.ParseOptions) => Promise<S["Encoded"]>;
|
|
1106
1170
|
/**
|
|
1107
1171
|
* Encodes a typed input (the schema's `Type`) against a schema, returning a
|
|
1108
1172
|
* `Promise` that resolves with the encoded value or rejects with a
|
|
1109
1173
|
* {@link SchemaError}. For `unknown` input use {@link encodeUnknownPromise}.
|
|
1174
|
+
* Options may be provided either when creating the encoder or when applying it;
|
|
1175
|
+
* application options override creation options.
|
|
1110
1176
|
*
|
|
1111
|
-
* @category
|
|
1112
|
-
* @since
|
|
1177
|
+
* @category encoding
|
|
1178
|
+
* @since 3.10.0
|
|
1113
1179
|
*/
|
|
1114
|
-
export declare const encodePromise: <S extends Encoder<unknown>>(schema: S) => (input: S["Type"], options?: AST.ParseOptions) => Promise<S["Encoded"]>;
|
|
1180
|
+
export declare const encodePromise: <S extends Encoder<unknown>>(schema: S, options?: AST.ParseOptions) => (input: S["Type"], options?: AST.ParseOptions) => Promise<S["Encoded"]>;
|
|
1115
1181
|
/**
|
|
1116
1182
|
* Encodes an `unknown` input against a schema synchronously, throwing a
|
|
1117
1183
|
* {@link SchemaError} on failure. Use this when you want to serialize data at a
|
|
@@ -1119,8 +1185,10 @@ export declare const encodePromise: <S extends Encoder<unknown>>(schema: S) => (
|
|
|
1119
1185
|
* non-throwing alternatives see {@link encodeUnknownOption},
|
|
1120
1186
|
* {@link encodeUnknownExit}, or {@link encodeUnknownEffect}. For typed input
|
|
1121
1187
|
* use {@link encodeSync}.
|
|
1188
|
+
* Options may be provided either when creating the encoder or when applying it;
|
|
1189
|
+
* application options override creation options.
|
|
1122
1190
|
*
|
|
1123
|
-
* @category
|
|
1191
|
+
* @category encoding
|
|
1124
1192
|
* @since 4.0.0
|
|
1125
1193
|
*/
|
|
1126
1194
|
export declare const encodeUnknownSync: typeof Parser.encodeUnknownSync;
|
|
@@ -1128,11 +1196,13 @@ export declare const encodeUnknownSync: typeof Parser.encodeUnknownSync;
|
|
|
1128
1196
|
* Encodes a typed input (the schema's `Type`) against a schema synchronously,
|
|
1129
1197
|
* throwing a {@link SchemaError} on failure. For `unknown` input use
|
|
1130
1198
|
* {@link encodeUnknownSync}.
|
|
1199
|
+
* Options may be provided either when creating the encoder or when applying it;
|
|
1200
|
+
* application options override creation options.
|
|
1131
1201
|
*
|
|
1132
|
-
* @category
|
|
1202
|
+
* @category encoding
|
|
1133
1203
|
* @since 4.0.0
|
|
1134
1204
|
*/
|
|
1135
|
-
export declare const encodeSync: <S extends Encoder<unknown>>(schema: S) => (input: S["Type"], options?: AST.ParseOptions) => S["Encoded"];
|
|
1205
|
+
export declare const encodeSync: <S extends Encoder<unknown>>(schema: S, options?: AST.ParseOptions) => (input: S["Type"], options?: AST.ParseOptions) => S["Encoded"];
|
|
1136
1206
|
/**
|
|
1137
1207
|
* Creates a schema from an AST (Abstract Syntax Tree) node.
|
|
1138
1208
|
*
|
|
@@ -1145,8 +1215,8 @@ export declare const encodeSync: <S extends Encoder<unknown>>(schema: S) => (inp
|
|
|
1145
1215
|
* the bridge between the untyped AST representation and the strongly-typed
|
|
1146
1216
|
* schema.
|
|
1147
1217
|
*
|
|
1148
|
-
* @category
|
|
1149
|
-
* @since
|
|
1218
|
+
* @category constructors
|
|
1219
|
+
* @since 3.10.0
|
|
1150
1220
|
*/
|
|
1151
1221
|
export declare const make: <S extends Top>(ast: S["ast"], options?: object) => S;
|
|
1152
1222
|
/**
|
|
@@ -1167,6 +1237,7 @@ export declare const make: <S extends Top>(ast: S["ast"], options?: object) => S
|
|
|
1167
1237
|
* // "a"
|
|
1168
1238
|
* ```
|
|
1169
1239
|
*
|
|
1240
|
+
* @category constructors
|
|
1170
1241
|
* @since 4.0.0
|
|
1171
1242
|
*/
|
|
1172
1243
|
export declare function asClass<S extends Top>(schema: S): S & {
|
|
@@ -1175,8 +1246,8 @@ export declare function asClass<S extends Top>(schema: S): S & {
|
|
|
1175
1246
|
/**
|
|
1176
1247
|
* Tests if a value is a `Schema`.
|
|
1177
1248
|
*
|
|
1178
|
-
* @category
|
|
1179
|
-
* @since
|
|
1249
|
+
* @category guards
|
|
1250
|
+
* @since 3.10.0
|
|
1180
1251
|
*/
|
|
1181
1252
|
export declare function isSchema(u: unknown): u is Top;
|
|
1182
1253
|
/**
|
|
@@ -1184,6 +1255,7 @@ export declare function isSchema(u: unknown): u is Top;
|
|
|
1184
1255
|
* when present must match the wrapped schema (no implicit `undefined`).
|
|
1185
1256
|
* Produced by {@link optionalKey}.
|
|
1186
1257
|
*
|
|
1258
|
+
* @category models
|
|
1187
1259
|
* @since 4.0.0
|
|
1188
1260
|
*/
|
|
1189
1261
|
export interface optionalKey<S extends Top> extends Bottom<S["Type"], S["Encoded"], S["DecodingServices"], S["EncodingServices"], S["ast"], optionalKey<S>, S["~type.make.in"], S["Iso"], S["~type.parameters"], S["~type.make"], S["~type.mutability"], "optional", S["~type.constructor.default"], S["~encoded.mutability"], "optional"> {
|
|
@@ -1212,6 +1284,7 @@ interface optionalKeyLambda extends Lambda {
|
|
|
1212
1284
|
* type Person = typeof schema["Type"]
|
|
1213
1285
|
* ```
|
|
1214
1286
|
*
|
|
1287
|
+
* @category combinators
|
|
1215
1288
|
* @since 4.0.0
|
|
1216
1289
|
*/
|
|
1217
1290
|
export declare const optionalKey: optionalKeyLambda;
|
|
@@ -1223,6 +1296,7 @@ interface requiredKeyLambda extends Lambda {
|
|
|
1223
1296
|
* Reverses {@link optionalKey}, returning the inner required schema. Only
|
|
1224
1297
|
* applicable to schemas already wrapped with `optionalKey`.
|
|
1225
1298
|
*
|
|
1299
|
+
* @category combinators
|
|
1226
1300
|
* @since 4.0.0
|
|
1227
1301
|
*/
|
|
1228
1302
|
export declare const requiredKey: requiredKeyLambda;
|
|
@@ -1230,7 +1304,8 @@ export declare const requiredKey: requiredKeyLambda;
|
|
|
1230
1304
|
* Companion type for an optional struct key that also accepts `undefined`.
|
|
1231
1305
|
* Equivalent to `optionalKey<UndefinedOr<S>>`. Produced by {@link optional}.
|
|
1232
1306
|
*
|
|
1233
|
-
* @
|
|
1307
|
+
* @category models
|
|
1308
|
+
* @since 3.10.0
|
|
1234
1309
|
*/
|
|
1235
1310
|
export interface optional<S extends Top> extends optionalKey<UndefinedOr<S>> {
|
|
1236
1311
|
readonly "Rebuild": optional<S>;
|
|
@@ -1262,7 +1337,8 @@ interface optionalLambda extends Lambda {
|
|
|
1262
1337
|
* type Person = typeof schema.Type
|
|
1263
1338
|
* ```
|
|
1264
1339
|
*
|
|
1265
|
-
* @
|
|
1340
|
+
* @category combinators
|
|
1341
|
+
* @since 3.10.0
|
|
1266
1342
|
*/
|
|
1267
1343
|
export declare const optional: optionalLambda;
|
|
1268
1344
|
interface requiredLambda extends Lambda {
|
|
@@ -1273,13 +1349,15 @@ interface requiredLambda extends Lambda {
|
|
|
1273
1349
|
* Reverses {@link optional}, returning the inner schema (unwrapping `UndefinedOr`).
|
|
1274
1350
|
* Only applicable to schemas already wrapped with `optional`.
|
|
1275
1351
|
*
|
|
1276
|
-
* @
|
|
1352
|
+
* @category combinators
|
|
1353
|
+
* @since 3.10.0
|
|
1277
1354
|
*/
|
|
1278
1355
|
export declare const required: requiredLambda;
|
|
1279
1356
|
/**
|
|
1280
1357
|
* Companion type for a mutable struct key. The key's property is writable.
|
|
1281
1358
|
* Produced by {@link mutableKey}.
|
|
1282
1359
|
*
|
|
1360
|
+
* @category models
|
|
1283
1361
|
* @since 4.0.0
|
|
1284
1362
|
*/
|
|
1285
1363
|
export interface mutableKey<S extends Top> extends Bottom<S["Type"], S["Encoded"], S["DecodingServices"], S["EncodingServices"], S["ast"], mutableKey<S>, S["~type.make.in"], S["Iso"], S["~type.parameters"], S["~type.make"], "mutable", S["~type.optionality"], S["~type.constructor.default"], "mutable", S["~encoded.optionality"]> {
|
|
@@ -1293,6 +1371,7 @@ interface mutableKeyLambda extends Lambda {
|
|
|
1293
1371
|
* Makes a struct field mutable (removes the `readonly` modifier on the property).
|
|
1294
1372
|
* Use {@link readonlyKey} to reverse.
|
|
1295
1373
|
*
|
|
1374
|
+
* @category combinators
|
|
1296
1375
|
* @since 4.0.0
|
|
1297
1376
|
*/
|
|
1298
1377
|
export declare const mutableKey: mutableKeyLambda;
|
|
@@ -1304,6 +1383,7 @@ interface readonlyKeyLambda extends Lambda {
|
|
|
1304
1383
|
* Reverses {@link mutableKey}, returning the inner schema as readonly again.
|
|
1305
1384
|
* Only applicable to schemas already wrapped with `mutableKey`.
|
|
1306
1385
|
*
|
|
1386
|
+
* @category combinators
|
|
1307
1387
|
* @since 4.0.0
|
|
1308
1388
|
*/
|
|
1309
1389
|
export declare const readonlyKey: readonlyKeyLambda;
|
|
@@ -1311,6 +1391,7 @@ export declare const readonlyKey: readonlyKeyLambda;
|
|
|
1311
1391
|
* Schema type that collapses a transformation schema to its decoded `Type` on
|
|
1312
1392
|
* both sides (Type = Encoded = S["Type"]). Produced by {@link toType}.
|
|
1313
1393
|
*
|
|
1394
|
+
* @category transforming
|
|
1314
1395
|
* @since 4.0.0
|
|
1315
1396
|
*/
|
|
1316
1397
|
export interface toType<S extends Top> extends Bottom<S["Type"], S["Type"], never, never, S["ast"], toType<S>, S["~type.make.in"], S["Iso"], S["~type.parameters"], S["~type.make"], S["~type.mutability"], S["~type.optionality"], S["~type.constructor.default"], S["~encoded.mutability"], S["~encoded.optionality"]> {
|
|
@@ -1323,6 +1404,7 @@ interface toTypeLambda extends Lambda {
|
|
|
1323
1404
|
* Extracts the type-side schema: sets `Encoded` to equal the decoded `Type`,
|
|
1324
1405
|
* discarding the encoding transformation path.
|
|
1325
1406
|
*
|
|
1407
|
+
* @category transforming
|
|
1326
1408
|
* @since 4.0.0
|
|
1327
1409
|
*/
|
|
1328
1410
|
export declare const toType: toTypeLambda;
|
|
@@ -1330,6 +1412,7 @@ export declare const toType: toTypeLambda;
|
|
|
1330
1412
|
* Schema type that collapses a transformation schema to its `Encoded` side on
|
|
1331
1413
|
* both sides (Type = Encoded = S["Encoded"]). Produced by {@link toEncoded}.
|
|
1332
1414
|
*
|
|
1415
|
+
* @category transforming
|
|
1333
1416
|
* @since 4.0.0
|
|
1334
1417
|
*/
|
|
1335
1418
|
export interface toEncoded<S extends Top> extends Bottom<S["Encoded"], S["Encoded"], never, never, AST.AST, toEncoded<S>, S["Encoded"], S["Encoded"], ReadonlyArray<Top>, S["Encoded"], S["~type.mutability"], S["~type.optionality"], S["~type.constructor.default"], S["~encoded.mutability"], S["~encoded.optionality"]> {
|
|
@@ -1342,6 +1425,7 @@ interface toEncodedLambda extends Lambda {
|
|
|
1342
1425
|
* Extracts the encoded-side schema: sets `Type` to equal the `Encoded`,
|
|
1343
1426
|
* discarding the decoding transformation path.
|
|
1344
1427
|
*
|
|
1428
|
+
* @category transforming
|
|
1345
1429
|
* @since 4.0.0
|
|
1346
1430
|
*/
|
|
1347
1431
|
export declare const toEncoded: toEncodedLambda;
|
|
@@ -1350,6 +1434,7 @@ declare const FlipTypeId = "~effect/Schema/flip";
|
|
|
1350
1434
|
* Schema type representing a flipped schema where `Type` and `Encoded` are
|
|
1351
1435
|
* swapped. Produced by {@link flip}.
|
|
1352
1436
|
*
|
|
1437
|
+
* @category transforming
|
|
1353
1438
|
* @since 4.0.0
|
|
1354
1439
|
*/
|
|
1355
1440
|
export interface flip<S extends Top> extends Bottom<S["Encoded"], S["Type"], S["EncodingServices"], S["DecodingServices"], AST.AST, flip<S>, S["Encoded"], S["Encoded"], ReadonlyArray<Top>, S["Encoded"], S["~encoded.mutability"], S["~encoded.optionality"], ConstructorDefault, S["~type.mutability"], S["~type.optionality"]> {
|
|
@@ -1370,6 +1455,7 @@ export interface flip<S extends Top> extends Bottom<S["Encoded"], S["Type"], S["
|
|
|
1370
1455
|
* // flipped: decodes number → string
|
|
1371
1456
|
* ```
|
|
1372
1457
|
*
|
|
1458
|
+
* @category transforming
|
|
1373
1459
|
* @since 4.0.0
|
|
1374
1460
|
*/
|
|
1375
1461
|
export declare function flip<S extends Top>(schema: S): S extends flip<infer F> ? F["Rebuild"] : flip<S>;
|
|
@@ -1377,7 +1463,8 @@ export declare function flip<S extends Top>(schema: S): S extends flip<infer F>
|
|
|
1377
1463
|
* Represents a schema for a single literal value.
|
|
1378
1464
|
*
|
|
1379
1465
|
* @see {@link Literal} for the constructor function.
|
|
1380
|
-
* @
|
|
1466
|
+
* @category models
|
|
1467
|
+
* @since 3.10.0
|
|
1381
1468
|
*/
|
|
1382
1469
|
export interface Literal<L extends AST.LiteralValue> extends Bottom<L, L, never, never, AST.Literal, Literal<L>> {
|
|
1383
1470
|
readonly literal: L;
|
|
@@ -1387,6 +1474,7 @@ export interface Literal<L extends AST.LiteralValue> extends Bottom<L, L, never,
|
|
|
1387
1474
|
* Creates a schema for a single literal value (string, number, bigint, boolean, or null).
|
|
1388
1475
|
*
|
|
1389
1476
|
* **Example** (String literal)
|
|
1477
|
+
*
|
|
1390
1478
|
* ```ts
|
|
1391
1479
|
* import { Schema } from "effect"
|
|
1392
1480
|
*
|
|
@@ -1397,36 +1485,58 @@ export interface Literal<L extends AST.LiteralValue> extends Bottom<L, L, never,
|
|
|
1397
1485
|
* @see {@link Literals} for a schema that represents a union of literals.
|
|
1398
1486
|
* @see {@link tag} for a schema that represents a literal value that can be
|
|
1399
1487
|
* used as a discriminator field in tagged unions and has a constructor default.
|
|
1400
|
-
* @
|
|
1488
|
+
* @category constructors
|
|
1489
|
+
* @since 3.10.0
|
|
1401
1490
|
*/
|
|
1402
1491
|
export declare function Literal<L extends AST.LiteralValue>(literal: L): Literal<L>;
|
|
1403
1492
|
/**
|
|
1404
1493
|
* Namespace for {@link TemplateLiteral} helper types.
|
|
1405
1494
|
*
|
|
1406
|
-
* @since
|
|
1495
|
+
* @since 3.10.0
|
|
1407
1496
|
*/
|
|
1408
1497
|
export declare namespace TemplateLiteral {
|
|
1409
1498
|
/**
|
|
1499
|
+
* Constraint for schema parts that can appear inside a `TemplateLiteral`.
|
|
1500
|
+
*
|
|
1501
|
+
* **Details**
|
|
1502
|
+
* The schema's encoded value must be a `string`, `number`, or `bigint` so it can
|
|
1503
|
+
* be converted into a template literal string segment.
|
|
1504
|
+
*
|
|
1505
|
+
* @category utility types
|
|
1410
1506
|
* @since 4.0.0
|
|
1411
1507
|
*/
|
|
1412
1508
|
interface SchemaPart extends Top {
|
|
1413
1509
|
readonly Encoded: string | number | bigint;
|
|
1414
1510
|
}
|
|
1415
1511
|
/**
|
|
1512
|
+
* Literal value that can be used directly as a part of a `TemplateLiteral`.
|
|
1513
|
+
*
|
|
1514
|
+
* @category utility types
|
|
1416
1515
|
* @since 4.0.0
|
|
1417
1516
|
*/
|
|
1418
1517
|
type LiteralPart = string | number | bigint;
|
|
1419
1518
|
/**
|
|
1519
|
+
* A single part of a `TemplateLiteral`, either an interpolated schema part or a
|
|
1520
|
+
* literal `string`, `number`, or `bigint`.
|
|
1521
|
+
*
|
|
1522
|
+
* @category utility types
|
|
1420
1523
|
* @since 4.0.0
|
|
1421
1524
|
*/
|
|
1422
1525
|
type Part = SchemaPart | LiteralPart;
|
|
1423
1526
|
/**
|
|
1527
|
+
* Ordered list of parts used to construct a `TemplateLiteral` schema.
|
|
1528
|
+
*
|
|
1529
|
+
* @category utility types
|
|
1424
1530
|
* @since 4.0.0
|
|
1425
1531
|
*/
|
|
1426
1532
|
type Parts = ReadonlyArray<Part>;
|
|
1427
1533
|
type AppendType<Template extends string, Next> = Next extends LiteralPart ? `${Template}${Next}` : Next extends Codec<unknown, infer E extends LiteralPart, unknown, unknown> ? `${Template}${E}` : never;
|
|
1428
1534
|
/**
|
|
1429
|
-
*
|
|
1535
|
+
* Computes the encoded string literal type produced by concatenating the encoded
|
|
1536
|
+
* forms of all template literal parts.
|
|
1537
|
+
*
|
|
1538
|
+
* @category utility types
|
|
1539
|
+
* @since 3.10.0
|
|
1430
1540
|
*/
|
|
1431
1541
|
type Encoded<Parts> = Parts extends readonly [...infer Init, infer Last] ? AppendType<Encoded<Init>, Last> : ``;
|
|
1432
1542
|
}
|
|
@@ -1435,7 +1545,8 @@ export declare namespace TemplateLiteral {
|
|
|
1435
1545
|
* The encoded type is a string formed by concatenating the parts.
|
|
1436
1546
|
*
|
|
1437
1547
|
* @see {@link TemplateLiteral} for the constructor function.
|
|
1438
|
-
* @
|
|
1548
|
+
* @category models
|
|
1549
|
+
* @since 3.10.0
|
|
1439
1550
|
*/
|
|
1440
1551
|
export interface TemplateLiteral<Parts extends TemplateLiteral.Parts> extends Bottom<TemplateLiteral.Encoded<Parts>, TemplateLiteral.Encoded<Parts>, never, never, AST.TemplateLiteral, TemplateLiteral<Parts>> {
|
|
1441
1552
|
readonly parts: Parts;
|
|
@@ -1445,6 +1556,7 @@ export interface TemplateLiteral<Parts extends TemplateLiteral.Parts> extends Bo
|
|
|
1445
1556
|
* a literal string/number/bigint or a schema whose encoded type is a string, number, or bigint.
|
|
1446
1557
|
*
|
|
1447
1558
|
* **Example** (URL path pattern)
|
|
1559
|
+
*
|
|
1448
1560
|
* ```ts
|
|
1449
1561
|
* import { Schema } from "effect"
|
|
1450
1562
|
*
|
|
@@ -1453,17 +1565,25 @@ export interface TemplateLiteral<Parts extends TemplateLiteral.Parts> extends Bo
|
|
|
1453
1565
|
* ```
|
|
1454
1566
|
*
|
|
1455
1567
|
* @see {@link TemplateLiteralParser} for a schema that also parses matched parts into a tuple.
|
|
1456
|
-
* @
|
|
1568
|
+
* @category constructors
|
|
1569
|
+
* @since 3.10.0
|
|
1457
1570
|
*/
|
|
1458
1571
|
export declare function TemplateLiteral<const Parts extends TemplateLiteral.Parts>(parts: Parts): TemplateLiteral<Parts>;
|
|
1459
1572
|
/**
|
|
1460
1573
|
* Namespace for {@link TemplateLiteralParser} helper types.
|
|
1461
1574
|
*
|
|
1462
|
-
* @since
|
|
1575
|
+
* @since 3.10.0
|
|
1463
1576
|
*/
|
|
1464
1577
|
export declare namespace TemplateLiteralParser {
|
|
1465
1578
|
/**
|
|
1466
|
-
*
|
|
1579
|
+
* Computes the decoded tuple type produced by `TemplateLiteralParser`.
|
|
1580
|
+
*
|
|
1581
|
+
* **Details**
|
|
1582
|
+
* Literal parts contribute their literal value to the tuple. Schema parts
|
|
1583
|
+
* contribute their decoded `Type`.
|
|
1584
|
+
*
|
|
1585
|
+
* @category utility types
|
|
1586
|
+
* @since 3.10.0
|
|
1467
1587
|
*/
|
|
1468
1588
|
type Type<Parts> = Parts extends readonly [infer Head, ...infer Tail] ? readonly [
|
|
1469
1589
|
Head extends TemplateLiteral.LiteralPart ? Head : Head extends Codec<infer T, unknown, unknown, unknown> ? T : never,
|
|
@@ -1475,7 +1595,8 @@ export declare namespace TemplateLiteralParser {
|
|
|
1475
1595
|
* them into a tuple of typed values, one per schema part.
|
|
1476
1596
|
*
|
|
1477
1597
|
* @see {@link TemplateLiteralParser} for the constructor function.
|
|
1478
|
-
* @
|
|
1598
|
+
* @category models
|
|
1599
|
+
* @since 3.10.0
|
|
1479
1600
|
*/
|
|
1480
1601
|
export interface TemplateLiteralParser<Parts extends TemplateLiteral.Parts> extends Bottom<TemplateLiteralParser.Type<Parts>, TemplateLiteral.Encoded<Parts>, never, never, AST.Arrays, TemplateLiteralParser<Parts>> {
|
|
1481
1602
|
readonly parts: Parts;
|
|
@@ -1485,6 +1606,7 @@ export interface TemplateLiteralParser<Parts extends TemplateLiteral.Parts> exte
|
|
|
1485
1606
|
* one element per schema part.
|
|
1486
1607
|
*
|
|
1487
1608
|
* **Example** (Parse path parameters)
|
|
1609
|
+
*
|
|
1488
1610
|
* ```ts
|
|
1489
1611
|
* import { Schema } from "effect"
|
|
1490
1612
|
*
|
|
@@ -1493,14 +1615,16 @@ export interface TemplateLiteralParser<Parts extends TemplateLiteral.Parts> exte
|
|
|
1493
1615
|
* ```
|
|
1494
1616
|
*
|
|
1495
1617
|
* @see {@link TemplateLiteral} for a validation-only version that keeps the string encoded.
|
|
1496
|
-
* @
|
|
1618
|
+
* @category constructors
|
|
1619
|
+
* @since 3.10.0
|
|
1497
1620
|
*/
|
|
1498
1621
|
export declare function TemplateLiteralParser<const Parts extends TemplateLiteral.Parts>(parts: Parts): TemplateLiteralParser<Parts>;
|
|
1499
1622
|
/**
|
|
1500
|
-
* Represents a schema derived from a TypeScript
|
|
1501
|
-
* accepting any of its values.
|
|
1623
|
+
* Represents a schema derived from a TypeScript enum object or an enum-like
|
|
1624
|
+
* `as const` object, accepting any of its values.
|
|
1502
1625
|
*
|
|
1503
1626
|
* @see {@link Enum} for the constructor function.
|
|
1627
|
+
* @category models
|
|
1504
1628
|
* @since 4.0.0
|
|
1505
1629
|
*/
|
|
1506
1630
|
export interface Enum<A extends {
|
|
@@ -1512,6 +1636,7 @@ export interface Enum<A extends {
|
|
|
1512
1636
|
* Creates a schema from a TypeScript enum object. Validates that the input is one of the enum's values.
|
|
1513
1637
|
*
|
|
1514
1638
|
* **Example** (Direction enum)
|
|
1639
|
+
*
|
|
1515
1640
|
* ```ts
|
|
1516
1641
|
* import { Schema } from "effect"
|
|
1517
1642
|
*
|
|
@@ -1524,6 +1649,7 @@ export interface Enum<A extends {
|
|
|
1524
1649
|
* // accepts "Up" or "Down"
|
|
1525
1650
|
* ```
|
|
1526
1651
|
*
|
|
1652
|
+
* @category constructors
|
|
1527
1653
|
* @since 4.0.0
|
|
1528
1654
|
*/
|
|
1529
1655
|
export declare function Enum<A extends {
|
|
@@ -1533,21 +1659,24 @@ export declare function Enum<A extends {
|
|
|
1533
1659
|
* Schema for the `never` type. Always fails validation.
|
|
1534
1660
|
*
|
|
1535
1661
|
* @see {@link Never} for the schema value.
|
|
1536
|
-
* @
|
|
1662
|
+
* @category models
|
|
1663
|
+
* @since 3.10.0
|
|
1537
1664
|
*/
|
|
1538
1665
|
export interface Never extends Bottom<never, never, never, never, AST.Never, Never> {
|
|
1539
1666
|
}
|
|
1540
1667
|
/**
|
|
1541
1668
|
* Schema for the `never` type. Always fails validation — no value satisfies it.
|
|
1542
1669
|
*
|
|
1543
|
-
* @
|
|
1670
|
+
* @category schemas
|
|
1671
|
+
* @since 3.10.0
|
|
1544
1672
|
*/
|
|
1545
1673
|
export declare const Never: Never;
|
|
1546
1674
|
/**
|
|
1547
1675
|
* Schema for the `any` type. Accepts any value without validation.
|
|
1548
1676
|
*
|
|
1549
1677
|
* @see {@link Any} for the schema value.
|
|
1550
|
-
* @
|
|
1678
|
+
* @category models
|
|
1679
|
+
* @since 3.10.0
|
|
1551
1680
|
*/
|
|
1552
1681
|
export interface Any extends Bottom<any, any, never, never, AST.Any, Any> {
|
|
1553
1682
|
}
|
|
@@ -1555,14 +1684,16 @@ export interface Any extends Bottom<any, any, never, never, AST.Any, Any> {
|
|
|
1555
1684
|
* Schema for the `any` type. Accepts any value without validation.
|
|
1556
1685
|
*
|
|
1557
1686
|
* @see {@link Unknown} for a safer alternative that uses `unknown`.
|
|
1558
|
-
* @
|
|
1687
|
+
* @category schemas
|
|
1688
|
+
* @since 3.10.0
|
|
1559
1689
|
*/
|
|
1560
1690
|
export declare const Any: Any;
|
|
1561
1691
|
/**
|
|
1562
1692
|
* Schema for the `unknown` type. Accepts any value without validation.
|
|
1563
1693
|
*
|
|
1564
1694
|
* @see {@link Unknown} for the schema value.
|
|
1565
|
-
* @
|
|
1695
|
+
* @category models
|
|
1696
|
+
* @since 3.10.0
|
|
1566
1697
|
*/
|
|
1567
1698
|
export interface Unknown extends Bottom<unknown, unknown, never, never, AST.Unknown, Unknown> {
|
|
1568
1699
|
}
|
|
@@ -1570,14 +1701,16 @@ export interface Unknown extends Bottom<unknown, unknown, never, never, AST.Unkn
|
|
|
1570
1701
|
* Schema for the `unknown` type. Accepts any value without validation.
|
|
1571
1702
|
*
|
|
1572
1703
|
* @see {@link Any} for the `any` variant.
|
|
1573
|
-
* @
|
|
1704
|
+
* @category schemas
|
|
1705
|
+
* @since 3.10.0
|
|
1574
1706
|
*/
|
|
1575
1707
|
export declare const Unknown: Unknown;
|
|
1576
1708
|
/**
|
|
1577
1709
|
* Schema for the `null` literal. Validates that the input is strictly `null`.
|
|
1578
1710
|
*
|
|
1579
1711
|
* @see {@link Null} for the schema value.
|
|
1580
|
-
* @
|
|
1712
|
+
* @category models
|
|
1713
|
+
* @since 3.10.0
|
|
1581
1714
|
*/
|
|
1582
1715
|
export interface Null extends Bottom<null, null, never, never, AST.Null, Null> {
|
|
1583
1716
|
}
|
|
@@ -1585,14 +1718,16 @@ export interface Null extends Bottom<null, null, never, never, AST.Null, Null> {
|
|
|
1585
1718
|
* Schema for the `null` literal. Validates that the input is strictly `null`.
|
|
1586
1719
|
*
|
|
1587
1720
|
* @see {@link NullOr} for a union with another schema.
|
|
1588
|
-
* @
|
|
1721
|
+
* @category schemas
|
|
1722
|
+
* @since 3.10.0
|
|
1589
1723
|
*/
|
|
1590
1724
|
export declare const Null: Null;
|
|
1591
1725
|
/**
|
|
1592
1726
|
* Schema for the `undefined` literal. Validates that the input is strictly `undefined`.
|
|
1593
1727
|
*
|
|
1594
1728
|
* @see {@link Undefined} for the schema value.
|
|
1595
|
-
* @
|
|
1729
|
+
* @category models
|
|
1730
|
+
* @since 3.10.0
|
|
1596
1731
|
*/
|
|
1597
1732
|
export interface Undefined extends Bottom<undefined, undefined, never, never, AST.Undefined, Undefined> {
|
|
1598
1733
|
}
|
|
@@ -1600,13 +1735,15 @@ export interface Undefined extends Bottom<undefined, undefined, never, never, AS
|
|
|
1600
1735
|
* Schema for the `undefined` literal. Validates that the input is strictly `undefined`.
|
|
1601
1736
|
*
|
|
1602
1737
|
* @see {@link UndefinedOr} for a union with another schema.
|
|
1603
|
-
* @
|
|
1738
|
+
* @category schemas
|
|
1739
|
+
* @since 3.10.0
|
|
1604
1740
|
*/
|
|
1605
1741
|
export declare const Undefined: Undefined;
|
|
1606
1742
|
/**
|
|
1607
1743
|
* Schema for `string` values.
|
|
1608
1744
|
*
|
|
1609
1745
|
* @see {@link String} for the schema value.
|
|
1746
|
+
* @category models
|
|
1610
1747
|
* @since 4.0.0
|
|
1611
1748
|
*/
|
|
1612
1749
|
export interface String extends Bottom<string, string, never, never, AST.String, String> {
|
|
@@ -1614,6 +1751,7 @@ export interface String extends Bottom<string, string, never, never, AST.String,
|
|
|
1614
1751
|
/**
|
|
1615
1752
|
* Schema for `string` values. Validates that the input is `typeof` `"string"`.
|
|
1616
1753
|
*
|
|
1754
|
+
* @category schemas
|
|
1617
1755
|
* @since 4.0.0
|
|
1618
1756
|
*/
|
|
1619
1757
|
export declare const String: String;
|
|
@@ -1621,6 +1759,7 @@ export declare const String: String;
|
|
|
1621
1759
|
* Schema for `number` values, including `NaN`, `Infinity`, and `-Infinity`.
|
|
1622
1760
|
*
|
|
1623
1761
|
* @see {@link Number} for the schema value.
|
|
1762
|
+
* @category models
|
|
1624
1763
|
* @since 4.0.0
|
|
1625
1764
|
*/
|
|
1626
1765
|
export interface Number extends Bottom<number, number, never, never, AST.Number, Number> {
|
|
@@ -1634,6 +1773,7 @@ export interface Number extends Bottom<number, number, never, never, AST.Number,
|
|
|
1634
1773
|
* - Non-finite values are serialized as strings (`"NaN"`, `"Infinity"`, `"-Infinity"`).
|
|
1635
1774
|
*
|
|
1636
1775
|
* @see {@link Finite} for a schema that excludes non-finite values.
|
|
1776
|
+
* @category schemas
|
|
1637
1777
|
* @since 4.0.0
|
|
1638
1778
|
*/
|
|
1639
1779
|
export declare const Number: Number;
|
|
@@ -1641,6 +1781,7 @@ export declare const Number: Number;
|
|
|
1641
1781
|
* Schema for `boolean` values.
|
|
1642
1782
|
*
|
|
1643
1783
|
* @see {@link Boolean} for the schema value.
|
|
1784
|
+
* @category models
|
|
1644
1785
|
* @since 4.0.0
|
|
1645
1786
|
*/
|
|
1646
1787
|
export interface Boolean extends Bottom<boolean, boolean, never, never, AST.Boolean, Boolean> {
|
|
@@ -1656,6 +1797,7 @@ export declare const Boolean: Boolean;
|
|
|
1656
1797
|
* Schema for `symbol` values.
|
|
1657
1798
|
*
|
|
1658
1799
|
* @see {@link Symbol} for the schema value.
|
|
1800
|
+
* @category models
|
|
1659
1801
|
* @since 4.0.0
|
|
1660
1802
|
*/
|
|
1661
1803
|
export interface Symbol extends Bottom<symbol, symbol, never, never, AST.Symbol, Symbol> {
|
|
@@ -1664,6 +1806,7 @@ export interface Symbol extends Bottom<symbol, symbol, never, never, AST.Symbol,
|
|
|
1664
1806
|
* Schema for `symbol` values. Validates that the input is `typeof` `"symbol"`.
|
|
1665
1807
|
*
|
|
1666
1808
|
* @see {@link UniqueSymbol} for a schema that matches a specific symbol.
|
|
1809
|
+
* @category schemas
|
|
1667
1810
|
* @since 4.0.0
|
|
1668
1811
|
*/
|
|
1669
1812
|
export declare const Symbol: Symbol;
|
|
@@ -1671,6 +1814,7 @@ export declare const Symbol: Symbol;
|
|
|
1671
1814
|
* Schema for `bigint` values.
|
|
1672
1815
|
*
|
|
1673
1816
|
* @see {@link BigInt} for the schema value.
|
|
1817
|
+
* @category models
|
|
1674
1818
|
* @since 4.0.0
|
|
1675
1819
|
*/
|
|
1676
1820
|
export interface BigInt extends Bottom<bigint, bigint, never, never, AST.BigInt, BigInt> {
|
|
@@ -1678,6 +1822,7 @@ export interface BigInt extends Bottom<bigint, bigint, never, never, AST.BigInt,
|
|
|
1678
1822
|
/**
|
|
1679
1823
|
* Schema for `bigint` values. Validates that the input is `typeof` `"bigint"`.
|
|
1680
1824
|
*
|
|
1825
|
+
* @category schemas
|
|
1681
1826
|
* @since 4.0.0
|
|
1682
1827
|
*/
|
|
1683
1828
|
export declare const BigInt: BigInt;
|
|
@@ -1685,20 +1830,23 @@ export declare const BigInt: BigInt;
|
|
|
1685
1830
|
* Schema for the `void` type.
|
|
1686
1831
|
*
|
|
1687
1832
|
* @see {@link Void} for the schema value.
|
|
1688
|
-
* @
|
|
1833
|
+
* @category models
|
|
1834
|
+
* @since 3.10.0
|
|
1689
1835
|
*/
|
|
1690
1836
|
export interface Void extends Bottom<void, void, never, never, AST.Void, Void> {
|
|
1691
1837
|
}
|
|
1692
1838
|
/**
|
|
1693
1839
|
* Schema for the `void` type. Accepts `undefined` as the encoded value.
|
|
1694
1840
|
*
|
|
1695
|
-
* @
|
|
1841
|
+
* @category schemas
|
|
1842
|
+
* @since 3.10.0
|
|
1696
1843
|
*/
|
|
1697
1844
|
export declare const Void: Void;
|
|
1698
1845
|
/**
|
|
1699
1846
|
* Schema for the `object` type keyword.
|
|
1700
1847
|
*
|
|
1701
1848
|
* @see {@link ObjectKeyword} for the schema value.
|
|
1849
|
+
* @category models
|
|
1702
1850
|
* @since 4.0.0
|
|
1703
1851
|
*/
|
|
1704
1852
|
export interface ObjectKeyword extends Bottom<object, object, never, never, AST.ObjectKeyword, ObjectKeyword> {
|
|
@@ -1707,6 +1855,7 @@ export interface ObjectKeyword extends Bottom<object, object, never, never, AST.
|
|
|
1707
1855
|
* Schema for the `object` type. Validates that the input is a non-null object or function
|
|
1708
1856
|
* (i.e. `typeof value === "object" && value !== null || typeof value === "function"`).
|
|
1709
1857
|
*
|
|
1858
|
+
* @category schemas
|
|
1710
1859
|
* @since 4.0.0
|
|
1711
1860
|
*/
|
|
1712
1861
|
export declare const ObjectKeyword: ObjectKeyword;
|
|
@@ -1714,6 +1863,7 @@ export declare const ObjectKeyword: ObjectKeyword;
|
|
|
1714
1863
|
* Represents a schema for a specific unique symbol.
|
|
1715
1864
|
*
|
|
1716
1865
|
* @see {@link UniqueSymbol} for the constructor function.
|
|
1866
|
+
* @category models
|
|
1717
1867
|
* @since 4.0.0
|
|
1718
1868
|
*/
|
|
1719
1869
|
export interface UniqueSymbol<sym extends symbol> extends Bottom<sym, sym, never, never, AST.UniqueSymbol, UniqueSymbol<sym>> {
|
|
@@ -1722,6 +1872,7 @@ export interface UniqueSymbol<sym extends symbol> extends Bottom<sym, sym, never
|
|
|
1722
1872
|
* Creates a schema for a specific symbol. Only that exact symbol satisfies the schema.
|
|
1723
1873
|
*
|
|
1724
1874
|
* **Example** (Specific symbol)
|
|
1875
|
+
*
|
|
1725
1876
|
* ```ts
|
|
1726
1877
|
* import { Schema } from "effect"
|
|
1727
1878
|
*
|
|
@@ -1730,6 +1881,7 @@ export interface UniqueSymbol<sym extends symbol> extends Bottom<sym, sym, never
|
|
|
1730
1881
|
* ```
|
|
1731
1882
|
*
|
|
1732
1883
|
* @see {@link Symbol} for a schema that accepts any symbol.
|
|
1884
|
+
* @category constructors
|
|
1733
1885
|
* @since 4.0.0
|
|
1734
1886
|
*/
|
|
1735
1887
|
export declare function UniqueSymbol<const sym extends symbol>(symbol: sym): UniqueSymbol<sym>;
|
|
@@ -1746,13 +1898,14 @@ export declare function UniqueSymbol<const sym extends symbol>(symbol: sym): Uni
|
|
|
1746
1898
|
* - `Struct.MakeIn<F>` — constructor input (optional/defaulted fields may be omitted)
|
|
1747
1899
|
* - `Struct.DecodingServices<F>` / `Struct.EncodingServices<F>` — required services
|
|
1748
1900
|
*
|
|
1749
|
-
* @since
|
|
1901
|
+
* @since 3.10.0
|
|
1750
1902
|
*/
|
|
1751
1903
|
export declare namespace Struct {
|
|
1752
1904
|
/**
|
|
1753
1905
|
* Constraint for a struct field map: an object whose values are schemas.
|
|
1754
1906
|
*
|
|
1755
|
-
* @
|
|
1907
|
+
* @category utility types
|
|
1908
|
+
* @since 3.10.0
|
|
1756
1909
|
*/
|
|
1757
1910
|
type Fields = {
|
|
1758
1911
|
readonly [x: PropertyKey]: Top;
|
|
@@ -1777,7 +1930,14 @@ export declare namespace Struct {
|
|
|
1777
1930
|
-readonly [K in keyof F as K extends M & O ? K : never]?: F[K]["Type"];
|
|
1778
1931
|
};
|
|
1779
1932
|
/**
|
|
1780
|
-
*
|
|
1933
|
+
* Computes the decoded object type for a struct field map.
|
|
1934
|
+
*
|
|
1935
|
+
* **Details**
|
|
1936
|
+
* Field schemas contribute their decoded `Type`. `optionalKey` and `optional`
|
|
1937
|
+
* produce optional properties, while `mutableKey` produces writable properties.
|
|
1938
|
+
*
|
|
1939
|
+
* @category utility types
|
|
1940
|
+
* @since 3.10.0
|
|
1781
1941
|
*/
|
|
1782
1942
|
type Type<F extends Fields> = Simplify<Type_<F>>;
|
|
1783
1943
|
type Iso_<F extends Fields, O extends keyof F = TypeOptionalKeys<F>, M extends keyof F = TypeMutableKeys<F>> = {
|
|
@@ -1790,6 +1950,14 @@ export declare namespace Struct {
|
|
|
1790
1950
|
-readonly [K in keyof F as K extends M & O ? K : never]?: F[K]["Iso"];
|
|
1791
1951
|
};
|
|
1792
1952
|
/**
|
|
1953
|
+
* Computes the iso object type for a struct field map from each field schema's
|
|
1954
|
+
* `Iso` type.
|
|
1955
|
+
*
|
|
1956
|
+
* **Details**
|
|
1957
|
+
* The resulting property optionality and mutability follow the same field
|
|
1958
|
+
* modifiers used by `Struct.Type`.
|
|
1959
|
+
*
|
|
1960
|
+
* @category utility types
|
|
1793
1961
|
* @since 4.0.0
|
|
1794
1962
|
*/
|
|
1795
1963
|
type Iso<F extends Fields> = Simplify<Iso_<F>>;
|
|
@@ -1813,16 +1981,32 @@ export declare namespace Struct {
|
|
|
1813
1981
|
-readonly [K in keyof F as K extends M & O ? K : never]?: F[K]["Encoded"];
|
|
1814
1982
|
};
|
|
1815
1983
|
/**
|
|
1816
|
-
*
|
|
1984
|
+
* Computes the encoded object type for a struct field map.
|
|
1985
|
+
*
|
|
1986
|
+
* **Details**
|
|
1987
|
+
* Field schemas contribute their `Encoded` type. Encoded-side optionality and
|
|
1988
|
+
* mutability modifiers determine whether properties are optional or writable in
|
|
1989
|
+
* the encoded shape.
|
|
1990
|
+
*
|
|
1991
|
+
* @category utility types
|
|
1992
|
+
* @since 3.10.0
|
|
1817
1993
|
*/
|
|
1818
1994
|
type Encoded<F extends Fields> = Simplify<Encoded_<F>>;
|
|
1819
1995
|
/**
|
|
1996
|
+
* Union of all decoding service requirements needed by the schemas in a struct
|
|
1997
|
+
* field map.
|
|
1998
|
+
*
|
|
1999
|
+
* @category utility types
|
|
1820
2000
|
* @since 4.0.0
|
|
1821
2001
|
*/
|
|
1822
2002
|
type DecodingServices<F extends Fields> = {
|
|
1823
2003
|
readonly [K in keyof F]: F[K]["DecodingServices"];
|
|
1824
2004
|
}[keyof F];
|
|
1825
2005
|
/**
|
|
2006
|
+
* Union of all encoding service requirements needed by the schemas in a struct
|
|
2007
|
+
* field map.
|
|
2008
|
+
*
|
|
2009
|
+
* @category utility types
|
|
1826
2010
|
* @since 4.0.0
|
|
1827
2011
|
*/
|
|
1828
2012
|
type EncodingServices<F extends Fields> = {
|
|
@@ -1839,12 +2023,27 @@ export declare namespace Struct {
|
|
|
1839
2023
|
readonly [K in keyof F as K extends O ? K : never]?: F[K]["~type.make"];
|
|
1840
2024
|
};
|
|
1841
2025
|
/**
|
|
2026
|
+
* Computes the input object type accepted when constructing a struct value.
|
|
2027
|
+
*
|
|
2028
|
+
* **Details**
|
|
2029
|
+
* Required fields use each field schema's `~type.make` input. Fields marked
|
|
2030
|
+
* optional or with a constructor default may be omitted.
|
|
2031
|
+
*
|
|
2032
|
+
* @category utility types
|
|
1842
2033
|
* @since 4.0.0
|
|
1843
2034
|
*/
|
|
1844
2035
|
type MakeIn<F extends Fields> = Simplify<MakeIn_<F>>;
|
|
1845
2036
|
}
|
|
1846
2037
|
/**
|
|
1847
|
-
*
|
|
2038
|
+
* Schema type returned by `Schema.Struct` for an object with a fixed set of
|
|
2039
|
+
* schema-defined fields.
|
|
2040
|
+
*
|
|
2041
|
+
* **Details**
|
|
2042
|
+
* The `fields` property exposes the original field map for reuse, and
|
|
2043
|
+
* `mapFields` creates a new struct schema by transforming that field map.
|
|
2044
|
+
*
|
|
2045
|
+
* @category models
|
|
2046
|
+
* @since 3.10.0
|
|
1848
2047
|
*/
|
|
1849
2048
|
export interface Struct<Fields extends Struct.Fields> extends Bottom<Struct.Type<Fields>, Struct.Encoded<Fields>, Struct.DecodingServices<Fields>, Struct.EncodingServices<Fields>, AST.Objects, Struct<Fields>, Struct.MakeIn<Fields>, Struct.Iso<Fields>> {
|
|
1850
2049
|
/**
|
|
@@ -1915,8 +2114,8 @@ export interface Struct<Fields extends Struct.Fields> extends Bottom<Struct.Type
|
|
|
1915
2114
|
* // { name: 'Alice', age: 30 }
|
|
1916
2115
|
* ```
|
|
1917
2116
|
*
|
|
1918
|
-
* @category
|
|
1919
|
-
* @since
|
|
2117
|
+
* @category constructors
|
|
2118
|
+
* @since 3.10.0
|
|
1920
2119
|
*/
|
|
1921
2120
|
export declare function Struct<const Fields extends Struct.Fields>(fields: Fields): Struct<Fields>;
|
|
1922
2121
|
interface fieldsAssign<NewFields extends Struct.Fields> extends Lambda {
|
|
@@ -1939,6 +2138,7 @@ interface fieldsAssign<NewFields extends Struct.Fields> extends Lambda {
|
|
|
1939
2138
|
* ]).mapMembers(Tuple.map(Schema.fieldsAssign({ c: Schema.Number })))
|
|
1940
2139
|
* ```
|
|
1941
2140
|
*
|
|
2141
|
+
* @category combinators
|
|
1942
2142
|
* @since 4.0.0
|
|
1943
2143
|
*/
|
|
1944
2144
|
export declare function fieldsAssign<const NewFields extends Struct.Fields>(fields: NewFields): fieldsAssign<NewFields>;
|
|
@@ -1946,6 +2146,7 @@ export declare function fieldsAssign<const NewFields extends Struct.Fields>(fiel
|
|
|
1946
2146
|
* Schema type for a struct with renamed encoded keys. Produced by
|
|
1947
2147
|
* {@link encodeKeys}.
|
|
1948
2148
|
*
|
|
2149
|
+
* @category transforming
|
|
1949
2150
|
* @since 4.0.0
|
|
1950
2151
|
*/
|
|
1951
2152
|
export interface encodeKeys<S extends Top & {
|
|
@@ -1977,7 +2178,7 @@ export interface encodeKeys<S extends Top & {
|
|
|
1977
2178
|
* // { name: 'Alice', age: 30 }
|
|
1978
2179
|
* ```
|
|
1979
2180
|
*
|
|
1980
|
-
* @category
|
|
2181
|
+
* @category transforming
|
|
1981
2182
|
* @since 4.0.0
|
|
1982
2183
|
*/
|
|
1983
2184
|
export declare function encodeKeys<S extends Top & {
|
|
@@ -2011,8 +2212,8 @@ export declare function encodeKeys<S extends Top & {
|
|
|
2011
2212
|
* // Alice Smith
|
|
2012
2213
|
* ```
|
|
2013
2214
|
*
|
|
2215
|
+
* @category transforming
|
|
2014
2216
|
* @since 4.0.0
|
|
2015
|
-
* @experimental
|
|
2016
2217
|
*/
|
|
2017
2218
|
export declare function extendTo<S extends Struct<Struct.Fields>, const Fields extends Struct.Fields>(
|
|
2018
2219
|
/** The new fields to add */
|
|
@@ -2028,10 +2229,17 @@ derive: {
|
|
|
2028
2229
|
* - `Record.Type<K, V>` — decoded type of the record
|
|
2029
2230
|
* - `Record.Encoded<K, V>` — encoded type of the record
|
|
2030
2231
|
*
|
|
2031
|
-
* @since
|
|
2232
|
+
* @since 3.10.0
|
|
2032
2233
|
*/
|
|
2033
2234
|
export declare namespace Record {
|
|
2034
2235
|
/**
|
|
2236
|
+
* Constraint for schemas that can be used as record keys.
|
|
2237
|
+
*
|
|
2238
|
+
* **Details**
|
|
2239
|
+
* The key schema must decode and encode property keys (`string`, `number`, or
|
|
2240
|
+
* `symbol`) so it can describe object property names.
|
|
2241
|
+
*
|
|
2242
|
+
* @category utility types
|
|
2035
2243
|
* @since 4.0.0
|
|
2036
2244
|
*/
|
|
2037
2245
|
interface Key extends Codec<PropertyKey, PropertyKey, unknown, unknown> {
|
|
@@ -2039,7 +2247,16 @@ export declare namespace Record {
|
|
|
2039
2247
|
readonly "Iso": PropertyKey;
|
|
2040
2248
|
}
|
|
2041
2249
|
/**
|
|
2042
|
-
*
|
|
2250
|
+
* Computes the decoded object type for a record schema from its key and value
|
|
2251
|
+
* schemas.
|
|
2252
|
+
*
|
|
2253
|
+
* **Details**
|
|
2254
|
+
* The key schema supplies the property keys and the value schema supplies each
|
|
2255
|
+
* property's decoded `Type`. Optional and mutable value schemas affect the
|
|
2256
|
+
* resulting property optionality and writability.
|
|
2257
|
+
*
|
|
2258
|
+
* @category utility types
|
|
2259
|
+
* @since 3.10.0
|
|
2043
2260
|
*/
|
|
2044
2261
|
type Type<Key extends Record.Key, Value extends Top> = Value extends {
|
|
2045
2262
|
readonly "~type.optionality": "optional";
|
|
@@ -2057,6 +2274,10 @@ export declare namespace Record {
|
|
|
2057
2274
|
readonly [P in Key["Type"]]: Value["Type"];
|
|
2058
2275
|
};
|
|
2059
2276
|
/**
|
|
2277
|
+
* Computes the iso object type for a record schema from the key schema's `Iso`
|
|
2278
|
+
* keys and the value schema's `Iso` values.
|
|
2279
|
+
*
|
|
2280
|
+
* @category utility types
|
|
2060
2281
|
* @since 4.0.0
|
|
2061
2282
|
*/
|
|
2062
2283
|
type Iso<Key extends Record.Key, Value extends Top> = Value extends {
|
|
@@ -2075,7 +2296,15 @@ export declare namespace Record {
|
|
|
2075
2296
|
readonly [P in Key["Iso"]]: Value["Iso"];
|
|
2076
2297
|
};
|
|
2077
2298
|
/**
|
|
2078
|
-
*
|
|
2299
|
+
* Computes the encoded object type for a record schema from the key and value
|
|
2300
|
+
* schemas' encoded types.
|
|
2301
|
+
*
|
|
2302
|
+
* **Details**
|
|
2303
|
+
* Encoded-side optionality and mutability on the value schema determine whether
|
|
2304
|
+
* the encoded record properties are optional or writable.
|
|
2305
|
+
*
|
|
2306
|
+
* @category utility types
|
|
2307
|
+
* @since 3.10.0
|
|
2079
2308
|
*/
|
|
2080
2309
|
type Encoded<Key extends Record.Key, Value extends Top> = Value extends {
|
|
2081
2310
|
readonly "~encoded.optionality": "optional";
|
|
@@ -2093,14 +2322,30 @@ export declare namespace Record {
|
|
|
2093
2322
|
readonly [P in Key["Encoded"]]: Value["Encoded"];
|
|
2094
2323
|
};
|
|
2095
2324
|
/**
|
|
2325
|
+
* Union of the decoding service requirements of a record's key schema and value
|
|
2326
|
+
* schema.
|
|
2327
|
+
*
|
|
2328
|
+
* @category utility types
|
|
2096
2329
|
* @since 4.0.0
|
|
2097
2330
|
*/
|
|
2098
2331
|
type DecodingServices<Key extends Record.Key, Value extends Top> = Key["DecodingServices"] | Value["DecodingServices"];
|
|
2099
2332
|
/**
|
|
2333
|
+
* Union of the encoding service requirements of a record's key schema and value
|
|
2334
|
+
* schema.
|
|
2335
|
+
*
|
|
2336
|
+
* @category utility types
|
|
2100
2337
|
* @since 4.0.0
|
|
2101
2338
|
*/
|
|
2102
2339
|
type EncodingServices<Key extends Record.Key, Value extends Top> = Key["EncodingServices"] | Value["EncodingServices"];
|
|
2103
2340
|
/**
|
|
2341
|
+
* Computes the input object type accepted when constructing a record value.
|
|
2342
|
+
*
|
|
2343
|
+
* **Details**
|
|
2344
|
+
* Keys use the key schema's `~type.make` type and values use the value schema's
|
|
2345
|
+
* `~type.make` type. Value optionality and mutability determine whether
|
|
2346
|
+
* properties are optional or writable.
|
|
2347
|
+
*
|
|
2348
|
+
* @category utility types
|
|
2104
2349
|
* @since 4.0.0
|
|
2105
2350
|
*/
|
|
2106
2351
|
type MakeIn<Key extends Record.Key, Value extends Top> = Value extends {
|
|
@@ -2123,6 +2368,7 @@ export declare namespace Record {
|
|
|
2123
2368
|
* Companion type for a key-value record (map) with a typed key and value schema.
|
|
2124
2369
|
* Produced by {@link Record}.
|
|
2125
2370
|
*
|
|
2371
|
+
* @category models
|
|
2126
2372
|
* @since 4.0.0
|
|
2127
2373
|
*/
|
|
2128
2374
|
export interface $Record<Key extends Record.Key, Value extends Top> extends Bottom<Record.Type<Key, Value>, Record.Encoded<Key, Value>, Record.DecodingServices<Key, Value>, Record.EncodingServices<Key, Value>, AST.Objects, $Record<Key, Value>, Simplify<Record.MakeIn<Key, Value>>, Record.Iso<Key, Value>> {
|
|
@@ -2147,8 +2393,8 @@ export interface $Record<Key extends Record.Key, Value extends Top> extends Bott
|
|
|
2147
2393
|
* // { a: 1, b: 2 }
|
|
2148
2394
|
* ```
|
|
2149
2395
|
*
|
|
2150
|
-
* @category
|
|
2151
|
-
* @since
|
|
2396
|
+
* @category constructors
|
|
2397
|
+
* @since 3.10.0
|
|
2152
2398
|
*/
|
|
2153
2399
|
export declare function Record<Key extends Record.Key, Value extends Top>(key: Key, value: Value, options?: {
|
|
2154
2400
|
readonly keyValueCombiner: {
|
|
@@ -2166,47 +2412,80 @@ export declare function Record<Key extends Record.Key, Value extends Top>(key: K
|
|
|
2166
2412
|
*/
|
|
2167
2413
|
export declare namespace StructWithRest {
|
|
2168
2414
|
/**
|
|
2415
|
+
* Constraint for object-like schemas that can be used as the fixed portion of a
|
|
2416
|
+
* `StructWithRest` schema.
|
|
2417
|
+
*
|
|
2418
|
+
* @category utility types
|
|
2169
2419
|
* @since 4.0.0
|
|
2170
2420
|
*/
|
|
2171
2421
|
type Objects = Top & {
|
|
2172
2422
|
readonly ast: AST.Objects;
|
|
2173
2423
|
};
|
|
2174
2424
|
/**
|
|
2175
|
-
*
|
|
2425
|
+
* Readonly list of record schemas that provide the additional index signatures
|
|
2426
|
+
* for a `StructWithRest` schema.
|
|
2427
|
+
*
|
|
2428
|
+
* @category utility types
|
|
2429
|
+
* @since 3.10.0
|
|
2176
2430
|
*/
|
|
2177
2431
|
type Records = ReadonlyArray<$Record<Record.Key, Top>>;
|
|
2178
2432
|
type MergeTuple<T extends ReadonlyArray<unknown>> = T extends readonly [infer Head, ...infer Tail] ? Head & MergeTuple<Tail> : {};
|
|
2179
2433
|
/**
|
|
2180
|
-
*
|
|
2434
|
+
* Computes the decoded type for `StructWithRest` by intersecting the base object
|
|
2435
|
+
* schema's decoded `Type` with the decoded types of all rest record schemas.
|
|
2436
|
+
*
|
|
2437
|
+
* @category utility types
|
|
2438
|
+
* @since 3.10.0
|
|
2181
2439
|
*/
|
|
2182
2440
|
type Type<S extends Objects, Records extends StructWithRest.Records> = S["Type"] & MergeTuple<{
|
|
2183
2441
|
readonly [K in keyof Records]: Records[K]["Type"];
|
|
2184
2442
|
}>;
|
|
2185
2443
|
/**
|
|
2444
|
+
* Computes the iso type for `StructWithRest` by intersecting the base object
|
|
2445
|
+
* schema's `Iso` type with the `Iso` types of all rest record schemas.
|
|
2446
|
+
*
|
|
2447
|
+
* @category utility types
|
|
2186
2448
|
* @since 4.0.0
|
|
2187
2449
|
*/
|
|
2188
2450
|
type Iso<S extends Objects, Records extends StructWithRest.Records> = S["Iso"] & MergeTuple<{
|
|
2189
2451
|
readonly [K in keyof Records]: Records[K]["Iso"];
|
|
2190
2452
|
}>;
|
|
2191
2453
|
/**
|
|
2192
|
-
*
|
|
2454
|
+
* Computes the encoded type for `StructWithRest` by intersecting the base object
|
|
2455
|
+
* schema's encoded type with the encoded types of all rest record schemas.
|
|
2456
|
+
*
|
|
2457
|
+
* @category utility types
|
|
2458
|
+
* @since 3.10.0
|
|
2193
2459
|
*/
|
|
2194
2460
|
type Encoded<S extends Objects, Records extends StructWithRest.Records> = S["Encoded"] & MergeTuple<{
|
|
2195
2461
|
readonly [K in keyof Records]: Records[K]["Encoded"];
|
|
2196
2462
|
}>;
|
|
2197
2463
|
/**
|
|
2464
|
+
* Union of the decoding service requirements of the base object schema and all
|
|
2465
|
+
* rest record schemas.
|
|
2466
|
+
*
|
|
2467
|
+
* @category utility types
|
|
2198
2468
|
* @since 4.0.0
|
|
2199
2469
|
*/
|
|
2200
2470
|
type DecodingServices<S extends Objects, Records extends StructWithRest.Records> = S["DecodingServices"] | {
|
|
2201
2471
|
[K in keyof Records]: Records[K]["DecodingServices"];
|
|
2202
2472
|
}[number];
|
|
2203
2473
|
/**
|
|
2474
|
+
* Union of the encoding service requirements of the base object schema and all
|
|
2475
|
+
* rest record schemas.
|
|
2476
|
+
*
|
|
2477
|
+
* @category utility types
|
|
2204
2478
|
* @since 4.0.0
|
|
2205
2479
|
*/
|
|
2206
2480
|
type EncodingServices<S extends Objects, Records extends StructWithRest.Records> = S["EncodingServices"] | {
|
|
2207
2481
|
[K in keyof Records]: Records[K]["EncodingServices"];
|
|
2208
2482
|
}[number];
|
|
2209
2483
|
/**
|
|
2484
|
+
* Computes the input type accepted when constructing a `StructWithRest` value by
|
|
2485
|
+
* intersecting the base object's make input with the make inputs of all rest
|
|
2486
|
+
* record schemas.
|
|
2487
|
+
*
|
|
2488
|
+
* @category utility types
|
|
2210
2489
|
* @since 4.0.0
|
|
2211
2490
|
*/
|
|
2212
2491
|
type MakeIn<S extends Objects, Records extends StructWithRest.Records> = S["~type.make"] & MergeTuple<{
|
|
@@ -2217,6 +2496,7 @@ export declare namespace StructWithRest {
|
|
|
2217
2496
|
* Companion type for a struct combined with one or more record schemas. Produced
|
|
2218
2497
|
* by {@link StructWithRest}.
|
|
2219
2498
|
*
|
|
2499
|
+
* @category models
|
|
2220
2500
|
* @since 4.0.0
|
|
2221
2501
|
*/
|
|
2222
2502
|
export interface StructWithRest<S extends StructWithRest.Objects, Records extends StructWithRest.Records> extends Bottom<Simplify<StructWithRest.Type<S, Records>>, Simplify<StructWithRest.Encoded<S, Records>>, StructWithRest.DecodingServices<S, Records>, StructWithRest.EncodingServices<S, Records>, AST.Objects, StructWithRest<S, Records>, Simplify<StructWithRest.MakeIn<S, Records>>, Simplify<StructWithRest.Iso<S, Records>>> {
|
|
@@ -2241,7 +2521,7 @@ export interface StructWithRest<S extends StructWithRest.Objects, Records extend
|
|
|
2241
2521
|
* type T = typeof schema.Type
|
|
2242
2522
|
* ```
|
|
2243
2523
|
*
|
|
2244
|
-
* @category
|
|
2524
|
+
* @category constructors
|
|
2245
2525
|
* @since 4.0.0
|
|
2246
2526
|
*/
|
|
2247
2527
|
export declare function StructWithRest<const S extends StructWithRest.Objects, const Records extends StructWithRest.Records>(schema: S, records: Records): StructWithRest<S, Records>;
|
|
@@ -2253,11 +2533,15 @@ export declare function StructWithRest<const S extends StructWithRest.Objects, c
|
|
|
2253
2533
|
* - `Tuple.Encoded<E>` — encoded tuple type
|
|
2254
2534
|
* - `Tuple.MakeIn<E>` — constructor input tuple
|
|
2255
2535
|
*
|
|
2256
|
-
* @since
|
|
2536
|
+
* @since 3.10.0
|
|
2257
2537
|
*/
|
|
2258
2538
|
export declare namespace Tuple {
|
|
2259
2539
|
/**
|
|
2260
|
-
*
|
|
2540
|
+
* Constraint for the readonly array of element schemas used to define a
|
|
2541
|
+
* fixed-length `Tuple` schema.
|
|
2542
|
+
*
|
|
2543
|
+
* @category utility types
|
|
2544
|
+
* @since 3.10.0
|
|
2261
2545
|
*/
|
|
2262
2546
|
type Elements = ReadonlyArray<Top>;
|
|
2263
2547
|
type Type_<Elements, Out extends ReadonlyArray<any> = readonly []> = Elements extends readonly [infer Head, ...infer Tail] ? Head extends {
|
|
@@ -2266,7 +2550,14 @@ export declare namespace Tuple {
|
|
|
2266
2550
|
readonly "~type.optionality": "optional";
|
|
2267
2551
|
} ? Type_<Tail, readonly [...Out, T?]> : Type_<Tail, readonly [...Out, T]> : Out : Out;
|
|
2268
2552
|
/**
|
|
2269
|
-
*
|
|
2553
|
+
* Computes the decoded tuple type for a tuple element schema array.
|
|
2554
|
+
*
|
|
2555
|
+
* **Details**
|
|
2556
|
+
* Each element contributes its decoded `Type`; optional element schemas produce
|
|
2557
|
+
* optional tuple positions.
|
|
2558
|
+
*
|
|
2559
|
+
* @category utility types
|
|
2560
|
+
* @since 3.10.0
|
|
2270
2561
|
*/
|
|
2271
2562
|
type Type<E extends Elements> = Type_<E>;
|
|
2272
2563
|
type Iso_<Elements, Out extends ReadonlyArray<any> = readonly []> = Elements extends readonly [infer Head, ...infer Tail] ? Head extends {
|
|
@@ -2275,6 +2566,10 @@ export declare namespace Tuple {
|
|
|
2275
2566
|
readonly "~type.optionality": "optional";
|
|
2276
2567
|
} ? Iso_<Tail, readonly [...Out, T?]> : Iso_<Tail, readonly [...Out, T]> : Out : Out;
|
|
2277
2568
|
/**
|
|
2569
|
+
* Computes the iso tuple type for a tuple element schema array from each
|
|
2570
|
+
* element schema's `Iso` type.
|
|
2571
|
+
*
|
|
2572
|
+
* @category utility types
|
|
2278
2573
|
* @since 4.0.0
|
|
2279
2574
|
*/
|
|
2280
2575
|
type Iso<E extends Elements> = Iso_<E>;
|
|
@@ -2284,14 +2579,29 @@ export declare namespace Tuple {
|
|
|
2284
2579
|
readonly "~encoded.optionality": "optional";
|
|
2285
2580
|
} ? Encoded_<Tail, readonly [...Out, T?]> : Encoded_<Tail, readonly [...Out, T]> : Out : Out;
|
|
2286
2581
|
/**
|
|
2287
|
-
*
|
|
2582
|
+
* Computes the encoded tuple type for a tuple element schema array.
|
|
2583
|
+
*
|
|
2584
|
+
* **Details**
|
|
2585
|
+
* Each element contributes its `Encoded` type; encoded-side optional element
|
|
2586
|
+
* schemas produce optional tuple positions.
|
|
2587
|
+
*
|
|
2588
|
+
* @category utility types
|
|
2589
|
+
* @since 3.10.0
|
|
2288
2590
|
*/
|
|
2289
2591
|
type Encoded<E extends Elements> = Encoded_<E>;
|
|
2290
2592
|
/**
|
|
2593
|
+
* Union of all decoding service requirements needed by the tuple element
|
|
2594
|
+
* schemas.
|
|
2595
|
+
*
|
|
2596
|
+
* @category utility types
|
|
2291
2597
|
* @since 4.0.0
|
|
2292
2598
|
*/
|
|
2293
2599
|
type DecodingServices<E extends Elements> = E[number]["DecodingServices"];
|
|
2294
2600
|
/**
|
|
2601
|
+
* Union of all encoding service requirements needed by the tuple element
|
|
2602
|
+
* schemas.
|
|
2603
|
+
*
|
|
2604
|
+
* @category utility types
|
|
2295
2605
|
* @since 4.0.0
|
|
2296
2606
|
*/
|
|
2297
2607
|
type EncodingServices<E extends Elements> = E[number]["EncodingServices"];
|
|
@@ -2303,6 +2613,13 @@ export declare namespace Tuple {
|
|
|
2303
2613
|
readonly "~type.constructor.default": "with-default";
|
|
2304
2614
|
} ? MakeIn_<Tail, readonly [...Out, T?]> : MakeIn_<Tail, readonly [...Out, T]> : Out : Out;
|
|
2305
2615
|
/**
|
|
2616
|
+
* Computes the input tuple type accepted when constructing a tuple value.
|
|
2617
|
+
*
|
|
2618
|
+
* **Details**
|
|
2619
|
+
* Each element uses its `~type.make` input type. Optional elements and elements
|
|
2620
|
+
* with constructor defaults produce optional tuple positions.
|
|
2621
|
+
*
|
|
2622
|
+
* @category utility types
|
|
2306
2623
|
* @since 4.0.0
|
|
2307
2624
|
*/
|
|
2308
2625
|
type MakeIn<E extends Elements> = MakeIn_<E>;
|
|
@@ -2310,7 +2627,8 @@ export declare namespace Tuple {
|
|
|
2310
2627
|
/**
|
|
2311
2628
|
* Companion type for a fixed-length tuple. Produced by {@link Tuple}.
|
|
2312
2629
|
*
|
|
2313
|
-
* @
|
|
2630
|
+
* @category models
|
|
2631
|
+
* @since 3.10.0
|
|
2314
2632
|
*/
|
|
2315
2633
|
export interface Tuple<Elements extends Tuple.Elements> extends Bottom<Tuple.Type<Elements>, Tuple.Encoded<Elements>, Tuple.DecodingServices<Elements>, Tuple.EncodingServices<Elements>, AST.Arrays, Tuple<Elements>, Tuple.MakeIn<Elements>, Tuple.Iso<Elements>> {
|
|
2316
2634
|
readonly elements: Elements;
|
|
@@ -2347,8 +2665,8 @@ export interface Tuple<Elements extends Tuple.Elements> extends Bottom<Tuple.Typ
|
|
|
2347
2665
|
* // [ 'hello', 42 ]
|
|
2348
2666
|
* ```
|
|
2349
2667
|
*
|
|
2350
|
-
* @category
|
|
2351
|
-
* @since
|
|
2668
|
+
* @category constructors
|
|
2669
|
+
* @since 3.10.0
|
|
2352
2670
|
*/
|
|
2353
2671
|
export declare function Tuple<const Elements extends ReadonlyArray<Top>>(elements: Elements): Tuple<Elements>;
|
|
2354
2672
|
/**
|
|
@@ -2363,7 +2681,11 @@ export declare function Tuple<const Elements extends ReadonlyArray<Top>>(element
|
|
|
2363
2681
|
*/
|
|
2364
2682
|
export declare namespace TupleWithRest {
|
|
2365
2683
|
/**
|
|
2366
|
-
*
|
|
2684
|
+
* Constraint for tuple-like schemas that can be used as the fixed leading
|
|
2685
|
+
* portion of a `TupleWithRest` schema.
|
|
2686
|
+
*
|
|
2687
|
+
* @category utility types
|
|
2688
|
+
* @since 3.10.0
|
|
2367
2689
|
*/
|
|
2368
2690
|
type TupleType = Top & {
|
|
2369
2691
|
readonly Type: ReadonlyArray<unknown>;
|
|
@@ -2373,11 +2695,26 @@ export declare namespace TupleWithRest {
|
|
|
2373
2695
|
readonly "Iso": ReadonlyArray<unknown>;
|
|
2374
2696
|
};
|
|
2375
2697
|
/**
|
|
2376
|
-
*
|
|
2698
|
+
* Non-empty list of schemas used for the rest portion of a `TupleWithRest`.
|
|
2699
|
+
*
|
|
2700
|
+
* **Details**
|
|
2701
|
+
* The first schema describes the repeated rest element. Additional schemas, when
|
|
2702
|
+
* present, describe trailing tuple elements after the repeated rest segment.
|
|
2703
|
+
*
|
|
2704
|
+
* @category utility types
|
|
2705
|
+
* @since 3.10.0
|
|
2377
2706
|
*/
|
|
2378
2707
|
type Rest = readonly [Top, ...Array<Top>];
|
|
2379
2708
|
/**
|
|
2380
|
-
*
|
|
2709
|
+
* Computes the decoded tuple type for a `TupleWithRest`.
|
|
2710
|
+
*
|
|
2711
|
+
* **Details**
|
|
2712
|
+
* The output starts with the fixed tuple elements, continues with zero or more
|
|
2713
|
+
* values decoded by the first rest schema, and includes any trailing rest schemas
|
|
2714
|
+
* as fixed tuple positions.
|
|
2715
|
+
*
|
|
2716
|
+
* @category utility types
|
|
2717
|
+
* @since 3.10.0
|
|
2381
2718
|
*/
|
|
2382
2719
|
type Type<T extends ReadonlyArray<unknown>, Rest extends TupleWithRest.Rest> = Rest extends readonly [infer Head extends Top, ...infer Tail extends ReadonlyArray<Top>] ? Readonly<[
|
|
2383
2720
|
...T,
|
|
@@ -2387,6 +2724,14 @@ export declare namespace TupleWithRest {
|
|
|
2387
2724
|
}
|
|
2388
2725
|
]> : T;
|
|
2389
2726
|
/**
|
|
2727
|
+
* Computes the iso tuple type for a `TupleWithRest`.
|
|
2728
|
+
*
|
|
2729
|
+
* **Details**
|
|
2730
|
+
* The output starts with the fixed tuple's `Iso` elements, continues with zero
|
|
2731
|
+
* or more values using the first rest schema's `Iso`, and includes any trailing
|
|
2732
|
+
* rest schemas as fixed tuple positions.
|
|
2733
|
+
*
|
|
2734
|
+
* @category utility types
|
|
2390
2735
|
* @since 4.0.0
|
|
2391
2736
|
*/
|
|
2392
2737
|
type Iso<T extends ReadonlyArray<unknown>, Rest extends TupleWithRest.Rest> = Rest extends readonly [infer Head extends Top, ...infer Tail extends ReadonlyArray<Top>] ? Readonly<[
|
|
@@ -2397,7 +2742,15 @@ export declare namespace TupleWithRest {
|
|
|
2397
2742
|
}
|
|
2398
2743
|
]> : T;
|
|
2399
2744
|
/**
|
|
2400
|
-
*
|
|
2745
|
+
* Computes the encoded tuple type for `TupleWithRest`.
|
|
2746
|
+
*
|
|
2747
|
+
* **Details**
|
|
2748
|
+
* The leading tuple's encoded elements are kept first. The encoded type of the
|
|
2749
|
+
* first rest schema may repeat zero or more times, and the encoded types of any
|
|
2750
|
+
* additional rest schemas become required trailing tuple elements.
|
|
2751
|
+
*
|
|
2752
|
+
* @category utility types
|
|
2753
|
+
* @since 3.10.0
|
|
2401
2754
|
*/
|
|
2402
2755
|
type Encoded<E extends ReadonlyArray<unknown>, Rest extends TupleWithRest.Rest> = Rest extends readonly [infer Head extends Top, ...infer Tail extends ReadonlyArray<Top>] ? readonly [
|
|
2403
2756
|
...E,
|
|
@@ -2407,6 +2760,14 @@ export declare namespace TupleWithRest {
|
|
|
2407
2760
|
}
|
|
2408
2761
|
] : E;
|
|
2409
2762
|
/**
|
|
2763
|
+
* Computes the constructor input tuple type for `TupleWithRest`.
|
|
2764
|
+
*
|
|
2765
|
+
* **Details**
|
|
2766
|
+
* The leading tuple's make input elements are kept first. The make input type of
|
|
2767
|
+
* the first rest schema may repeat zero or more times, and the make input types
|
|
2768
|
+
* of any additional rest schemas become required trailing tuple elements.
|
|
2769
|
+
*
|
|
2770
|
+
* @category utility types
|
|
2410
2771
|
* @since 4.0.0
|
|
2411
2772
|
*/
|
|
2412
2773
|
type MakeIn<M extends ReadonlyArray<unknown>, Rest extends TupleWithRest.Rest> = Rest extends readonly [infer Head extends Top, ...infer Tail extends ReadonlyArray<Top>] ? readonly [
|
|
@@ -2421,6 +2782,7 @@ export declare namespace TupleWithRest {
|
|
|
2421
2782
|
* Companion type for a tuple with additional rest elements. Produced by
|
|
2422
2783
|
* {@link TupleWithRest}.
|
|
2423
2784
|
*
|
|
2785
|
+
* @category models
|
|
2424
2786
|
* @since 4.0.0
|
|
2425
2787
|
*/
|
|
2426
2788
|
export interface TupleWithRest<S extends TupleWithRest.TupleType, Rest extends TupleWithRest.Rest> extends Bottom<TupleWithRest.Type<S["Type"], Rest>, TupleWithRest.Encoded<S["Encoded"], Rest>, S["DecodingServices"] | Rest[number]["DecodingServices"], S["EncodingServices"] | Rest[number]["EncodingServices"], AST.Arrays, TupleWithRest<S, Rest>, TupleWithRest.MakeIn<S["~type.make"], Rest>, TupleWithRest.Iso<S["Iso"], Rest>> {
|
|
@@ -2428,9 +2790,14 @@ export interface TupleWithRest<S extends TupleWithRest.TupleType, Rest extends T
|
|
|
2428
2790
|
readonly rest: Rest;
|
|
2429
2791
|
}
|
|
2430
2792
|
/**
|
|
2431
|
-
* Extends a fixed-length tuple schema with
|
|
2432
|
-
*
|
|
2433
|
-
*
|
|
2793
|
+
* Extends a fixed-length tuple schema with a variadic rest segment.
|
|
2794
|
+
*
|
|
2795
|
+
* **Details**
|
|
2796
|
+
* The resulting tuple starts with the fixed elements from `schema`. The first
|
|
2797
|
+
* schema in `rest` is the repeatable element schema, and any additional schemas
|
|
2798
|
+
* in `rest` are required trailing tuple elements after the variadic segment. For
|
|
2799
|
+
* example, `[Schema.Boolean, Schema.String]` represents zero or more booleans
|
|
2800
|
+
* followed by a final string.
|
|
2434
2801
|
*
|
|
2435
2802
|
* **Example** (Tuple with rest)
|
|
2436
2803
|
*
|
|
@@ -2448,13 +2815,19 @@ export interface TupleWithRest<S extends TupleWithRest.TupleType, Rest extends T
|
|
|
2448
2815
|
* // [ 'hello', 1, true, false ]
|
|
2449
2816
|
* ```
|
|
2450
2817
|
*
|
|
2451
|
-
* @category
|
|
2818
|
+
* @category constructors
|
|
2452
2819
|
* @since 4.0.0
|
|
2453
2820
|
*/
|
|
2454
2821
|
export declare function TupleWithRest<S extends Tuple<Tuple.Elements>, const Rest extends TupleWithRest.Rest>(schema: S, rest: Rest): TupleWithRest<S, Rest>;
|
|
2455
2822
|
/**
|
|
2456
|
-
*
|
|
2823
|
+
* Schema interface produced by `Schema.Array` for readonly arrays.
|
|
2824
|
+
*
|
|
2825
|
+
* **Details**
|
|
2826
|
+
* The decoded type is `ReadonlyArray<S["Type"]>`, the encoded type is
|
|
2827
|
+
* `ReadonlyArray<S["Encoded"]>`, and the element schema is available as
|
|
2828
|
+
* `schema`.
|
|
2457
2829
|
*
|
|
2830
|
+
* @category models
|
|
2458
2831
|
* @since 4.0.0
|
|
2459
2832
|
*/
|
|
2460
2833
|
export interface $Array<S extends Top> extends Bottom<ReadonlyArray<S["Type"]>, ReadonlyArray<S["Encoded"]>, S["DecodingServices"], S["EncodingServices"], AST.Arrays, $Array<S>, ReadonlyArray<S["~type.make"]>, ReadonlyArray<S["Iso"]>> {
|
|
@@ -2465,7 +2838,7 @@ interface ArrayLambda extends Lambda {
|
|
|
2465
2838
|
readonly "~lambda.out": this["~lambda.in"] extends Top ? $Array<this["~lambda.in"]> : never;
|
|
2466
2839
|
}
|
|
2467
2840
|
/**
|
|
2468
|
-
* @category
|
|
2841
|
+
* @category constructors
|
|
2469
2842
|
* @since 4.0.0
|
|
2470
2843
|
*/
|
|
2471
2844
|
declare const ArraySchema: ArrayLambda;
|
|
@@ -2485,14 +2858,15 @@ export {
|
|
|
2485
2858
|
* // [ 'a', 'b', 'c' ]
|
|
2486
2859
|
* ```
|
|
2487
2860
|
*
|
|
2488
|
-
* @category
|
|
2861
|
+
* @category constructors
|
|
2489
2862
|
* @since 4.0.0
|
|
2490
2863
|
*/
|
|
2491
2864
|
ArraySchema as Array };
|
|
2492
2865
|
/**
|
|
2493
2866
|
* Companion type for a non-empty `ReadonlyArray`. Produced by {@link NonEmptyArray}.
|
|
2494
2867
|
*
|
|
2495
|
-
* @
|
|
2868
|
+
* @category models
|
|
2869
|
+
* @since 3.10.0
|
|
2496
2870
|
*/
|
|
2497
2871
|
export interface NonEmptyArray<S extends Top> extends Bottom<readonly [S["Type"], ...Array<S["Type"]>], readonly [S["Encoded"], ...Array<S["Encoded"]>], S["DecodingServices"], S["EncodingServices"], AST.Arrays, NonEmptyArray<S>, readonly [S["~type.make"], ...Array<S["~type.make"]>], readonly [S["Iso"], ...Array<S["Iso"]>]> {
|
|
2498
2872
|
readonly schema: S;
|
|
@@ -2516,35 +2890,44 @@ interface NonEmptyArrayLambda extends Lambda {
|
|
|
2516
2890
|
* Schema.decodeUnknownSync(schema)([]) // throws
|
|
2517
2891
|
* ```
|
|
2518
2892
|
*
|
|
2519
|
-
* @category
|
|
2520
|
-
* @since
|
|
2893
|
+
* @category constructors
|
|
2894
|
+
* @since 3.10.0
|
|
2521
2895
|
*/
|
|
2522
2896
|
export declare const NonEmptyArray: NonEmptyArrayLambda;
|
|
2523
2897
|
/**
|
|
2898
|
+
* Schema interface returned by `ArrayEnsure`, which normalizes a single item or
|
|
2899
|
+
* an array of items into a readonly array.
|
|
2900
|
+
*
|
|
2901
|
+
* **Details**
|
|
2902
|
+
* The schema decodes from `S` or `Schema.Array(S)` and produces
|
|
2903
|
+
* `ReadonlyArray<S["Type"]>`.
|
|
2904
|
+
*
|
|
2524
2905
|
* @category Arrays
|
|
2525
|
-
* @since
|
|
2906
|
+
* @since 3.10.0
|
|
2526
2907
|
*/
|
|
2527
2908
|
export interface ArrayEnsure<S extends Top> extends decodeTo<$Array<toType<S>>, Union<readonly [S, $Array<S>]>> {
|
|
2528
2909
|
readonly "Rebuild": ArrayEnsure<S>;
|
|
2529
2910
|
}
|
|
2530
2911
|
/**
|
|
2531
|
-
*
|
|
2912
|
+
* Creates a schema that accepts either a value decoded by `schema` or an array
|
|
2913
|
+
* decoded by `Schema.Array(schema)`, then returns an array.
|
|
2532
2914
|
*
|
|
2533
|
-
*
|
|
2534
|
-
*
|
|
2535
|
-
*
|
|
2915
|
+
* **Details**
|
|
2916
|
+
* The single-value branch is tried before the array branch. If `schema` itself
|
|
2917
|
+
* accepts arrays, an array input can be treated as one value and wrapped in a
|
|
2918
|
+
* one-element array.
|
|
2536
2919
|
*
|
|
2537
|
-
*
|
|
2538
|
-
*
|
|
2539
|
-
* - arrays with more than one element are encoded as arrays
|
|
2920
|
+
* During encoding, one-element arrays are encoded as the single element. Empty
|
|
2921
|
+
* arrays and arrays with two or more elements are encoded as arrays.
|
|
2540
2922
|
*
|
|
2541
2923
|
* @category Arrays
|
|
2542
|
-
* @since
|
|
2924
|
+
* @since 3.10.0
|
|
2543
2925
|
*/
|
|
2544
2926
|
export declare function ArrayEnsure<S extends Top>(schema: S): ArrayEnsure<S>;
|
|
2545
2927
|
/**
|
|
2546
2928
|
* Companion type for an array with unique elements. Produced by {@link UniqueArray}.
|
|
2547
2929
|
*
|
|
2930
|
+
* @category models
|
|
2548
2931
|
* @since 4.0.0
|
|
2549
2932
|
*/
|
|
2550
2933
|
export interface UniqueArray<S extends Top> extends $Array<S> {
|
|
@@ -2556,7 +2939,7 @@ export interface UniqueArray<S extends Top> extends $Array<S> {
|
|
|
2556
2939
|
* The equivalence used to determine uniqueness is the one provided by
|
|
2557
2940
|
* `Schema.toEquivalence(item)`.
|
|
2558
2941
|
*
|
|
2559
|
-
* @category
|
|
2942
|
+
* @category constructors
|
|
2560
2943
|
* @since 4.0.0
|
|
2561
2944
|
*/
|
|
2562
2945
|
export declare function UniqueArray<S extends Top>(item: S): UniqueArray<S>;
|
|
@@ -2564,7 +2947,8 @@ export declare function UniqueArray<S extends Top>(item: S): UniqueArray<S>;
|
|
|
2564
2947
|
* Schema type that makes array or tuple elements mutable (removes `readonly`).
|
|
2565
2948
|
* Produced by {@link mutable}.
|
|
2566
2949
|
*
|
|
2567
|
-
* @
|
|
2950
|
+
* @category transforming
|
|
2951
|
+
* @since 3.10.0
|
|
2568
2952
|
*/
|
|
2569
2953
|
export interface mutable<S extends Top & {
|
|
2570
2954
|
readonly "ast": AST.Arrays;
|
|
@@ -2593,13 +2977,15 @@ interface mutableLambda extends Lambda {
|
|
|
2593
2977
|
* type T = typeof schema.Type
|
|
2594
2978
|
* ```
|
|
2595
2979
|
*
|
|
2596
|
-
* @
|
|
2980
|
+
* @category transforming
|
|
2981
|
+
* @since 3.10.0
|
|
2597
2982
|
*/
|
|
2598
2983
|
export declare const mutable: mutableLambda;
|
|
2599
2984
|
/**
|
|
2600
2985
|
* Companion type for a union of multiple schemas. Produced by {@link Union}.
|
|
2601
2986
|
*
|
|
2602
|
-
* @
|
|
2987
|
+
* @category models
|
|
2988
|
+
* @since 3.10.0
|
|
2603
2989
|
*/
|
|
2604
2990
|
export interface Union<Members extends ReadonlyArray<Top>> extends Bottom<{
|
|
2605
2991
|
[K in keyof Members]: Members[K]["Type"];
|
|
@@ -2654,8 +3040,8 @@ export interface Union<Members extends ReadonlyArray<Top>> extends Bottom<{
|
|
|
2654
3040
|
* Schema.decodeUnknownSync(schema)(42) // 42
|
|
2655
3041
|
* ```
|
|
2656
3042
|
*
|
|
2657
|
-
* @category
|
|
2658
|
-
* @since
|
|
3043
|
+
* @category constructors
|
|
3044
|
+
* @since 3.10.0
|
|
2659
3045
|
*/
|
|
2660
3046
|
export declare function Union<const Members extends ReadonlyArray<Top>>(members: Members, options?: {
|
|
2661
3047
|
mode?: "anyOf" | "oneOf";
|
|
@@ -2664,6 +3050,7 @@ export declare function Union<const Members extends ReadonlyArray<Top>>(members:
|
|
|
2664
3050
|
* Represents a union schema of multiple literal values.
|
|
2665
3051
|
*
|
|
2666
3052
|
* @see {@link Literals} for the constructor function.
|
|
3053
|
+
* @category models
|
|
2667
3054
|
* @since 4.0.0
|
|
2668
3055
|
*/
|
|
2669
3056
|
export interface Literals<L extends ReadonlyArray<AST.LiteralValue>> extends Bottom<L[number], L[number], never, never, AST.Union<AST.Literal>, Literals<L>> {
|
|
@@ -2686,6 +3073,7 @@ export interface Literals<L extends ReadonlyArray<AST.LiteralValue>> extends Bot
|
|
|
2686
3073
|
* Creates a union schema from an array of literal values.
|
|
2687
3074
|
*
|
|
2688
3075
|
* **Example** (Status codes)
|
|
3076
|
+
*
|
|
2689
3077
|
* ```ts
|
|
2690
3078
|
* import { Schema } from "effect"
|
|
2691
3079
|
*
|
|
@@ -2694,14 +3082,15 @@ export interface Literals<L extends ReadonlyArray<AST.LiteralValue>> extends Bot
|
|
|
2694
3082
|
* ```
|
|
2695
3083
|
*
|
|
2696
3084
|
* @see {@link Literal} for a schema that represents a single literal.
|
|
2697
|
-
* @category
|
|
3085
|
+
* @category constructors
|
|
2698
3086
|
* @since 4.0.0
|
|
2699
3087
|
*/
|
|
2700
3088
|
export declare function Literals<const L extends ReadonlyArray<AST.LiteralValue>>(literals: L): Literals<L>;
|
|
2701
3089
|
/**
|
|
2702
3090
|
* Companion type for `S | null`. Produced by {@link NullOr}.
|
|
2703
3091
|
*
|
|
2704
|
-
* @
|
|
3092
|
+
* @category models
|
|
3093
|
+
* @since 3.10.0
|
|
2705
3094
|
*/
|
|
2706
3095
|
export interface NullOr<S extends Top> extends Union<readonly [S, Null]> {
|
|
2707
3096
|
readonly "Rebuild": NullOr<S>;
|
|
@@ -2713,14 +3102,15 @@ interface NullOrLambda extends Lambda {
|
|
|
2713
3102
|
/**
|
|
2714
3103
|
* Creates a union schema of `S | null`.
|
|
2715
3104
|
*
|
|
2716
|
-
* @category
|
|
2717
|
-
* @since
|
|
3105
|
+
* @category constructors
|
|
3106
|
+
* @since 3.10.0
|
|
2718
3107
|
*/
|
|
2719
3108
|
export declare const NullOr: NullOrLambda;
|
|
2720
3109
|
/**
|
|
2721
3110
|
* Companion type for `S | undefined`. Produced by {@link UndefinedOr}.
|
|
2722
3111
|
*
|
|
2723
|
-
* @
|
|
3112
|
+
* @category models
|
|
3113
|
+
* @since 3.10.0
|
|
2724
3114
|
*/
|
|
2725
3115
|
export interface UndefinedOr<S extends Top> extends Union<readonly [S, Undefined]> {
|
|
2726
3116
|
readonly "Rebuild": UndefinedOr<S>;
|
|
@@ -2732,13 +3122,14 @@ interface UndefinedOrLambda extends Lambda {
|
|
|
2732
3122
|
/**
|
|
2733
3123
|
* Creates a union schema of `S | undefined`.
|
|
2734
3124
|
*
|
|
2735
|
-
* @category
|
|
2736
|
-
* @since
|
|
3125
|
+
* @category constructors
|
|
3126
|
+
* @since 3.10.0
|
|
2737
3127
|
*/
|
|
2738
3128
|
export declare const UndefinedOr: UndefinedOrLambda;
|
|
2739
3129
|
/**
|
|
2740
3130
|
* Companion type for `S | null | undefined`. Produced by {@link NullishOr}.
|
|
2741
|
-
* @
|
|
3131
|
+
* @category models
|
|
3132
|
+
* @since 3.10.0
|
|
2742
3133
|
*/
|
|
2743
3134
|
export interface NullishOr<S extends Top> extends Union<readonly [S, Null, Undefined]> {
|
|
2744
3135
|
readonly "Rebuild": NullishOr<S>;
|
|
@@ -2749,13 +3140,14 @@ interface NullishOrLambda extends Lambda {
|
|
|
2749
3140
|
}
|
|
2750
3141
|
/**
|
|
2751
3142
|
* Creates a union schema of `S | null | undefined`.
|
|
2752
|
-
* @category
|
|
2753
|
-
* @since
|
|
3143
|
+
* @category constructors
|
|
3144
|
+
* @since 3.10.0
|
|
2754
3145
|
*/
|
|
2755
3146
|
export declare const NullishOr: NullishOrLambda;
|
|
2756
3147
|
/**
|
|
2757
3148
|
* Schema type wrapping a lazily-evaluated schema. Produced by {@link suspend}.
|
|
2758
|
-
* @
|
|
3149
|
+
* @category models
|
|
3150
|
+
* @since 3.10.0
|
|
2759
3151
|
*/
|
|
2760
3152
|
export interface suspend<S extends Top> extends Bottom<S["Type"], S["Encoded"], S["DecodingServices"], S["EncodingServices"], AST.Suspend, suspend<S>, S["~type.make.in"], S["Iso"], S["~type.parameters"], S["~type.make"], S["~type.mutability"], S["~type.optionality"], S["~type.constructor.default"], S["~encoded.mutability"], S["~encoded.optionality"]> {
|
|
2761
3153
|
}
|
|
@@ -2765,6 +3157,7 @@ export interface suspend<S extends Top> extends Bottom<S["Type"], S["Encoded"],
|
|
|
2765
3157
|
* preventing infinite recursion during schema definition.
|
|
2766
3158
|
*
|
|
2767
3159
|
* **Example** (Recursive tree schema)
|
|
3160
|
+
*
|
|
2768
3161
|
* ```ts
|
|
2769
3162
|
* import { Schema } from "effect"
|
|
2770
3163
|
*
|
|
@@ -2779,8 +3172,8 @@ export interface suspend<S extends Top> extends Bottom<S["Type"], S["Encoded"],
|
|
|
2779
3172
|
* })
|
|
2780
3173
|
* ```
|
|
2781
3174
|
*
|
|
2782
|
-
* @category
|
|
2783
|
-
* @since
|
|
3175
|
+
* @category constructors
|
|
3176
|
+
* @since 3.10.0
|
|
2784
3177
|
*/
|
|
2785
3178
|
export declare function suspend<S extends Top>(f: () => S): suspend<S>;
|
|
2786
3179
|
/**
|
|
@@ -2788,6 +3181,7 @@ export declare function suspend<S extends Top>(f: () => S): suspend<S>;
|
|
|
2788
3181
|
* changing the TypeScript type.
|
|
2789
3182
|
*
|
|
2790
3183
|
* **Example** (Adding checks to a schema)
|
|
3184
|
+
*
|
|
2791
3185
|
* ```ts
|
|
2792
3186
|
* import { Schema } from "effect"
|
|
2793
3187
|
*
|
|
@@ -2796,7 +3190,7 @@ export declare function suspend<S extends Top>(f: () => S): suspend<S>;
|
|
|
2796
3190
|
* )
|
|
2797
3191
|
* ```
|
|
2798
3192
|
*
|
|
2799
|
-
* @category
|
|
3193
|
+
* @category filtering
|
|
2800
3194
|
* @since 4.0.0
|
|
2801
3195
|
*/
|
|
2802
3196
|
export declare function check<S extends Top>(...checks: readonly [AST.Check<S["Type"]>, ...Array<AST.Check<S["Type"]>>]): (self: S) => S["Rebuild"];
|
|
@@ -2804,7 +3198,8 @@ export declare function check<S extends Top>(...checks: readonly [AST.Check<S["T
|
|
|
2804
3198
|
* The output type of {@link refine}, narrowing the schema's `Type` to `T` via a
|
|
2805
3199
|
* type guard.
|
|
2806
3200
|
*
|
|
2807
|
-
* @
|
|
3201
|
+
* @category filtering
|
|
3202
|
+
* @since 3.10.0
|
|
2808
3203
|
*/
|
|
2809
3204
|
export interface refine<T extends S["Type"], S extends Top> extends Bottom<T, S["Encoded"], S["DecodingServices"], S["EncodingServices"], S["ast"], refine<T, S>, S["~type.make.in"], T, S["~type.parameters"], T, S["~type.mutability"], S["~type.optionality"], S["~type.constructor.default"], S["~encoded.mutability"], S["~encoded.optionality"]> {
|
|
2810
3205
|
readonly schema: S;
|
|
@@ -2813,8 +3208,14 @@ export interface refine<T extends S["Type"], S extends Top> extends Bottom<T, S[
|
|
|
2813
3208
|
* Narrows the TypeScript type of a schema's output via a type guard predicate,
|
|
2814
3209
|
* attaching the guard as a runtime filter check.
|
|
2815
3210
|
*
|
|
2816
|
-
*
|
|
2817
|
-
*
|
|
3211
|
+
* The `annotations` parameter annotates the filter created by the refinement.
|
|
3212
|
+
* With the default formatter, failed refinements use `message` first,
|
|
3213
|
+
* `expected` second, and `<filter>` when neither is provided. `identifier`
|
|
3214
|
+
* names type-level failures before the refinement runs; it does not name the
|
|
3215
|
+
* failed refinement itself.
|
|
3216
|
+
*
|
|
3217
|
+
* @category filtering
|
|
3218
|
+
* @since 3.10.0
|
|
2818
3219
|
*/
|
|
2819
3220
|
export declare function refine<S extends Top, T extends S["Type"]>(refinement: (value: S["Type"]) => value is T, annotations?: Annotations.Filter): (schema: S) => refine<T, S>;
|
|
2820
3221
|
type DistributeBrands<B> = UnionToIntersection<B extends infer U extends string ? Brand.Brand<U> : never>;
|
|
@@ -2822,7 +3223,8 @@ type DistributeBrands<B> = UnionToIntersection<B extends infer U extends string
|
|
|
2822
3223
|
* The output type of {@link brand}, intersecting the schema's `Type` with one or
|
|
2823
3224
|
* more {@link Brand.Brand} tags.
|
|
2824
3225
|
*
|
|
2825
|
-
* @
|
|
3226
|
+
* @category branding
|
|
3227
|
+
* @since 3.10.0
|
|
2826
3228
|
*/
|
|
2827
3229
|
export interface brand<S extends Top, B> extends Bottom<S["Type"] & DistributeBrands<B>, S["Encoded"], S["DecodingServices"], S["EncodingServices"], S["ast"], brand<S, B>, S["~type.make.in"], S["Type"] & DistributeBrands<B>, S["~type.parameters"], S["Type"] & DistributeBrands<B>, S["~type.mutability"], S["~type.optionality"], S["~type.constructor.default"], S["~encoded.mutability"], S["~encoded.optionality"]> {
|
|
2828
3230
|
readonly schema: S;
|
|
@@ -2832,16 +3234,16 @@ export interface brand<S extends Top, B> extends Bottom<S["Type"] & DistributeBr
|
|
|
2832
3234
|
* Adds a nominal brand to a schema, intersecting the output type with
|
|
2833
3235
|
* `Brand.Brand<B>` to prevent accidental mixing of structurally identical types.
|
|
2834
3236
|
*
|
|
2835
|
-
* @category
|
|
2836
|
-
* @since
|
|
3237
|
+
* @category branding
|
|
3238
|
+
* @since 3.10.0
|
|
2837
3239
|
*/
|
|
2838
3240
|
export declare function brand<B extends string>(identifier: B): <S extends Top>(schema: S) => brand<S["Rebuild"], B>;
|
|
2839
3241
|
/**
|
|
2840
3242
|
* Creates a branded schema from a {@link Brand.Constructor}, applying the
|
|
2841
3243
|
* constructor's checks and brand tag to the underlying schema.
|
|
2842
3244
|
*
|
|
2843
|
-
* @category
|
|
2844
|
-
* @since
|
|
3245
|
+
* @category branding
|
|
3246
|
+
* @since 3.10.0
|
|
2845
3247
|
*/
|
|
2846
3248
|
export declare function fromBrand<A extends Brand.Brand<any>>(identifier: string, ctor: Brand.Constructor<A>): <S extends Top & {
|
|
2847
3249
|
readonly "Type": Brand.Brand.Unbranded<A>;
|
|
@@ -2853,6 +3255,7 @@ export declare function fromBrand<A extends Brand.Brand<any>>(identifier: string
|
|
|
2853
3255
|
* or augment it — including adding service requirements via `RD`.
|
|
2854
3256
|
*
|
|
2855
3257
|
* @see {@link middlewareDecoding} for the constructor
|
|
3258
|
+
* @category decoding
|
|
2856
3259
|
* @since 4.0.0
|
|
2857
3260
|
*/
|
|
2858
3261
|
export interface middlewareDecoding<S extends Top, RD> extends Bottom<S["Type"], S["Encoded"], RD, S["EncodingServices"], S["ast"], middlewareDecoding<S, RD>, S["~type.make.in"], S["Iso"], S["~type.parameters"], S["~type.make"], S["~type.mutability"], S["~type.optionality"], S["~type.constructor.default"], S["~encoded.mutability"], S["~encoded.optionality"]> {
|
|
@@ -2878,6 +3281,7 @@ export interface middlewareDecoding<S extends Top, RD> extends Bottom<S["Type"],
|
|
|
2878
3281
|
* ```
|
|
2879
3282
|
*
|
|
2880
3283
|
* @see {@link catchDecoding} for a simpler error-recovery variant
|
|
3284
|
+
* @category decoding
|
|
2881
3285
|
* @since 4.0.0
|
|
2882
3286
|
*/
|
|
2883
3287
|
export declare function middlewareDecoding<S extends Top, RD>(decode: (effect: Effect.Effect<Option_.Option<S["Type"]>, Issue.Issue, S["DecodingServices"]>, options: AST.ParseOptions) => Effect.Effect<Option_.Option<S["Type"]>, Issue.Issue, RD>): (schema: S) => middlewareDecoding<S, RD>;
|
|
@@ -2888,6 +3292,7 @@ export declare function middlewareDecoding<S extends Top, RD>(decode: (effect: E
|
|
|
2888
3292
|
* or augment it — including adding service requirements via `RE`.
|
|
2889
3293
|
*
|
|
2890
3294
|
* @see {@link middlewareEncoding} for the constructor
|
|
3295
|
+
* @category encoding
|
|
2891
3296
|
* @since 4.0.0
|
|
2892
3297
|
*/
|
|
2893
3298
|
export interface middlewareEncoding<S extends Top, RE> extends Bottom<S["Type"], S["Encoded"], S["DecodingServices"], RE, S["ast"], middlewareEncoding<S, RE>, S["~type.make.in"], S["Iso"], S["~type.parameters"], S["~type.make"], S["~type.mutability"], S["~type.optionality"], S["~type.constructor.default"], S["~encoded.mutability"], S["~encoded.optionality"]> {
|
|
@@ -2913,6 +3318,7 @@ export interface middlewareEncoding<S extends Top, RE> extends Bottom<S["Type"],
|
|
|
2913
3318
|
* ```
|
|
2914
3319
|
*
|
|
2915
3320
|
* @see {@link catchEncoding} for a simpler error-recovery variant
|
|
3321
|
+
* @category encoding
|
|
2916
3322
|
* @since 4.0.0
|
|
2917
3323
|
*/
|
|
2918
3324
|
export declare function middlewareEncoding<S extends Top, RE>(encode: (effect: Effect.Effect<Option_.Option<S["Encoded"]>, Issue.Issue, S["EncodingServices"]>, options: AST.ParseOptions) => Effect.Effect<Option_.Option<S["Encoded"]>, Issue.Issue, RE>): (schema: S) => middlewareEncoding<S, RE>;
|
|
@@ -2933,12 +3339,14 @@ export declare function middlewareEncoding<S extends Top, RE>(encode: (effect: E
|
|
|
2933
3339
|
* ```
|
|
2934
3340
|
*
|
|
2935
3341
|
* @see {@link catchDecodingWithContext} to add service requirements to the handler
|
|
3342
|
+
* @category error handling
|
|
2936
3343
|
* @since 4.0.0
|
|
2937
3344
|
*/
|
|
2938
3345
|
export declare function catchDecoding<S extends Top>(f: (issue: Issue.Issue) => Effect.Effect<Option_.Option<S["Type"]>, Issue.Issue>): (self: S) => S["Rebuild"];
|
|
2939
3346
|
/**
|
|
2940
3347
|
* Like {@link catchDecoding}, but the handler may require Effect services (`R`).
|
|
2941
3348
|
*
|
|
3349
|
+
* @category error handling
|
|
2942
3350
|
* @since 4.0.0
|
|
2943
3351
|
*/
|
|
2944
3352
|
export declare function catchDecodingWithContext<S extends Top, R = never>(f: (issue: Issue.Issue) => Effect.Effect<Option_.Option<S["Type"]>, Issue.Issue, R>): (self: S) => middlewareDecoding<S, S["DecodingServices"] | R>;
|
|
@@ -2949,22 +3357,28 @@ export declare function catchDecodingWithContext<S extends Top, R = never>(f: (i
|
|
|
2949
3357
|
* succeeds with a fallback value or re-fails with a (possibly different) issue.
|
|
2950
3358
|
*
|
|
2951
3359
|
* @see {@link catchEncodingWithContext} to add service requirements to the handler
|
|
3360
|
+
* @category error handling
|
|
2952
3361
|
* @since 4.0.0
|
|
2953
3362
|
*/
|
|
2954
3363
|
export declare function catchEncoding<S extends Top>(f: (issue: Issue.Issue) => Effect.Effect<Option_.Option<S["Encoded"]>, Issue.Issue>): (self: S) => S["Rebuild"];
|
|
2955
3364
|
/**
|
|
2956
3365
|
* Like {@link catchEncoding}, but the handler may require Effect services (`R`).
|
|
2957
3366
|
*
|
|
3367
|
+
* @category error handling
|
|
2958
3368
|
* @since 4.0.0
|
|
2959
3369
|
*/
|
|
2960
3370
|
export declare function catchEncodingWithContext<S extends Top, R = never>(f: (issue: Issue.Issue) => Effect.Effect<Option_.Option<S["Encoded"]>, Issue.Issue, R>): (self: S) => middlewareEncoding<S, S["EncodingServices"] | R>;
|
|
2961
3371
|
/**
|
|
2962
|
-
*
|
|
3372
|
+
* Schema type produced by `decodeTo` when a custom transformation composes a
|
|
3373
|
+
* `From` schema with a `To` schema.
|
|
2963
3374
|
*
|
|
2964
|
-
*
|
|
2965
|
-
*
|
|
3375
|
+
* **Details**
|
|
3376
|
+
* `Type` is `To["Type"]` and `Encoded` is `From["Encoded"]`. Decoding services
|
|
3377
|
+
* are `To["DecodingServices"] | From["DecodingServices"] | RD`; encoding
|
|
3378
|
+
* services are `To["EncodingServices"] | From["EncodingServices"] | RE`.
|
|
2966
3379
|
*
|
|
2967
3380
|
* @see {@link compose} for the passthrough (no transformation) variant
|
|
3381
|
+
* @category transforming
|
|
2968
3382
|
* @since 4.0.0
|
|
2969
3383
|
*/
|
|
2970
3384
|
export interface decodeTo<To extends Top, From extends Top, RD = never, RE = never> extends Bottom<To["Type"], From["Encoded"], To["DecodingServices"] | From["DecodingServices"] | RD, To["EncodingServices"] | From["EncodingServices"] | RE, To["ast"], decodeTo<To, From, RD, RE>, To["~type.make.in"], To["Iso"], To["~type.parameters"], To["~type.make"], To["~type.mutability"], To["~type.optionality"], To["~type.constructor.default"], From["~encoded.mutability"], From["~encoded.optionality"]> {
|
|
@@ -2978,7 +3392,8 @@ export interface decodeTo<To extends Top, From extends Top, RD = never, RE = nev
|
|
|
2978
3392
|
* are composed using their natural encoding/decoding chain.
|
|
2979
3393
|
*
|
|
2980
3394
|
* @see {@link decodeTo} for the transformation variant
|
|
2981
|
-
* @
|
|
3395
|
+
* @category transforming
|
|
3396
|
+
* @since 3.10.0
|
|
2982
3397
|
*/
|
|
2983
3398
|
export interface compose<To extends Top, From extends Top> extends decodeTo<To, From> {
|
|
2984
3399
|
}
|
|
@@ -3022,6 +3437,7 @@ export interface compose<To extends Top, From extends Top> extends decodeTo<To,
|
|
|
3022
3437
|
* // result: 123
|
|
3023
3438
|
* ```
|
|
3024
3439
|
*
|
|
3440
|
+
* @category transforming
|
|
3025
3441
|
* @since 4.0.0
|
|
3026
3442
|
*/
|
|
3027
3443
|
export declare function decodeTo<To extends Top>(to: To): <From extends Top>(from: From) => compose<To, From>;
|
|
@@ -3064,7 +3480,8 @@ export declare function decodeTo<To extends Top, From extends Top, RD = never, R
|
|
|
3064
3480
|
* // result: "hello"
|
|
3065
3481
|
* ```
|
|
3066
3482
|
*
|
|
3067
|
-
* @
|
|
3483
|
+
* @category transforming
|
|
3484
|
+
* @since 3.10.0
|
|
3068
3485
|
*/
|
|
3069
3486
|
export declare function decode<S extends Top, RD = never, RE = never>(transformation: {
|
|
3070
3487
|
readonly decode: Getter.Getter<S["Type"], S["Type"], RD>;
|
|
@@ -3090,6 +3507,7 @@ export declare function decode<S extends Top, RD = never, RE = never>(transforma
|
|
|
3090
3507
|
* )
|
|
3091
3508
|
* ```
|
|
3092
3509
|
*
|
|
3510
|
+
* @category transforming
|
|
3093
3511
|
* @since 4.0.0
|
|
3094
3512
|
*/
|
|
3095
3513
|
export declare function encodeTo<To extends Top>(to: To): <From extends Top>(from: From) => decodeTo<From, To>;
|
|
@@ -3117,7 +3535,8 @@ export declare function encodeTo<To extends Top, From extends Top, RD = never, R
|
|
|
3117
3535
|
* )
|
|
3118
3536
|
* ```
|
|
3119
3537
|
*
|
|
3120
|
-
* @
|
|
3538
|
+
* @category transforming
|
|
3539
|
+
* @since 3.10.0
|
|
3121
3540
|
*/
|
|
3122
3541
|
export declare function encode<S extends Top, RD = never, RE = never>(transformation: {
|
|
3123
3542
|
readonly decode: Getter.Getter<S["Encoded"], S["Encoded"], RD>;
|
|
@@ -3128,16 +3547,25 @@ export declare function encode<S extends Top, RD = never, RE = never>(transforma
|
|
|
3128
3547
|
*
|
|
3129
3548
|
* Only schemas that satisfy this constraint can be passed to {@link withConstructorDefault}.
|
|
3130
3549
|
*
|
|
3550
|
+
* @category models
|
|
3131
3551
|
* @since 4.0.0
|
|
3132
3552
|
*/
|
|
3133
3553
|
export interface WithoutConstructorDefault {
|
|
3134
3554
|
readonly "~type.constructor.default": "no-default";
|
|
3135
3555
|
}
|
|
3136
3556
|
/**
|
|
3137
|
-
*
|
|
3557
|
+
* Schema type returned by `withConstructorDefault` after attaching a default used
|
|
3558
|
+
* by constructor helpers.
|
|
3559
|
+
*
|
|
3560
|
+
* **Details**
|
|
3561
|
+
* The default affects `make` and related constructor helpers only; decoding and
|
|
3562
|
+
* encoding still use the original schema behavior. The schema is marked as
|
|
3563
|
+
* already having a constructor default so another constructor default cannot be
|
|
3564
|
+
* added.
|
|
3138
3565
|
*
|
|
3139
3566
|
* @see {@link withConstructorDefault} for the constructor
|
|
3140
|
-
* @
|
|
3567
|
+
* @category constructors
|
|
3568
|
+
* @since 3.10.0
|
|
3141
3569
|
*/
|
|
3142
3570
|
export interface withConstructorDefault<S extends Top & WithoutConstructorDefault> extends Bottom<S["Type"], S["Encoded"], S["DecodingServices"], S["EncodingServices"], S["ast"], withConstructorDefault<S>, S["~type.make.in"], S["Iso"], S["~type.parameters"], S["~type.make"], S["~type.mutability"], S["~type.optionality"], "with-default", S["~encoded.mutability"], S["~encoded.optionality"]> {
|
|
3143
3571
|
readonly schema: S;
|
|
@@ -3164,18 +3592,20 @@ export interface withConstructorDefault<S extends Top & WithoutConstructorDefaul
|
|
|
3164
3592
|
* // value: { name: "anonymous" }
|
|
3165
3593
|
* ```
|
|
3166
3594
|
*
|
|
3167
|
-
* @
|
|
3595
|
+
* @category constructors
|
|
3596
|
+
* @since 3.10.0
|
|
3168
3597
|
*/
|
|
3169
|
-
export declare function withConstructorDefault<S extends Top & WithoutConstructorDefault>(defaultValue: Effect.Effect<S["~type.make.in"]>): (schema: S) => withConstructorDefault<S>;
|
|
3598
|
+
export declare function withConstructorDefault<S extends Top & WithoutConstructorDefault>(defaultValue: Effect.Effect<S["~type.make.in"], SchemaError>): (schema: S) => withConstructorDefault<S>;
|
|
3170
3599
|
/**
|
|
3171
3600
|
* The type produced by {@link withDecodingDefaultKey}: a schema whose `Encoded`
|
|
3172
3601
|
* side is `optionalKey` and that fills in a default `Encoded` value during decoding.
|
|
3173
3602
|
*
|
|
3174
3603
|
* @see {@link withDecodingDefaultKey} for the constructor
|
|
3604
|
+
* @category decoding
|
|
3175
3605
|
* @since 4.0.0
|
|
3176
3606
|
*/
|
|
3177
|
-
export interface withDecodingDefaultKey<S extends Top> extends decodeTo<S, optionalKey<toEncoded<S
|
|
3178
|
-
readonly "Rebuild": withDecodingDefaultKey<S>;
|
|
3607
|
+
export interface withDecodingDefaultKey<S extends Top, R = never> extends decodeTo<S, optionalKey<toEncoded<S>>, R> {
|
|
3608
|
+
readonly "Rebuild": withDecodingDefaultKey<S, R>;
|
|
3179
3609
|
}
|
|
3180
3610
|
/**
|
|
3181
3611
|
* Options for {@link withDecodingDefaultKey} and {@link withDecodingDefault}.
|
|
@@ -3184,6 +3614,7 @@ export interface withDecodingDefaultKey<S extends Top> extends decodeTo<S, optio
|
|
|
3184
3614
|
* - `"passthrough"` (default): pass the value through during encoding
|
|
3185
3615
|
* - `"omit"`: omit the key from the encoded output
|
|
3186
3616
|
*
|
|
3617
|
+
* @category models
|
|
3187
3618
|
* @since 4.0.0
|
|
3188
3619
|
*/
|
|
3189
3620
|
export type DecodingDefaultOptions = {
|
|
@@ -3218,19 +3649,21 @@ export type DecodingDefaultOptions = {
|
|
|
3218
3649
|
*
|
|
3219
3650
|
* @see {@link withDecodingDefault} for the value-level variant (key absent **or** `undefined`)
|
|
3220
3651
|
* @see {@link withDecodingDefaultTypeKey} for the variant where the default is a `Type` value
|
|
3652
|
+
* @category decoding
|
|
3221
3653
|
* @since 4.0.0
|
|
3222
3654
|
*/
|
|
3223
|
-
export declare function withDecodingDefaultKey<S extends Top>(defaultValue: Effect.Effect<S["Encoded"]>, options?: DecodingDefaultOptions): (self: S) => withDecodingDefaultKey<S>;
|
|
3655
|
+
export declare function withDecodingDefaultKey<S extends Top, R = never>(defaultValue: Effect.Effect<S["Encoded"], SchemaError, R>, options?: DecodingDefaultOptions): (self: S) => withDecodingDefaultKey<S, R>;
|
|
3224
3656
|
/**
|
|
3225
3657
|
* The type produced by {@link withDecodingDefaultTypeKey}: a schema whose
|
|
3226
3658
|
* `Encoded` side is `optionalKey` and that fills in a default `Type` value
|
|
3227
3659
|
* during decoding.
|
|
3228
3660
|
*
|
|
3229
3661
|
* @see {@link withDecodingDefaultTypeKey} for the constructor
|
|
3662
|
+
* @category decoding
|
|
3230
3663
|
* @since 4.0.0
|
|
3231
3664
|
*/
|
|
3232
|
-
export interface withDecodingDefaultTypeKey<S extends Top> extends decodeTo<withDecodingDefaultKey<toType<S
|
|
3233
|
-
readonly "Rebuild": withDecodingDefaultTypeKey<S>;
|
|
3665
|
+
export interface withDecodingDefaultTypeKey<S extends Top, R = never> extends decodeTo<withDecodingDefaultKey<toType<S>, R>, optionalKey<S>> {
|
|
3666
|
+
readonly "Rebuild": withDecodingDefaultTypeKey<S, R>;
|
|
3234
3667
|
}
|
|
3235
3668
|
/**
|
|
3236
3669
|
* Makes a struct key optional on the `Encoded` side (`optionalKey`, so the
|
|
@@ -3249,18 +3682,20 @@ export interface withDecodingDefaultTypeKey<S extends Top> extends decodeTo<with
|
|
|
3249
3682
|
*
|
|
3250
3683
|
* @see {@link withDecodingDefaultKey} for the variant where the default is an `Encoded` value
|
|
3251
3684
|
* @see {@link withDecodingDefaultType} for the value-level variant
|
|
3685
|
+
* @category decoding
|
|
3252
3686
|
* @since 4.0.0
|
|
3253
3687
|
*/
|
|
3254
|
-
export declare function withDecodingDefaultTypeKey<S extends Top>(defaultValue: Effect.Effect<S["Type"]>, options?: DecodingDefaultOptions): (self: S) => withDecodingDefaultTypeKey<S>;
|
|
3688
|
+
export declare function withDecodingDefaultTypeKey<S extends Top, R = never>(defaultValue: Effect.Effect<S["Type"], SchemaError, R>, options?: DecodingDefaultOptions): (self: S) => withDecodingDefaultTypeKey<S, R>;
|
|
3255
3689
|
/**
|
|
3256
3690
|
* The type produced by {@link withDecodingDefault}: a schema whose `Encoded`
|
|
3257
3691
|
* side is `optional` and that fills in a default `Encoded` value during decoding.
|
|
3258
3692
|
*
|
|
3259
3693
|
* @see {@link withDecodingDefault} for the constructor
|
|
3260
|
-
* @
|
|
3694
|
+
* @category decoding
|
|
3695
|
+
* @since 3.10.0
|
|
3261
3696
|
*/
|
|
3262
|
-
export interface withDecodingDefault<S extends Top> extends decodeTo<S, optional<toEncoded<S
|
|
3263
|
-
readonly "Rebuild": withDecodingDefault<S>;
|
|
3697
|
+
export interface withDecodingDefault<S extends Top, R = never> extends decodeTo<S, optional<toEncoded<S>>, R> {
|
|
3698
|
+
readonly "Rebuild": withDecodingDefault<S, R>;
|
|
3264
3699
|
}
|
|
3265
3700
|
/**
|
|
3266
3701
|
* Wraps the `Encoded` side with `optional` (key absent **or** `undefined`)
|
|
@@ -3291,19 +3726,21 @@ export interface withDecodingDefault<S extends Top> extends decodeTo<S, optional
|
|
|
3291
3726
|
*
|
|
3292
3727
|
* @see {@link withDecodingDefaultKey} for the key-level variant (key absent only, not `undefined`)
|
|
3293
3728
|
* @see {@link withDecodingDefaultType} for the variant where the default is a `Type` value
|
|
3294
|
-
* @
|
|
3729
|
+
* @category decoding
|
|
3730
|
+
* @since 3.10.0
|
|
3295
3731
|
*/
|
|
3296
|
-
export declare function withDecodingDefault<S extends Top>(defaultValue: Effect.Effect<S["Encoded"]>, options?: DecodingDefaultOptions): (self: S) => withDecodingDefault<S>;
|
|
3732
|
+
export declare function withDecodingDefault<S extends Top, R = never>(defaultValue: Effect.Effect<S["Encoded"], SchemaError, R>, options?: DecodingDefaultOptions): (self: S) => withDecodingDefault<S, R>;
|
|
3297
3733
|
/**
|
|
3298
3734
|
* The type produced by {@link withDecodingDefaultType}: a schema whose
|
|
3299
3735
|
* `Encoded` side is `optional` and that fills in a default `Type` value during
|
|
3300
3736
|
* decoding.
|
|
3301
3737
|
*
|
|
3302
3738
|
* @see {@link withDecodingDefaultType} for the constructor
|
|
3739
|
+
* @category decoding
|
|
3303
3740
|
* @since 4.0.0
|
|
3304
3741
|
*/
|
|
3305
|
-
export interface withDecodingDefaultType<S extends Top> extends decodeTo<withDecodingDefault<toType<S
|
|
3306
|
-
readonly "Rebuild": withDecodingDefaultType<S>;
|
|
3742
|
+
export interface withDecodingDefaultType<S extends Top, R = never> extends decodeTo<withDecodingDefault<toType<S>, R>, optional<S>> {
|
|
3743
|
+
readonly "Rebuild": withDecodingDefaultType<S, R>;
|
|
3307
3744
|
}
|
|
3308
3745
|
/**
|
|
3309
3746
|
* Wraps the `Encoded` side with `optional` (key absent **or** `undefined`)
|
|
@@ -3322,16 +3759,18 @@ export interface withDecodingDefaultType<S extends Top> extends decodeTo<withDec
|
|
|
3322
3759
|
*
|
|
3323
3760
|
* @see {@link withDecodingDefault} for the variant where the default is an `Encoded` value
|
|
3324
3761
|
* @see {@link withDecodingDefaultTypeKey} for the key-level variant
|
|
3762
|
+
* @category decoding
|
|
3325
3763
|
* @since 4.0.0
|
|
3326
3764
|
*/
|
|
3327
|
-
export declare function withDecodingDefaultType<S extends Top>(defaultValue: Effect.Effect<S["Type"]>, options?: DecodingDefaultOptions): (self: S) => withDecodingDefaultType<S>;
|
|
3765
|
+
export declare function withDecodingDefaultType<S extends Top, R = never>(defaultValue: Effect.Effect<S["Type"], SchemaError, R>, options?: DecodingDefaultOptions): (self: S) => withDecodingDefaultType<S, R>;
|
|
3328
3766
|
/**
|
|
3329
3767
|
* The type produced by {@link tag} — a literal schema with a constructor default.
|
|
3330
3768
|
*
|
|
3331
3769
|
* Used as the type of the `_tag` field in {@link TaggedStruct} and related helpers.
|
|
3332
3770
|
*
|
|
3333
3771
|
* @see {@link tag} for the constructor
|
|
3334
|
-
* @
|
|
3772
|
+
* @category constructors
|
|
3773
|
+
* @since 3.10.0
|
|
3335
3774
|
*/
|
|
3336
3775
|
export interface tag<Tag extends AST.LiteralValue> extends withConstructorDefault<Literal<Tag>> {
|
|
3337
3776
|
}
|
|
@@ -3354,7 +3793,8 @@ export interface tag<Tag extends AST.LiteralValue> extends withConstructorDefaul
|
|
|
3354
3793
|
*
|
|
3355
3794
|
* @see {@link tagDefaultOmit} to also omit the tag during encoding
|
|
3356
3795
|
* @see {@link TaggedStruct} for a shorthand that adds `_tag` automatically
|
|
3357
|
-
* @
|
|
3796
|
+
* @category constructors
|
|
3797
|
+
* @since 3.10.0
|
|
3358
3798
|
*/
|
|
3359
3799
|
export declare function tag<Tag extends AST.LiteralValue>(literal: Tag): tag<Tag>;
|
|
3360
3800
|
/**
|
|
@@ -3378,14 +3818,16 @@ export declare function tag<Tag extends AST.LiteralValue>(literal: Tag): tag<Tag
|
|
|
3378
3818
|
* ```
|
|
3379
3819
|
*
|
|
3380
3820
|
* @see {@link tag} for the variant that keeps the tag during encoding
|
|
3821
|
+
* @category constructors
|
|
3381
3822
|
* @since 4.0.0
|
|
3382
3823
|
*/
|
|
3383
|
-
export declare function tagDefaultOmit<Tag extends AST.LiteralValue>(literal: Tag): withDecodingDefaultKey<tag<Tag
|
|
3824
|
+
export declare function tagDefaultOmit<Tag extends AST.LiteralValue>(literal: Tag): withDecodingDefaultKey<tag<Tag>, never>;
|
|
3384
3825
|
/**
|
|
3385
3826
|
* The type produced by {@link TaggedStruct} — a {@link Struct} with an extra `_tag` field of type {@link tag}.
|
|
3386
3827
|
*
|
|
3387
3828
|
* @see {@link TaggedStruct} for the constructor
|
|
3388
|
-
* @
|
|
3829
|
+
* @category models
|
|
3830
|
+
* @since 3.10.0
|
|
3389
3831
|
*/
|
|
3390
3832
|
export type TaggedStruct<Tag extends AST.LiteralValue, Fields extends Struct.Fields> = Struct<Simplify<{
|
|
3391
3833
|
readonly _tag: tag<Tag>;
|
|
@@ -3429,8 +3871,8 @@ export type TaggedStruct<Tag extends AST.LiteralValue, Fields extends Struct.Fie
|
|
|
3429
3871
|
* const literal = tagged.fields._tag.schema.literal
|
|
3430
3872
|
* ```
|
|
3431
3873
|
*
|
|
3432
|
-
* @category
|
|
3433
|
-
* @since
|
|
3874
|
+
* @category constructors
|
|
3875
|
+
* @since 3.10.0
|
|
3434
3876
|
*/
|
|
3435
3877
|
export declare function TaggedStruct<const Tag extends AST.LiteralValue, const Fields extends Struct.Fields>(value: Tag, fields: Fields): TaggedStruct<Tag, Fields>;
|
|
3436
3878
|
/**
|
|
@@ -3468,8 +3910,8 @@ type TaggedUnionUtils<Tag extends PropertyKey, Members extends ReadonlyArray<Top
|
|
|
3468
3910
|
* The type produced by {@link toTaggedUnion} — a {@link Union} augmented with `cases`, `guards`, `isAnyOf`, and `match` utilities.
|
|
3469
3911
|
*
|
|
3470
3912
|
* @see {@link toTaggedUnion} for the constructor
|
|
3913
|
+
* @category combinators
|
|
3471
3914
|
* @since 4.0.0
|
|
3472
|
-
* @experimental
|
|
3473
3915
|
*/
|
|
3474
3916
|
export type toTaggedUnion<Tag extends PropertyKey, Members extends ReadonlyArray<Top & {
|
|
3475
3917
|
readonly Type: {
|
|
@@ -3497,8 +3939,8 @@ export type toTaggedUnion<Tag extends PropertyKey, Members extends ReadonlyArray
|
|
|
3497
3939
|
* ```
|
|
3498
3940
|
*
|
|
3499
3941
|
* @see {@link TaggedUnion} for a shorthand that builds the union from scratch
|
|
3942
|
+
* @category combinators
|
|
3500
3943
|
* @since 4.0.0
|
|
3501
|
-
* @experimental
|
|
3502
3944
|
*/
|
|
3503
3945
|
export declare function toTaggedUnion<const Tag extends PropertyKey>(tag: Tag): <const Members extends ReadonlyArray<Top & {
|
|
3504
3946
|
readonly Type: { readonly [K in Tag]: PropertyKey; };
|
|
@@ -3508,8 +3950,8 @@ export declare function toTaggedUnion<const Tag extends PropertyKey>(tag: Tag):
|
|
|
3508
3950
|
* Produced by {@link TaggedUnion}.
|
|
3509
3951
|
*
|
|
3510
3952
|
* @see {@link TaggedUnion} for the constructor
|
|
3953
|
+
* @category models
|
|
3511
3954
|
* @since 4.0.0
|
|
3512
|
-
* @experimental
|
|
3513
3955
|
*/
|
|
3514
3956
|
export interface TaggedUnion<Cases extends Record<string, Top>> extends Bottom<{
|
|
3515
3957
|
[K in keyof Cases]: Cases[K]["Type"];
|
|
@@ -3561,7 +4003,7 @@ export interface TaggedUnion<Cases extends Record<string, Top>> extends Bottom<{
|
|
|
3561
4003
|
* ```
|
|
3562
4004
|
*
|
|
3563
4005
|
* @see {@link toTaggedUnion} to augment an existing union instead
|
|
3564
|
-
* @category
|
|
4006
|
+
* @category constructors
|
|
3565
4007
|
* @since 4.0.0
|
|
3566
4008
|
*/
|
|
3567
4009
|
export declare function TaggedUnion<const CasesByTag extends Record<string, Struct.Fields>>(casesByTag: CasesByTag): TaggedUnion<{
|
|
@@ -3573,6 +4015,7 @@ export declare function TaggedUnion<const CasesByTag extends Record<string, Stru
|
|
|
3573
4015
|
* making the decoded value nominally distinct.
|
|
3574
4016
|
*
|
|
3575
4017
|
* @see {@link Opaque} for the constructor
|
|
4018
|
+
* @category models
|
|
3576
4019
|
* @since 4.0.0
|
|
3577
4020
|
*/
|
|
3578
4021
|
export interface Opaque<Self, S extends Top, Brand> extends Bottom<Self, S["Encoded"], S["DecodingServices"], S["EncodingServices"], S["ast"], S["Rebuild"], S["~type.make.in"], S["Iso"], S["~type.parameters"], S["~type.make"], S["~type.mutability"], S["~type.optionality"], S["~type.constructor.default"], S["~encoded.mutability"], S["~encoded.optionality"]> {
|
|
@@ -3599,6 +4042,7 @@ export interface Opaque<Self, S extends Top, Brand> extends Bottom<Self, S["Enco
|
|
|
3599
4042
|
* // person: Person
|
|
3600
4043
|
* ```
|
|
3601
4044
|
*
|
|
4045
|
+
* @category constructors
|
|
3602
4046
|
* @since 4.0.0
|
|
3603
4047
|
*/
|
|
3604
4048
|
export declare function Opaque<Self, Brand = {}>(): <S extends Top>(schema: S) => Opaque<Self, S, Brand> & Omit<S, keyof Top>;
|
|
@@ -3606,7 +4050,8 @@ export declare function Opaque<Self, Brand = {}>(): <S extends Top>(schema: S) =
|
|
|
3606
4050
|
* The type produced by {@link instanceOf} — a declaration schema that validates class instances.
|
|
3607
4051
|
*
|
|
3608
4052
|
* @see {@link instanceOf} for the constructor
|
|
3609
|
-
* @
|
|
4053
|
+
* @category models
|
|
4054
|
+
* @since 3.10.0
|
|
3610
4055
|
*/
|
|
3611
4056
|
export interface instanceOf<T, Iso = T> extends declare<T, Iso> {
|
|
3612
4057
|
readonly "Rebuild": instanceOf<T, Iso>;
|
|
@@ -3626,14 +4071,15 @@ export interface instanceOf<T, Iso = T> extends declare<T, Iso> {
|
|
|
3626
4071
|
* // decoded: Date
|
|
3627
4072
|
* ```
|
|
3628
4073
|
*
|
|
3629
|
-
* @category
|
|
3630
|
-
* @since
|
|
4074
|
+
* @category constructors
|
|
4075
|
+
* @since 3.10.0
|
|
3631
4076
|
*/
|
|
3632
4077
|
export declare function instanceOf<C extends abstract new (...args: any) => any, Iso = InstanceType<C>>(constructor: C, annotations?: Annotations.Declaration<InstanceType<C>> | undefined): instanceOf<InstanceType<C>, Iso>;
|
|
3633
4078
|
/**
|
|
3634
4079
|
* Constructs an `AST.Link` that describes how a value of type `T` encodes to and decodes from a `To` schema.
|
|
3635
4080
|
* Used when building low-level AST transformations that bridge two schema types.
|
|
3636
4081
|
*
|
|
4082
|
+
* @category transforming
|
|
3637
4083
|
* @since 4.0.0
|
|
3638
4084
|
*/
|
|
3639
4085
|
export declare function link<T>(): <To extends Top>(encodeTo: To, transformation: {
|
|
@@ -3641,9 +4087,17 @@ export declare function link<T>(): <To extends Top>(encodeTo: To, transformation
|
|
|
3641
4087
|
readonly encode: Getter.Getter<NoInfer<To["Type"]>, T>;
|
|
3642
4088
|
}) => AST.Link;
|
|
3643
4089
|
/**
|
|
3644
|
-
* Creates a custom filter
|
|
3645
|
-
*
|
|
3646
|
-
*
|
|
4090
|
+
* Creates a custom validation filter from a predicate function.
|
|
4091
|
+
*
|
|
4092
|
+
* **Details**
|
|
4093
|
+
* The predicate receives the decoded input value, the schema AST, and parse
|
|
4094
|
+
* options, and returns a `FilterOutput`. Non-success outputs are normalized into
|
|
4095
|
+
* schema issues. The `annotations` parameter annotates the filter itself; with
|
|
4096
|
+
* the default formatter, failures use `message` first, `expected` second, and
|
|
4097
|
+
* `<filter>` when neither is provided.
|
|
4098
|
+
*
|
|
4099
|
+
* When `abort` is `true`, parsing stops after this filter fails instead of
|
|
4100
|
+
* collecting later check failures.
|
|
3647
4101
|
*
|
|
3648
4102
|
* **Example** (Failure at a nested path)
|
|
3649
4103
|
*
|
|
@@ -3703,8 +4157,8 @@ export declare const makeFilter: <T>(filter: (input: T, ast: AST.AST, options: A
|
|
|
3703
4157
|
* {@link Issue.Issue}; the result is wrapped in an {@link Issue.Pointer}
|
|
3704
4158
|
* at the given `path`.
|
|
3705
4159
|
*
|
|
3706
|
-
* @category
|
|
3707
|
-
* @since
|
|
4160
|
+
* @category models
|
|
4161
|
+
* @since 3.10.0
|
|
3708
4162
|
*/
|
|
3709
4163
|
export type FilterIssue = string | Issue.Issue | {
|
|
3710
4164
|
readonly path: ReadonlyArray<PropertyKey>;
|
|
@@ -3728,8 +4182,8 @@ export type FilterIssue = string | Issue.Issue | {
|
|
|
3728
4182
|
* to returning that element directly; otherwise the entries are grouped
|
|
3729
4183
|
* into an {@link Issue.Composite}.
|
|
3730
4184
|
*
|
|
3731
|
-
* @category
|
|
3732
|
-
* @since
|
|
4185
|
+
* @category models
|
|
4186
|
+
* @since 3.10.0
|
|
3733
4187
|
*/
|
|
3734
4188
|
export type FilterOutput = undefined | boolean | FilterIssue | ReadonlyArray<FilterIssue>;
|
|
3735
4189
|
/**
|
|
@@ -3791,34 +4245,29 @@ export declare const isPattern: (regExp: globalThis.RegExp, annotations?: Annota
|
|
|
3791
4245
|
*/
|
|
3792
4246
|
export declare const isStringFinite: (annotations?: Annotations.Filter) => AST.Filter<string>;
|
|
3793
4247
|
/**
|
|
3794
|
-
* Validates that a string
|
|
3795
|
-
*
|
|
3796
|
-
* **JSON Schema**
|
|
4248
|
+
* Validates that a string is a signed base-10 integer literal for Effect's
|
|
4249
|
+
* BigInt string encoding.
|
|
3797
4250
|
*
|
|
3798
|
-
*
|
|
3799
|
-
*
|
|
3800
|
-
*
|
|
3801
|
-
*
|
|
4251
|
+
* **Details**
|
|
4252
|
+
* The check uses the pattern `^-?\d+$`. It does not accept leading `+`, decimal
|
|
4253
|
+
* points, exponent notation, separators, or non-decimal inputs such as
|
|
4254
|
+
* hexadecimal strings.
|
|
3802
4255
|
*
|
|
3803
|
-
*
|
|
3804
|
-
*
|
|
4256
|
+
* **JSON Schema**
|
|
4257
|
+
* This check corresponds to a `pattern` constraint with the same signed
|
|
4258
|
+
* base-10 integer pattern.
|
|
3805
4259
|
*
|
|
3806
4260
|
* @category String checks
|
|
3807
4261
|
* @since 4.0.0
|
|
3808
4262
|
*/
|
|
3809
4263
|
export declare const isStringBigInt: (annotations?: Annotations.Filter) => AST.Filter<string>;
|
|
3810
4264
|
/**
|
|
3811
|
-
* Validates that a string
|
|
3812
|
-
*
|
|
3813
|
-
* **JSON Schema**
|
|
4265
|
+
* Validates that a string has the `Symbol(description)` format used by Effect's
|
|
4266
|
+
* symbol string encoding.
|
|
3814
4267
|
*
|
|
3815
|
-
*
|
|
3816
|
-
*
|
|
3817
|
-
*
|
|
3818
|
-
* **Arbitrary**
|
|
3819
|
-
*
|
|
3820
|
-
* When generating test data with fast-check, this applies a `patterns`
|
|
3821
|
-
* constraint to ensure generated strings match the Symbol string pattern.
|
|
4268
|
+
* **Details**
|
|
4269
|
+
* The check uses the pattern `^Symbol\((.*)\)$`. It is not a general test for
|
|
4270
|
+
* whether a string can be passed to JavaScript's `Symbol()` function.
|
|
3822
4271
|
*
|
|
3823
4272
|
* @category String checks
|
|
3824
4273
|
* @since 4.0.0
|
|
@@ -3897,119 +4346,84 @@ export declare function isBase64(annotations?: Annotations.Filter): AST.Filter<s
|
|
|
3897
4346
|
*/
|
|
3898
4347
|
export declare function isBase64Url(annotations?: Annotations.Filter): AST.Filter<string>;
|
|
3899
4348
|
/**
|
|
3900
|
-
* Validates that a string starts with the specified prefix.
|
|
3901
|
-
*
|
|
3902
|
-
* **JSON Schema**
|
|
4349
|
+
* Validates at runtime that a string starts with the specified literal prefix.
|
|
3903
4350
|
*
|
|
3904
|
-
*
|
|
3905
|
-
*
|
|
3906
|
-
*
|
|
3907
|
-
*
|
|
3908
|
-
*
|
|
3909
|
-
* When generating test data with fast-check, this applies a `patterns`
|
|
3910
|
-
* constraint to ensure generated strings start with the required prefix.
|
|
4351
|
+
* **Notes**
|
|
4352
|
+
* The JSON Schema and arbitrary metadata are built from `^${startsWith}` without
|
|
4353
|
+
* escaping regexp metacharacters. If the prefix contains regexp syntax, generated
|
|
4354
|
+
* patterns may not be equivalent to the runtime `startsWith` check.
|
|
3911
4355
|
*
|
|
3912
4356
|
* @category String checks
|
|
3913
4357
|
* @since 4.0.0
|
|
3914
4358
|
*/
|
|
3915
4359
|
export declare function isStartsWith(startsWith: string, annotations?: Annotations.Filter): AST.Filter<string>;
|
|
3916
4360
|
/**
|
|
3917
|
-
* Validates that a string ends with the specified suffix.
|
|
3918
|
-
*
|
|
3919
|
-
* **JSON Schema**
|
|
4361
|
+
* Validates at runtime that a string ends with the specified literal suffix.
|
|
3920
4362
|
*
|
|
3921
|
-
*
|
|
3922
|
-
*
|
|
3923
|
-
*
|
|
3924
|
-
*
|
|
3925
|
-
*
|
|
3926
|
-
* When generating test data with fast-check, this applies a `patterns`
|
|
3927
|
-
* constraint to ensure generated strings end with the required suffix.
|
|
4363
|
+
* **Notes**
|
|
4364
|
+
* The JSON Schema and arbitrary metadata are built from `${endsWith}$` without
|
|
4365
|
+
* escaping regexp metacharacters. If the suffix contains regexp syntax, generated
|
|
4366
|
+
* patterns may not be equivalent to the runtime `endsWith` check.
|
|
3928
4367
|
*
|
|
3929
4368
|
* @category String checks
|
|
3930
4369
|
* @since 4.0.0
|
|
3931
4370
|
*/
|
|
3932
4371
|
export declare function isEndsWith(endsWith: string, annotations?: Annotations.Filter): AST.Filter<string>;
|
|
3933
4372
|
/**
|
|
3934
|
-
* Validates that a string contains the specified substring.
|
|
4373
|
+
* Validates at runtime that a string contains the specified literal substring.
|
|
3935
4374
|
*
|
|
3936
|
-
* **
|
|
3937
|
-
*
|
|
3938
|
-
*
|
|
3939
|
-
*
|
|
3940
|
-
*
|
|
3941
|
-
* **Arbitrary**
|
|
3942
|
-
*
|
|
3943
|
-
* When generating test data with fast-check, this applies a `patterns`
|
|
3944
|
-
* constraint to ensure generated strings contain the required substring.
|
|
4375
|
+
* **Notes**
|
|
4376
|
+
* The JSON Schema and arbitrary metadata use the substring as a raw regexp
|
|
4377
|
+
* pattern. If the substring contains regexp syntax, generated patterns may not be
|
|
4378
|
+
* equivalent to the runtime `includes` check.
|
|
3945
4379
|
*
|
|
3946
4380
|
* @category String checks
|
|
3947
4381
|
* @since 4.0.0
|
|
3948
4382
|
*/
|
|
3949
4383
|
export declare function isIncludes(includes: string, annotations?: Annotations.Filter): AST.Filter<string>;
|
|
3950
4384
|
/**
|
|
3951
|
-
* Validates that a string
|
|
3952
|
-
*
|
|
3953
|
-
* **JSON Schema**
|
|
3954
|
-
*
|
|
3955
|
-
* This check corresponds to a `pattern` constraint in JSON Schema that matches
|
|
3956
|
-
* strings with only uppercase characters.
|
|
3957
|
-
*
|
|
3958
|
-
* **Arbitrary**
|
|
4385
|
+
* Validates that a string is unchanged by JavaScript's `toUpperCase()`.
|
|
3959
4386
|
*
|
|
3960
|
-
*
|
|
3961
|
-
*
|
|
4387
|
+
* **Details**
|
|
4388
|
+
* This accepts empty strings and characters that do not have lowercase forms,
|
|
4389
|
+
* such as digits, punctuation, and whitespace. It rejects strings that would
|
|
4390
|
+
* change when uppercased.
|
|
3962
4391
|
*
|
|
3963
4392
|
* @category String checks
|
|
3964
4393
|
* @since 4.0.0
|
|
3965
4394
|
*/
|
|
3966
4395
|
export declare function isUppercased(annotations?: Annotations.Filter): AST.Filter<string>;
|
|
3967
4396
|
/**
|
|
3968
|
-
* Validates that a string
|
|
4397
|
+
* Validates that a string is unchanged by JavaScript's `toLowerCase()`.
|
|
3969
4398
|
*
|
|
3970
|
-
* **
|
|
3971
|
-
*
|
|
3972
|
-
*
|
|
3973
|
-
*
|
|
3974
|
-
*
|
|
3975
|
-
* **Arbitrary**
|
|
3976
|
-
*
|
|
3977
|
-
* When generating test data with fast-check, this applies a `patterns`
|
|
3978
|
-
* constraint to ensure generated strings contain only lowercase characters.
|
|
4399
|
+
* **Details**
|
|
4400
|
+
* This accepts empty strings and characters that do not have uppercase forms,
|
|
4401
|
+
* such as digits, punctuation, and whitespace. It rejects strings that would
|
|
4402
|
+
* change when lowercased.
|
|
3979
4403
|
*
|
|
3980
4404
|
* @category String checks
|
|
3981
4405
|
* @since 4.0.0
|
|
3982
4406
|
*/
|
|
3983
4407
|
export declare function isLowercased(annotations?: Annotations.Filter): AST.Filter<string>;
|
|
3984
4408
|
/**
|
|
3985
|
-
* Validates that
|
|
3986
|
-
*
|
|
3987
|
-
* **JSON Schema**
|
|
3988
|
-
*
|
|
3989
|
-
* This check corresponds to a `pattern` constraint in JSON Schema that matches
|
|
3990
|
-
* strings with the first character in uppercase.
|
|
3991
|
-
*
|
|
3992
|
-
* **Arbitrary**
|
|
4409
|
+
* Validates that the first character of a string is unchanged by
|
|
4410
|
+
* `toUpperCase()`.
|
|
3993
4411
|
*
|
|
3994
|
-
*
|
|
3995
|
-
*
|
|
4412
|
+
* **Details**
|
|
4413
|
+
* Empty strings pass. Strings whose first character has no lowercase form, such
|
|
4414
|
+
* as a digit, punctuation mark, or whitespace, also pass.
|
|
3996
4415
|
*
|
|
3997
4416
|
* @category String checks
|
|
3998
4417
|
* @since 4.0.0
|
|
3999
4418
|
*/
|
|
4000
4419
|
export declare function isCapitalized(annotations?: Annotations.Filter): AST.Filter<string>;
|
|
4001
4420
|
/**
|
|
4002
|
-
* Validates that
|
|
4003
|
-
*
|
|
4004
|
-
* **JSON Schema**
|
|
4005
|
-
*
|
|
4006
|
-
* This check corresponds to a `pattern` constraint in JSON Schema that matches
|
|
4007
|
-
* strings with the first character in lowercase.
|
|
4008
|
-
*
|
|
4009
|
-
* **Arbitrary**
|
|
4421
|
+
* Validates that the first character of a string is unchanged by
|
|
4422
|
+
* `toLowerCase()`.
|
|
4010
4423
|
*
|
|
4011
|
-
*
|
|
4012
|
-
*
|
|
4424
|
+
* **Details**
|
|
4425
|
+
* Empty strings pass. Strings whose first character has no uppercase form, such
|
|
4426
|
+
* as a digit, punctuation mark, or whitespace, also pass.
|
|
4013
4427
|
*
|
|
4014
4428
|
* @category String checks
|
|
4015
4429
|
* @since 4.0.0
|
|
@@ -4485,7 +4899,11 @@ export declare const isLessThanBigDecimal: (exclusiveMaximum: BigDecimal_.BigDec
|
|
|
4485
4899
|
*/
|
|
4486
4900
|
export declare const isLessThanOrEqualToBigDecimal: (maximum: BigDecimal_.BigDecimal, annotations?: Annotations.Filter) => AST.Filter<BigDecimal_.BigDecimal>;
|
|
4487
4901
|
/**
|
|
4488
|
-
* Validates that a BigDecimal is within a specified range.
|
|
4902
|
+
* Validates that a `BigDecimal` is within a specified range.
|
|
4903
|
+
*
|
|
4904
|
+
* **Details**
|
|
4905
|
+
* The minimum and maximum boundaries are inclusive by default. Pass
|
|
4906
|
+
* `exclusiveMinimum` or `exclusiveMaximum` to exclude either boundary.
|
|
4489
4907
|
*
|
|
4490
4908
|
* @category BigDecimal checks
|
|
4491
4909
|
* @since 4.0.0
|
|
@@ -4512,6 +4930,7 @@ export declare const isBetweenBigDecimal: (options: {
|
|
|
4512
4930
|
* length.
|
|
4513
4931
|
*
|
|
4514
4932
|
* **Example** (Minimum length check)
|
|
4933
|
+
*
|
|
4515
4934
|
* ```ts
|
|
4516
4935
|
* import { Schema } from "effect"
|
|
4517
4936
|
*
|
|
@@ -4709,40 +5128,41 @@ export declare function isMaxProperties(maxProperties: number, annotations?: Ann
|
|
|
4709
5128
|
*/
|
|
4710
5129
|
export declare function isPropertiesLengthBetween(minimum: number, maximum: number, annotations?: Annotations.Filter): AST.Filter<object>;
|
|
4711
5130
|
/**
|
|
4712
|
-
* Validates that
|
|
4713
|
-
*
|
|
5131
|
+
* Validates that every own property key of an object satisfies the encoded side
|
|
5132
|
+
* of the provided key schema.
|
|
4714
5133
|
*
|
|
4715
|
-
* **
|
|
5134
|
+
* **Details**
|
|
5135
|
+
* This check uses `Reflect.ownKeys`, so symbol keys are validated in addition to
|
|
5136
|
+
* string property names.
|
|
4716
5137
|
*
|
|
4717
|
-
*
|
|
5138
|
+
* **JSON Schema**
|
|
5139
|
+
* For string property names, this corresponds to the `propertyNames` constraint
|
|
5140
|
+
* in JSON Schema.
|
|
4718
5141
|
*
|
|
4719
5142
|
* @category Object checks
|
|
4720
5143
|
* @since 4.0.0
|
|
4721
5144
|
*/
|
|
4722
5145
|
export declare function isPropertyNames(keySchema: Top, annotations?: Annotations.Filter): AST.Filter<object>;
|
|
4723
5146
|
/**
|
|
4724
|
-
* Validates that all items in an array are unique according to
|
|
4725
|
-
* equivalence function.
|
|
5147
|
+
* Validates that all items in an array are unique according to Effect equality.
|
|
4726
5148
|
*
|
|
4727
5149
|
* **JSON Schema**
|
|
4728
|
-
*
|
|
4729
5150
|
* This check corresponds to the `uniqueItems: true` constraint in JSON Schema.
|
|
4730
5151
|
*
|
|
4731
5152
|
* **Arbitrary**
|
|
4732
|
-
*
|
|
4733
|
-
*
|
|
4734
|
-
* constraint using the provided equivalence function to ensure generated arrays
|
|
4735
|
-
* contain only unique items.
|
|
5153
|
+
* When generating test data with fast-check, this applies a comparator based on
|
|
5154
|
+
* Effect equality to ensure generated arrays contain only unique items.
|
|
4736
5155
|
*
|
|
4737
5156
|
* @category Array checks
|
|
4738
5157
|
* @since 4.0.0
|
|
4739
5158
|
*/
|
|
4740
5159
|
export declare function isUnique<T>(annotations?: Annotations.Filter): AST.Filter<readonly T[]>;
|
|
4741
5160
|
/**
|
|
4742
|
-
*
|
|
5161
|
+
* Type-level representation of the `NonEmptyString` schema, which validates
|
|
5162
|
+
* strings with a length of at least one.
|
|
4743
5163
|
*
|
|
4744
5164
|
* @category String
|
|
4745
|
-
* @since
|
|
5165
|
+
* @since 3.10.0
|
|
4746
5166
|
*/
|
|
4747
5167
|
export interface NonEmptyString extends String {
|
|
4748
5168
|
readonly "Rebuild": NonEmptyString;
|
|
@@ -4752,14 +5172,15 @@ export interface NonEmptyString extends String {
|
|
|
4752
5172
|
* character.
|
|
4753
5173
|
*
|
|
4754
5174
|
* @category String
|
|
4755
|
-
* @since
|
|
5175
|
+
* @since 3.10.0
|
|
4756
5176
|
*/
|
|
4757
5177
|
export declare const NonEmptyString: NonEmptyString;
|
|
4758
5178
|
/**
|
|
4759
|
-
*
|
|
5179
|
+
* Type-level representation of the `Char` schema, which validates strings whose
|
|
5180
|
+
* length is exactly one.
|
|
4760
5181
|
*
|
|
4761
5182
|
* @category String
|
|
4762
|
-
* @since
|
|
5183
|
+
* @since 3.10.0
|
|
4763
5184
|
*/
|
|
4764
5185
|
export interface Char extends String {
|
|
4765
5186
|
readonly "Rebuild": Char;
|
|
@@ -4768,7 +5189,7 @@ export interface Char extends String {
|
|
|
4768
5189
|
* A schema representing a single character.
|
|
4769
5190
|
*
|
|
4770
5191
|
* @category String
|
|
4771
|
-
* @since
|
|
5192
|
+
* @since 3.10.0
|
|
4772
5193
|
*/
|
|
4773
5194
|
export declare const Char: Char;
|
|
4774
5195
|
/**
|
|
@@ -4778,8 +5199,7 @@ export declare const Char: Char;
|
|
|
4778
5199
|
* **Example** (Option schema)
|
|
4779
5200
|
*
|
|
4780
5201
|
* ```ts
|
|
4781
|
-
* import { Schema } from "effect"
|
|
4782
|
-
* import { Option } from "effect"
|
|
5202
|
+
* import { Option, Schema } from "effect"
|
|
4783
5203
|
*
|
|
4784
5204
|
* const schema = Schema.Option(Schema.Number)
|
|
4785
5205
|
*
|
|
@@ -4790,13 +5210,19 @@ export declare const Char: Char;
|
|
|
4790
5210
|
* ```
|
|
4791
5211
|
*
|
|
4792
5212
|
* @category Option
|
|
4793
|
-
* @since
|
|
5213
|
+
* @since 3.10.0
|
|
4794
5214
|
*/
|
|
4795
5215
|
export interface Option<A extends Top> extends declareConstructor<Option_.Option<A["Type"]>, Option_.Option<A["Encoded"]>, readonly [A], OptionIso<A>> {
|
|
4796
5216
|
readonly "Rebuild": Option<A>;
|
|
4797
5217
|
readonly value: A;
|
|
4798
5218
|
}
|
|
4799
5219
|
/**
|
|
5220
|
+
* Iso representation used for `Option` schemas.
|
|
5221
|
+
*
|
|
5222
|
+
* **Details**
|
|
5223
|
+
* `None` is represented as `{ _tag: "None" }`, while `Some` is represented as
|
|
5224
|
+
* `{ _tag: "Some", value }` using the wrapped schema's `Iso` type.
|
|
5225
|
+
*
|
|
4800
5226
|
* @category Option
|
|
4801
5227
|
* @since 4.0.0
|
|
4802
5228
|
*/
|
|
@@ -4810,14 +5236,15 @@ export type OptionIso<A extends Top> = {
|
|
|
4810
5236
|
* Creates a schema for `Option<A>`. See {@link Option} for details.
|
|
4811
5237
|
*
|
|
4812
5238
|
* @category Option
|
|
4813
|
-
* @since
|
|
5239
|
+
* @since 3.10.0
|
|
4814
5240
|
*/
|
|
4815
5241
|
export declare function Option<A extends Top>(value: A): Option<A>;
|
|
4816
5242
|
/**
|
|
4817
|
-
*
|
|
5243
|
+
* Type-level representation of a schema that decodes `null` as `None` and all
|
|
5244
|
+
* other values as `Some`.
|
|
4818
5245
|
*
|
|
4819
5246
|
* @category Option
|
|
4820
|
-
* @since
|
|
5247
|
+
* @since 3.10.0
|
|
4821
5248
|
*/
|
|
4822
5249
|
export interface OptionFromNullOr<S extends Top> extends decodeTo<Option<toType<S>>, NullOr<S>> {
|
|
4823
5250
|
readonly "Rebuild": OptionFromNullOr<S>;
|
|
@@ -4834,14 +5261,15 @@ export interface OptionFromNullOr<S extends Top> extends decodeTo<Option<toType<
|
|
|
4834
5261
|
* - `Some` is encoded as the value
|
|
4835
5262
|
*
|
|
4836
5263
|
* @category Option
|
|
4837
|
-
* @since
|
|
5264
|
+
* @since 3.10.0
|
|
4838
5265
|
*/
|
|
4839
5266
|
export declare function OptionFromNullOr<S extends Top>(schema: S): OptionFromNullOr<S>;
|
|
4840
5267
|
/**
|
|
4841
|
-
*
|
|
5268
|
+
* Type-level representation of a schema that decodes `undefined` as `None` and
|
|
5269
|
+
* all other values as `Some`.
|
|
4842
5270
|
*
|
|
4843
5271
|
* @category Option
|
|
4844
|
-
* @since
|
|
5272
|
+
* @since 3.10.0
|
|
4845
5273
|
*/
|
|
4846
5274
|
export interface OptionFromUndefinedOr<S extends Top> extends decodeTo<Option<toType<S>>, UndefinedOr<S>> {
|
|
4847
5275
|
readonly "Rebuild": OptionFromUndefinedOr<S>;
|
|
@@ -4858,14 +5286,15 @@ export interface OptionFromUndefinedOr<S extends Top> extends decodeTo<Option<to
|
|
|
4858
5286
|
* - `Some` is encoded as the value
|
|
4859
5287
|
*
|
|
4860
5288
|
* @category Option
|
|
4861
|
-
* @since
|
|
5289
|
+
* @since 3.10.0
|
|
4862
5290
|
*/
|
|
4863
5291
|
export declare function OptionFromUndefinedOr<S extends Top>(schema: S): OptionFromUndefinedOr<S>;
|
|
4864
5292
|
/**
|
|
4865
|
-
*
|
|
5293
|
+
* Type-level representation of a schema that decodes `null` or `undefined` as
|
|
5294
|
+
* `None` and all other values as `Some`.
|
|
4866
5295
|
*
|
|
4867
5296
|
* @category Option
|
|
4868
|
-
* @since
|
|
5297
|
+
* @since 3.10.0
|
|
4869
5298
|
*/
|
|
4870
5299
|
export interface OptionFromNullishOr<S extends Top> extends decodeTo<Option<toType<S>>, NullishOr<S>> {
|
|
4871
5300
|
readonly "Rebuild": OptionFromNullishOr<S>;
|
|
@@ -4882,13 +5311,14 @@ export interface OptionFromNullishOr<S extends Top> extends decodeTo<Option<toTy
|
|
|
4882
5311
|
* - `Some` is encoded as the value
|
|
4883
5312
|
*
|
|
4884
5313
|
* @category Option
|
|
4885
|
-
* @since
|
|
5314
|
+
* @since 3.10.0
|
|
4886
5315
|
*/
|
|
4887
5316
|
export declare function OptionFromNullishOr<S extends Top>(schema: S, options?: {
|
|
4888
5317
|
onNoneEncoding: null | undefined;
|
|
4889
5318
|
}): OptionFromNullishOr<S>;
|
|
4890
5319
|
/**
|
|
4891
|
-
*
|
|
5320
|
+
* Type-level representation of a schema that decodes a missing object key as
|
|
5321
|
+
* `None` and a present key as `Some`.
|
|
4892
5322
|
*
|
|
4893
5323
|
* @category Option
|
|
4894
5324
|
* @since 4.0.0
|
|
@@ -4912,7 +5342,8 @@ export interface OptionFromOptionalKey<S extends Top> extends decodeTo<Option<to
|
|
|
4912
5342
|
*/
|
|
4913
5343
|
export declare function OptionFromOptionalKey<S extends Top>(schema: S): OptionFromOptionalKey<S>;
|
|
4914
5344
|
/**
|
|
4915
|
-
*
|
|
5345
|
+
* Type-level representation of a schema that decodes a missing key or
|
|
5346
|
+
* `undefined` value as `None` and other present values as `Some`.
|
|
4916
5347
|
*
|
|
4917
5348
|
* @category Option
|
|
4918
5349
|
* @since 4.0.0
|
|
@@ -4938,7 +5369,8 @@ export interface OptionFromOptional<S extends Top> extends decodeTo<Option<toTyp
|
|
|
4938
5369
|
*/
|
|
4939
5370
|
export declare function OptionFromOptional<S extends Top>(schema: S): OptionFromOptional<S>;
|
|
4940
5371
|
/**
|
|
4941
|
-
*
|
|
5372
|
+
* Type-level representation of a schema that decodes a missing key, `undefined`,
|
|
5373
|
+
* or `null` as `None` and all other present values as `Some`.
|
|
4942
5374
|
*
|
|
4943
5375
|
* @category Option
|
|
4944
5376
|
* @since 4.0.0
|
|
@@ -4981,6 +5413,12 @@ export interface Result<A extends Top, E extends Top> extends declareConstructor
|
|
|
4981
5413
|
readonly failure: E;
|
|
4982
5414
|
}
|
|
4983
5415
|
/**
|
|
5416
|
+
* Iso representation used for `Result` schemas.
|
|
5417
|
+
*
|
|
5418
|
+
* **Details**
|
|
5419
|
+
* Successful results are represented as `{ _tag: "Success", success }`, while
|
|
5420
|
+
* failed results are represented as `{ _tag: "Failure", failure }`.
|
|
5421
|
+
*
|
|
4984
5422
|
* @category Result
|
|
4985
5423
|
* @since 4.0.0
|
|
4986
5424
|
*/
|
|
@@ -5003,7 +5441,7 @@ export declare function Result<A extends Top, E extends Top>(success: A, failure
|
|
|
5003
5441
|
* values. The inner value is hidden from error messages.
|
|
5004
5442
|
*
|
|
5005
5443
|
* @category Redacted
|
|
5006
|
-
* @since
|
|
5444
|
+
* @since 3.10.0
|
|
5007
5445
|
*/
|
|
5008
5446
|
export interface Redacted<S extends Top> extends declareConstructor<Redacted_.Redacted<S["Type"]>, Redacted_.Redacted<S["Encoded"]>, readonly [S]> {
|
|
5009
5447
|
readonly "Rebuild": Redacted<S>;
|
|
@@ -5030,13 +5468,14 @@ export interface Redacted<S extends Top> extends declareConstructor<Redacted_.Re
|
|
|
5030
5468
|
* but it will deserialize a value into a `Redacted` instance.
|
|
5031
5469
|
*
|
|
5032
5470
|
* @category Redacted
|
|
5033
|
-
* @since
|
|
5471
|
+
* @since 3.10.0
|
|
5034
5472
|
*/
|
|
5035
5473
|
export declare function Redacted<S extends Top>(value: S, options?: {
|
|
5036
5474
|
readonly label?: string | undefined;
|
|
5037
5475
|
}): Redacted<S>;
|
|
5038
5476
|
/**
|
|
5039
|
-
*
|
|
5477
|
+
* Type-level representation of a schema that decodes a raw value with the
|
|
5478
|
+
* provided schema and wraps the result in `Redacted`.
|
|
5040
5479
|
*
|
|
5041
5480
|
* @category Redacted
|
|
5042
5481
|
* @since 4.0.0
|
|
@@ -5064,10 +5503,14 @@ export declare function RedactedFromValue<S extends Top>(value: S, options?: {
|
|
|
5064
5503
|
readonly label?: string | undefined;
|
|
5065
5504
|
}): RedactedFromValue<S>;
|
|
5066
5505
|
/**
|
|
5067
|
-
* Schema for a single `Cause.Reason
|
|
5068
|
-
*
|
|
5506
|
+
* Schema for a single `Cause.Reason`, representing one reason a fiber may fail:
|
|
5507
|
+
* a typed error (`Fail`), an unexpected defect (`Die`), or an interrupt
|
|
5069
5508
|
* (`Interrupt`).
|
|
5070
5509
|
*
|
|
5510
|
+
* **Details**
|
|
5511
|
+
* The `error` schema validates typed failures and the `defect` schema validates
|
|
5512
|
+
* unexpected defects.
|
|
5513
|
+
*
|
|
5071
5514
|
* @category CauseReason
|
|
5072
5515
|
* @since 4.0.0
|
|
5073
5516
|
*/
|
|
@@ -5077,6 +5520,12 @@ export interface CauseReason<E extends Top, D extends Top> extends declareConstr
|
|
|
5077
5520
|
readonly defect: D;
|
|
5078
5521
|
}
|
|
5079
5522
|
/**
|
|
5523
|
+
* Iso representation used for `CauseReason` schemas.
|
|
5524
|
+
*
|
|
5525
|
+
* **Details**
|
|
5526
|
+
* Failures are represented with a `Fail` tag and encoded error, defects with a
|
|
5527
|
+
* `Die` tag and encoded defect, and interrupts with an optional `fiberId`.
|
|
5528
|
+
*
|
|
5080
5529
|
* @category CauseReason
|
|
5081
5530
|
* @since 4.0.0
|
|
5082
5531
|
*/
|
|
@@ -5091,18 +5540,23 @@ export type CauseReasonIso<E extends Top, D extends Top> = {
|
|
|
5091
5540
|
readonly fiberId: number | undefined;
|
|
5092
5541
|
};
|
|
5093
5542
|
/**
|
|
5094
|
-
* Creates a schema for `Cause.Reason
|
|
5543
|
+
* Creates a schema for `Cause.Reason` values using separate schemas for typed
|
|
5544
|
+
* failures and unexpected defects.
|
|
5095
5545
|
*
|
|
5096
5546
|
* @category CauseReason
|
|
5097
5547
|
* @since 4.0.0
|
|
5098
5548
|
*/
|
|
5099
5549
|
export declare function CauseReason<E extends Top, D extends Top>(error: E, defect: D): CauseReason<E, D>;
|
|
5100
5550
|
/**
|
|
5101
|
-
* Schema for `Cause
|
|
5102
|
-
* combining typed errors, defects, and interrupts.
|
|
5551
|
+
* Schema for `Cause` values, represented as an ordered collection of failure
|
|
5552
|
+
* reasons combining typed errors, defects, and interrupts.
|
|
5553
|
+
*
|
|
5554
|
+
* **Details**
|
|
5555
|
+
* The `error` schema validates typed failures and the `defect` schema validates
|
|
5556
|
+
* unexpected defects.
|
|
5103
5557
|
*
|
|
5104
5558
|
* @category Cause
|
|
5105
|
-
* @since
|
|
5559
|
+
* @since 3.10.0
|
|
5106
5560
|
*/
|
|
5107
5561
|
export interface Cause<E extends Top, D extends Top> extends declareConstructor<Cause_.Cause<E["Type"]>, Cause_.Cause<E["Encoded"]>, readonly [E, D], CauseIso<E, D>> {
|
|
5108
5562
|
readonly "Rebuild": Cause<E, D>;
|
|
@@ -5110,19 +5564,23 @@ export interface Cause<E extends Top, D extends Top> extends declareConstructor<
|
|
|
5110
5564
|
readonly defect: D;
|
|
5111
5565
|
}
|
|
5112
5566
|
/**
|
|
5567
|
+
* Iso representation used for `Cause` schemas: an ordered array of
|
|
5568
|
+
* `CauseReasonIso` values.
|
|
5569
|
+
*
|
|
5113
5570
|
* @category Cause
|
|
5114
5571
|
* @since 4.0.0
|
|
5115
5572
|
*/
|
|
5116
5573
|
export type CauseIso<E extends Top, D extends Top> = ReadonlyArray<CauseReasonIso<E, D>>;
|
|
5117
5574
|
/**
|
|
5118
|
-
* Creates a schema for `Cause
|
|
5575
|
+
* Creates a schema for `Cause` values using separate schemas for typed failures
|
|
5576
|
+
* and unexpected defects.
|
|
5119
5577
|
*
|
|
5120
5578
|
* @category Cause
|
|
5121
|
-
* @since
|
|
5579
|
+
* @since 3.10.0
|
|
5122
5580
|
*/
|
|
5123
5581
|
export declare function Cause<E extends Top, D extends Top>(error: E, defect: D): Cause<E, D>;
|
|
5124
5582
|
/**
|
|
5125
|
-
*
|
|
5583
|
+
* Type-level representation of the schema for JavaScript `Error` instances.
|
|
5126
5584
|
*
|
|
5127
5585
|
* @category Error
|
|
5128
5586
|
* @since 4.0.0
|
|
@@ -5131,30 +5589,35 @@ export interface Error extends instanceOf<globalThis.Error> {
|
|
|
5131
5589
|
readonly "Rebuild": Error;
|
|
5132
5590
|
}
|
|
5133
5591
|
/**
|
|
5134
|
-
* A schema
|
|
5592
|
+
* A schema for JavaScript `Error` objects.
|
|
5135
5593
|
*
|
|
5136
|
-
*
|
|
5137
|
-
*
|
|
5594
|
+
* **Default JSON serializer**
|
|
5595
|
+
* Encodes an `Error` as an object with `message` and optional `name` properties,
|
|
5596
|
+
* and decodes that object back into an `Error`. The stack trace is omitted from
|
|
5597
|
+
* the encoded form for security.
|
|
5138
5598
|
*
|
|
5139
|
-
* @category
|
|
5599
|
+
* @category schemas
|
|
5140
5600
|
* @since 4.0.0
|
|
5141
5601
|
*/
|
|
5142
5602
|
export declare const Error: Error;
|
|
5143
5603
|
/**
|
|
5144
|
-
* A schema
|
|
5604
|
+
* A schema for JavaScript `Error` objects that preserves stack traces in the JSON
|
|
5605
|
+
* encoded form.
|
|
5145
5606
|
*
|
|
5146
|
-
*
|
|
5147
|
-
* `
|
|
5607
|
+
* **Default JSON serializer**
|
|
5608
|
+
* Encodes an `Error` as an object with `message`, optional `name`, and optional
|
|
5609
|
+
* `stack` properties, and decodes that object back into an `Error`.
|
|
5148
5610
|
*
|
|
5149
|
-
* @category
|
|
5611
|
+
* @category schemas
|
|
5150
5612
|
* @since 4.0.0
|
|
5151
5613
|
*/
|
|
5152
5614
|
export declare const ErrorWithStack: Error;
|
|
5153
5615
|
/**
|
|
5154
|
-
*
|
|
5616
|
+
* Type-level representation of the `Defect` schema, which accepts JavaScript
|
|
5617
|
+
* `Error` values and arbitrary unknown defect values.
|
|
5155
5618
|
*
|
|
5156
5619
|
* @category Defect
|
|
5157
|
-
* @since
|
|
5620
|
+
* @since 3.10.0
|
|
5158
5621
|
*/
|
|
5159
5622
|
export interface Defect extends Union<readonly [
|
|
5160
5623
|
decodeTo<Error, Struct<{
|
|
@@ -5167,10 +5630,15 @@ export interface Defect extends Union<readonly [
|
|
|
5167
5630
|
readonly "Rebuild": Defect;
|
|
5168
5631
|
}
|
|
5169
5632
|
/**
|
|
5170
|
-
* A schema
|
|
5633
|
+
* A schema for defect values, accepting either JavaScript `Error` values encoded
|
|
5634
|
+
* with `message` and optional `name`, or arbitrary unknown defect values.
|
|
5171
5635
|
*
|
|
5172
|
-
*
|
|
5173
|
-
*
|
|
5636
|
+
* **Default JSON serializer**
|
|
5637
|
+
* Unknown defects are serialized with `JSON.stringify` when possible and fall
|
|
5638
|
+
* back to Effect's formatted representation when JSON serialization fails.
|
|
5639
|
+
*
|
|
5640
|
+
* @category constructors
|
|
5641
|
+
* @since 3.10.0
|
|
5174
5642
|
*/
|
|
5175
5643
|
export declare const Defect: Defect;
|
|
5176
5644
|
/**
|
|
@@ -5182,11 +5650,11 @@ export declare const Defect: Defect;
|
|
|
5182
5650
|
*/
|
|
5183
5651
|
export declare const DefectWithStack: Defect;
|
|
5184
5652
|
/**
|
|
5185
|
-
* Schema for `Exit
|
|
5186
|
-
*
|
|
5653
|
+
* Schema for `Exit` values, representing either a success with value `A` or a
|
|
5654
|
+
* failure with a `Cause` containing typed errors and defects.
|
|
5187
5655
|
*
|
|
5188
5656
|
* @category Exit
|
|
5189
|
-
* @since
|
|
5657
|
+
* @since 3.10.0
|
|
5190
5658
|
*/
|
|
5191
5659
|
export interface Exit<A extends Top, E extends Top, D extends Top> extends declareConstructor<Exit_.Exit<A["Type"], E["Type"]>, Exit_.Exit<A["Encoded"], E["Encoded"]>, readonly [A, E, D], ExitIso<A, E, D>> {
|
|
5192
5660
|
readonly "Rebuild": Exit<A, E, D>;
|
|
@@ -5195,6 +5663,12 @@ export interface Exit<A extends Top, E extends Top, D extends Top> extends decla
|
|
|
5195
5663
|
readonly defect: D;
|
|
5196
5664
|
}
|
|
5197
5665
|
/**
|
|
5666
|
+
* Iso representation used for `Exit` schemas.
|
|
5667
|
+
*
|
|
5668
|
+
* **Details**
|
|
5669
|
+
* Successful exits are represented as `{ _tag: "Success", value }`, while failed
|
|
5670
|
+
* exits are represented as `{ _tag: "Failure", cause }`.
|
|
5671
|
+
*
|
|
5198
5672
|
* @category Exit
|
|
5199
5673
|
* @since 4.0.0
|
|
5200
5674
|
*/
|
|
@@ -5206,14 +5680,16 @@ export type ExitIso<A extends Top, E extends Top, D extends Top> = {
|
|
|
5206
5680
|
readonly cause: CauseIso<E, D>;
|
|
5207
5681
|
};
|
|
5208
5682
|
/**
|
|
5209
|
-
* Creates a schema for `Exit
|
|
5683
|
+
* Creates a schema for `Exit` values using schemas for the success value, typed
|
|
5684
|
+
* failure, and unexpected defect channels.
|
|
5210
5685
|
*
|
|
5211
5686
|
* @category Exit
|
|
5212
|
-
* @since
|
|
5687
|
+
* @since 3.10.0
|
|
5213
5688
|
*/
|
|
5214
5689
|
export declare function Exit<A extends Top, E extends Top, D extends Top>(value: A, error: E, defect: D): Exit<A, E, D>;
|
|
5215
5690
|
/**
|
|
5216
|
-
*
|
|
5691
|
+
* Type-level representation of a `ReadonlyMap` schema whose keys and values are
|
|
5692
|
+
* validated by the provided schemas.
|
|
5217
5693
|
*
|
|
5218
5694
|
* @category ReadonlyMap
|
|
5219
5695
|
* @since 4.0.0
|
|
@@ -5224,6 +5700,9 @@ export interface $ReadonlyMap<Key extends Top, Value extends Top> extends declar
|
|
|
5224
5700
|
readonly value: Value;
|
|
5225
5701
|
}
|
|
5226
5702
|
/**
|
|
5703
|
+
* Iso representation used for `ReadonlyMap` schemas: an array of readonly
|
|
5704
|
+
* `[key, value]` tuples using each entry schema's `Iso` type.
|
|
5705
|
+
*
|
|
5227
5706
|
* @category ReadonlyMap
|
|
5228
5707
|
* @since 4.0.0
|
|
5229
5708
|
*/
|
|
@@ -5233,7 +5712,7 @@ export type ReadonlyMapIso<Key extends Top, Value extends Top> = ReadonlyArray<r
|
|
|
5233
5712
|
* conform to the provided schemas.
|
|
5234
5713
|
*
|
|
5235
5714
|
* @category ReadonlyMap
|
|
5236
|
-
* @since
|
|
5715
|
+
* @since 3.10.0
|
|
5237
5716
|
*/
|
|
5238
5717
|
export declare function ReadonlyMap<Key extends Top, Value extends Top>(key: Key, value: Value): $ReadonlyMap<Key, Value>;
|
|
5239
5718
|
/**
|
|
@@ -5241,7 +5720,7 @@ export declare function ReadonlyMap<Key extends Top, Value extends Top>(key: Key
|
|
|
5241
5720
|
* provided schemas.
|
|
5242
5721
|
*
|
|
5243
5722
|
* @category HashMap
|
|
5244
|
-
* @since
|
|
5723
|
+
* @since 3.10.0
|
|
5245
5724
|
*/
|
|
5246
5725
|
export interface HashMap<Key extends Top, Value extends Top> extends declareConstructor<HashMap_.HashMap<Key["Type"], Value["Type"]>, HashMap_.HashMap<Key["Encoded"], Value["Encoded"]>, readonly [Key, Value], HashMapIso<Key, Value>> {
|
|
5247
5726
|
readonly "Rebuild": HashMap<Key, Value>;
|
|
@@ -5249,6 +5728,9 @@ export interface HashMap<Key extends Top, Value extends Top> extends declareCons
|
|
|
5249
5728
|
readonly value: Value;
|
|
5250
5729
|
}
|
|
5251
5730
|
/**
|
|
5731
|
+
* Iso representation used for `HashMap` schemas: an array of readonly
|
|
5732
|
+
* `[key, value]` tuples using each entry schema's `Iso` type.
|
|
5733
|
+
*
|
|
5252
5734
|
* @category HashMap
|
|
5253
5735
|
* @since 4.0.0
|
|
5254
5736
|
*/
|
|
@@ -5258,11 +5740,12 @@ export type HashMapIso<Key extends Top, Value extends Top> = ReadonlyArray<reado
|
|
|
5258
5740
|
* conform to the provided schemas.
|
|
5259
5741
|
*
|
|
5260
5742
|
* @category HashMap
|
|
5261
|
-
* @since
|
|
5743
|
+
* @since 3.10.0
|
|
5262
5744
|
*/
|
|
5263
5745
|
export declare function HashMap<Key extends Top, Value extends Top>(key: Key, value: Value): HashMap<Key, Value>;
|
|
5264
5746
|
/**
|
|
5265
|
-
*
|
|
5747
|
+
* Type-level representation of a `ReadonlySet` schema whose values are validated
|
|
5748
|
+
* by the provided element schema.
|
|
5266
5749
|
*
|
|
5267
5750
|
* @category ReadonlySet
|
|
5268
5751
|
* @since 4.0.0
|
|
@@ -5272,13 +5755,19 @@ export interface $ReadonlySet<Value extends Top> extends declareConstructor<glob
|
|
|
5272
5755
|
readonly value: Value;
|
|
5273
5756
|
}
|
|
5274
5757
|
/**
|
|
5758
|
+
* Iso representation used for `ReadonlySet` schemas: an array of element values
|
|
5759
|
+
* using the element schema's `Iso` type.
|
|
5760
|
+
*
|
|
5275
5761
|
* @category ReadonlySet
|
|
5276
5762
|
* @since 4.0.0
|
|
5277
5763
|
*/
|
|
5278
5764
|
export type ReadonlySetIso<Value extends Top> = ReadonlyArray<Value["Iso"]>;
|
|
5279
5765
|
/**
|
|
5766
|
+
* Creates a schema that validates a `ReadonlySet` whose values conform to the
|
|
5767
|
+
* provided element schema.
|
|
5768
|
+
*
|
|
5280
5769
|
* @category ReadonlySet
|
|
5281
|
-
* @since
|
|
5770
|
+
* @since 3.10.0
|
|
5282
5771
|
*/
|
|
5283
5772
|
export declare function ReadonlySet<Value extends Top>(value: Value): $ReadonlySet<Value>;
|
|
5284
5773
|
/**
|
|
@@ -5286,13 +5775,16 @@ export declare function ReadonlySet<Value extends Top>(value: Value): $ReadonlyS
|
|
|
5286
5775
|
* schema.
|
|
5287
5776
|
*
|
|
5288
5777
|
* @category HashSet
|
|
5289
|
-
* @since
|
|
5778
|
+
* @since 3.10.0
|
|
5290
5779
|
*/
|
|
5291
5780
|
export interface HashSet<Value extends Top> extends declareConstructor<HashSet_.HashSet<Value["Type"]>, HashSet_.HashSet<Value["Encoded"]>, readonly [Value], HashSetIso<Value>> {
|
|
5292
5781
|
readonly "Rebuild": HashSet<Value>;
|
|
5293
5782
|
readonly value: Value;
|
|
5294
5783
|
}
|
|
5295
5784
|
/**
|
|
5785
|
+
* Iso representation used for `HashSet` schemas: an array of element values
|
|
5786
|
+
* using the element schema's `Iso` type.
|
|
5787
|
+
*
|
|
5296
5788
|
* @category HashSet
|
|
5297
5789
|
* @since 4.0.0
|
|
5298
5790
|
*/
|
|
@@ -5302,7 +5794,7 @@ export type HashSetIso<Value extends Top> = ReadonlyArray<Value["Iso"]>;
|
|
|
5302
5794
|
* provided schema.
|
|
5303
5795
|
*
|
|
5304
5796
|
* @category HashSet
|
|
5305
|
-
* @since
|
|
5797
|
+
* @since 3.10.0
|
|
5306
5798
|
*/
|
|
5307
5799
|
export declare function HashSet<Value extends Top>(value: Value): HashSet<Value>;
|
|
5308
5800
|
/**
|
|
@@ -5310,13 +5802,16 @@ export declare function HashSet<Value extends Top>(value: Value): HashSet<Value>
|
|
|
5310
5802
|
* must conform to the provided schema.
|
|
5311
5803
|
*
|
|
5312
5804
|
* @category Chunk
|
|
5313
|
-
* @since
|
|
5805
|
+
* @since 3.10.0
|
|
5314
5806
|
*/
|
|
5315
5807
|
export interface Chunk<Value extends Top> extends declareConstructor<Chunk_.Chunk<Value["Type"]>, Chunk_.Chunk<Value["Encoded"]>, readonly [Value], ChunkIso<Value>> {
|
|
5316
5808
|
readonly "Rebuild": Chunk<Value>;
|
|
5317
5809
|
readonly value: Value;
|
|
5318
5810
|
}
|
|
5319
5811
|
/**
|
|
5812
|
+
* Iso representation used for `Chunk` schemas: an array of element values using
|
|
5813
|
+
* the element schema's `Iso` type.
|
|
5814
|
+
*
|
|
5320
5815
|
* @category Chunk
|
|
5321
5816
|
* @since 4.0.0
|
|
5322
5817
|
*/
|
|
@@ -5326,11 +5821,11 @@ export type ChunkIso<Value extends Top> = ReadonlyArray<Value["Iso"]>;
|
|
|
5326
5821
|
* provided schema.
|
|
5327
5822
|
*
|
|
5328
5823
|
* @category Chunk
|
|
5329
|
-
* @since
|
|
5824
|
+
* @since 3.10.0
|
|
5330
5825
|
*/
|
|
5331
5826
|
export declare function Chunk<Value extends Top>(value: Value): Chunk<Value>;
|
|
5332
5827
|
/**
|
|
5333
|
-
*
|
|
5828
|
+
* Type-level representation of the schema for JavaScript `RegExp` instances.
|
|
5334
5829
|
*
|
|
5335
5830
|
* @category RegExp
|
|
5336
5831
|
* @since 4.0.0
|
|
@@ -5348,7 +5843,7 @@ export interface RegExp extends instanceOf<globalThis.RegExp> {
|
|
|
5348
5843
|
*/
|
|
5349
5844
|
export declare const RegExp: RegExp;
|
|
5350
5845
|
/**
|
|
5351
|
-
*
|
|
5846
|
+
* Type-level representation of the schema for JavaScript `URL` instances.
|
|
5352
5847
|
*
|
|
5353
5848
|
* @category URL
|
|
5354
5849
|
* @since 4.0.0
|
|
@@ -5363,12 +5858,13 @@ export interface URL extends instanceOf<globalThis.URL> {
|
|
|
5363
5858
|
*
|
|
5364
5859
|
* - encodes `URL` as a `string`
|
|
5365
5860
|
*
|
|
5366
|
-
* @since 4.0.0
|
|
5367
5861
|
* @category URL
|
|
5862
|
+
* @since 4.0.0
|
|
5368
5863
|
*/
|
|
5369
5864
|
export declare const URL: URL;
|
|
5370
5865
|
/**
|
|
5371
|
-
*
|
|
5866
|
+
* Type-level representation of a transformation schema that decodes valid URL
|
|
5867
|
+
* strings into JavaScript `URL` instances.
|
|
5372
5868
|
*
|
|
5373
5869
|
* @category URL
|
|
5374
5870
|
* @since 4.0.0
|
|
@@ -5390,7 +5886,8 @@ export interface URLFromString extends decodeTo<URL, String> {
|
|
|
5390
5886
|
*/
|
|
5391
5887
|
export declare const URLFromString: URLFromString;
|
|
5392
5888
|
/**
|
|
5393
|
-
*
|
|
5889
|
+
* Type-level representation of the schema for JavaScript `Date` instances,
|
|
5890
|
+
* including invalid dates.
|
|
5394
5891
|
*
|
|
5395
5892
|
* @category Date
|
|
5396
5893
|
* @since 4.0.0
|
|
@@ -5401,9 +5898,10 @@ export interface Date extends instanceOf<globalThis.Date> {
|
|
|
5401
5898
|
/**
|
|
5402
5899
|
* A schema for JavaScript `Date` objects.
|
|
5403
5900
|
*
|
|
5404
|
-
* This schema accepts any `Date` instance, including invalid dates
|
|
5405
|
-
*
|
|
5406
|
-
*
|
|
5901
|
+
* This schema accepts any `Date` instance, including invalid dates. For
|
|
5902
|
+
* validating only valid dates, use `DateValid` instead. The default JSON
|
|
5903
|
+
* serializer encodes valid dates as ISO 8601 strings; invalid dates encode as
|
|
5904
|
+
* `"Invalid Date"`.
|
|
5407
5905
|
*
|
|
5408
5906
|
* **Example** (Date schema)
|
|
5409
5907
|
*
|
|
@@ -5419,29 +5917,33 @@ export interface Date extends instanceOf<globalThis.Date> {
|
|
|
5419
5917
|
*/
|
|
5420
5918
|
export declare const Date: Date;
|
|
5421
5919
|
/**
|
|
5422
|
-
*
|
|
5920
|
+
* Type-level representation of a transformation schema that decodes strings into
|
|
5921
|
+
* JavaScript `Date` instances.
|
|
5423
5922
|
*
|
|
5424
5923
|
* @category Date
|
|
5425
|
-
* @since
|
|
5924
|
+
* @since 3.10.0
|
|
5426
5925
|
*/
|
|
5427
5926
|
export interface DateFromString extends decodeTo<Date, String> {
|
|
5428
5927
|
readonly "Rebuild": DateFromString;
|
|
5429
5928
|
}
|
|
5430
5929
|
/**
|
|
5431
|
-
* A transformation schema that
|
|
5930
|
+
* A transformation schema that decodes a string into a JavaScript `Date`.
|
|
5432
5931
|
*
|
|
5433
|
-
* Decoding
|
|
5434
|
-
*
|
|
5932
|
+
* **Decoding**
|
|
5933
|
+
* The string is passed to JavaScript `Date` construction and may decode to an
|
|
5934
|
+
* invalid `Date`. Compose with `DateValid` when invalid dates should be rejected.
|
|
5435
5935
|
*
|
|
5436
|
-
* Encoding
|
|
5437
|
-
*
|
|
5936
|
+
* **Encoding**
|
|
5937
|
+
* A valid `Date` is encoded as an ISO string; an invalid `Date` is encoded as
|
|
5938
|
+
* `"Invalid Date"`.
|
|
5438
5939
|
*
|
|
5439
5940
|
* @category Date
|
|
5440
|
-
* @since
|
|
5941
|
+
* @since 3.10.0
|
|
5441
5942
|
*/
|
|
5442
5943
|
export declare const DateFromString: DateFromString;
|
|
5443
5944
|
/**
|
|
5444
|
-
*
|
|
5945
|
+
* Type-level representation of the `DateValid` schema, which accepts only valid
|
|
5946
|
+
* JavaScript `Date` instances.
|
|
5445
5947
|
*
|
|
5446
5948
|
* @category Date
|
|
5447
5949
|
* @since 4.0.0
|
|
@@ -5460,10 +5962,10 @@ export interface DateValid extends Date {
|
|
|
5460
5962
|
*/
|
|
5461
5963
|
export declare const DateValid: DateValid;
|
|
5462
5964
|
/**
|
|
5463
|
-
*
|
|
5965
|
+
* Type-level representation of the schema for Effect `Duration` values.
|
|
5464
5966
|
*
|
|
5465
5967
|
* @category Duration
|
|
5466
|
-
* @since
|
|
5968
|
+
* @since 3.10.0
|
|
5467
5969
|
*/
|
|
5468
5970
|
export interface Duration extends declare<Duration_.Duration> {
|
|
5469
5971
|
readonly "Rebuild": Duration;
|
|
@@ -5477,8 +5979,7 @@ export interface Duration extends declare<Duration_.Duration> {
|
|
|
5477
5979
|
* **Example** (Duration schema)
|
|
5478
5980
|
*
|
|
5479
5981
|
* ```ts
|
|
5480
|
-
* import { Schema } from "effect"
|
|
5481
|
-
* import { Duration } from "effect"
|
|
5982
|
+
* import { Duration, Schema } from "effect"
|
|
5482
5983
|
*
|
|
5483
5984
|
* Schema.decodeUnknownSync(Schema.Duration)(Duration.seconds(5))
|
|
5484
5985
|
* // => Duration(5s)
|
|
@@ -5486,11 +5987,12 @@ export interface Duration extends declare<Duration_.Duration> {
|
|
|
5486
5987
|
*
|
|
5487
5988
|
* @category Duration
|
|
5488
5989
|
*
|
|
5489
|
-
* @since
|
|
5990
|
+
* @since 3.10.0
|
|
5490
5991
|
*/
|
|
5491
5992
|
export declare const Duration: Duration;
|
|
5492
5993
|
/**
|
|
5493
|
-
*
|
|
5994
|
+
* Type-level representation of a transformation schema that decodes strings
|
|
5995
|
+
* accepted by `Duration.fromInput` into `Duration` values.
|
|
5494
5996
|
*
|
|
5495
5997
|
* @category Duration
|
|
5496
5998
|
* @since 4.0.0
|
|
@@ -5513,33 +6015,37 @@ export interface DurationFromString extends decodeTo<Duration, String> {
|
|
|
5513
6015
|
*/
|
|
5514
6016
|
export declare const DurationFromString: DurationFromString;
|
|
5515
6017
|
/**
|
|
5516
|
-
*
|
|
6018
|
+
* Type-level representation of a transformation schema that decodes non-negative
|
|
6019
|
+
* nanosecond `bigint` values into `Duration` values.
|
|
5517
6020
|
*
|
|
5518
6021
|
* @category Duration
|
|
5519
|
-
* @since
|
|
6022
|
+
* @since 3.10.0
|
|
5520
6023
|
*/
|
|
5521
6024
|
export interface DurationFromNanos extends decodeTo<Duration, BigInt> {
|
|
5522
6025
|
readonly "Rebuild": DurationFromNanos;
|
|
5523
6026
|
}
|
|
5524
6027
|
/**
|
|
5525
6028
|
* A transformation schema that decodes a non-negative `bigint` into a
|
|
5526
|
-
* `Duration`, treating the
|
|
6029
|
+
* `Duration`, treating the bigint as nanoseconds.
|
|
5527
6030
|
*
|
|
5528
|
-
* Decoding
|
|
5529
|
-
*
|
|
6031
|
+
* **Decoding**
|
|
6032
|
+
* A non-negative `bigint` representing nanoseconds is decoded as a `Duration`.
|
|
5530
6033
|
*
|
|
5531
|
-
* Encoding
|
|
5532
|
-
*
|
|
6034
|
+
* **Encoding**
|
|
6035
|
+
* Finite durations are encoded as a non-negative `bigint` number of nanoseconds.
|
|
6036
|
+
* Encoding fails when the duration cannot be represented as nanoseconds, such as
|
|
6037
|
+
* `Duration.infinity`.
|
|
5533
6038
|
*
|
|
5534
6039
|
* @category Duration
|
|
5535
|
-
* @since
|
|
6040
|
+
* @since 3.10.0
|
|
5536
6041
|
*/
|
|
5537
6042
|
export declare const DurationFromNanos: DurationFromNanos;
|
|
5538
6043
|
/**
|
|
5539
|
-
*
|
|
6044
|
+
* Type-level representation of a transformation schema that decodes
|
|
6045
|
+
* non-negative millisecond numbers into `Duration` values.
|
|
5540
6046
|
*
|
|
5541
6047
|
* @category Duration
|
|
5542
|
-
* @since
|
|
6048
|
+
* @since 3.10.0
|
|
5543
6049
|
*/
|
|
5544
6050
|
export interface DurationFromMillis extends decodeTo<Duration, Number> {
|
|
5545
6051
|
readonly "Rebuild": DurationFromMillis;
|
|
@@ -5558,14 +6064,14 @@ export interface DurationFromMillis extends decodeTo<Duration, Number> {
|
|
|
5558
6064
|
* representing milliseconds
|
|
5559
6065
|
*
|
|
5560
6066
|
* @category Duration
|
|
5561
|
-
* @since
|
|
6067
|
+
* @since 3.10.0
|
|
5562
6068
|
*/
|
|
5563
6069
|
export declare const DurationFromMillis: DurationFromMillis;
|
|
5564
6070
|
/**
|
|
5565
|
-
*
|
|
6071
|
+
* Type-level representation of the schema for Effect `BigDecimal` values.
|
|
5566
6072
|
*
|
|
5567
6073
|
* @category BigDecimal
|
|
5568
|
-
* @since
|
|
6074
|
+
* @since 3.10.0
|
|
5569
6075
|
*/
|
|
5570
6076
|
export interface BigDecimal extends declare<BigDecimal_.BigDecimal> {
|
|
5571
6077
|
readonly "Rebuild": BigDecimal;
|
|
@@ -5578,11 +6084,12 @@ export interface BigDecimal extends declare<BigDecimal_.BigDecimal> {
|
|
|
5578
6084
|
* - encodes `BigDecimal` as a `string`
|
|
5579
6085
|
*
|
|
5580
6086
|
* @category BigDecimal
|
|
5581
|
-
* @since
|
|
6087
|
+
* @since 3.10.0
|
|
5582
6088
|
*/
|
|
5583
6089
|
export declare const BigDecimal: BigDecimal;
|
|
5584
6090
|
/**
|
|
5585
|
-
*
|
|
6091
|
+
* Type-level representation of a transformation schema that decodes strings into
|
|
6092
|
+
* `BigDecimal` values.
|
|
5586
6093
|
*
|
|
5587
6094
|
* @category BigDecimal
|
|
5588
6095
|
* @since 4.0.0
|
|
@@ -5604,7 +6111,8 @@ export interface BigDecimalFromString extends decodeTo<BigDecimal, String> {
|
|
|
5604
6111
|
*/
|
|
5605
6112
|
export declare const BigDecimalFromString: BigDecimalFromString;
|
|
5606
6113
|
/**
|
|
5607
|
-
*
|
|
6114
|
+
* Type-level representation of a transformation schema that decodes
|
|
6115
|
+
* JSON-encoded strings into `unknown` values.
|
|
5608
6116
|
*
|
|
5609
6117
|
* @category JSON
|
|
5610
6118
|
* @since 4.0.0
|
|
@@ -5623,7 +6131,7 @@ export interface UnknownFromJsonString extends fromJsonString<Unknown> {
|
|
|
5623
6131
|
* - Any value is encoded as a JSON string using `JSON.stringify`.
|
|
5624
6132
|
* - If the value is not a valid JSON value, encoding fails.
|
|
5625
6133
|
*
|
|
5626
|
-
* **Example**
|
|
6134
|
+
* **Example** (Decoding unknown JSON strings)
|
|
5627
6135
|
*
|
|
5628
6136
|
* ```ts
|
|
5629
6137
|
* import { Schema } from "effect"
|
|
@@ -5637,7 +6145,8 @@ export interface UnknownFromJsonString extends fromJsonString<Unknown> {
|
|
|
5637
6145
|
*/
|
|
5638
6146
|
export declare const UnknownFromJsonString: UnknownFromJsonString;
|
|
5639
6147
|
/**
|
|
5640
|
-
*
|
|
6148
|
+
* Type-level representation of a schema that parses a JSON string and then
|
|
6149
|
+
* decodes the parsed value with the provided schema.
|
|
5641
6150
|
*
|
|
5642
6151
|
* @category JSON
|
|
5643
6152
|
* @since 4.0.0
|
|
@@ -5655,7 +6164,7 @@ export interface fromJsonString<S extends Top> extends decodeTo<S, String> {
|
|
|
5655
6164
|
* The resulting schema first parses the input string as JSON, and then runs the
|
|
5656
6165
|
* provided schema on the parsed result.
|
|
5657
6166
|
*
|
|
5658
|
-
* **Example**
|
|
6167
|
+
* **Example** (Decoding JSON strings with a schema)
|
|
5659
6168
|
*
|
|
5660
6169
|
* ```ts
|
|
5661
6170
|
* import { Schema } from "effect"
|
|
@@ -5673,7 +6182,7 @@ export interface fromJsonString<S extends Top> extends decodeTo<S, String> {
|
|
|
5673
6182
|
* resulting schema will be a JSON Schema with a `contentSchema` property that
|
|
5674
6183
|
* contains the JSON Schema for the given schema.
|
|
5675
6184
|
*
|
|
5676
|
-
* **Example**
|
|
6185
|
+
* **Example** (Emitting JSON Schema for a JSON string decoder)
|
|
5677
6186
|
*
|
|
5678
6187
|
* ```ts
|
|
5679
6188
|
* import { Schema } from "effect"
|
|
@@ -5711,7 +6220,7 @@ export interface fromJsonString<S extends Top> extends decodeTo<S, String> {
|
|
|
5711
6220
|
*/
|
|
5712
6221
|
export declare function fromJsonString<S extends Top>(schema: S): fromJsonString<S>;
|
|
5713
6222
|
/**
|
|
5714
|
-
*
|
|
6223
|
+
* Type-level representation of the schema for JavaScript `File` instances.
|
|
5715
6224
|
*
|
|
5716
6225
|
* @category File
|
|
5717
6226
|
* @since 4.0.0
|
|
@@ -5730,7 +6239,7 @@ export interface File extends instanceOf<globalThis.File> {
|
|
|
5730
6239
|
*/
|
|
5731
6240
|
export declare const File: File;
|
|
5732
6241
|
/**
|
|
5733
|
-
*
|
|
6242
|
+
* Type-level representation of the schema for JavaScript `FormData` instances.
|
|
5734
6243
|
*
|
|
5735
6244
|
* @category FormData
|
|
5736
6245
|
* @since 4.0.0
|
|
@@ -5749,7 +6258,8 @@ export interface FormData extends instanceOf<globalThis.FormData> {
|
|
|
5749
6258
|
*/
|
|
5750
6259
|
export declare const FormData: FormData;
|
|
5751
6260
|
/**
|
|
5752
|
-
*
|
|
6261
|
+
* Type-level representation of a schema that parses `FormData` into a tree
|
|
6262
|
+
* record and then decodes it with the provided schema.
|
|
5753
6263
|
*
|
|
5754
6264
|
* @category FormData
|
|
5755
6265
|
* @since 4.0.0
|
|
@@ -5838,11 +6348,13 @@ export interface fromFormData<S extends Top> extends decodeTo<S, FormData> {
|
|
|
5838
6348
|
* // Success({"a":1}) // Note: the value is a number
|
|
5839
6349
|
* ```
|
|
5840
6350
|
*
|
|
6351
|
+
* @category decoding
|
|
5841
6352
|
* @since 4.0.0
|
|
5842
6353
|
*/
|
|
5843
6354
|
export declare function fromFormData<S extends Top>(schema: S): fromFormData<S>;
|
|
5844
6355
|
/**
|
|
5845
|
-
*
|
|
6356
|
+
* Type-level representation of the schema for JavaScript `URLSearchParams`
|
|
6357
|
+
* instances.
|
|
5846
6358
|
*
|
|
5847
6359
|
* @category URLSearchParams
|
|
5848
6360
|
* @since 4.0.0
|
|
@@ -5860,7 +6372,8 @@ export interface URLSearchParams extends instanceOf<globalThis.URLSearchParams>
|
|
|
5860
6372
|
*/
|
|
5861
6373
|
export declare const URLSearchParams: URLSearchParams;
|
|
5862
6374
|
/**
|
|
5863
|
-
*
|
|
6375
|
+
* Type-level representation of a schema that parses `URLSearchParams` into a
|
|
6376
|
+
* tree record and then decodes it with the provided schema.
|
|
5864
6377
|
*
|
|
5865
6378
|
* @category URLSearchParams
|
|
5866
6379
|
* @since 4.0.0
|
|
@@ -5940,14 +6453,16 @@ export interface fromURLSearchParams<S extends Top> extends decodeTo<S, URLSearc
|
|
|
5940
6453
|
* // Success({"a":1}) // Note: the value is a number
|
|
5941
6454
|
* ```
|
|
5942
6455
|
*
|
|
6456
|
+
* @category decoding
|
|
5943
6457
|
* @since 4.0.0
|
|
5944
6458
|
*/
|
|
5945
6459
|
export declare function fromURLSearchParams<S extends Top>(schema: S): fromURLSearchParams<S>;
|
|
5946
6460
|
/**
|
|
5947
|
-
*
|
|
6461
|
+
* Type-level representation of the `Finite` number schema, which rejects `NaN`,
|
|
6462
|
+
* `Infinity`, and `-Infinity`.
|
|
5948
6463
|
*
|
|
5949
6464
|
* @category Number
|
|
5950
|
-
* @since
|
|
6465
|
+
* @since 3.10.0
|
|
5951
6466
|
*/
|
|
5952
6467
|
export interface Finite extends Number {
|
|
5953
6468
|
readonly "Rebuild": Finite;
|
|
@@ -5956,14 +6471,15 @@ export interface Finite extends Number {
|
|
|
5956
6471
|
* A schema for finite numbers, rejecting `NaN`, `Infinity`, and `-Infinity`.
|
|
5957
6472
|
*
|
|
5958
6473
|
* @category Number
|
|
5959
|
-
* @since
|
|
6474
|
+
* @since 3.10.0
|
|
5960
6475
|
*/
|
|
5961
6476
|
export declare const Finite: Finite;
|
|
5962
6477
|
/**
|
|
5963
|
-
*
|
|
6478
|
+
* Type-level representation of the `Int` schema, which accepts only finite
|
|
6479
|
+
* integer numbers.
|
|
5964
6480
|
*
|
|
5965
6481
|
* @category Number
|
|
5966
|
-
* @since
|
|
6482
|
+
* @since 3.10.0
|
|
5967
6483
|
*/
|
|
5968
6484
|
export interface Int extends Number {
|
|
5969
6485
|
readonly "Rebuild": Int;
|
|
@@ -5972,33 +6488,38 @@ export interface Int extends Number {
|
|
|
5972
6488
|
* A schema for integers, rejecting `NaN`, `Infinity`, and `-Infinity`.
|
|
5973
6489
|
*
|
|
5974
6490
|
* @category Number
|
|
5975
|
-
* @since
|
|
6491
|
+
* @since 3.10.0
|
|
5976
6492
|
*/
|
|
5977
6493
|
export declare const Int: Int;
|
|
5978
6494
|
/**
|
|
5979
|
-
*
|
|
6495
|
+
* Type-level representation of a transformation schema that decodes strings into
|
|
6496
|
+
* numbers using JavaScript number coercion.
|
|
5980
6497
|
*
|
|
5981
6498
|
* @category Number
|
|
5982
|
-
* @since
|
|
6499
|
+
* @since 3.10.0
|
|
5983
6500
|
*/
|
|
5984
6501
|
export interface NumberFromString extends decodeTo<Finite, String> {
|
|
5985
6502
|
readonly "Rebuild": NumberFromString;
|
|
5986
6503
|
}
|
|
5987
6504
|
/**
|
|
5988
|
-
* A transformation schema that parses a string into a number
|
|
6505
|
+
* A transformation schema that parses a string into a `number` using JavaScript
|
|
6506
|
+
* number coercion.
|
|
5989
6507
|
*
|
|
5990
|
-
* Decoding
|
|
5991
|
-
*
|
|
6508
|
+
* **Decoding**
|
|
6509
|
+
* A `string` is decoded as a number, including possible non-finite values such as
|
|
6510
|
+
* `NaN`, `Infinity`, and `-Infinity`. Use `FiniteFromString` to reject non-finite
|
|
6511
|
+
* numbers.
|
|
5992
6512
|
*
|
|
5993
|
-
* Encoding
|
|
5994
|
-
*
|
|
6513
|
+
* **Encoding**
|
|
6514
|
+
* A number is encoded as a `string`.
|
|
5995
6515
|
*
|
|
5996
6516
|
* @category Number
|
|
5997
|
-
* @since
|
|
6517
|
+
* @since 3.10.0
|
|
5998
6518
|
*/
|
|
5999
6519
|
export declare const NumberFromString: NumberFromString;
|
|
6000
6520
|
/**
|
|
6001
|
-
*
|
|
6521
|
+
* Type-level representation of a transformation schema that decodes strings into
|
|
6522
|
+
* finite numbers.
|
|
6002
6523
|
*
|
|
6003
6524
|
* @category Number
|
|
6004
6525
|
* @since 4.0.0
|
|
@@ -6021,7 +6542,8 @@ export interface FiniteFromString extends decodeTo<Finite, String> {
|
|
|
6021
6542
|
*/
|
|
6022
6543
|
export declare const FiniteFromString: FiniteFromString;
|
|
6023
6544
|
/**
|
|
6024
|
-
*
|
|
6545
|
+
* Type-level representation of a transformation schema that decodes strings into
|
|
6546
|
+
* `bigint` values.
|
|
6025
6547
|
*
|
|
6026
6548
|
* @category BigInt
|
|
6027
6549
|
* @since 4.0.0
|
|
@@ -6043,10 +6565,11 @@ export interface BigIntFromString extends decodeTo<BigInt, String> {
|
|
|
6043
6565
|
*/
|
|
6044
6566
|
export declare const BigIntFromString: BigIntFromString;
|
|
6045
6567
|
/**
|
|
6046
|
-
*
|
|
6568
|
+
* Schema interface for `Trimmed`, representing strings with no leading or
|
|
6569
|
+
* trailing whitespace.
|
|
6047
6570
|
*
|
|
6048
6571
|
* @category String
|
|
6049
|
-
* @since
|
|
6572
|
+
* @since 3.10.0
|
|
6050
6573
|
*/
|
|
6051
6574
|
export interface Trimmed extends String {
|
|
6052
6575
|
readonly "Rebuild": Trimmed;
|
|
@@ -6055,14 +6578,15 @@ export interface Trimmed extends String {
|
|
|
6055
6578
|
* A schema for strings that contains no leading or trailing whitespaces.
|
|
6056
6579
|
*
|
|
6057
6580
|
* @category String
|
|
6058
|
-
* @since
|
|
6581
|
+
* @since 3.10.0
|
|
6059
6582
|
*/
|
|
6060
6583
|
export declare const Trimmed: Trimmed;
|
|
6061
6584
|
/**
|
|
6062
|
-
*
|
|
6585
|
+
* Schema interface for `Trim`, a transformation that trims leading and trailing
|
|
6586
|
+
* whitespace while decoding and encodes the trimmed string unchanged.
|
|
6063
6587
|
*
|
|
6064
6588
|
* @category String
|
|
6065
|
-
* @since
|
|
6589
|
+
* @since 3.10.0
|
|
6066
6590
|
*/
|
|
6067
6591
|
export interface Trim extends decodeTo<Trimmed, String> {
|
|
6068
6592
|
readonly "Rebuild": Trim;
|
|
@@ -6077,14 +6601,15 @@ export interface Trim extends decodeTo<Trimmed, String> {
|
|
|
6077
6601
|
* - The trimmed string is encoded as is.
|
|
6078
6602
|
*
|
|
6079
6603
|
* @category String
|
|
6080
|
-
* @since
|
|
6604
|
+
* @since 3.10.0
|
|
6081
6605
|
*/
|
|
6082
6606
|
export declare const Trim: Trim;
|
|
6083
6607
|
/**
|
|
6084
|
-
*
|
|
6608
|
+
* Schema interface for `StringFromBase64`, a transformation between RFC4648
|
|
6609
|
+
* base64-encoded strings and UTF-8 strings.
|
|
6085
6610
|
*
|
|
6086
6611
|
* @category String
|
|
6087
|
-
* @since
|
|
6612
|
+
* @since 3.10.0
|
|
6088
6613
|
*/
|
|
6089
6614
|
export interface StringFromBase64 extends decodeTo<String, String> {
|
|
6090
6615
|
readonly "Rebuild": StringFromBase64;
|
|
@@ -6099,14 +6624,15 @@ export interface StringFromBase64 extends decodeTo<String, String> {
|
|
|
6099
6624
|
* - A `string` is encoded as a base64-encoded string.
|
|
6100
6625
|
*
|
|
6101
6626
|
* @category String
|
|
6102
|
-
* @since
|
|
6627
|
+
* @since 3.10.0
|
|
6103
6628
|
*/
|
|
6104
6629
|
export declare const StringFromBase64: StringFromBase64;
|
|
6105
6630
|
/**
|
|
6106
|
-
*
|
|
6631
|
+
* Schema interface for `StringFromBase64Url`, a transformation between URL-safe
|
|
6632
|
+
* base64-encoded strings and UTF-8 strings.
|
|
6107
6633
|
*
|
|
6108
6634
|
* @category String
|
|
6109
|
-
* @since
|
|
6635
|
+
* @since 3.10.0
|
|
6110
6636
|
*/
|
|
6111
6637
|
export interface StringFromBase64Url extends decodeTo<String, String> {
|
|
6112
6638
|
readonly "Rebuild": StringFromBase64Url;
|
|
@@ -6121,14 +6647,15 @@ export interface StringFromBase64Url extends decodeTo<String, String> {
|
|
|
6121
6647
|
* - A `string` is encoded as a base64 (URL) encoded string.
|
|
6122
6648
|
*
|
|
6123
6649
|
* @category String
|
|
6124
|
-
* @since
|
|
6650
|
+
* @since 3.10.0
|
|
6125
6651
|
*/
|
|
6126
6652
|
export declare const StringFromBase64Url: StringFromBase64Url;
|
|
6127
6653
|
/**
|
|
6128
|
-
*
|
|
6654
|
+
* Schema interface for `StringFromHex`, a transformation between hex-encoded
|
|
6655
|
+
* strings and UTF-8 strings.
|
|
6129
6656
|
*
|
|
6130
6657
|
* @category String
|
|
6131
|
-
* @since
|
|
6658
|
+
* @since 3.10.0
|
|
6132
6659
|
*/
|
|
6133
6660
|
export interface StringFromHex extends decodeTo<String, String> {
|
|
6134
6661
|
readonly "Rebuild": StringFromHex;
|
|
@@ -6143,14 +6670,15 @@ export interface StringFromHex extends decodeTo<String, String> {
|
|
|
6143
6670
|
* - A `string` is encoded as a hex string.
|
|
6144
6671
|
*
|
|
6145
6672
|
* @category String
|
|
6146
|
-
* @since
|
|
6673
|
+
* @since 3.10.0
|
|
6147
6674
|
*/
|
|
6148
6675
|
export declare const StringFromHex: StringFromHex;
|
|
6149
6676
|
/**
|
|
6150
|
-
*
|
|
6677
|
+
* Schema interface for `StringFromUriComponent`, a transformation between
|
|
6678
|
+
* URI-component encoded strings and UTF-8 strings.
|
|
6151
6679
|
*
|
|
6152
6680
|
* @category String
|
|
6153
|
-
* @since
|
|
6681
|
+
* @since 3.12.0
|
|
6154
6682
|
*/
|
|
6155
6683
|
export interface StringFromUriComponent extends decodeTo<String, String> {
|
|
6156
6684
|
readonly "Rebuild": StringFromUriComponent;
|
|
@@ -6165,7 +6693,7 @@ export interface StringFromUriComponent extends decodeTo<String, String> {
|
|
|
6165
6693
|
* Encoding:
|
|
6166
6694
|
* - A `string` is encoded as a URI component encoded string.
|
|
6167
6695
|
*
|
|
6168
|
-
* **Example**
|
|
6696
|
+
* **Example** (Decoding URI component strings)
|
|
6169
6697
|
*
|
|
6170
6698
|
* ```ts
|
|
6171
6699
|
* import { Schema } from "effect"
|
|
@@ -6184,17 +6712,23 @@ export interface StringFromUriComponent extends decodeTo<String, String> {
|
|
|
6184
6712
|
* ```
|
|
6185
6713
|
*
|
|
6186
6714
|
* @category String
|
|
6187
|
-
* @since
|
|
6715
|
+
* @since 3.12.0
|
|
6188
6716
|
*/
|
|
6189
6717
|
export declare const StringFromUriComponent: StringFromUriComponent;
|
|
6190
6718
|
/**
|
|
6191
|
-
* A union schema for
|
|
6719
|
+
* A union schema for property keys accepted by Effect schemas: finite `number`,
|
|
6720
|
+
* `symbol`, or `string`.
|
|
6192
6721
|
*
|
|
6193
6722
|
* @category PropertyKey
|
|
6194
6723
|
* @since 4.0.0
|
|
6195
6724
|
*/
|
|
6196
6725
|
export declare const PropertyKey: Union<readonly [Finite, Symbol, String]>;
|
|
6197
6726
|
/**
|
|
6727
|
+
* Schema for a Standard Schema v1 failure result.
|
|
6728
|
+
*
|
|
6729
|
+
* The result contains an `issues` array where each issue has a message and an
|
|
6730
|
+
* optional path made of property keys or keyed path segments.
|
|
6731
|
+
*
|
|
6198
6732
|
* @category StandardSchema
|
|
6199
6733
|
* @since 4.0.0
|
|
6200
6734
|
*/
|
|
@@ -6207,7 +6741,8 @@ export declare const StandardSchemaV1FailureResult: Struct<{
|
|
|
6207
6741
|
}>>;
|
|
6208
6742
|
}>;
|
|
6209
6743
|
/**
|
|
6210
|
-
*
|
|
6744
|
+
* Schema interface for `BooleanFromBit`, a transformation between bit literals
|
|
6745
|
+
* `0 | 1` and boolean values.
|
|
6211
6746
|
*
|
|
6212
6747
|
* @category Boolean
|
|
6213
6748
|
* @since 4.0.0
|
|
@@ -6223,7 +6758,8 @@ export interface BooleanFromBit extends decodeTo<Boolean, Literals<readonly [0,
|
|
|
6223
6758
|
*/
|
|
6224
6759
|
export declare const BooleanFromBit: BooleanFromBit;
|
|
6225
6760
|
/**
|
|
6226
|
-
*
|
|
6761
|
+
* Schema interface for `Uint8Array`, representing JavaScript `Uint8Array`
|
|
6762
|
+
* instances with base64 JSON encoding.
|
|
6227
6763
|
*
|
|
6228
6764
|
* @category Uint8Array
|
|
6229
6765
|
* @since 4.0.0
|
|
@@ -6243,10 +6779,11 @@ export interface Uint8Array extends instanceOf<globalThis.Uint8Array<ArrayBuffer
|
|
|
6243
6779
|
*/
|
|
6244
6780
|
export declare const Uint8Array: Uint8Array;
|
|
6245
6781
|
/**
|
|
6246
|
-
*
|
|
6782
|
+
* Schema interface for `Uint8ArrayFromBase64`, a transformation between
|
|
6783
|
+
* base64-encoded strings and `Uint8Array` values.
|
|
6247
6784
|
*
|
|
6248
6785
|
* @category Uint8Array
|
|
6249
|
-
* @since
|
|
6786
|
+
* @since 3.10.0
|
|
6250
6787
|
*/
|
|
6251
6788
|
export interface Uint8ArrayFromBase64 extends decodeTo<Uint8Array, String> {
|
|
6252
6789
|
readonly "Rebuild": Uint8ArrayFromBase64;
|
|
@@ -6262,14 +6799,15 @@ export interface Uint8ArrayFromBase64 extends decodeTo<Uint8Array, String> {
|
|
|
6262
6799
|
* - A `Uint8Array` is encoded as a base64-encoded string.
|
|
6263
6800
|
*
|
|
6264
6801
|
* @category Uint8Array
|
|
6265
|
-
* @since
|
|
6802
|
+
* @since 3.10.0
|
|
6266
6803
|
*/
|
|
6267
6804
|
export declare const Uint8ArrayFromBase64: Uint8ArrayFromBase64;
|
|
6268
6805
|
/**
|
|
6269
|
-
*
|
|
6806
|
+
* Schema interface for `Uint8ArrayFromBase64Url`, a transformation between
|
|
6807
|
+
* URL-safe base64-encoded strings and `Uint8Array` values.
|
|
6270
6808
|
*
|
|
6271
6809
|
* @category Uint8Array
|
|
6272
|
-
* @since
|
|
6810
|
+
* @since 3.10.0
|
|
6273
6811
|
*/
|
|
6274
6812
|
export interface Uint8ArrayFromBase64Url extends decodeTo<Uint8Array, String> {
|
|
6275
6813
|
readonly "Rebuild": Uint8ArrayFromBase64Url;
|
|
@@ -6285,14 +6823,15 @@ export interface Uint8ArrayFromBase64Url extends decodeTo<Uint8Array, String> {
|
|
|
6285
6823
|
* - A `Uint8Array` is encoded as a base64 (URL) encoded string.
|
|
6286
6824
|
*
|
|
6287
6825
|
* @category Uint8Array
|
|
6288
|
-
* @since
|
|
6826
|
+
* @since 3.10.0
|
|
6289
6827
|
*/
|
|
6290
6828
|
export declare const Uint8ArrayFromBase64Url: Uint8ArrayFromBase64Url;
|
|
6291
6829
|
/**
|
|
6292
|
-
*
|
|
6830
|
+
* Schema interface for `Uint8ArrayFromHex`, a transformation between
|
|
6831
|
+
* hex-encoded strings and `Uint8Array` values.
|
|
6293
6832
|
*
|
|
6294
6833
|
* @category Uint8Array
|
|
6295
|
-
* @since
|
|
6834
|
+
* @since 3.10.0
|
|
6296
6835
|
*/
|
|
6297
6836
|
export interface Uint8ArrayFromHex extends decodeTo<Uint8Array, String> {
|
|
6298
6837
|
readonly "Rebuild": Uint8ArrayFromHex;
|
|
@@ -6308,14 +6847,15 @@ export interface Uint8ArrayFromHex extends decodeTo<Uint8Array, String> {
|
|
|
6308
6847
|
* - A `Uint8Array` is encoded as a hex encoded string.
|
|
6309
6848
|
*
|
|
6310
6849
|
* @category Uint8Array
|
|
6311
|
-
* @since
|
|
6850
|
+
* @since 3.10.0
|
|
6312
6851
|
*/
|
|
6313
6852
|
export declare const Uint8ArrayFromHex: Uint8ArrayFromHex;
|
|
6314
6853
|
/**
|
|
6315
|
-
*
|
|
6854
|
+
* Schema interface for `DateTimeUtc`, representing `DateTime.Utc` values with
|
|
6855
|
+
* UTC ISO string JSON encoding.
|
|
6316
6856
|
*
|
|
6317
6857
|
* @category DateTime
|
|
6318
|
-
* @since
|
|
6858
|
+
* @since 3.10.0
|
|
6319
6859
|
*/
|
|
6320
6860
|
export interface DateTimeUtc extends declare<DateTime.Utc> {
|
|
6321
6861
|
readonly "Rebuild": DateTimeUtc;
|
|
@@ -6328,14 +6868,15 @@ export interface DateTimeUtc extends declare<DateTime.Utc> {
|
|
|
6328
6868
|
* - encodes `DateTime.Utc` as a UTC ISO string
|
|
6329
6869
|
*
|
|
6330
6870
|
* @category DateTime
|
|
6331
|
-
* @since
|
|
6871
|
+
* @since 3.10.0
|
|
6332
6872
|
*/
|
|
6333
6873
|
export declare const DateTimeUtc: DateTimeUtc;
|
|
6334
6874
|
/**
|
|
6335
|
-
*
|
|
6875
|
+
* Schema interface for `DateTimeUtcFromDate`, a transformation from valid
|
|
6876
|
+
* JavaScript `Date` values to `DateTime.Utc`.
|
|
6336
6877
|
*
|
|
6337
6878
|
* @category DateTime
|
|
6338
|
-
* @since
|
|
6879
|
+
* @since 3.12.0
|
|
6339
6880
|
*/
|
|
6340
6881
|
export interface DateTimeUtcFromDate extends decodeTo<DateTimeUtc, Date> {
|
|
6341
6882
|
readonly "Rebuild": DateTimeUtcFromDate;
|
|
@@ -6350,11 +6891,12 @@ export interface DateTimeUtcFromDate extends decodeTo<DateTimeUtc, Date> {
|
|
|
6350
6891
|
* - A `DateTime.Utc` is encoded as a `Date`
|
|
6351
6892
|
*
|
|
6352
6893
|
* @category DateTime
|
|
6353
|
-
* @since
|
|
6894
|
+
* @since 3.12.0
|
|
6354
6895
|
*/
|
|
6355
6896
|
export declare const DateTimeUtcFromDate: DateTimeUtcFromDate;
|
|
6356
6897
|
/**
|
|
6357
|
-
*
|
|
6898
|
+
* Schema interface for `DateTimeUtcFromString`, a transformation from date-time
|
|
6899
|
+
* strings to `DateTime.Utc`.
|
|
6358
6900
|
*
|
|
6359
6901
|
* @category DateTime
|
|
6360
6902
|
* @since 4.0.0
|
|
@@ -6363,22 +6905,24 @@ export interface DateTimeUtcFromString extends decodeTo<DateTimeUtc, String> {
|
|
|
6363
6905
|
readonly "Rebuild": DateTimeUtcFromString;
|
|
6364
6906
|
}
|
|
6365
6907
|
/**
|
|
6366
|
-
* A transformation schema that decodes a string into a `DateTime.Utc`.
|
|
6908
|
+
* A transformation schema that decodes a date-time string into a `DateTime.Utc`.
|
|
6367
6909
|
*
|
|
6368
6910
|
* Decoding:
|
|
6369
|
-
*
|
|
6370
|
-
*
|
|
6911
|
+
*
|
|
6912
|
+
* - A string accepted by `DateTime.make` is parsed and normalized to UTC. Strings
|
|
6913
|
+
* without an explicit zone are interpreted as UTC.
|
|
6371
6914
|
*
|
|
6372
6915
|
* Encoding:
|
|
6373
|
-
*
|
|
6374
|
-
*
|
|
6916
|
+
*
|
|
6917
|
+
* - A `DateTime.Utc` is encoded as a UTC ISO 8601 string.
|
|
6375
6918
|
*
|
|
6376
6919
|
* @category DateTime
|
|
6377
6920
|
* @since 4.0.0
|
|
6378
6921
|
*/
|
|
6379
6922
|
export declare const DateTimeUtcFromString: DateTimeUtcFromString;
|
|
6380
6923
|
/**
|
|
6381
|
-
*
|
|
6924
|
+
* Schema interface for `DateTimeUtcFromMillis`, a transformation between epoch
|
|
6925
|
+
* milliseconds and `DateTime.Utc` values.
|
|
6382
6926
|
*
|
|
6383
6927
|
* @category DateTime
|
|
6384
6928
|
* @since 4.0.0
|
|
@@ -6400,10 +6944,11 @@ export interface DateTimeUtcFromMillis extends decodeTo<instanceOf<DateTime.Utc>
|
|
|
6400
6944
|
*/
|
|
6401
6945
|
export declare const DateTimeUtcFromMillis: DateTimeUtcFromMillis;
|
|
6402
6946
|
/**
|
|
6403
|
-
*
|
|
6947
|
+
* Schema interface for `TimeZoneOffset`, representing
|
|
6948
|
+
* `DateTime.TimeZone.Offset` values encoded as offset milliseconds.
|
|
6404
6949
|
*
|
|
6405
6950
|
* @category DateTime
|
|
6406
|
-
* @since
|
|
6951
|
+
* @since 3.10.0
|
|
6407
6952
|
*/
|
|
6408
6953
|
export interface TimeZoneOffset extends declare<DateTime.TimeZone.Offset> {
|
|
6409
6954
|
readonly "Rebuild": TimeZoneOffset;
|
|
@@ -6416,14 +6961,15 @@ export interface TimeZoneOffset extends declare<DateTime.TimeZone.Offset> {
|
|
|
6416
6961
|
* - encodes `DateTime.TimeZone.Offset` as a number (offset in milliseconds)
|
|
6417
6962
|
*
|
|
6418
6963
|
* @category DateTime
|
|
6419
|
-
* @since
|
|
6964
|
+
* @since 3.10.0
|
|
6420
6965
|
*/
|
|
6421
6966
|
export declare const TimeZoneOffset: TimeZoneOffset;
|
|
6422
6967
|
/**
|
|
6423
|
-
*
|
|
6968
|
+
* Schema interface for `TimeZoneNamed`, representing
|
|
6969
|
+
* `DateTime.TimeZone.Named` values encoded as IANA time zone identifiers.
|
|
6424
6970
|
*
|
|
6425
6971
|
* @category DateTime
|
|
6426
|
-
* @since
|
|
6972
|
+
* @since 3.10.0
|
|
6427
6973
|
*/
|
|
6428
6974
|
export interface TimeZoneNamed extends declare<DateTime.TimeZone.Named> {
|
|
6429
6975
|
readonly "Rebuild": TimeZoneNamed;
|
|
@@ -6436,11 +6982,12 @@ export interface TimeZoneNamed extends declare<DateTime.TimeZone.Named> {
|
|
|
6436
6982
|
* - encodes `DateTime.TimeZone.Named` as a string (IANA time zone identifier)
|
|
6437
6983
|
*
|
|
6438
6984
|
* @category DateTime
|
|
6439
|
-
* @since
|
|
6985
|
+
* @since 3.10.0
|
|
6440
6986
|
*/
|
|
6441
6987
|
export declare const TimeZoneNamed: TimeZoneNamed;
|
|
6442
6988
|
/**
|
|
6443
|
-
*
|
|
6989
|
+
* Schema interface for `TimeZoneNamedFromString`, a transformation between IANA
|
|
6990
|
+
* time zone identifier strings and `DateTime.TimeZone.Named` values.
|
|
6444
6991
|
*
|
|
6445
6992
|
* @category DateTime
|
|
6446
6993
|
* @since 4.0.0
|
|
@@ -6462,10 +7009,11 @@ export interface TimeZoneNamedFromString extends decodeTo<TimeZoneNamed, String>
|
|
|
6462
7009
|
*/
|
|
6463
7010
|
export declare const TimeZoneNamedFromString: TimeZoneNamedFromString;
|
|
6464
7011
|
/**
|
|
6465
|
-
*
|
|
7012
|
+
* Schema interface for `TimeZone`, representing `DateTime.TimeZone` values
|
|
7013
|
+
* encoded as either IANA identifiers or numeric offset strings.
|
|
6466
7014
|
*
|
|
6467
7015
|
* @category DateTime
|
|
6468
|
-
* @since
|
|
7016
|
+
* @since 3.10.0
|
|
6469
7017
|
*/
|
|
6470
7018
|
export interface TimeZone extends declare<DateTime.TimeZone> {
|
|
6471
7019
|
readonly "Rebuild": TimeZone;
|
|
@@ -6479,11 +7027,12 @@ export interface TimeZone extends declare<DateTime.TimeZone> {
|
|
|
6479
7027
|
* `+03:00`)
|
|
6480
7028
|
*
|
|
6481
7029
|
* @category DateTime
|
|
6482
|
-
* @since
|
|
7030
|
+
* @since 3.10.0
|
|
6483
7031
|
*/
|
|
6484
7032
|
export declare const TimeZone: TimeZone;
|
|
6485
7033
|
/**
|
|
6486
|
-
*
|
|
7034
|
+
* Schema interface for `TimeZoneFromString`, a transformation from IANA
|
|
7035
|
+
* identifier or offset strings to `DateTime.TimeZone` values.
|
|
6487
7036
|
*
|
|
6488
7037
|
* @category DateTime
|
|
6489
7038
|
* @since 4.0.0
|
|
@@ -6505,10 +7054,11 @@ export interface TimeZoneFromString extends decodeTo<TimeZone, String> {
|
|
|
6505
7054
|
*/
|
|
6506
7055
|
export declare const TimeZoneFromString: TimeZoneFromString;
|
|
6507
7056
|
/**
|
|
6508
|
-
*
|
|
7057
|
+
* Schema interface for `DateTimeZoned`, representing `DateTime.Zoned` values
|
|
7058
|
+
* with ISO offset or named-zone string JSON encoding.
|
|
6509
7059
|
*
|
|
6510
7060
|
* @category DateTime
|
|
6511
|
-
* @since
|
|
7061
|
+
* @since 3.10.0
|
|
6512
7062
|
*/
|
|
6513
7063
|
export interface DateTimeZoned extends declare<DateTime.Zoned> {
|
|
6514
7064
|
readonly "Rebuild": DateTimeZoned;
|
|
@@ -6518,15 +7068,18 @@ export interface DateTimeZoned extends declare<DateTime.Zoned> {
|
|
|
6518
7068
|
*
|
|
6519
7069
|
* **Default JSON serializer**
|
|
6520
7070
|
*
|
|
6521
|
-
* - encodes
|
|
7071
|
+
* - encodes offset zones as an ISO date-time with a numeric offset, such as
|
|
7072
|
+
* `YYYY-MM-DDTHH:mm:ss.sss+HH:MM`
|
|
7073
|
+
* - encodes named zones by appending the IANA identifier in brackets, such as
|
|
6522
7074
|
* `YYYY-MM-DDTHH:mm:ss.sss+HH:MM[Time/Zone]`
|
|
6523
7075
|
*
|
|
6524
7076
|
* @category DateTime
|
|
6525
|
-
* @since
|
|
7077
|
+
* @since 3.10.0
|
|
6526
7078
|
*/
|
|
6527
7079
|
export declare const DateTimeZoned: DateTimeZoned;
|
|
6528
7080
|
/**
|
|
6529
|
-
*
|
|
7081
|
+
* Schema interface for `DateTimeZonedFromString`, a transformation between
|
|
7082
|
+
* zoned date-time strings and `DateTime.Zoned` values.
|
|
6530
7083
|
*
|
|
6531
7084
|
* @category DateTime
|
|
6532
7085
|
* @since 4.0.0
|
|
@@ -6556,7 +7109,8 @@ export declare const DateTimeZonedFromString: DateTimeZonedFromString;
|
|
|
6556
7109
|
* The interface exposes the schema's `fields`, an `identifier` string, and
|
|
6557
7110
|
* helpers such as `mapFields`, `annotate`, `check`, and `extend`.
|
|
6558
7111
|
*
|
|
6559
|
-
* @
|
|
7112
|
+
* @category models
|
|
7113
|
+
* @since 3.10.0
|
|
6560
7114
|
*/
|
|
6561
7115
|
export interface Class<Self, S extends Top & {
|
|
6562
7116
|
readonly fields: Struct.Fields;
|
|
@@ -6626,8 +7180,8 @@ type MissingSelfGeneric<Usage extends string> = `Missing \`Self\` generic - use
|
|
|
6626
7180
|
* console.log(dog.breed) // "Labrador"
|
|
6627
7181
|
* ```
|
|
6628
7182
|
*
|
|
6629
|
-
* @category
|
|
6630
|
-
* @since
|
|
7183
|
+
* @category constructors
|
|
7184
|
+
* @since 3.10.0
|
|
6631
7185
|
*/
|
|
6632
7186
|
export declare const Class: {
|
|
6633
7187
|
/**
|
|
@@ -6671,8 +7225,8 @@ export declare const Class: {
|
|
|
6671
7225
|
* console.log(dog.breed) // "Labrador"
|
|
6672
7226
|
* ```
|
|
6673
7227
|
*
|
|
6674
|
-
* @category
|
|
6675
|
-
* @since
|
|
7228
|
+
* @category constructors
|
|
7229
|
+
* @since 3.10.0
|
|
6676
7230
|
*/
|
|
6677
7231
|
<Self = never, Brand = {}>(identifier: string): {
|
|
6678
7232
|
/**
|
|
@@ -6716,8 +7270,8 @@ export declare const Class: {
|
|
|
6716
7270
|
* console.log(dog.breed) // "Labrador"
|
|
6717
7271
|
* ```
|
|
6718
7272
|
*
|
|
6719
|
-
* @category
|
|
6720
|
-
* @since
|
|
7273
|
+
* @category constructors
|
|
7274
|
+
* @since 3.10.0
|
|
6721
7275
|
*/
|
|
6722
7276
|
<const Fields extends Struct.Fields>(fields: Fields, annotations?: Annotations.Declaration<Self, readonly [Struct<Fields>]>): [Self] extends [never] ? MissingSelfGeneric<"Schema.Class"> : Class<Self, Struct<Fields>, Brand>;
|
|
6723
7277
|
/**
|
|
@@ -6761,8 +7315,8 @@ export declare const Class: {
|
|
|
6761
7315
|
* console.log(dog.breed) // "Labrador"
|
|
6762
7316
|
* ```
|
|
6763
7317
|
*
|
|
6764
|
-
* @category
|
|
6765
|
-
* @since
|
|
7318
|
+
* @category constructors
|
|
7319
|
+
* @since 3.10.0
|
|
6766
7320
|
*/
|
|
6767
7321
|
<S extends Struct<Struct.Fields>>(schema: S, annotations?: Annotations.Declaration<Self, readonly [S]>): [Self] extends [never] ? MissingSelfGeneric<"Schema.Class"> : Class<Self, S, Brand>;
|
|
6768
7322
|
};
|
|
@@ -6789,8 +7343,8 @@ export declare const Class: {
|
|
|
6789
7343
|
* console.log(c.radius) // 5
|
|
6790
7344
|
* ```
|
|
6791
7345
|
*
|
|
6792
|
-
* @category
|
|
6793
|
-
* @since
|
|
7346
|
+
* @category constructors
|
|
7347
|
+
* @since 3.10.0
|
|
6794
7348
|
*/
|
|
6795
7349
|
export declare const TaggedClass: {
|
|
6796
7350
|
/**
|
|
@@ -6815,8 +7369,8 @@ export declare const TaggedClass: {
|
|
|
6815
7369
|
* console.log(c.radius) // 5
|
|
6816
7370
|
* ```
|
|
6817
7371
|
*
|
|
6818
|
-
* @category
|
|
6819
|
-
* @since
|
|
7372
|
+
* @category constructors
|
|
7373
|
+
* @since 3.10.0
|
|
6820
7374
|
*/
|
|
6821
7375
|
<Self = never, Brand = {}>(identifier?: string): {
|
|
6822
7376
|
/**
|
|
@@ -6841,8 +7395,8 @@ export declare const TaggedClass: {
|
|
|
6841
7395
|
* console.log(c.radius) // 5
|
|
6842
7396
|
* ```
|
|
6843
7397
|
*
|
|
6844
|
-
* @category
|
|
6845
|
-
* @since
|
|
7398
|
+
* @category constructors
|
|
7399
|
+
* @since 3.10.0
|
|
6846
7400
|
*/
|
|
6847
7401
|
<Tag extends string, const Fields extends Struct.Fields>(tag: Tag, fields: Fields, annotations?: Annotations.Declaration<Self, readonly [TaggedStruct<Tag, Fields>]>): [Self] extends [never] ? MissingSelfGeneric<"Schema.TaggedClass"> : Class<Self, TaggedStruct<Tag, Fields>, Brand>;
|
|
6848
7402
|
/**
|
|
@@ -6867,8 +7421,8 @@ export declare const TaggedClass: {
|
|
|
6867
7421
|
* console.log(c.radius) // 5
|
|
6868
7422
|
* ```
|
|
6869
7423
|
*
|
|
6870
|
-
* @category
|
|
6871
|
-
* @since
|
|
7424
|
+
* @category constructors
|
|
7425
|
+
* @since 3.10.0
|
|
6872
7426
|
*/
|
|
6873
7427
|
<Tag extends string, S extends Struct<Struct.Fields>>(tag: Tag, schema: S, annotations?: Annotations.Declaration<Self, readonly [Struct<Simplify<{
|
|
6874
7428
|
readonly _tag: tag<Tag>;
|
|
@@ -6897,7 +7451,7 @@ export declare const TaggedClass: {
|
|
|
6897
7451
|
* })
|
|
6898
7452
|
* ```
|
|
6899
7453
|
*
|
|
6900
|
-
* @category
|
|
7454
|
+
* @category constructors
|
|
6901
7455
|
* @since 4.0.0
|
|
6902
7456
|
*/
|
|
6903
7457
|
export declare const ErrorClass: {
|
|
@@ -6921,7 +7475,7 @@ export declare const ErrorClass: {
|
|
|
6921
7475
|
* })
|
|
6922
7476
|
* ```
|
|
6923
7477
|
*
|
|
6924
|
-
* @category
|
|
7478
|
+
* @category constructors
|
|
6925
7479
|
* @since 4.0.0
|
|
6926
7480
|
*/
|
|
6927
7481
|
<Self = never, Brand = {}>(identifier: string): {
|
|
@@ -6945,7 +7499,7 @@ export declare const ErrorClass: {
|
|
|
6945
7499
|
* })
|
|
6946
7500
|
* ```
|
|
6947
7501
|
*
|
|
6948
|
-
* @category
|
|
7502
|
+
* @category constructors
|
|
6949
7503
|
* @since 4.0.0
|
|
6950
7504
|
*/
|
|
6951
7505
|
<const Fields extends Struct.Fields>(fields: Fields, annotations?: Annotations.Declaration<Self, readonly [Struct<Fields>]>): [Self] extends [never] ? MissingSelfGeneric<"Schema.ErrorClass"> : Class<Self, Struct<Fields>, Cause_.YieldableError & Brand>;
|
|
@@ -6969,7 +7523,7 @@ export declare const ErrorClass: {
|
|
|
6969
7523
|
* })
|
|
6970
7524
|
* ```
|
|
6971
7525
|
*
|
|
6972
|
-
* @category
|
|
7526
|
+
* @category constructors
|
|
6973
7527
|
* @since 4.0.0
|
|
6974
7528
|
*/
|
|
6975
7529
|
<S extends Struct<Struct.Fields>>(schema: S, annotations?: Annotations.Declaration<Self, readonly [S]>): [Self] extends [never] ? MissingSelfGeneric<"Schema.ErrorClass"> : Class<Self, S, Cause_.YieldableError & Brand>;
|
|
@@ -6994,8 +7548,8 @@ export declare const ErrorClass: {
|
|
|
6994
7548
|
* })
|
|
6995
7549
|
* ```
|
|
6996
7550
|
*
|
|
6997
|
-
* @category
|
|
6998
|
-
* @since
|
|
7551
|
+
* @category constructors
|
|
7552
|
+
* @since 3.10.0
|
|
6999
7553
|
*/
|
|
7000
7554
|
export declare const TaggedErrorClass: {
|
|
7001
7555
|
/**
|
|
@@ -7017,8 +7571,8 @@ export declare const TaggedErrorClass: {
|
|
|
7017
7571
|
* })
|
|
7018
7572
|
* ```
|
|
7019
7573
|
*
|
|
7020
|
-
* @category
|
|
7021
|
-
* @since
|
|
7574
|
+
* @category constructors
|
|
7575
|
+
* @since 3.10.0
|
|
7022
7576
|
*/
|
|
7023
7577
|
<Self = never, Brand = {}>(identifier?: string): {
|
|
7024
7578
|
/**
|
|
@@ -7040,8 +7594,8 @@ export declare const TaggedErrorClass: {
|
|
|
7040
7594
|
* })
|
|
7041
7595
|
* ```
|
|
7042
7596
|
*
|
|
7043
|
-
* @category
|
|
7044
|
-
* @since
|
|
7597
|
+
* @category constructors
|
|
7598
|
+
* @since 3.10.0
|
|
7045
7599
|
*/
|
|
7046
7600
|
<Tag extends string, const Fields extends Struct.Fields>(tag: Tag, fields: Fields, annotations?: Annotations.Declaration<Self, readonly [TaggedStruct<Tag, Fields>]>): [Self] extends [never] ? MissingSelfGeneric<"Schema.TaggedErrorClass"> : Class<Self, TaggedStruct<Tag, Fields>, Cause_.YieldableError & Brand>;
|
|
7047
7601
|
/**
|
|
@@ -7063,8 +7617,8 @@ export declare const TaggedErrorClass: {
|
|
|
7063
7617
|
* })
|
|
7064
7618
|
* ```
|
|
7065
7619
|
*
|
|
7066
|
-
* @category
|
|
7067
|
-
* @since
|
|
7620
|
+
* @category constructors
|
|
7621
|
+
* @since 3.10.0
|
|
7068
7622
|
*/
|
|
7069
7623
|
<Tag extends string, S extends Struct<Struct.Fields>>(tag: Tag, schema: S, annotations?: Annotations.Declaration<Self, readonly [Struct<Simplify<{
|
|
7070
7624
|
readonly _tag: tag<Tag>;
|
|
@@ -7116,10 +7670,11 @@ export declare function toArbitraryLazy<S extends Top>(schema: S): LazyArbitrary
|
|
|
7116
7670
|
*/
|
|
7117
7671
|
export declare function toArbitrary<S extends Top>(schema: S): FastCheck.Arbitrary<S["Type"]>;
|
|
7118
7672
|
/**
|
|
7119
|
-
*
|
|
7673
|
+
* Annotates a schema with a custom formatter used by `toFormatter`.
|
|
7120
7674
|
*
|
|
7121
|
-
*
|
|
7122
|
-
*
|
|
7675
|
+
* Use this when the formatter derived from the schema structure is not suitable.
|
|
7676
|
+
* The annotation is applied through this helper because adding it directly to
|
|
7677
|
+
* `Annotations.Bottom` would make schemas invariant.
|
|
7123
7678
|
*
|
|
7124
7679
|
* @category Formatter
|
|
7125
7680
|
* @since 4.0.0
|
|
@@ -7180,6 +7735,7 @@ export declare function toRepresentation(schema: Top): SchemaRepresentation.Docu
|
|
|
7180
7735
|
/**
|
|
7181
7736
|
* Options for {@link toJsonSchemaDocument}.
|
|
7182
7737
|
*
|
|
7738
|
+
* @category models
|
|
7183
7739
|
* @since 4.0.0
|
|
7184
7740
|
*/
|
|
7185
7741
|
export interface ToJsonSchemaOptions {
|
|
@@ -7200,17 +7756,19 @@ export interface ToJsonSchemaOptions {
|
|
|
7200
7756
|
readonly generateDescriptions?: boolean | undefined;
|
|
7201
7757
|
}
|
|
7202
7758
|
/**
|
|
7203
|
-
* Returns a JSON Schema
|
|
7759
|
+
* Returns a JSON Schema document using draft 2020-12.
|
|
7204
7760
|
*
|
|
7205
|
-
*
|
|
7761
|
+
* The `options` parameter controls generation details such as additional
|
|
7762
|
+
* properties and synthesized check descriptions; it does not change the draft
|
|
7763
|
+
* target.
|
|
7206
7764
|
*
|
|
7207
7765
|
* @category JsonSchema
|
|
7208
7766
|
* @since 4.0.0
|
|
7209
7767
|
*/
|
|
7210
7768
|
export declare function toJsonSchemaDocument(schema: Top, options?: ToJsonSchemaOptions): JsonSchema.Document<"draft-2020-12">;
|
|
7211
7769
|
/**
|
|
7212
|
-
* Derives a canonical JSON codec from a schema. The encoded form is `
|
|
7213
|
-
*
|
|
7770
|
+
* Derives a canonical JSON codec from a schema. The encoded form is `Json`, and
|
|
7771
|
+
* decoding produces the schema's `Type`.
|
|
7214
7772
|
*
|
|
7215
7773
|
* @category Canonical Codecs
|
|
7216
7774
|
* @since 4.0.0
|
|
@@ -7267,9 +7825,11 @@ type XmlEncoderOptions = {
|
|
|
7267
7825
|
readonly sortKeys?: boolean | undefined;
|
|
7268
7826
|
};
|
|
7269
7827
|
/**
|
|
7270
|
-
* Derives an XML encoder from a codec.
|
|
7271
|
-
*
|
|
7272
|
-
*
|
|
7828
|
+
* Derives an XML encoder from a codec.
|
|
7829
|
+
*
|
|
7830
|
+
* The returned function encodes a value through `toCodecStringTree` and returns
|
|
7831
|
+
* an `Effect` that succeeds with the XML string or fails with `SchemaError` if
|
|
7832
|
+
* codec encoding fails.
|
|
7273
7833
|
*
|
|
7274
7834
|
* @category Canonical Codecs
|
|
7275
7835
|
* @since 4.0.0
|
|
@@ -7331,6 +7891,9 @@ export declare function overrideToCodecIso<S extends Top, Iso>(to: Codec<Iso>, t
|
|
|
7331
7891
|
*/
|
|
7332
7892
|
export declare function toDifferJsonPatch<T, E>(schema: Codec<T, E>): Differ<T, JsonPatch.JsonPatch>;
|
|
7333
7893
|
/**
|
|
7894
|
+
* Recursive tree type whose leaves are `Node` values and whose branches are
|
|
7895
|
+
* readonly arrays or string-keyed records of child trees.
|
|
7896
|
+
*
|
|
7334
7897
|
* @category Tree
|
|
7335
7898
|
* @since 4.0.0
|
|
7336
7899
|
*/
|
|
@@ -7398,6 +7961,9 @@ export interface JsonObject {
|
|
|
7398
7961
|
*/
|
|
7399
7962
|
export declare const Json: Codec<Json>;
|
|
7400
7963
|
/**
|
|
7964
|
+
* Recursive TypeScript type for mutable JSON values: `null`, `number`,
|
|
7965
|
+
* `boolean`, `string`, mutable arrays, or mutable string-keyed records.
|
|
7966
|
+
*
|
|
7401
7967
|
* @category JSON
|
|
7402
7968
|
* @since 4.0.0
|
|
7403
7969
|
*/
|
|
@@ -7454,7 +8020,7 @@ export declare function resolveAnnotationsKey<S extends Top>(schema: S): Annotat
|
|
|
7454
8020
|
* Use {@link resolveAnnotations} to read the annotations attached to a schema at
|
|
7455
8021
|
* runtime.
|
|
7456
8022
|
*
|
|
7457
|
-
* @since
|
|
8023
|
+
* @since 3.10.0
|
|
7458
8024
|
*/
|
|
7459
8025
|
export declare namespace Annotations {
|
|
7460
8026
|
/**
|
|
@@ -7495,8 +8061,8 @@ export declare namespace Annotations {
|
|
|
7495
8061
|
* }
|
|
7496
8062
|
* ```
|
|
7497
8063
|
*
|
|
7498
|
-
* @category
|
|
7499
|
-
* @since
|
|
8064
|
+
* @category models
|
|
8065
|
+
* @since 3.10.0
|
|
7500
8066
|
*/
|
|
7501
8067
|
interface Annotations {
|
|
7502
8068
|
readonly [x: string]: unknown;
|
|
@@ -7505,9 +8071,19 @@ export declare namespace Annotations {
|
|
|
7505
8071
|
* Annotations shared by all schema nodes. These map to common JSON Schema /
|
|
7506
8072
|
* OpenAPI fields: `title`, `description`, `format`, etc.
|
|
7507
8073
|
*
|
|
8074
|
+
* @category models
|
|
7508
8075
|
* @since 4.0.0
|
|
7509
8076
|
*/
|
|
7510
8077
|
interface Augment extends Annotations {
|
|
8078
|
+
/**
|
|
8079
|
+
* Human-readable description of what a value is expected to satisfy.
|
|
8080
|
+
*
|
|
8081
|
+
* For filter and refinement failures, the default formatter uses
|
|
8082
|
+
* `message` first, then `expected`, and finally falls back to `<filter>`.
|
|
8083
|
+
*
|
|
8084
|
+
* Use this to name a failed filter in the default message:
|
|
8085
|
+
* `Expected <expected>, got <actual>`.
|
|
8086
|
+
*/
|
|
7511
8087
|
readonly expected?: string | undefined;
|
|
7512
8088
|
readonly title?: string | undefined;
|
|
7513
8089
|
readonly description?: string | undefined;
|
|
@@ -7521,6 +8097,7 @@ export declare namespace Annotations {
|
|
|
7521
8097
|
/**
|
|
7522
8098
|
* Extends {@link Augment} with type-parametric `default` and `examples` fields.
|
|
7523
8099
|
*
|
|
8100
|
+
* @category models
|
|
7524
8101
|
* @since 4.0.0
|
|
7525
8102
|
*/
|
|
7526
8103
|
interface Documentation<T> extends Augment {
|
|
@@ -7532,7 +8109,7 @@ export declare namespace Annotations {
|
|
|
7532
8109
|
* with an optional `messageMissingKey` to override the error message when
|
|
7533
8110
|
* the property key is absent during decoding.
|
|
7534
8111
|
*
|
|
7535
|
-
* @category
|
|
8112
|
+
* @category models
|
|
7536
8113
|
* @since 4.0.0
|
|
7537
8114
|
*/
|
|
7538
8115
|
interface Key<T> extends Documentation<T> {
|
|
@@ -7547,18 +8124,36 @@ export declare namespace Annotations {
|
|
|
7547
8124
|
* arbitrary generation hooks. {@link Declaration} and other annotation
|
|
7548
8125
|
* interfaces build on top of this.
|
|
7549
8126
|
*
|
|
7550
|
-
* @category
|
|
8127
|
+
* @category models
|
|
7551
8128
|
* @since 4.0.0
|
|
7552
8129
|
*/
|
|
7553
8130
|
interface Bottom<T, TypeParameters extends ReadonlyArray<Top>> extends Documentation<T> {
|
|
7554
8131
|
/**
|
|
7555
|
-
*
|
|
8132
|
+
* Complete message to use when this schema node reports an issue.
|
|
8133
|
+
*
|
|
8134
|
+
* This replaces the default message for matching issue types instead of
|
|
8135
|
+
* only changing the expected label. For a filter or refinement failure,
|
|
8136
|
+
* annotate the filter with `message` to replace the whole filter failure
|
|
8137
|
+
* message, or `expected` to keep the default
|
|
8138
|
+
* `Expected <expected>, got <actual>` shape.
|
|
7556
8139
|
*/
|
|
7557
8140
|
readonly message?: string | undefined;
|
|
7558
8141
|
/**
|
|
7559
8142
|
* The message to use when a key is unexpected.
|
|
7560
8143
|
*/
|
|
7561
8144
|
readonly messageUnexpectedKey?: string | undefined;
|
|
8145
|
+
/**
|
|
8146
|
+
* Stable identifier for this schema node.
|
|
8147
|
+
*
|
|
8148
|
+
* Identifiers are used by schema tooling, including JSON Schema
|
|
8149
|
+
* generation, to name references. The default formatter also uses
|
|
8150
|
+
* `identifier` as the expected label for type-level failures, such as
|
|
8151
|
+
* `Expected UserId, got null`.
|
|
8152
|
+
*
|
|
8153
|
+
* `identifier` does not name a failed filter or refinement. If the base
|
|
8154
|
+
* type matches and a filter fails, put `expected` or `message` on the
|
|
8155
|
+
* filter/refinement instead.
|
|
8156
|
+
*/
|
|
7562
8157
|
readonly identifier?: string | undefined;
|
|
7563
8158
|
readonly parseOptions?: AST.ParseOptions | undefined;
|
|
7564
8159
|
/**
|
|
@@ -7572,17 +8167,27 @@ export declare namespace Annotations {
|
|
|
7572
8167
|
readonly toArbitrary?: ToArbitrary.Declaration<T, TypeParameters> | undefined;
|
|
7573
8168
|
}
|
|
7574
8169
|
/**
|
|
8170
|
+
* Helpers for projecting declaration type-parameter schemas into decoded or
|
|
8171
|
+
* encoded codec arrays used by annotation hooks.
|
|
8172
|
+
*
|
|
7575
8173
|
* @since 4.0.0
|
|
7576
8174
|
*/
|
|
7577
8175
|
namespace TypeParameters {
|
|
7578
8176
|
/**
|
|
7579
|
-
*
|
|
8177
|
+
* Maps declaration type-parameter schemas to codecs for their decoded `Type`
|
|
8178
|
+
* values.
|
|
8179
|
+
*
|
|
8180
|
+
* @category utility types
|
|
8181
|
+
* @since 3.10.0
|
|
7580
8182
|
*/
|
|
7581
8183
|
type Type<TypeParameters extends ReadonlyArray<Top>> = {
|
|
7582
8184
|
readonly [K in keyof TypeParameters]: Codec<TypeParameters[K]["Type"]>;
|
|
7583
8185
|
};
|
|
7584
8186
|
/**
|
|
7585
|
-
*
|
|
8187
|
+
* Maps declaration type-parameter schemas to codecs for their `Encoded` values.
|
|
8188
|
+
*
|
|
8189
|
+
* @category utility types
|
|
8190
|
+
* @since 3.10.0
|
|
7586
8191
|
*/
|
|
7587
8192
|
type Encoded<TypeParameters extends ReadonlyArray<Top>> = {
|
|
7588
8193
|
readonly [K in keyof TypeParameters]: Codec<TypeParameters[K]["Encoded"]>;
|
|
@@ -7595,7 +8200,7 @@ export declare namespace Annotations {
|
|
|
7595
8200
|
* derived capabilities (JSON encoding, property testing, etc.) can be
|
|
7596
8201
|
* provided for the custom type.
|
|
7597
8202
|
*
|
|
7598
|
-
* @category
|
|
8203
|
+
* @category models
|
|
7599
8204
|
* @since 4.0.0
|
|
7600
8205
|
*/
|
|
7601
8206
|
interface Declaration<T, TypeParameters extends ReadonlyArray<Top> = readonly []> extends Bottom<T, TypeParameters> {
|
|
@@ -7620,11 +8225,25 @@ export declare namespace Annotations {
|
|
|
7620
8225
|
* {@link Augment} with an optional error message, identifier, and metadata.
|
|
7621
8226
|
* Filters are intentionally non-parametric to keep them covariant.
|
|
7622
8227
|
*
|
|
7623
|
-
* @category
|
|
7624
|
-
* @since
|
|
8228
|
+
* @category models
|
|
8229
|
+
* @since 3.10.0
|
|
7625
8230
|
*/
|
|
7626
8231
|
interface Filter extends Augment {
|
|
8232
|
+
/**
|
|
8233
|
+
* Complete message to use when this filter or refinement fails.
|
|
8234
|
+
*
|
|
8235
|
+
* The default formatter checks filter annotations in this order:
|
|
8236
|
+
* `message`, then `expected`, then `<filter>`.
|
|
8237
|
+
*/
|
|
7627
8238
|
readonly message?: string | undefined;
|
|
8239
|
+
/**
|
|
8240
|
+
* Stable identifier for the schema after this filter is attached.
|
|
8241
|
+
*
|
|
8242
|
+
* This can affect schema tooling such as JSON Schema generation and
|
|
8243
|
+
* type-level failures before the filter runs, but it does not name the
|
|
8244
|
+
* failed filter itself. For filter failure messages, use `expected` or
|
|
8245
|
+
* `message`.
|
|
8246
|
+
*/
|
|
7628
8247
|
readonly identifier?: string | undefined;
|
|
7629
8248
|
/**
|
|
7630
8249
|
* Optional metadata used to identify or extend the filter with custom data.
|
|
@@ -7641,38 +8260,65 @@ export declare namespace Annotations {
|
|
|
7641
8260
|
readonly "~structural"?: boolean | undefined;
|
|
7642
8261
|
}
|
|
7643
8262
|
/**
|
|
8263
|
+
* Types used by arbitrary-derivation annotations to configure `toArbitrary`
|
|
8264
|
+
* hooks and carry merged fast-check constraints.
|
|
8265
|
+
*
|
|
7644
8266
|
* @since 4.0.0
|
|
7645
8267
|
*/
|
|
7646
8268
|
namespace ToArbitrary {
|
|
7647
8269
|
/**
|
|
8270
|
+
* fast-check string constraints plus optional regular-expression pattern strings
|
|
8271
|
+
* used when deriving string arbitraries from schema checks.
|
|
8272
|
+
*
|
|
8273
|
+
* @category models
|
|
7648
8274
|
* @since 4.0.0
|
|
7649
8275
|
*/
|
|
7650
8276
|
interface StringConstraints extends FastCheck.StringSharedConstraints {
|
|
7651
8277
|
readonly patterns?: readonly [string, ...Array<string>];
|
|
7652
8278
|
}
|
|
7653
8279
|
/**
|
|
8280
|
+
* fast-check floating-point constraints plus `isInteger`, which switches
|
|
8281
|
+
* derived number arbitraries to integer generation.
|
|
8282
|
+
*
|
|
8283
|
+
* @category models
|
|
7654
8284
|
* @since 4.0.0
|
|
7655
8285
|
*/
|
|
7656
8286
|
interface NumberConstraints extends FastCheck.FloatConstraints {
|
|
7657
8287
|
readonly isInteger?: boolean;
|
|
7658
8288
|
}
|
|
7659
8289
|
/**
|
|
8290
|
+
* fast-check bigint constraints used when deriving arbitraries for bigint
|
|
8291
|
+
* schemas.
|
|
8292
|
+
*
|
|
8293
|
+
* @category models
|
|
7660
8294
|
* @since 4.0.0
|
|
7661
8295
|
*/
|
|
7662
8296
|
interface BigIntConstraints extends FastCheck.BigIntConstraints {
|
|
7663
8297
|
}
|
|
7664
8298
|
/**
|
|
8299
|
+
* fast-check array constraints plus an optional comparator used when deriving
|
|
8300
|
+
* unique-array arbitraries.
|
|
8301
|
+
*
|
|
8302
|
+
* @category models
|
|
7665
8303
|
* @since 4.0.0
|
|
7666
8304
|
*/
|
|
7667
8305
|
interface ArrayConstraints extends FastCheck.ArrayConstraints {
|
|
7668
8306
|
readonly comparator?: (a: any, b: any) => boolean;
|
|
7669
8307
|
}
|
|
7670
8308
|
/**
|
|
8309
|
+
* fast-check date constraints used when deriving arbitraries for `Date` and
|
|
8310
|
+
* DateTime schemas.
|
|
8311
|
+
*
|
|
8312
|
+
* @category models
|
|
7671
8313
|
* @since 4.0.0
|
|
7672
8314
|
*/
|
|
7673
8315
|
interface DateConstraints extends FastCheck.DateConstraints {
|
|
7674
8316
|
}
|
|
7675
8317
|
/**
|
|
8318
|
+
* Grouped arbitrary-generation constraints accumulated from schema checks and
|
|
8319
|
+
* passed to `toArbitrary` derivation.
|
|
8320
|
+
*
|
|
8321
|
+
* @category models
|
|
7676
8322
|
* @since 4.0.0
|
|
7677
8323
|
*/
|
|
7678
8324
|
interface Constraint {
|
|
@@ -7683,7 +8329,12 @@ export declare namespace Annotations {
|
|
|
7683
8329
|
readonly date?: DateConstraints | undefined;
|
|
7684
8330
|
}
|
|
7685
8331
|
/**
|
|
7686
|
-
*
|
|
8332
|
+
* Context passed to arbitrary-derivation hooks, including accumulated
|
|
8333
|
+
* constraints and an `isSuspend` flag used to limit recursion for suspended
|
|
8334
|
+
* schemas.
|
|
8335
|
+
*
|
|
8336
|
+
* @category models
|
|
8337
|
+
* @since 3.10.0
|
|
7687
8338
|
*/
|
|
7688
8339
|
interface Context {
|
|
7689
8340
|
/**
|
|
@@ -7695,6 +8346,12 @@ export declare namespace Annotations {
|
|
|
7695
8346
|
readonly constraints?: ToArbitrary.Constraint | undefined;
|
|
7696
8347
|
}
|
|
7697
8348
|
/**
|
|
8349
|
+
* Hook signature for declaration schema arbitrary annotations.
|
|
8350
|
+
*
|
|
8351
|
+
* Given arbitraries for any type parameters, returns a function that receives the
|
|
8352
|
+
* fast-check module and derivation context and produces an arbitrary for `T`.
|
|
8353
|
+
*
|
|
8354
|
+
* @category models
|
|
7698
8355
|
* @since 4.0.0
|
|
7699
8356
|
*/
|
|
7700
8357
|
interface Declaration<T, TypeParameters extends ReadonlyArray<Top>> {
|
|
@@ -7704,10 +8361,18 @@ export declare namespace Annotations {
|
|
|
7704
8361
|
}
|
|
7705
8362
|
}
|
|
7706
8363
|
/**
|
|
8364
|
+
* Types used by formatter annotations to customize formatter derivation for
|
|
8365
|
+
* declaration schemas.
|
|
8366
|
+
*
|
|
7707
8367
|
* @since 4.0.0
|
|
7708
8368
|
*/
|
|
7709
8369
|
namespace ToFormatter {
|
|
7710
8370
|
/**
|
|
8371
|
+
* Hook signature for declaration schema formatter annotations.
|
|
8372
|
+
*
|
|
8373
|
+
* Given formatters for any type parameters, returns a formatter for `T`.
|
|
8374
|
+
*
|
|
8375
|
+
* @category models
|
|
7711
8376
|
* @since 4.0.0
|
|
7712
8377
|
*/
|
|
7713
8378
|
interface Declaration<T, TypeParameters extends ReadonlyArray<Top>> {
|
|
@@ -7717,10 +8382,18 @@ export declare namespace Annotations {
|
|
|
7717
8382
|
}
|
|
7718
8383
|
}
|
|
7719
8384
|
/**
|
|
8385
|
+
* Types used by equivalence annotations to customize equivalence derivation for
|
|
8386
|
+
* declaration schemas.
|
|
8387
|
+
*
|
|
7720
8388
|
* @since 4.0.0
|
|
7721
8389
|
*/
|
|
7722
8390
|
namespace ToEquivalence {
|
|
7723
8391
|
/**
|
|
8392
|
+
* Hook signature for declaration schema equivalence annotations.
|
|
8393
|
+
*
|
|
8394
|
+
* Given equivalences for any type parameters, returns an `Equivalence` for `T`.
|
|
8395
|
+
*
|
|
8396
|
+
* @category models
|
|
7724
8397
|
* @since 4.0.0
|
|
7725
8398
|
*/
|
|
7726
8399
|
interface Declaration<T, TypeParameters extends ReadonlyArray<Top>> {
|
|
@@ -7730,15 +8403,23 @@ export declare namespace Annotations {
|
|
|
7730
8403
|
}
|
|
7731
8404
|
}
|
|
7732
8405
|
/**
|
|
7733
|
-
*
|
|
8406
|
+
* Annotations that can be attached to schema issues.
|
|
8407
|
+
*
|
|
8408
|
+
* The optional `message` field overrides the default issue message.
|
|
8409
|
+
*
|
|
8410
|
+
* @category models
|
|
7734
8411
|
* @since 4.0.0
|
|
7735
8412
|
*/
|
|
7736
8413
|
interface Issue extends Annotations {
|
|
7737
8414
|
readonly message?: string | undefined;
|
|
7738
8415
|
}
|
|
7739
8416
|
/**
|
|
7740
|
-
*
|
|
8417
|
+
* Registry of metadata payloads emitted by built-in schema filters and checks.
|
|
8418
|
+
*
|
|
8419
|
+
* Do not augment this interface with custom metadata; extend `MetaDefinitions`
|
|
8420
|
+
* instead.
|
|
7741
8421
|
*
|
|
8422
|
+
* @category models
|
|
7742
8423
|
* @since 4.0.0
|
|
7743
8424
|
*/
|
|
7744
8425
|
interface BuiltInMetaDefinitions {
|
|
@@ -7940,17 +8621,27 @@ export declare namespace Annotations {
|
|
|
7940
8621
|
};
|
|
7941
8622
|
}
|
|
7942
8623
|
/**
|
|
8624
|
+
* Union of all metadata payloads defined by `BuiltInMetaDefinitions`.
|
|
8625
|
+
*
|
|
8626
|
+
* @category utility types
|
|
7943
8627
|
* @since 4.0.0
|
|
7944
8628
|
*/
|
|
7945
8629
|
type BuiltInMeta = BuiltInMetaDefinitions[keyof BuiltInMetaDefinitions];
|
|
7946
8630
|
/**
|
|
7947
|
-
*
|
|
8631
|
+
* Augmentable registry of schema filter metadata payloads.
|
|
8632
|
+
*
|
|
8633
|
+
* Extend this interface to add custom values accepted by annotation `meta`
|
|
8634
|
+
* fields.
|
|
7948
8635
|
*
|
|
8636
|
+
* @category models
|
|
7949
8637
|
* @since 4.0.0
|
|
7950
8638
|
*/
|
|
7951
8639
|
interface MetaDefinitions extends BuiltInMetaDefinitions {
|
|
7952
8640
|
}
|
|
7953
8641
|
/**
|
|
8642
|
+
* Union of built-in and user-augmented schema filter metadata payloads.
|
|
8643
|
+
*
|
|
8644
|
+
* @category utility types
|
|
7954
8645
|
* @since 4.0.0
|
|
7955
8646
|
*/
|
|
7956
8647
|
type Meta = MetaDefinitions[keyof MetaDefinitions];
|