effect 4.0.0-beta.43 → 4.0.0-beta.45
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/Cache.d.ts +12 -43
- package/dist/Cache.d.ts.map +1 -1
- package/dist/Cache.js +15 -42
- package/dist/Cache.js.map +1 -1
- package/dist/Cause.d.ts +21 -21
- package/dist/Cause.d.ts.map +1 -1
- package/dist/Cause.js +89 -10
- package/dist/Cause.js.map +1 -1
- package/dist/Channel.d.ts +42 -19
- package/dist/Channel.d.ts.map +1 -1
- package/dist/Channel.js +86 -46
- package/dist/Channel.js.map +1 -1
- package/dist/Clock.d.ts +2 -2
- package/dist/Clock.d.ts.map +1 -1
- package/dist/Clock.js.map +1 -1
- package/dist/Config.d.ts +2 -2
- package/dist/ConfigProvider.d.ts +5 -5
- package/dist/ConfigProvider.d.ts.map +1 -1
- package/dist/ConfigProvider.js +5 -5
- package/dist/ConfigProvider.js.map +1 -1
- package/dist/Console.d.ts +2 -2
- package/dist/Console.d.ts.map +1 -1
- package/dist/Console.js.map +1 -1
- package/dist/Context.d.ts +1150 -0
- package/dist/Context.d.ts.map +1 -0
- package/dist/{ServiceMap.js → Context.js} +139 -139
- package/dist/Context.js.map +1 -0
- package/dist/DateTime.d.ts +2 -2
- package/dist/DateTime.d.ts.map +1 -1
- package/dist/DateTime.js +2 -2
- package/dist/DateTime.js.map +1 -1
- package/dist/Effect.d.ts +177 -177
- package/dist/Effect.d.ts.map +1 -1
- package/dist/Effect.js +81 -81
- package/dist/Effect.js.map +1 -1
- package/dist/Equal.d.ts.map +1 -1
- package/dist/Equal.js +16 -0
- package/dist/Equal.js.map +1 -1
- package/dist/ErrorReporter.d.ts +3 -3
- package/dist/ErrorReporter.d.ts.map +1 -1
- package/dist/ErrorReporter.js +1 -1
- package/dist/ErrorReporter.js.map +1 -1
- package/dist/ExecutionPlan.d.ts +6 -6
- package/dist/ExecutionPlan.d.ts.map +1 -1
- package/dist/ExecutionPlan.js +4 -4
- package/dist/ExecutionPlan.js.map +1 -1
- package/dist/Fiber.d.ts +7 -7
- package/dist/Fiber.d.ts.map +1 -1
- package/dist/Fiber.js.map +1 -1
- package/dist/FiberHandle.d.ts +2 -2
- package/dist/FiberHandle.d.ts.map +1 -1
- package/dist/FiberHandle.js +4 -4
- package/dist/FiberHandle.js.map +1 -1
- package/dist/FiberMap.d.ts +2 -2
- package/dist/FiberMap.d.ts.map +1 -1
- package/dist/FiberMap.js +4 -4
- package/dist/FiberMap.js.map +1 -1
- package/dist/FiberSet.d.ts +2 -2
- package/dist/FiberSet.d.ts.map +1 -1
- package/dist/FiberSet.js +4 -4
- package/dist/FiberSet.js.map +1 -1
- package/dist/FileSystem.d.ts +3 -3
- package/dist/FileSystem.d.ts.map +1 -1
- package/dist/FileSystem.js +3 -3
- package/dist/FileSystem.js.map +1 -1
- package/dist/Hash.js +1 -1
- package/dist/Hash.js.map +1 -1
- package/dist/Layer.d.ts +286 -268
- package/dist/Layer.d.ts.map +1 -1
- package/dist/Layer.js +133 -134
- package/dist/Layer.js.map +1 -1
- package/dist/LayerMap.d.ts +18 -18
- package/dist/LayerMap.d.ts.map +1 -1
- package/dist/LayerMap.js +18 -15
- package/dist/LayerMap.js.map +1 -1
- package/dist/Logger.d.ts +3 -3
- package/dist/Logger.d.ts.map +1 -1
- package/dist/Logger.js.map +1 -1
- package/dist/ManagedRuntime.d.ts +6 -6
- package/dist/ManagedRuntime.d.ts.map +1 -1
- package/dist/ManagedRuntime.js +18 -21
- package/dist/ManagedRuntime.js.map +1 -1
- package/dist/Metric.d.ts +19 -19
- package/dist/Metric.d.ts.map +1 -1
- package/dist/Metric.js +21 -21
- package/dist/Metric.js.map +1 -1
- package/dist/Path.d.ts +2 -2
- package/dist/Path.d.ts.map +1 -1
- package/dist/Path.js +2 -2
- package/dist/Path.js.map +1 -1
- package/dist/Pool.d.ts.map +1 -1
- package/dist/Pool.js +4 -4
- package/dist/Pool.js.map +1 -1
- package/dist/PubSub.d.ts.map +1 -1
- package/dist/PubSub.js +3 -3
- package/dist/PubSub.js.map +1 -1
- package/dist/Random.d.ts +2 -2
- package/dist/Random.d.ts.map +1 -1
- package/dist/Random.js +0 -23
- package/dist/Random.js.map +1 -1
- package/dist/RcMap.d.ts +2 -2
- package/dist/RcMap.d.ts.map +1 -1
- package/dist/RcMap.js +12 -12
- package/dist/RcMap.js.map +1 -1
- package/dist/Redactable.d.ts +139 -62
- package/dist/Redactable.d.ts.map +1 -1
- package/dist/Redactable.js +59 -55
- package/dist/Redactable.js.map +1 -1
- package/dist/References.d.ts +26 -14
- package/dist/References.d.ts.map +1 -1
- package/dist/References.js +0 -12
- package/dist/References.js.map +1 -1
- package/dist/Request.d.ts +5 -5
- package/dist/Request.d.ts.map +1 -1
- package/dist/Request.js.map +1 -1
- package/dist/RequestResolver.d.ts.map +1 -1
- package/dist/RequestResolver.js +6 -7
- package/dist/RequestResolver.js.map +1 -1
- package/dist/Resource.d.ts +0 -3
- package/dist/Resource.d.ts.map +1 -1
- package/dist/Resource.js +3 -3
- package/dist/Resource.js.map +1 -1
- package/dist/Schedule.d.ts +2 -2
- package/dist/Schedule.d.ts.map +1 -1
- package/dist/Schedule.js +2 -2
- package/dist/Schedule.js.map +1 -1
- package/dist/Scheduler.d.ts +4 -4
- package/dist/Scheduler.d.ts.map +1 -1
- package/dist/Scheduler.js +7 -4
- package/dist/Scheduler.js.map +1 -1
- package/dist/Schema.d.ts +531 -214
- package/dist/Schema.d.ts.map +1 -1
- package/dist/Schema.js +304 -103
- package/dist/Schema.js.map +1 -1
- package/dist/SchemaAST.d.ts.map +1 -1
- package/dist/SchemaAST.js +5 -15
- package/dist/SchemaAST.js.map +1 -1
- package/dist/SchemaGetter.d.ts +49 -5
- package/dist/SchemaGetter.d.ts.map +1 -1
- package/dist/SchemaGetter.js +64 -5
- package/dist/SchemaGetter.js.map +1 -1
- package/dist/SchemaTransformation.d.ts +145 -0
- package/dist/SchemaTransformation.d.ts.map +1 -1
- package/dist/SchemaTransformation.js +146 -0
- package/dist/SchemaTransformation.js.map +1 -1
- package/dist/Scope.d.ts +2 -2
- package/dist/Scope.d.ts.map +1 -1
- package/dist/Scope.js.map +1 -1
- package/dist/ScopedCache.d.ts.map +1 -1
- package/dist/ScopedCache.js +4 -4
- package/dist/ScopedCache.js.map +1 -1
- package/dist/Semaphore.d.ts +1 -1
- package/dist/Semaphore.d.ts.map +1 -1
- package/dist/Semaphore.js +1 -3
- package/dist/Semaphore.js.map +1 -1
- package/dist/Sink.d.ts +6 -6
- package/dist/Sink.d.ts.map +1 -1
- package/dist/Sink.js +1 -1
- package/dist/Sink.js.map +1 -1
- package/dist/Stdio.d.ts +2 -2
- package/dist/Stdio.d.ts.map +1 -1
- package/dist/Stdio.js +2 -2
- package/dist/Stdio.js.map +1 -1
- package/dist/Stream.d.ts +187 -117
- package/dist/Stream.d.ts.map +1 -1
- package/dist/Stream.js +133 -57
- package/dist/Stream.js.map +1 -1
- package/dist/Terminal.d.ts +3 -3
- package/dist/Terminal.d.ts.map +1 -1
- package/dist/Terminal.js +2 -2
- package/dist/Terminal.js.map +1 -1
- package/dist/Tracer.d.ts +16 -16
- package/dist/Tracer.d.ts.map +1 -1
- package/dist/Tracer.js +11 -8
- package/dist/Tracer.js.map +1 -1
- package/dist/Unify.d.ts +8 -2
- package/dist/Unify.d.ts.map +1 -1
- package/dist/Unify.js.map +1 -1
- package/dist/index.d.ts +81 -15
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +81 -15
- package/dist/index.js.map +1 -1
- package/dist/internal/core.js.map +1 -1
- package/dist/internal/effect.js +74 -74
- package/dist/internal/effect.js.map +1 -1
- package/dist/internal/layer.js +3 -3
- package/dist/internal/layer.js.map +1 -1
- package/dist/internal/random.js +2 -2
- package/dist/internal/random.js.map +1 -1
- package/dist/internal/rcRef.js +9 -9
- package/dist/internal/rcRef.js.map +1 -1
- package/dist/internal/references.js +13 -13
- package/dist/internal/references.js.map +1 -1
- package/dist/internal/request.js +6 -6
- package/dist/internal/request.js.map +1 -1
- package/dist/internal/schedule.js +1 -1
- package/dist/internal/schedule.js.map +1 -1
- package/dist/internal/schema/representation.js +11 -1
- package/dist/internal/schema/representation.js.map +1 -1
- package/dist/internal/schema/schema.d.ts +10 -1
- package/dist/internal/schema/schema.d.ts.map +1 -1
- package/dist/internal/schema/schema.js +21 -1
- package/dist/internal/schema/schema.js.map +1 -1
- package/dist/testing/TestSchema.d.ts +3 -3
- package/dist/testing/TestSchema.d.ts.map +1 -1
- package/dist/testing/TestSchema.js.map +1 -1
- package/dist/unstable/ai/AiError.d.ts +19 -19
- package/dist/unstable/ai/AiError.d.ts.map +1 -1
- package/dist/unstable/ai/AiError.js +2 -1
- package/dist/unstable/ai/AiError.js.map +1 -1
- package/dist/unstable/ai/Chat.d.ts +4 -4
- package/dist/unstable/ai/Chat.d.ts.map +1 -1
- package/dist/unstable/ai/Chat.js +3 -3
- package/dist/unstable/ai/Chat.js.map +1 -1
- package/dist/unstable/ai/EmbeddingModel.d.ts +6 -6
- package/dist/unstable/ai/EmbeddingModel.d.ts.map +1 -1
- package/dist/unstable/ai/EmbeddingModel.js +3 -3
- package/dist/unstable/ai/EmbeddingModel.js.map +1 -1
- package/dist/unstable/ai/IdGenerator.d.ts +2 -2
- package/dist/unstable/ai/IdGenerator.d.ts.map +1 -1
- package/dist/unstable/ai/IdGenerator.js +2 -2
- package/dist/unstable/ai/IdGenerator.js.map +1 -1
- package/dist/unstable/ai/LanguageModel.d.ts +2 -2
- package/dist/unstable/ai/LanguageModel.d.ts.map +1 -1
- package/dist/unstable/ai/LanguageModel.js +2 -2
- package/dist/unstable/ai/LanguageModel.js.map +1 -1
- package/dist/unstable/ai/McpSchema.d.ts +54 -54
- package/dist/unstable/ai/McpSchema.d.ts.map +1 -1
- package/dist/unstable/ai/McpSchema.js +15 -8
- package/dist/unstable/ai/McpSchema.js.map +1 -1
- package/dist/unstable/ai/McpServer.d.ts +22 -22
- package/dist/unstable/ai/McpServer.d.ts.map +1 -1
- package/dist/unstable/ai/McpServer.js +49 -46
- package/dist/unstable/ai/McpServer.js.map +1 -1
- package/dist/unstable/ai/Model.d.ts +3 -3
- package/dist/unstable/ai/Model.d.ts.map +1 -1
- package/dist/unstable/ai/Model.js +5 -5
- package/dist/unstable/ai/Model.js.map +1 -1
- package/dist/unstable/ai/Prompt.d.ts.map +1 -1
- package/dist/unstable/ai/Prompt.js +6 -9
- package/dist/unstable/ai/Prompt.js.map +1 -1
- package/dist/unstable/ai/Response.d.ts +1 -1
- package/dist/unstable/ai/Response.d.ts.map +1 -1
- package/dist/unstable/ai/Response.js +6 -7
- package/dist/unstable/ai/Response.js.map +1 -1
- package/dist/unstable/ai/ResponseIdTracker.d.ts +2 -2
- package/dist/unstable/ai/ResponseIdTracker.d.ts.map +1 -1
- package/dist/unstable/ai/ResponseIdTracker.js +2 -2
- package/dist/unstable/ai/ResponseIdTracker.js.map +1 -1
- package/dist/unstable/ai/Telemetry.d.ts +35 -2
- package/dist/unstable/ai/Telemetry.d.ts.map +1 -1
- package/dist/unstable/ai/Telemetry.js +2 -2
- package/dist/unstable/ai/Telemetry.js.map +1 -1
- package/dist/unstable/ai/Tokenizer.d.ts +2 -2
- package/dist/unstable/ai/Tokenizer.d.ts.map +1 -1
- package/dist/unstable/ai/Tokenizer.js +2 -2
- package/dist/unstable/ai/Tokenizer.js.map +1 -1
- package/dist/unstable/ai/Tool.d.ts +16 -16
- package/dist/unstable/ai/Tool.d.ts.map +1 -1
- package/dist/unstable/ai/Tool.js +41 -13
- package/dist/unstable/ai/Tool.js.map +1 -1
- package/dist/unstable/ai/Toolkit.d.ts +3 -3
- package/dist/unstable/ai/Toolkit.d.ts.map +1 -1
- package/dist/unstable/ai/Toolkit.js +10 -10
- package/dist/unstable/ai/Toolkit.js.map +1 -1
- package/dist/unstable/cli/Argument.d.ts +2 -3
- package/dist/unstable/cli/Argument.d.ts.map +1 -1
- package/dist/unstable/cli/Argument.js.map +1 -1
- package/dist/unstable/cli/CliError.d.ts +29 -8
- package/dist/unstable/cli/CliError.d.ts.map +1 -1
- package/dist/unstable/cli/CliError.js +8 -1
- package/dist/unstable/cli/CliError.js.map +1 -1
- package/dist/unstable/cli/CliOutput.d.ts +2 -2
- package/dist/unstable/cli/CliOutput.d.ts.map +1 -1
- package/dist/unstable/cli/CliOutput.js +2 -2
- package/dist/unstable/cli/CliOutput.js.map +1 -1
- package/dist/unstable/cli/Command.d.ts +14 -14
- package/dist/unstable/cli/Command.d.ts.map +1 -1
- package/dist/unstable/cli/Command.js +11 -10
- package/dist/unstable/cli/Command.js.map +1 -1
- package/dist/unstable/cli/Flag.d.ts +2 -3
- package/dist/unstable/cli/Flag.d.ts.map +1 -1
- package/dist/unstable/cli/Flag.js.map +1 -1
- package/dist/unstable/cli/GlobalFlag.d.ts +2 -2
- package/dist/unstable/cli/GlobalFlag.d.ts.map +1 -1
- package/dist/unstable/cli/GlobalFlag.js +2 -2
- package/dist/unstable/cli/GlobalFlag.js.map +1 -1
- package/dist/unstable/cli/HelpDoc.d.ts +8 -8
- package/dist/unstable/cli/HelpDoc.d.ts.map +1 -1
- package/dist/unstable/cli/Param.d.ts +30 -2
- package/dist/unstable/cli/Param.d.ts.map +1 -1
- package/dist/unstable/cli/Param.js +17 -7
- package/dist/unstable/cli/Param.js.map +1 -1
- package/dist/unstable/cli/Prompt.js +8 -2
- package/dist/unstable/cli/Prompt.js.map +1 -1
- package/dist/unstable/cli/internal/command.d.ts +5 -5
- package/dist/unstable/cli/internal/command.d.ts.map +1 -1
- package/dist/unstable/cli/internal/command.js +3 -3
- package/dist/unstable/cli/internal/command.js.map +1 -1
- package/dist/unstable/cli/internal/parser.js +94 -15
- package/dist/unstable/cli/internal/parser.js.map +1 -1
- package/dist/unstable/cluster/ClusterError.d.ts +7 -7
- package/dist/unstable/cluster/ClusterSchema.d.ts +12 -9
- package/dist/unstable/cluster/ClusterSchema.d.ts.map +1 -1
- package/dist/unstable/cluster/ClusterSchema.js +9 -9
- package/dist/unstable/cluster/ClusterSchema.js.map +1 -1
- package/dist/unstable/cluster/ClusterWorkflowEngine.d.ts.map +1 -1
- package/dist/unstable/cluster/ClusterWorkflowEngine.js +13 -14
- package/dist/unstable/cluster/ClusterWorkflowEngine.js.map +1 -1
- package/dist/unstable/cluster/Entity.d.ts +8 -8
- package/dist/unstable/cluster/Entity.d.ts.map +1 -1
- package/dist/unstable/cluster/Entity.js +12 -12
- package/dist/unstable/cluster/Entity.js.map +1 -1
- package/dist/unstable/cluster/EntityAddress.d.ts +2 -2
- package/dist/unstable/cluster/EntityProxy.js +3 -3
- package/dist/unstable/cluster/EntityProxy.js.map +1 -1
- package/dist/unstable/cluster/EntityProxyServer.d.ts.map +1 -1
- package/dist/unstable/cluster/EntityProxyServer.js +4 -4
- package/dist/unstable/cluster/EntityProxyServer.js.map +1 -1
- package/dist/unstable/cluster/EntityResource.d.ts +2 -2
- package/dist/unstable/cluster/EntityResource.d.ts.map +1 -1
- package/dist/unstable/cluster/EntityResource.js +2 -2
- package/dist/unstable/cluster/EntityResource.js.map +1 -1
- package/dist/unstable/cluster/Envelope.d.ts +3 -3
- package/dist/unstable/cluster/HttpRunner.js +2 -2
- package/dist/unstable/cluster/HttpRunner.js.map +1 -1
- package/dist/unstable/cluster/K8sHttpClient.d.ts +4 -4
- package/dist/unstable/cluster/K8sHttpClient.d.ts.map +1 -1
- package/dist/unstable/cluster/K8sHttpClient.js +2 -2
- package/dist/unstable/cluster/K8sHttpClient.js.map +1 -1
- package/dist/unstable/cluster/Message.d.ts +7 -4
- package/dist/unstable/cluster/Message.d.ts.map +1 -1
- package/dist/unstable/cluster/Message.js +5 -5
- package/dist/unstable/cluster/Message.js.map +1 -1
- package/dist/unstable/cluster/MessageStorage.d.ts +14 -14
- package/dist/unstable/cluster/MessageStorage.d.ts.map +1 -1
- package/dist/unstable/cluster/MessageStorage.js +8 -8
- package/dist/unstable/cluster/MessageStorage.js.map +1 -1
- package/dist/unstable/cluster/Reply.d.ts +2 -2
- package/dist/unstable/cluster/Reply.d.ts.map +1 -1
- package/dist/unstable/cluster/Reply.js +5 -5
- package/dist/unstable/cluster/Reply.js.map +1 -1
- package/dist/unstable/cluster/Runner.d.ts +1 -1
- package/dist/unstable/cluster/RunnerAddress.d.ts +1 -1
- package/dist/unstable/cluster/RunnerHealth.d.ts +2 -2
- package/dist/unstable/cluster/RunnerHealth.d.ts.map +1 -1
- package/dist/unstable/cluster/RunnerHealth.js +2 -2
- package/dist/unstable/cluster/RunnerHealth.js.map +1 -1
- package/dist/unstable/cluster/RunnerServer.js +1 -1
- package/dist/unstable/cluster/RunnerServer.js.map +1 -1
- package/dist/unstable/cluster/RunnerStorage.d.ts +12 -12
- package/dist/unstable/cluster/RunnerStorage.d.ts.map +1 -1
- package/dist/unstable/cluster/RunnerStorage.js +3 -3
- package/dist/unstable/cluster/RunnerStorage.js.map +1 -1
- package/dist/unstable/cluster/Runners.d.ts +3 -3
- package/dist/unstable/cluster/Runners.d.ts.map +1 -1
- package/dist/unstable/cluster/Runners.js +7 -7
- package/dist/unstable/cluster/Runners.js.map +1 -1
- package/dist/unstable/cluster/ShardId.d.ts +35 -49
- package/dist/unstable/cluster/ShardId.d.ts.map +1 -1
- package/dist/unstable/cluster/ShardId.js +65 -67
- package/dist/unstable/cluster/ShardId.js.map +1 -1
- package/dist/unstable/cluster/Sharding.d.ts +2 -2
- package/dist/unstable/cluster/Sharding.d.ts.map +1 -1
- package/dist/unstable/cluster/Sharding.js +21 -21
- package/dist/unstable/cluster/Sharding.js.map +1 -1
- package/dist/unstable/cluster/ShardingConfig.d.ts +2 -2
- package/dist/unstable/cluster/ShardingConfig.d.ts.map +1 -1
- package/dist/unstable/cluster/ShardingConfig.js +5 -5
- package/dist/unstable/cluster/ShardingConfig.js.map +1 -1
- package/dist/unstable/cluster/SingletonAddress.d.ts +2 -2
- package/dist/unstable/cluster/Snowflake.d.ts +2 -2
- package/dist/unstable/cluster/Snowflake.d.ts.map +1 -1
- package/dist/unstable/cluster/Snowflake.js +2 -2
- package/dist/unstable/cluster/Snowflake.js.map +1 -1
- package/dist/unstable/cluster/SqlMessageStorage.js +1 -1
- package/dist/unstable/cluster/SqlMessageStorage.js.map +1 -1
- package/dist/unstable/cluster/internal/entityManager.js +15 -14
- package/dist/unstable/cluster/internal/entityManager.js.map +1 -1
- package/dist/unstable/cluster/internal/entityReaper.js +2 -2
- package/dist/unstable/cluster/internal/entityReaper.js.map +1 -1
- package/dist/unstable/cluster/internal/resourceMap.js +3 -3
- package/dist/unstable/cluster/internal/resourceMap.js.map +1 -1
- package/dist/unstable/devtools/DevToolsClient.d.ts +2 -2
- package/dist/unstable/devtools/DevToolsClient.d.ts.map +1 -1
- package/dist/unstable/devtools/DevToolsClient.js +5 -5
- package/dist/unstable/devtools/DevToolsClient.js.map +1 -1
- package/dist/unstable/eventlog/Event.d.ts +0 -6
- package/dist/unstable/eventlog/Event.d.ts.map +1 -1
- package/dist/unstable/eventlog/Event.js +0 -5
- package/dist/unstable/eventlog/Event.js.map +1 -1
- package/dist/unstable/eventlog/EventGroup.d.ts +0 -2
- package/dist/unstable/eventlog/EventGroup.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventGroup.js +0 -2
- package/dist/unstable/eventlog/EventGroup.js.map +1 -1
- package/dist/unstable/eventlog/EventJournal.d.ts +26 -9
- package/dist/unstable/eventlog/EventJournal.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventJournal.js +128 -69
- package/dist/unstable/eventlog/EventJournal.js.map +1 -1
- package/dist/unstable/eventlog/EventLog.d.ts +91 -37
- package/dist/unstable/eventlog/EventLog.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLog.js +223 -149
- package/dist/unstable/eventlog/EventLog.js.map +1 -1
- package/dist/unstable/eventlog/EventLogEncryption.d.ts +11 -9
- package/dist/unstable/eventlog/EventLogEncryption.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogEncryption.js +15 -17
- package/dist/unstable/eventlog/EventLogEncryption.js.map +1 -1
- package/dist/unstable/eventlog/EventLogMessage.d.ts +228 -0
- package/dist/unstable/eventlog/EventLogMessage.d.ts.map +1 -0
- package/dist/unstable/eventlog/EventLogMessage.js +214 -0
- package/dist/unstable/eventlog/EventLogMessage.js.map +1 -0
- package/dist/unstable/eventlog/EventLogRemote.d.ts +111 -193
- package/dist/unstable/eventlog/EventLogRemote.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogRemote.js +167 -322
- package/dist/unstable/eventlog/EventLogRemote.js.map +1 -1
- package/dist/unstable/eventlog/EventLogServer.d.ts +26 -48
- package/dist/unstable/eventlog/EventLogServer.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogServer.js +128 -199
- package/dist/unstable/eventlog/EventLogServer.js.map +1 -1
- package/dist/unstable/eventlog/EventLogServerEncrypted.d.ts +60 -0
- package/dist/unstable/eventlog/EventLogServerEncrypted.d.ts.map +1 -0
- package/dist/unstable/eventlog/EventLogServerEncrypted.js +166 -0
- package/dist/unstable/eventlog/EventLogServerEncrypted.js.map +1 -0
- package/dist/unstable/eventlog/EventLogServerUnencrypted.d.ts +183 -0
- package/dist/unstable/eventlog/EventLogServerUnencrypted.d.ts.map +1 -0
- package/dist/unstable/eventlog/EventLogServerUnencrypted.js +461 -0
- package/dist/unstable/eventlog/EventLogServerUnencrypted.js.map +1 -0
- package/dist/unstable/eventlog/EventLogSessionAuth.d.ts +117 -0
- package/dist/unstable/eventlog/EventLogSessionAuth.d.ts.map +1 -0
- package/dist/unstable/eventlog/EventLogSessionAuth.js +284 -0
- package/dist/unstable/eventlog/EventLogSessionAuth.js.map +1 -0
- package/dist/unstable/eventlog/{SqlEventLogJournal.d.ts → SqlEventJournal.d.ts} +2 -2
- package/dist/unstable/eventlog/SqlEventJournal.d.ts.map +1 -0
- package/dist/unstable/eventlog/{SqlEventLogJournal.js → SqlEventJournal.js} +20 -14
- package/dist/unstable/eventlog/SqlEventJournal.js.map +1 -0
- package/dist/unstable/eventlog/{SqlEventLogServer.d.ts → SqlEventLogServerEncrypted.d.ts} +5 -5
- package/dist/unstable/eventlog/SqlEventLogServerEncrypted.d.ts.map +1 -0
- package/dist/unstable/eventlog/{SqlEventLogServer.js → SqlEventLogServerEncrypted.js} +65 -24
- package/dist/unstable/eventlog/SqlEventLogServerEncrypted.js.map +1 -0
- package/dist/unstable/eventlog/SqlEventLogServerUnencrypted.d.ts +25 -0
- package/dist/unstable/eventlog/SqlEventLogServerUnencrypted.d.ts.map +1 -0
- package/dist/unstable/eventlog/SqlEventLogServerUnencrypted.js +354 -0
- package/dist/unstable/eventlog/SqlEventLogServerUnencrypted.js.map +1 -0
- package/dist/unstable/eventlog/index.d.ts +22 -2
- package/dist/unstable/eventlog/index.d.ts.map +1 -1
- package/dist/unstable/eventlog/index.js +22 -2
- package/dist/unstable/eventlog/index.js.map +1 -1
- package/dist/unstable/eventlog/internal/identityRootSecretDerivation.d.ts +2 -0
- package/dist/unstable/eventlog/internal/identityRootSecretDerivation.d.ts.map +1 -0
- package/dist/unstable/eventlog/internal/identityRootSecretDerivation.js +89 -0
- package/dist/unstable/eventlog/internal/identityRootSecretDerivation.js.map +1 -0
- package/dist/unstable/http/Etag.d.ts +2 -2
- package/dist/unstable/http/Etag.d.ts.map +1 -1
- package/dist/unstable/http/Etag.js +2 -2
- package/dist/unstable/http/Etag.js.map +1 -1
- package/dist/unstable/http/FetchHttpClient.d.ts +6 -3
- package/dist/unstable/http/FetchHttpClient.d.ts.map +1 -1
- package/dist/unstable/http/FetchHttpClient.js +5 -5
- package/dist/unstable/http/FetchHttpClient.js.map +1 -1
- package/dist/unstable/http/Headers.d.ts +5 -2
- package/dist/unstable/http/Headers.d.ts.map +1 -1
- package/dist/unstable/http/Headers.js +3 -3
- package/dist/unstable/http/Headers.js.map +1 -1
- package/dist/unstable/http/HttpClient.d.ts +8 -6
- package/dist/unstable/http/HttpClient.d.ts.map +1 -1
- package/dist/unstable/http/HttpClient.js +6 -6
- package/dist/unstable/http/HttpClient.js.map +1 -1
- package/dist/unstable/http/HttpClientError.d.ts +1 -1
- package/dist/unstable/http/HttpClientRequest.d.ts +2 -2
- package/dist/unstable/http/HttpClientRequest.d.ts.map +1 -1
- package/dist/unstable/http/HttpClientRequest.js +4 -4
- package/dist/unstable/http/HttpClientRequest.js.map +1 -1
- package/dist/unstable/http/HttpEffect.d.ts +6 -6
- package/dist/unstable/http/HttpEffect.d.ts.map +1 -1
- package/dist/unstable/http/HttpEffect.js +24 -24
- package/dist/unstable/http/HttpEffect.js.map +1 -1
- package/dist/unstable/http/HttpIncomingMessage.d.ts +2 -2
- package/dist/unstable/http/HttpIncomingMessage.d.ts.map +1 -1
- package/dist/unstable/http/HttpIncomingMessage.js +2 -2
- package/dist/unstable/http/HttpIncomingMessage.js.map +1 -1
- package/dist/unstable/http/HttpMiddleware.d.ts +3 -3
- package/dist/unstable/http/HttpMiddleware.d.ts.map +1 -1
- package/dist/unstable/http/HttpMiddleware.js +26 -14
- package/dist/unstable/http/HttpMiddleware.js.map +1 -1
- package/dist/unstable/http/HttpPlatform.d.ts +2 -2
- package/dist/unstable/http/HttpPlatform.d.ts.map +1 -1
- package/dist/unstable/http/HttpPlatform.js +2 -2
- package/dist/unstable/http/HttpPlatform.js.map +1 -1
- package/dist/unstable/http/HttpRouter.d.ts +7 -7
- package/dist/unstable/http/HttpRouter.d.ts.map +1 -1
- package/dist/unstable/http/HttpRouter.js +29 -29
- package/dist/unstable/http/HttpRouter.js.map +1 -1
- package/dist/unstable/http/HttpServer.d.ts +2 -2
- package/dist/unstable/http/HttpServer.d.ts.map +1 -1
- package/dist/unstable/http/HttpServer.js +2 -2
- package/dist/unstable/http/HttpServer.js.map +1 -1
- package/dist/unstable/http/HttpServerError.d.ts +3 -3
- package/dist/unstable/http/HttpServerError.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerError.js +3 -3
- package/dist/unstable/http/HttpServerError.js.map +1 -1
- package/dist/unstable/http/HttpServerRequest.d.ts +4 -4
- package/dist/unstable/http/HttpServerRequest.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerRequest.js +6 -6
- package/dist/unstable/http/HttpServerRequest.js.map +1 -1
- package/dist/unstable/http/HttpServerResponse.d.ts +2 -2
- package/dist/unstable/http/HttpServerResponse.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerResponse.js +6 -6
- package/dist/unstable/http/HttpServerResponse.js.map +1 -1
- package/dist/unstable/http/Multipart.d.ts +6 -6
- package/dist/unstable/http/Multipart.d.ts.map +1 -1
- package/dist/unstable/http/Multipart.js +7 -7
- package/dist/unstable/http/Multipart.js.map +1 -1
- package/dist/unstable/httpapi/HttpApi.d.ts +9 -9
- package/dist/unstable/httpapi/HttpApi.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApi.js +8 -8
- package/dist/unstable/httpapi/HttpApi.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiBuilder.d.ts +0 -3
- package/dist/unstable/httpapi/HttpApiBuilder.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiBuilder.js +20 -20
- package/dist/unstable/httpapi/HttpApiBuilder.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiClient.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiClient.js +1 -1
- package/dist/unstable/httpapi/HttpApiClient.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiEndpoint.d.ts +7 -7
- package/dist/unstable/httpapi/HttpApiEndpoint.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiEndpoint.js +4 -4
- package/dist/unstable/httpapi/HttpApiEndpoint.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiError.d.ts +13 -13
- package/dist/unstable/httpapi/HttpApiError.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiGroup.d.ts +8 -8
- package/dist/unstable/httpapi/HttpApiGroup.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiGroup.js +4 -4
- package/dist/unstable/httpapi/HttpApiGroup.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiMiddleware.d.ts +6 -6
- package/dist/unstable/httpapi/HttpApiMiddleware.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiMiddleware.js +5 -5
- package/dist/unstable/httpapi/HttpApiMiddleware.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiSecurity.d.ts +9 -6
- package/dist/unstable/httpapi/HttpApiSecurity.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiSecurity.js +6 -6
- package/dist/unstable/httpapi/HttpApiSecurity.js.map +1 -1
- package/dist/unstable/httpapi/OpenApi.d.ts +15 -15
- package/dist/unstable/httpapi/OpenApi.d.ts.map +1 -1
- package/dist/unstable/httpapi/OpenApi.js +23 -23
- package/dist/unstable/httpapi/OpenApi.js.map +1 -1
- package/dist/unstable/observability/OtlpExporter.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpExporter.js +5 -5
- package/dist/unstable/observability/OtlpExporter.js.map +1 -1
- package/dist/unstable/observability/OtlpMetrics.js +1 -1
- package/dist/unstable/observability/OtlpMetrics.js.map +1 -1
- package/dist/unstable/observability/OtlpSerialization.d.ts +2 -2
- package/dist/unstable/observability/OtlpSerialization.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpSerialization.js +2 -2
- package/dist/unstable/observability/OtlpSerialization.js.map +1 -1
- package/dist/unstable/observability/OtlpTracer.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpTracer.js.map +1 -1
- package/dist/unstable/observability/PrometheusMetrics.d.ts +3 -3
- package/dist/unstable/observability/PrometheusMetrics.d.ts.map +1 -1
- package/dist/unstable/observability/PrometheusMetrics.js +4 -33
- package/dist/unstable/observability/PrometheusMetrics.js.map +1 -1
- package/dist/unstable/persistence/KeyValueStore.d.ts +23 -2
- package/dist/unstable/persistence/KeyValueStore.d.ts.map +1 -1
- package/dist/unstable/persistence/KeyValueStore.js +144 -2
- package/dist/unstable/persistence/KeyValueStore.js.map +1 -1
- package/dist/unstable/persistence/PersistedCache.d.ts +1 -2
- package/dist/unstable/persistence/PersistedCache.d.ts.map +1 -1
- package/dist/unstable/persistence/PersistedCache.js +10 -11
- package/dist/unstable/persistence/PersistedCache.js.map +1 -1
- package/dist/unstable/persistence/PersistedQueue.d.ts +4 -4
- package/dist/unstable/persistence/PersistedQueue.d.ts.map +1 -1
- package/dist/unstable/persistence/PersistedQueue.js +3 -3
- package/dist/unstable/persistence/PersistedQueue.js.map +1 -1
- package/dist/unstable/persistence/Persistence.d.ts +4 -4
- package/dist/unstable/persistence/Persistence.d.ts.map +1 -1
- package/dist/unstable/persistence/Persistence.js +3 -3
- package/dist/unstable/persistence/Persistence.js.map +1 -1
- package/dist/unstable/persistence/RateLimiter.d.ts +6 -6
- package/dist/unstable/persistence/RateLimiter.d.ts.map +1 -1
- package/dist/unstable/persistence/RateLimiter.js +3 -3
- package/dist/unstable/persistence/RateLimiter.js.map +1 -1
- package/dist/unstable/persistence/Redis.d.ts +3 -3
- package/dist/unstable/persistence/Redis.d.ts.map +1 -1
- package/dist/unstable/persistence/Redis.js +2 -2
- package/dist/unstable/persistence/Redis.js.map +1 -1
- package/dist/unstable/process/ChildProcessSpawner.d.ts +45 -2
- package/dist/unstable/process/ChildProcessSpawner.d.ts.map +1 -1
- package/dist/unstable/process/ChildProcessSpawner.js +2 -2
- package/dist/unstable/process/ChildProcessSpawner.js.map +1 -1
- package/dist/unstable/reactivity/Atom.d.ts +36 -36
- package/dist/unstable/reactivity/Atom.d.ts.map +1 -1
- package/dist/unstable/reactivity/Atom.js +9 -9
- package/dist/unstable/reactivity/Atom.js.map +1 -1
- package/dist/unstable/reactivity/AtomHttpApi.d.ts +4 -5
- package/dist/unstable/reactivity/AtomHttpApi.d.ts.map +1 -1
- package/dist/unstable/reactivity/AtomHttpApi.js +4 -4
- package/dist/unstable/reactivity/AtomHttpApi.js.map +1 -1
- package/dist/unstable/reactivity/AtomRegistry.d.ts +2 -2
- package/dist/unstable/reactivity/AtomRegistry.d.ts.map +1 -1
- package/dist/unstable/reactivity/AtomRegistry.js +3 -3
- package/dist/unstable/reactivity/AtomRegistry.js.map +1 -1
- package/dist/unstable/reactivity/AtomRpc.d.ts +4 -5
- package/dist/unstable/reactivity/AtomRpc.d.ts.map +1 -1
- package/dist/unstable/reactivity/AtomRpc.js +5 -5
- package/dist/unstable/reactivity/AtomRpc.js.map +1 -1
- package/dist/unstable/reactivity/Reactivity.d.ts +2 -2
- package/dist/unstable/reactivity/Reactivity.d.ts.map +1 -1
- package/dist/unstable/reactivity/Reactivity.js +6 -6
- package/dist/unstable/reactivity/Reactivity.js.map +1 -1
- package/dist/unstable/rpc/Rpc.d.ts +35 -14
- package/dist/unstable/rpc/Rpc.d.ts.map +1 -1
- package/dist/unstable/rpc/Rpc.js +30 -4
- package/dist/unstable/rpc/Rpc.js.map +1 -1
- package/dist/unstable/rpc/RpcClient.d.ts +21 -21
- package/dist/unstable/rpc/RpcClient.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcClient.js +73 -40
- package/dist/unstable/rpc/RpcClient.js.map +1 -1
- package/dist/unstable/rpc/RpcClientError.d.ts +2 -2
- package/dist/unstable/rpc/RpcGroup.d.ts +8 -8
- package/dist/unstable/rpc/RpcGroup.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcGroup.js +20 -20
- package/dist/unstable/rpc/RpcGroup.js.map +1 -1
- package/dist/unstable/rpc/RpcMiddleware.d.ts +8 -8
- package/dist/unstable/rpc/RpcMiddleware.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcMiddleware.js +5 -5
- package/dist/unstable/rpc/RpcMiddleware.js.map +1 -1
- package/dist/unstable/rpc/RpcSchema.d.ts +3 -3
- package/dist/unstable/rpc/RpcSchema.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcSchema.js +3 -3
- package/dist/unstable/rpc/RpcSchema.js.map +1 -1
- package/dist/unstable/rpc/RpcSerialization.d.ts +2 -2
- package/dist/unstable/rpc/RpcSerialization.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcSerialization.js +2 -2
- package/dist/unstable/rpc/RpcSerialization.js.map +1 -1
- package/dist/unstable/rpc/RpcServer.d.ts +2 -2
- package/dist/unstable/rpc/RpcServer.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcServer.js +21 -20
- package/dist/unstable/rpc/RpcServer.js.map +1 -1
- package/dist/unstable/rpc/RpcWorker.d.ts +2 -2
- package/dist/unstable/rpc/RpcWorker.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcWorker.js +4 -4
- package/dist/unstable/rpc/RpcWorker.js.map +1 -1
- package/dist/unstable/rpc/Utils.d.ts +6 -3
- package/dist/unstable/rpc/Utils.d.ts.map +1 -1
- package/dist/unstable/rpc/Utils.js +46 -5
- package/dist/unstable/rpc/Utils.js.map +1 -1
- package/dist/unstable/schema/Model.d.ts +2 -2
- package/dist/unstable/schema/Model.d.ts.map +1 -1
- package/dist/unstable/schema/Model.js +2 -4
- package/dist/unstable/schema/Model.js.map +1 -1
- package/dist/unstable/schema/VariantSchema.d.ts +1 -1
- package/dist/unstable/schema/VariantSchema.d.ts.map +1 -1
- package/dist/unstable/schema/VariantSchema.js +1 -12
- package/dist/unstable/schema/VariantSchema.js.map +1 -1
- package/dist/unstable/socket/Socket.d.ts +10 -10
- package/dist/unstable/socket/Socket.d.ts.map +1 -1
- package/dist/unstable/socket/Socket.js +9 -9
- package/dist/unstable/socket/Socket.js.map +1 -1
- package/dist/unstable/socket/SocketServer.d.ts +5 -2
- package/dist/unstable/socket/SocketServer.d.ts.map +1 -1
- package/dist/unstable/socket/SocketServer.js +2 -2
- package/dist/unstable/socket/SocketServer.js.map +1 -1
- package/dist/unstable/sql/SqlClient.d.ts +5 -5
- package/dist/unstable/sql/SqlClient.d.ts.map +1 -1
- package/dist/unstable/sql/SqlClient.js +7 -7
- package/dist/unstable/sql/SqlClient.js.map +1 -1
- package/dist/unstable/sql/SqlConnection.d.ts +2 -2
- package/dist/unstable/sql/SqlConnection.d.ts.map +1 -1
- package/dist/unstable/sql/SqlConnection.js +5 -2
- package/dist/unstable/sql/SqlConnection.js.map +1 -1
- package/dist/unstable/sql/SqlError.d.ts +12 -12
- package/dist/unstable/sql/SqlModel.d.ts +8 -9
- package/dist/unstable/sql/SqlModel.d.ts.map +1 -1
- package/dist/unstable/sql/SqlModel.js +9 -35
- package/dist/unstable/sql/SqlModel.js.map +1 -1
- package/dist/unstable/sql/SqlResolver.js +11 -11
- package/dist/unstable/sql/SqlResolver.js.map +1 -1
- package/dist/unstable/sql/Statement.d.ts +2 -2
- package/dist/unstable/sql/Statement.d.ts.map +1 -1
- package/dist/unstable/sql/Statement.js +2 -2
- package/dist/unstable/sql/Statement.js.map +1 -1
- package/dist/unstable/workers/Transferable.d.ts +3 -3
- package/dist/unstable/workers/Transferable.d.ts.map +1 -1
- package/dist/unstable/workers/Transferable.js +7 -7
- package/dist/unstable/workers/Transferable.js.map +1 -1
- package/dist/unstable/workers/Worker.d.ts +3 -3
- package/dist/unstable/workers/Worker.d.ts.map +1 -1
- package/dist/unstable/workers/Worker.js +6 -3
- package/dist/unstable/workers/Worker.js.map +1 -1
- package/dist/unstable/workers/WorkerError.d.ts +5 -5
- package/dist/unstable/workers/WorkerRunner.d.ts +2 -2
- package/dist/unstable/workers/WorkerRunner.d.ts.map +1 -1
- package/dist/unstable/workers/WorkerRunner.js +5 -2
- package/dist/unstable/workers/WorkerRunner.js.map +1 -1
- package/dist/unstable/workflow/Activity.d.ts +7 -7
- package/dist/unstable/workflow/Activity.d.ts.map +1 -1
- package/dist/unstable/workflow/Activity.js +7 -7
- package/dist/unstable/workflow/Activity.js.map +1 -1
- package/dist/unstable/workflow/DurableClock.d.ts +0 -3
- package/dist/unstable/workflow/DurableClock.d.ts.map +1 -1
- package/dist/unstable/workflow/DurableClock.js +3 -3
- package/dist/unstable/workflow/DurableClock.js.map +1 -1
- package/dist/unstable/workflow/DurableDeferred.d.ts +1 -1
- package/dist/unstable/workflow/DurableDeferred.d.ts.map +1 -1
- package/dist/unstable/workflow/DurableDeferred.js +7 -7
- package/dist/unstable/workflow/DurableDeferred.js.map +1 -1
- package/dist/unstable/workflow/Workflow.d.ts +9 -9
- package/dist/unstable/workflow/Workflow.d.ts.map +1 -1
- package/dist/unstable/workflow/Workflow.js +18 -18
- package/dist/unstable/workflow/Workflow.js.map +1 -1
- package/dist/unstable/workflow/WorkflowEngine.d.ts +3 -3
- package/dist/unstable/workflow/WorkflowEngine.d.ts.map +1 -1
- package/dist/unstable/workflow/WorkflowEngine.js +5 -5
- package/dist/unstable/workflow/WorkflowEngine.js.map +1 -1
- package/dist/unstable/workflow/WorkflowProxyServer.d.ts.map +1 -1
- package/dist/unstable/workflow/WorkflowProxyServer.js +4 -4
- package/dist/unstable/workflow/WorkflowProxyServer.js.map +1 -1
- package/package.json +1 -1
- package/src/Cache.ts +18 -46
- package/src/Cause.ts +21 -21
- package/src/Channel.ts +120 -79
- package/src/Clock.ts +2 -2
- package/src/Config.ts +2 -2
- package/src/ConfigProvider.ts +5 -5
- package/src/Console.ts +2 -2
- package/src/{ServiceMap.ts → Context.ts} +337 -340
- package/src/DateTime.ts +2 -2
- package/src/Effect.ts +182 -184
- package/src/Equal.ts +17 -0
- package/src/ErrorReporter.ts +3 -3
- package/src/ExecutionPlan.ts +8 -9
- package/src/Fiber.ts +7 -7
- package/src/FiberHandle.ts +5 -5
- package/src/FiberMap.ts +5 -5
- package/src/FiberSet.ts +5 -5
- package/src/FileSystem.ts +3 -3
- package/src/Hash.ts +2 -2
- package/src/Layer.ts +333 -307
- package/src/LayerMap.ts +27 -26
- package/src/Logger.ts +3 -3
- package/src/ManagedRuntime.ts +32 -32
- package/src/Metric.ts +58 -58
- package/src/Path.ts +2 -2
- package/src/Pool.ts +5 -5
- package/src/PubSub.ts +3 -3
- package/src/Random.ts +2 -2
- package/src/RcMap.ts +14 -14
- package/src/Redactable.ts +146 -72
- package/src/References.ts +14 -14
- package/src/Request.ts +5 -5
- package/src/RequestResolver.ts +6 -7
- package/src/Resource.ts +4 -4
- package/src/Schedule.ts +2 -2
- package/src/Scheduler.ts +4 -4
- package/src/Schema.ts +837 -397
- package/src/SchemaAST.ts +5 -14
- package/src/SchemaGetter.ts +69 -11
- package/src/SchemaTransformation.ts +166 -0
- package/src/Scope.ts +2 -2
- package/src/ScopedCache.ts +5 -5
- package/src/Semaphore.ts +2 -4
- package/src/Sink.ts +9 -9
- package/src/Stdio.ts +2 -2
- package/src/Stream.ts +234 -158
- package/src/Terminal.ts +3 -3
- package/src/Tracer.ts +17 -17
- package/src/Unify.ts +26 -2
- package/src/index.ts +82 -16
- package/src/internal/core.ts +7 -7
- package/src/internal/effect.ts +106 -106
- package/src/internal/layer.ts +7 -7
- package/src/internal/random.ts +2 -2
- package/src/internal/rcRef.ts +10 -10
- package/src/internal/references.ts +13 -13
- package/src/internal/request.ts +8 -8
- package/src/internal/schedule.ts +3 -1
- package/src/internal/schema/representation.ts +8 -1
- package/src/internal/schema/schema.ts +24 -1
- package/src/testing/TestSchema.ts +3 -3
- package/src/unstable/ai/AiError.ts +3 -2
- package/src/unstable/ai/Chat.ts +3 -3
- package/src/unstable/ai/EmbeddingModel.ts +3 -3
- package/src/unstable/ai/IdGenerator.ts +2 -2
- package/src/unstable/ai/LanguageModel.ts +2 -2
- package/src/unstable/ai/McpSchema.ts +11 -9
- package/src/unstable/ai/McpServer.ts +68 -66
- package/src/unstable/ai/Model.ts +8 -8
- package/src/unstable/ai/Prompt.ts +6 -12
- package/src/unstable/ai/Response.ts +6 -8
- package/src/unstable/ai/ResponseIdTracker.ts +2 -4
- package/src/unstable/ai/Telemetry.ts +2 -2
- package/src/unstable/ai/Tokenizer.ts +2 -2
- package/src/unstable/ai/Tool.ts +25 -25
- package/src/unstable/ai/Toolkit.ts +12 -12
- package/src/unstable/cli/Argument.ts +3 -4
- package/src/unstable/cli/CliError.ts +22 -9
- package/src/unstable/cli/CliOutput.ts +2 -2
- package/src/unstable/cli/Command.ts +36 -30
- package/src/unstable/cli/Flag.ts +3 -4
- package/src/unstable/cli/GlobalFlag.ts +3 -3
- package/src/unstable/cli/HelpDoc.ts +8 -8
- package/src/unstable/cli/Param.ts +39 -16
- package/src/unstable/cli/Prompt.ts +13 -6
- package/src/unstable/cli/internal/command.ts +7 -7
- package/src/unstable/cli/internal/parser.ts +130 -21
- package/src/unstable/cluster/ClusterSchema.ts +12 -12
- package/src/unstable/cluster/ClusterWorkflowEngine.ts +14 -15
- package/src/unstable/cluster/Entity.ts +25 -25
- package/src/unstable/cluster/EntityProxy.ts +3 -3
- package/src/unstable/cluster/EntityProxyServer.ts +4 -4
- package/src/unstable/cluster/EntityResource.ts +2 -2
- package/src/unstable/cluster/HttpRunner.ts +2 -2
- package/src/unstable/cluster/K8sHttpClient.ts +2 -2
- package/src/unstable/cluster/Message.ts +8 -8
- package/src/unstable/cluster/MessageStorage.ts +11 -11
- package/src/unstable/cluster/Reply.ts +7 -7
- package/src/unstable/cluster/RunnerHealth.ts +2 -2
- package/src/unstable/cluster/RunnerServer.ts +1 -1
- package/src/unstable/cluster/RunnerStorage.ts +9 -9
- package/src/unstable/cluster/Runners.ts +7 -7
- package/src/unstable/cluster/ShardId.ts +84 -74
- package/src/unstable/cluster/Sharding.ts +26 -26
- package/src/unstable/cluster/ShardingConfig.ts +5 -5
- package/src/unstable/cluster/Snowflake.ts +2 -2
- package/src/unstable/cluster/SqlMessageStorage.ts +1 -1
- package/src/unstable/cluster/internal/entityManager.ts +27 -23
- package/src/unstable/cluster/internal/entityReaper.ts +2 -2
- package/src/unstable/cluster/internal/resourceMap.ts +3 -3
- package/src/unstable/devtools/DevToolsClient.ts +5 -5
- package/src/unstable/eventlog/Event.ts +0 -8
- package/src/unstable/eventlog/EventGroup.ts +0 -4
- package/src/unstable/eventlog/EventJournal.ts +146 -78
- package/src/unstable/eventlog/EventLog.ts +353 -232
- package/src/unstable/eventlog/EventLogEncryption.ts +18 -32
- package/src/unstable/eventlog/EventLogMessage.ts +277 -0
- package/src/unstable/eventlog/EventLogRemote.ts +263 -410
- package/src/unstable/eventlog/EventLogServer.ts +183 -275
- package/src/unstable/eventlog/EventLogServerEncrypted.ts +206 -0
- package/src/unstable/eventlog/EventLogServerUnencrypted.ts +749 -0
- package/src/unstable/eventlog/EventLogSessionAuth.ts +437 -0
- package/src/unstable/eventlog/{SqlEventLogJournal.ts → SqlEventJournal.ts} +26 -18
- package/src/unstable/eventlog/{SqlEventLogServer.ts → SqlEventLogServerEncrypted.ts} +102 -40
- package/src/unstable/eventlog/SqlEventLogServerUnencrypted.ts +500 -0
- package/src/unstable/eventlog/index.ts +27 -2
- package/src/unstable/eventlog/internal/identityRootSecretDerivation.ts +153 -0
- package/src/unstable/http/Etag.ts +2 -2
- package/src/unstable/http/FetchHttpClient.ts +5 -5
- package/src/unstable/http/Headers.ts +4 -4
- package/src/unstable/http/HttpClient.ts +9 -8
- package/src/unstable/http/HttpClientRequest.ts +5 -5
- package/src/unstable/http/HttpEffect.ts +35 -35
- package/src/unstable/http/HttpIncomingMessage.ts +2 -2
- package/src/unstable/http/HttpMiddleware.ts +28 -14
- package/src/unstable/http/HttpPlatform.ts +2 -2
- package/src/unstable/http/HttpRouter.ts +37 -37
- package/src/unstable/http/HttpServer.ts +2 -2
- package/src/unstable/http/HttpServerError.ts +4 -4
- package/src/unstable/http/HttpServerRequest.ts +7 -7
- package/src/unstable/http/HttpServerResponse.ts +8 -8
- package/src/unstable/http/Multipart.ts +8 -8
- package/src/unstable/httpapi/HttpApi.ts +18 -18
- package/src/unstable/httpapi/HttpApiBuilder.ts +20 -20
- package/src/unstable/httpapi/HttpApiClient.ts +4 -4
- package/src/unstable/httpapi/HttpApiEndpoint.ts +14 -14
- package/src/unstable/httpapi/HttpApiGroup.ts +16 -16
- package/src/unstable/httpapi/HttpApiMiddleware.ts +14 -14
- package/src/unstable/httpapi/HttpApiSecurity.ts +13 -13
- package/src/unstable/httpapi/OpenApi.ts +29 -31
- package/src/unstable/observability/OtlpExporter.ts +5 -5
- package/src/unstable/observability/OtlpMetrics.ts +1 -1
- package/src/unstable/observability/OtlpSerialization.ts +2 -2
- package/src/unstable/observability/OtlpTracer.ts +2 -2
- package/src/unstable/observability/PrometheusMetrics.ts +5 -5
- package/src/unstable/persistence/KeyValueStore.ts +226 -3
- package/src/unstable/persistence/PersistedCache.ts +20 -17
- package/src/unstable/persistence/PersistedQueue.ts +3 -3
- package/src/unstable/persistence/Persistence.ts +4 -4
- package/src/unstable/persistence/RateLimiter.ts +3 -3
- package/src/unstable/persistence/Redis.ts +2 -2
- package/src/unstable/process/ChildProcessSpawner.ts +46 -2
- package/src/unstable/reactivity/Atom.ts +79 -79
- package/src/unstable/reactivity/AtomHttpApi.ts +27 -12
- package/src/unstable/reactivity/AtomRegistry.ts +4 -4
- package/src/unstable/reactivity/AtomRpc.ts +20 -9
- package/src/unstable/reactivity/Reactivity.ts +6 -6
- package/src/unstable/rpc/Rpc.ts +59 -21
- package/src/unstable/rpc/RpcClient.ts +103 -54
- package/src/unstable/rpc/RpcGroup.ts +31 -31
- package/src/unstable/rpc/RpcMiddleware.ts +16 -16
- package/src/unstable/rpc/RpcSchema.ts +4 -4
- package/src/unstable/rpc/RpcSerialization.ts +2 -2
- package/src/unstable/rpc/RpcServer.ts +24 -22
- package/src/unstable/rpc/RpcWorker.ts +5 -5
- package/src/unstable/rpc/Utils.ts +63 -4
- package/src/unstable/schema/Model.ts +4 -6
- package/src/unstable/schema/VariantSchema.ts +4 -17
- package/src/unstable/socket/Socket.ts +9 -9
- package/src/unstable/socket/SocketServer.ts +2 -2
- package/src/unstable/sql/SqlClient.ts +11 -11
- package/src/unstable/sql/SqlConnection.ts +2 -2
- package/src/unstable/sql/SqlModel.ts +54 -82
- package/src/unstable/sql/SqlResolver.ts +11 -11
- package/src/unstable/sql/Statement.ts +2 -2
- package/src/unstable/workers/Transferable.ts +15 -17
- package/src/unstable/workers/Worker.ts +4 -4
- package/src/unstable/workers/WorkerRunner.ts +2 -2
- package/src/unstable/workflow/Activity.ts +14 -14
- package/src/unstable/workflow/DurableClock.ts +3 -3
- package/src/unstable/workflow/DurableDeferred.ts +8 -8
- package/src/unstable/workflow/Workflow.ts +23 -23
- package/src/unstable/workflow/WorkflowEngine.ts +6 -6
- package/src/unstable/workflow/WorkflowProxyServer.ts +4 -4
- package/dist/ServiceMap.d.ts +0 -1150
- package/dist/ServiceMap.d.ts.map +0 -1
- package/dist/ServiceMap.js.map +0 -1
- package/dist/unstable/eventlog/SqlEventLogJournal.d.ts.map +0 -1
- package/dist/unstable/eventlog/SqlEventLogJournal.js.map +0 -1
- package/dist/unstable/eventlog/SqlEventLogServer.d.ts.map +0 -1
- package/dist/unstable/eventlog/SqlEventLogServer.js.map +0 -1
package/src/Schema.ts
CHANGED
|
@@ -102,7 +102,7 @@ import * as Equal from "./Equal.ts"
|
|
|
102
102
|
import * as Equivalence from "./Equivalence.ts"
|
|
103
103
|
import * as Exit_ from "./Exit.ts"
|
|
104
104
|
import type { Formatter } from "./Formatter.ts"
|
|
105
|
-
import { format,
|
|
105
|
+
import { format, formatPropertyKey } from "./Formatter.ts"
|
|
106
106
|
import { identity } from "./Function.ts"
|
|
107
107
|
import * as HashMap_ from "./HashMap.ts"
|
|
108
108
|
import * as HashSet_ from "./HashSet.ts"
|
|
@@ -112,6 +112,7 @@ import * as InternalArbitrary from "./internal/schema/arbitrary.ts"
|
|
|
112
112
|
import * as InternalEquivalence from "./internal/schema/equivalence.ts"
|
|
113
113
|
import * as InternalStandard from "./internal/schema/representation.ts"
|
|
114
114
|
import * as InternalSchema from "./internal/schema/schema.ts"
|
|
115
|
+
import { SchemaError } from "./internal/schema/schema.ts"
|
|
115
116
|
import * as InternalToCodec from "./internal/schema/to-codec.ts"
|
|
116
117
|
import * as JsonPatch from "./JsonPatch.ts"
|
|
117
118
|
import * as JsonSchema from "./JsonSchema.ts"
|
|
@@ -169,13 +170,14 @@ export type Mutability = "readonly" | "mutable"
|
|
|
169
170
|
export type ConstructorDefault = "no-default" | "with-default"
|
|
170
171
|
|
|
171
172
|
/**
|
|
172
|
-
* Options for `
|
|
173
|
+
* Options for `makeEffect`, `make`, and Class constructors.
|
|
173
174
|
*
|
|
174
175
|
* When to use:
|
|
175
176
|
* - Pass `disableChecks: true` to skip validation when you trust the data.
|
|
176
177
|
* - Pass `parseOptions` to control error reporting behavior.
|
|
177
178
|
*
|
|
178
|
-
* @see {@link Bottom.
|
|
179
|
+
* @see {@link Bottom.makeEffect}
|
|
180
|
+
* @see {@link Bottom.make}
|
|
179
181
|
*
|
|
180
182
|
* @since 4.0.0
|
|
181
183
|
*/
|
|
@@ -229,7 +231,6 @@ export interface Bottom<
|
|
|
229
231
|
readonly ast: Ast
|
|
230
232
|
readonly "~rebuild.out": RebuildOut
|
|
231
233
|
readonly "~type.parameters": TypeParameters
|
|
232
|
-
readonly "~annotate.in": Annotations.Bottom<T, TypeParameters>
|
|
233
234
|
|
|
234
235
|
readonly "Type": T
|
|
235
236
|
readonly "Encoded": E
|
|
@@ -246,15 +247,16 @@ export interface Bottom<
|
|
|
246
247
|
readonly "~encoded.mutability": EncodedMutability
|
|
247
248
|
readonly "~encoded.optionality": EncodedOptionality
|
|
248
249
|
|
|
249
|
-
annotate(annotations: this["~
|
|
250
|
+
annotate(annotations: Annotations.Bottom<this["Type"], this["~type.parameters"]>): this["~rebuild.out"]
|
|
250
251
|
annotateKey(annotations: Annotations.Key<this["Type"]>): this["~rebuild.out"]
|
|
251
252
|
check(...checks: readonly [AST.Check<this["Type"]>, ...Array<AST.Check<this["Type"]>>]): this["~rebuild.out"]
|
|
252
253
|
rebuild(ast: this["ast"]): this["~rebuild.out"]
|
|
253
254
|
/**
|
|
254
255
|
* @throws {Error} The issue is contained in the error cause.
|
|
255
256
|
*/
|
|
256
|
-
|
|
257
|
+
make(input: this["~type.make.in"], options?: MakeOptions): this["Type"]
|
|
257
258
|
makeOption(input: this["~type.make.in"], options?: MakeOptions): Option_.Option<this["Type"]>
|
|
259
|
+
makeEffect(input: this["~type.make.in"], options?: MakeOptions): Effect.Effect<this["Type"], SchemaError>
|
|
258
260
|
}
|
|
259
261
|
|
|
260
262
|
/**
|
|
@@ -277,9 +279,7 @@ export interface declareConstructor<T, E, TypeParameters extends ReadonlyArray<T
|
|
|
277
279
|
Iso,
|
|
278
280
|
TypeParameters
|
|
279
281
|
>
|
|
280
|
-
{
|
|
281
|
-
readonly "~rebuild.out": this
|
|
282
|
-
}
|
|
282
|
+
{}
|
|
283
283
|
|
|
284
284
|
/**
|
|
285
285
|
* Creates a schema for a **parametric** type (a generic container such as
|
|
@@ -358,7 +358,9 @@ export function declareConstructor<T, E = T, Iso = T>() {
|
|
|
358
358
|
* @category Constructors
|
|
359
359
|
* @since 4.0.0
|
|
360
360
|
*/
|
|
361
|
-
export interface declare<T, Iso = T> extends declareConstructor<T, T, readonly [], Iso> {
|
|
361
|
+
export interface declare<T, Iso = T> extends declareConstructor<T, T, readonly [], Iso> {
|
|
362
|
+
readonly "~rebuild.out": declare<T, Iso>
|
|
363
|
+
}
|
|
362
364
|
|
|
363
365
|
/**
|
|
364
366
|
* Creates a schema for a **non-parametric** opaque type using a type-guard
|
|
@@ -475,7 +477,7 @@ export function revealBottom<S extends Top>(
|
|
|
475
477
|
* @category Annotations
|
|
476
478
|
* @since 4.0.0
|
|
477
479
|
*/
|
|
478
|
-
export function annotate<S extends Top>(annotations: S["~
|
|
480
|
+
export function annotate<S extends Top>(annotations: Annotations.Bottom<S["Type"], S["~type.parameters"]>) {
|
|
479
481
|
return (self: S): S["~rebuild.out"] => {
|
|
480
482
|
return self.annotate(annotations)
|
|
481
483
|
}
|
|
@@ -805,50 +807,36 @@ export function revealCodec<T, E, RD, RE>(codec: Codec<T, E, RD, RE>) {
|
|
|
805
807
|
return codec
|
|
806
808
|
}
|
|
807
809
|
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
export class SchemaError {
|
|
839
|
-
readonly [SchemaErrorTypeId] = SchemaErrorTypeId
|
|
840
|
-
readonly _tag = "SchemaError"
|
|
841
|
-
readonly name: string = "SchemaError"
|
|
842
|
-
readonly issue: Issue.Issue
|
|
843
|
-
constructor(issue: Issue.Issue) {
|
|
844
|
-
this.issue = issue
|
|
845
|
-
}
|
|
846
|
-
get message() {
|
|
847
|
-
return this.issue.toString()
|
|
848
|
-
}
|
|
849
|
-
toString() {
|
|
850
|
-
return `SchemaError(${this.message})`
|
|
851
|
-
}
|
|
810
|
+
export {
|
|
811
|
+
/**
|
|
812
|
+
* Error thrown (or returned as the error channel value) when schema decoding
|
|
813
|
+
* or encoding fails.
|
|
814
|
+
*
|
|
815
|
+
* The `issue` field contains a structured {@link Issue.Issue} tree describing
|
|
816
|
+
* every validation failure, including the path to the problematic value,
|
|
817
|
+
* expected types, and actual values received. `message` renders the issue tree
|
|
818
|
+
* as a human-readable string.
|
|
819
|
+
*
|
|
820
|
+
* Use {@link isSchemaError} to narrow an unknown value to `SchemaError`.
|
|
821
|
+
*
|
|
822
|
+
* **Example** (Catching a SchemaError)
|
|
823
|
+
*
|
|
824
|
+
* ```ts
|
|
825
|
+
* import { Schema } from "effect"
|
|
826
|
+
*
|
|
827
|
+
* try {
|
|
828
|
+
* Schema.decodeUnknownSync(Schema.Number)("not a number")
|
|
829
|
+
* } catch (err) {
|
|
830
|
+
* if (Schema.isSchemaError(err)) {
|
|
831
|
+
* console.log(err.message)
|
|
832
|
+
* // Expected number, actual "not a number"
|
|
833
|
+
* }
|
|
834
|
+
* }
|
|
835
|
+
* ```
|
|
836
|
+
*
|
|
837
|
+
* @since 4.0.0
|
|
838
|
+
*/
|
|
839
|
+
SchemaError
|
|
852
840
|
}
|
|
853
841
|
|
|
854
842
|
/**
|
|
@@ -871,7 +859,7 @@ export class SchemaError {
|
|
|
871
859
|
* @since 4.0.0
|
|
872
860
|
*/
|
|
873
861
|
export function isSchemaError(u: unknown): u is SchemaError {
|
|
874
|
-
return Predicate.hasProperty(u, SchemaErrorTypeId)
|
|
862
|
+
return Predicate.hasProperty(u, InternalSchema.SchemaErrorTypeId)
|
|
875
863
|
}
|
|
876
864
|
|
|
877
865
|
function makeStandardResult<A>(exit: Exit_.Exit<StandardSchemaV1.Result<A>>): StandardSchemaV1.Result<A> {
|
|
@@ -1439,6 +1427,32 @@ export const encodeSync = Parser.encodeSync
|
|
|
1439
1427
|
*/
|
|
1440
1428
|
export const make: <S extends Top>(ast: S["ast"], options?: object) => S = InternalSchema.make
|
|
1441
1429
|
|
|
1430
|
+
/**
|
|
1431
|
+
* Transforms a schema into a class that can be extended with `extends`. The
|
|
1432
|
+
* resulting class inherits the full schema API (e.g. `annotate`) and can define
|
|
1433
|
+
* static methods that reference `this`.
|
|
1434
|
+
*
|
|
1435
|
+
* **Example** (Wrapping a primitive schema)
|
|
1436
|
+
*
|
|
1437
|
+
* ```ts
|
|
1438
|
+
* import { Schema } from "effect"
|
|
1439
|
+
*
|
|
1440
|
+
* class MyString extends Schema.asClass(Schema.String) {
|
|
1441
|
+
* static readonly decodeUnknownSync = Schema.decodeUnknownSync(this)
|
|
1442
|
+
* }
|
|
1443
|
+
*
|
|
1444
|
+
* console.log(MyString.decodeUnknownSync("a"))
|
|
1445
|
+
* // "a"
|
|
1446
|
+
* ```
|
|
1447
|
+
*
|
|
1448
|
+
* @since 4.0.0
|
|
1449
|
+
*/
|
|
1450
|
+
export function asClass<S extends Top>(schema: S): S & { new(_: never): {} } {
|
|
1451
|
+
// oxlint-disable-next-line @typescript-eslint/no-extraneous-class
|
|
1452
|
+
class Class {}
|
|
1453
|
+
return Object.setPrototypeOf(Class, schema)
|
|
1454
|
+
}
|
|
1455
|
+
|
|
1442
1456
|
/**
|
|
1443
1457
|
* Tests if a value is a `Schema`.
|
|
1444
1458
|
*
|
|
@@ -1450,7 +1464,7 @@ export function isSchema(u: unknown): u is Top {
|
|
|
1450
1464
|
}
|
|
1451
1465
|
|
|
1452
1466
|
/**
|
|
1453
|
-
*
|
|
1467
|
+
* Companion type for an exact optional struct key. The key may be absent, but
|
|
1454
1468
|
* when present must match the wrapped schema (no implicit `undefined`).
|
|
1455
1469
|
* Produced by {@link optionalKey}.
|
|
1456
1470
|
*
|
|
@@ -1475,7 +1489,6 @@ export interface optionalKey<S extends Top> extends
|
|
|
1475
1489
|
"optional"
|
|
1476
1490
|
>
|
|
1477
1491
|
{
|
|
1478
|
-
readonly "~rebuild.out": this
|
|
1479
1492
|
readonly schema: S
|
|
1480
1493
|
}
|
|
1481
1494
|
|
|
@@ -1522,12 +1535,14 @@ interface requiredKeyLambda extends Lambda {
|
|
|
1522
1535
|
export const requiredKey = Struct_.lambda<requiredKeyLambda>((self) => self.schema)
|
|
1523
1536
|
|
|
1524
1537
|
/**
|
|
1525
|
-
*
|
|
1538
|
+
* Companion type for an optional struct key that also accepts `undefined`.
|
|
1526
1539
|
* Equivalent to `optionalKey<UndefinedOr<S>>`. Produced by {@link optional}.
|
|
1527
1540
|
*
|
|
1528
1541
|
* @since 4.0.0
|
|
1529
1542
|
*/
|
|
1530
|
-
export interface optional<S extends Top> extends optionalKey<UndefinedOr<S>> {
|
|
1543
|
+
export interface optional<S extends Top> extends optionalKey<UndefinedOr<S>> {
|
|
1544
|
+
readonly "~rebuild.out": optional<S>
|
|
1545
|
+
}
|
|
1531
1546
|
|
|
1532
1547
|
interface optionalLambda extends Lambda {
|
|
1533
1548
|
<S extends Top>(self: S): optional<S>
|
|
@@ -1576,7 +1591,7 @@ interface requiredLambda extends Lambda {
|
|
|
1576
1591
|
export const required = Struct_.lambda<requiredLambda>((self) => self.schema.members[0])
|
|
1577
1592
|
|
|
1578
1593
|
/**
|
|
1579
|
-
*
|
|
1594
|
+
* Companion type for a mutable struct key. The key's property is writable.
|
|
1580
1595
|
* Produced by {@link mutableKey}.
|
|
1581
1596
|
*
|
|
1582
1597
|
* @since 4.0.0
|
|
@@ -1600,7 +1615,6 @@ export interface mutableKey<S extends Top> extends
|
|
|
1600
1615
|
S["~encoded.optionality"]
|
|
1601
1616
|
>
|
|
1602
1617
|
{
|
|
1603
|
-
readonly "~rebuild.out": this
|
|
1604
1618
|
readonly schema: S
|
|
1605
1619
|
}
|
|
1606
1620
|
|
|
@@ -1655,9 +1669,7 @@ export interface toType<S extends Top> extends
|
|
|
1655
1669
|
S["~encoded.mutability"],
|
|
1656
1670
|
S["~encoded.optionality"]
|
|
1657
1671
|
>
|
|
1658
|
-
{
|
|
1659
|
-
readonly "~rebuild.out": this
|
|
1660
|
-
}
|
|
1672
|
+
{}
|
|
1661
1673
|
|
|
1662
1674
|
interface toTypeLambda extends Lambda {
|
|
1663
1675
|
<S extends Top>(self: S): toType<S>
|
|
@@ -1696,9 +1708,7 @@ export interface toEncoded<S extends Top> extends
|
|
|
1696
1708
|
S["~encoded.mutability"],
|
|
1697
1709
|
S["~encoded.optionality"]
|
|
1698
1710
|
>
|
|
1699
|
-
{
|
|
1700
|
-
readonly "~rebuild.out": this
|
|
1701
|
-
}
|
|
1711
|
+
{}
|
|
1702
1712
|
|
|
1703
1713
|
interface toEncodedLambda extends Lambda {
|
|
1704
1714
|
<S extends Top>(self: S): toEncoded<S>
|
|
@@ -1740,7 +1750,6 @@ export interface flip<S extends Top> extends
|
|
|
1740
1750
|
S["~type.optionality"]
|
|
1741
1751
|
>
|
|
1742
1752
|
{
|
|
1743
|
-
readonly "~rebuild.out": this
|
|
1744
1753
|
readonly [FlipTypeId]: typeof FlipTypeId
|
|
1745
1754
|
readonly schema: S
|
|
1746
1755
|
}
|
|
@@ -1780,7 +1789,6 @@ export function flip<S extends Top>(schema: S): flip<S> {
|
|
|
1780
1789
|
* @since 4.0.0
|
|
1781
1790
|
*/
|
|
1782
1791
|
export interface Literal<L extends AST.LiteralValue> extends Bottom<L, L, never, never, AST.Literal, Literal<L>> {
|
|
1783
|
-
readonly "~rebuild.out": this
|
|
1784
1792
|
readonly literal: L
|
|
1785
1793
|
transform<L2 extends AST.LiteralValue>(to: L2): decodeTo<Literal<L2>, Literal<L>>
|
|
1786
1794
|
}
|
|
@@ -1873,7 +1881,6 @@ export interface TemplateLiteral<Parts extends TemplateLiteral.Parts> extends
|
|
|
1873
1881
|
TemplateLiteral<Parts>
|
|
1874
1882
|
>
|
|
1875
1883
|
{
|
|
1876
|
-
readonly "~rebuild.out": this
|
|
1877
1884
|
readonly parts: Parts
|
|
1878
1885
|
}
|
|
1879
1886
|
|
|
@@ -1935,7 +1942,6 @@ export interface TemplateLiteralParser<Parts extends TemplateLiteral.Parts> exte
|
|
|
1935
1942
|
TemplateLiteralParser<Parts>
|
|
1936
1943
|
>
|
|
1937
1944
|
{
|
|
1938
|
-
readonly "~rebuild.out": this
|
|
1939
1945
|
readonly parts: Parts
|
|
1940
1946
|
}
|
|
1941
1947
|
|
|
@@ -1970,7 +1976,6 @@ export function TemplateLiteralParser<const Parts extends TemplateLiteral.Parts>
|
|
|
1970
1976
|
export interface Enum<A extends { [x: string]: string | number }>
|
|
1971
1977
|
extends Bottom<A[keyof A], A[keyof A], never, never, AST.Enum, Enum<A>>
|
|
1972
1978
|
{
|
|
1973
|
-
readonly "~rebuild.out": this
|
|
1974
1979
|
readonly enums: A
|
|
1975
1980
|
}
|
|
1976
1981
|
|
|
@@ -2009,9 +2014,7 @@ export function Enum<A extends { [x: string]: string | number }>(enums: A): Enum
|
|
|
2009
2014
|
* @see {@link Never} for the schema value.
|
|
2010
2015
|
* @since 4.0.0
|
|
2011
2016
|
*/
|
|
2012
|
-
export interface Never extends Bottom<never, never, never, never, AST.Never, Never> {
|
|
2013
|
-
readonly "~rebuild.out": this
|
|
2014
|
-
}
|
|
2017
|
+
export interface Never extends Bottom<never, never, never, never, AST.Never, Never> {}
|
|
2015
2018
|
|
|
2016
2019
|
/**
|
|
2017
2020
|
* Schema for the `never` type. Always fails validation — no value satisfies it.
|
|
@@ -2026,9 +2029,7 @@ export const Never: Never = make(AST.never)
|
|
|
2026
2029
|
* @see {@link Any} for the schema value.
|
|
2027
2030
|
* @since 4.0.0
|
|
2028
2031
|
*/
|
|
2029
|
-
export interface Any extends Bottom<any, any, never, never, AST.Any, Any> {
|
|
2030
|
-
readonly "~rebuild.out": this
|
|
2031
|
-
}
|
|
2032
|
+
export interface Any extends Bottom<any, any, never, never, AST.Any, Any> {}
|
|
2032
2033
|
|
|
2033
2034
|
/**
|
|
2034
2035
|
* Schema for the `any` type. Accepts any value without validation.
|
|
@@ -2044,9 +2045,7 @@ export const Any: Any = make(AST.any)
|
|
|
2044
2045
|
* @see {@link Unknown} for the schema value.
|
|
2045
2046
|
* @since 4.0.0
|
|
2046
2047
|
*/
|
|
2047
|
-
export interface Unknown extends Bottom<unknown, unknown, never, never, AST.Unknown, Unknown> {
|
|
2048
|
-
readonly "~rebuild.out": this
|
|
2049
|
-
}
|
|
2048
|
+
export interface Unknown extends Bottom<unknown, unknown, never, never, AST.Unknown, Unknown> {}
|
|
2050
2049
|
|
|
2051
2050
|
/**
|
|
2052
2051
|
* Schema for the `unknown` type. Accepts any value without validation.
|
|
@@ -2062,9 +2061,7 @@ export const Unknown: Unknown = make(AST.unknown)
|
|
|
2062
2061
|
* @see {@link Null} for the schema value.
|
|
2063
2062
|
* @since 4.0.0
|
|
2064
2063
|
*/
|
|
2065
|
-
export interface Null extends Bottom<null, null, never, never, AST.Null, Null> {
|
|
2066
|
-
readonly "~rebuild.out": this
|
|
2067
|
-
}
|
|
2064
|
+
export interface Null extends Bottom<null, null, never, never, AST.Null, Null> {}
|
|
2068
2065
|
|
|
2069
2066
|
/**
|
|
2070
2067
|
* Schema for the `null` literal. Validates that the input is strictly `null`.
|
|
@@ -2080,9 +2077,7 @@ export const Null: Null = make(AST.null)
|
|
|
2080
2077
|
* @see {@link Undefined} for the schema value.
|
|
2081
2078
|
* @since 4.0.0
|
|
2082
2079
|
*/
|
|
2083
|
-
export interface Undefined extends Bottom<undefined, undefined, never, never, AST.Undefined, Undefined> {
|
|
2084
|
-
readonly "~rebuild.out": this
|
|
2085
|
-
}
|
|
2080
|
+
export interface Undefined extends Bottom<undefined, undefined, never, never, AST.Undefined, Undefined> {}
|
|
2086
2081
|
|
|
2087
2082
|
/**
|
|
2088
2083
|
* Schema for the `undefined` literal. Validates that the input is strictly `undefined`.
|
|
@@ -2098,9 +2093,7 @@ export const Undefined: Undefined = make(AST.undefined)
|
|
|
2098
2093
|
* @see {@link String} for the schema value.
|
|
2099
2094
|
* @since 4.0.0
|
|
2100
2095
|
*/
|
|
2101
|
-
export interface String extends Bottom<string, string, never, never, AST.String, String> {
|
|
2102
|
-
readonly "~rebuild.out": this
|
|
2103
|
-
}
|
|
2096
|
+
export interface String extends Bottom<string, string, never, never, AST.String, String> {}
|
|
2104
2097
|
|
|
2105
2098
|
/**
|
|
2106
2099
|
* Schema for `string` values. Validates that the input is `typeof` `"string"`.
|
|
@@ -2115,9 +2108,7 @@ export const String: String = make(AST.string)
|
|
|
2115
2108
|
* @see {@link Number} for the schema value.
|
|
2116
2109
|
* @since 4.0.0
|
|
2117
2110
|
*/
|
|
2118
|
-
export interface Number extends Bottom<number, number, never, never, AST.Number, Number> {
|
|
2119
|
-
readonly "~rebuild.out": this
|
|
2120
|
-
}
|
|
2111
|
+
export interface Number extends Bottom<number, number, never, never, AST.Number, Number> {}
|
|
2121
2112
|
|
|
2122
2113
|
/**
|
|
2123
2114
|
* Schema for `number` values, including `NaN`, `Infinity`, and `-Infinity`.
|
|
@@ -2138,9 +2129,7 @@ export const Number: Number = make(AST.number)
|
|
|
2138
2129
|
* @see {@link Boolean} for the schema value.
|
|
2139
2130
|
* @since 4.0.0
|
|
2140
2131
|
*/
|
|
2141
|
-
export interface Boolean extends Bottom<boolean, boolean, never, never, AST.Boolean, Boolean> {
|
|
2142
|
-
readonly "~rebuild.out": this
|
|
2143
|
-
}
|
|
2132
|
+
export interface Boolean extends Bottom<boolean, boolean, never, never, AST.Boolean, Boolean> {}
|
|
2144
2133
|
|
|
2145
2134
|
/**
|
|
2146
2135
|
* Schema for `boolean` values. Validates that the input is `typeof` `"boolean"`.
|
|
@@ -2156,9 +2145,7 @@ export const Boolean: Boolean = make(AST.boolean)
|
|
|
2156
2145
|
* @see {@link Symbol} for the schema value.
|
|
2157
2146
|
* @since 4.0.0
|
|
2158
2147
|
*/
|
|
2159
|
-
export interface Symbol extends Bottom<symbol, symbol, never, never, AST.Symbol, Symbol> {
|
|
2160
|
-
readonly "~rebuild.out": this
|
|
2161
|
-
}
|
|
2148
|
+
export interface Symbol extends Bottom<symbol, symbol, never, never, AST.Symbol, Symbol> {}
|
|
2162
2149
|
|
|
2163
2150
|
/**
|
|
2164
2151
|
* Schema for `symbol` values. Validates that the input is `typeof` `"symbol"`.
|
|
@@ -2174,9 +2161,7 @@ export const Symbol: Symbol = make(AST.symbol)
|
|
|
2174
2161
|
* @see {@link BigInt} for the schema value.
|
|
2175
2162
|
* @since 4.0.0
|
|
2176
2163
|
*/
|
|
2177
|
-
export interface BigInt extends Bottom<bigint, bigint, never, never, AST.BigInt, BigInt> {
|
|
2178
|
-
readonly "~rebuild.out": this
|
|
2179
|
-
}
|
|
2164
|
+
export interface BigInt extends Bottom<bigint, bigint, never, never, AST.BigInt, BigInt> {}
|
|
2180
2165
|
|
|
2181
2166
|
/**
|
|
2182
2167
|
* Schema for `bigint` values. Validates that the input is `typeof` `"bigint"`.
|
|
@@ -2191,9 +2176,7 @@ export const BigInt: BigInt = make(AST.bigInt)
|
|
|
2191
2176
|
* @see {@link Void} for the schema value.
|
|
2192
2177
|
* @since 4.0.0
|
|
2193
2178
|
*/
|
|
2194
|
-
export interface Void extends Bottom<void, void, never, never, AST.Void, Void> {
|
|
2195
|
-
readonly "~rebuild.out": this
|
|
2196
|
-
}
|
|
2179
|
+
export interface Void extends Bottom<void, void, never, never, AST.Void, Void> {}
|
|
2197
2180
|
|
|
2198
2181
|
/**
|
|
2199
2182
|
* Schema for the `void` type. Accepts `undefined` as the encoded value.
|
|
@@ -2208,9 +2191,7 @@ export const Void: Void = make(AST.void)
|
|
|
2208
2191
|
* @see {@link ObjectKeyword} for the schema value.
|
|
2209
2192
|
* @since 4.0.0
|
|
2210
2193
|
*/
|
|
2211
|
-
export interface ObjectKeyword extends Bottom<object, object, never, never, AST.ObjectKeyword, ObjectKeyword> {
|
|
2212
|
-
readonly "~rebuild.out": this
|
|
2213
|
-
}
|
|
2194
|
+
export interface ObjectKeyword extends Bottom<object, object, never, never, AST.ObjectKeyword, ObjectKeyword> {}
|
|
2214
2195
|
|
|
2215
2196
|
/**
|
|
2216
2197
|
* Schema for the `object` type. Validates that the input is a non-null object or function
|
|
@@ -2228,9 +2209,7 @@ export const ObjectKeyword: ObjectKeyword = make(AST.objectKeyword)
|
|
|
2228
2209
|
*/
|
|
2229
2210
|
export interface UniqueSymbol<sym extends symbol>
|
|
2230
2211
|
extends Bottom<sym, sym, never, never, AST.UniqueSymbol, UniqueSymbol<sym>>
|
|
2231
|
-
{
|
|
2232
|
-
readonly "~rebuild.out": this
|
|
2233
|
-
}
|
|
2212
|
+
{}
|
|
2234
2213
|
|
|
2235
2214
|
/**
|
|
2236
2215
|
* Creates a schema for a specific symbol. Only that exact symbol satisfies the schema.
|
|
@@ -2381,7 +2360,6 @@ export interface Struct<Fields extends Struct.Fields> extends
|
|
|
2381
2360
|
Struct.Iso<Fields>
|
|
2382
2361
|
>
|
|
2383
2362
|
{
|
|
2384
|
-
readonly "~rebuild.out": this
|
|
2385
2363
|
/**
|
|
2386
2364
|
* The field definitions of this struct. Spread them into a new struct to
|
|
2387
2365
|
* reuse fields across schemas.
|
|
@@ -2508,6 +2486,22 @@ export function fieldsAssign<const NewFields extends Struct.Fields>(fields: NewF
|
|
|
2508
2486
|
return Struct_.lambda<fieldsAssign<NewFields>>((struct) => struct.mapFields(Struct_.assign(fields)))
|
|
2509
2487
|
}
|
|
2510
2488
|
|
|
2489
|
+
interface encodeKeys<
|
|
2490
|
+
S extends Top & { readonly fields: Struct.Fields },
|
|
2491
|
+
M extends { readonly [K in keyof S["fields"]]?: PropertyKey }
|
|
2492
|
+
> extends
|
|
2493
|
+
decodeTo<
|
|
2494
|
+
S,
|
|
2495
|
+
Struct<
|
|
2496
|
+
{
|
|
2497
|
+
[
|
|
2498
|
+
K in keyof S["fields"] as K extends keyof M ? M[K] extends PropertyKey ? M[K] : K : K
|
|
2499
|
+
]: toEncoded<S["fields"][K]>
|
|
2500
|
+
}
|
|
2501
|
+
>
|
|
2502
|
+
>
|
|
2503
|
+
{}
|
|
2504
|
+
|
|
2511
2505
|
/**
|
|
2512
2506
|
* Renames struct keys in the encoded form without changing the decoded type.
|
|
2513
2507
|
*
|
|
@@ -2536,18 +2530,7 @@ export function encodeKeys<
|
|
|
2536
2530
|
S extends Top & { readonly fields: Struct.Fields },
|
|
2537
2531
|
const M extends { readonly [K in keyof S["fields"]]?: PropertyKey }
|
|
2538
2532
|
>(mapping: M) {
|
|
2539
|
-
return function(
|
|
2540
|
-
self: S
|
|
2541
|
-
): decodeTo<
|
|
2542
|
-
S,
|
|
2543
|
-
Struct<
|
|
2544
|
-
{
|
|
2545
|
-
[
|
|
2546
|
-
K in keyof S["fields"] as K extends keyof M ? M[K] extends PropertyKey ? M[K] : K : K
|
|
2547
|
-
]: toEncoded<S["fields"][K]>
|
|
2548
|
-
}
|
|
2549
|
-
>
|
|
2550
|
-
> {
|
|
2533
|
+
return function(self: S): encodeKeys<S, M> {
|
|
2551
2534
|
const fields: any = {}
|
|
2552
2535
|
const reverseMapping: any = {}
|
|
2553
2536
|
for (const k in self.fields) {
|
|
@@ -2565,7 +2548,7 @@ export function encodeKeys<
|
|
|
2565
2548
|
decode: Struct_.renameKeys(reverseMapping),
|
|
2566
2549
|
encode: Struct_.renameKeys(mapping)
|
|
2567
2550
|
})
|
|
2568
|
-
))
|
|
2551
|
+
)) as any
|
|
2569
2552
|
}
|
|
2570
2553
|
}
|
|
2571
2554
|
|
|
@@ -2709,7 +2692,7 @@ export declare namespace Record {
|
|
|
2709
2692
|
}
|
|
2710
2693
|
|
|
2711
2694
|
/**
|
|
2712
|
-
*
|
|
2695
|
+
* Companion type for a key-value record (map) with a typed key and value schema.
|
|
2713
2696
|
* Produced by {@link Record}.
|
|
2714
2697
|
*
|
|
2715
2698
|
* @since 4.0.0
|
|
@@ -2726,7 +2709,6 @@ export interface $Record<Key extends Record.Key, Value extends Top> extends
|
|
|
2726
2709
|
Record.Iso<Key, Value>
|
|
2727
2710
|
>
|
|
2728
2711
|
{
|
|
2729
|
-
readonly "~rebuild.out": this
|
|
2730
2712
|
readonly key: Key
|
|
2731
2713
|
readonly value: Value
|
|
2732
2714
|
}
|
|
@@ -2835,7 +2817,7 @@ export declare namespace StructWithRest {
|
|
|
2835
2817
|
}
|
|
2836
2818
|
|
|
2837
2819
|
/**
|
|
2838
|
-
*
|
|
2820
|
+
* Companion type for a struct combined with one or more record schemas. Produced
|
|
2839
2821
|
* by {@link StructWithRest}.
|
|
2840
2822
|
*
|
|
2841
2823
|
* @since 4.0.0
|
|
@@ -2855,7 +2837,6 @@ export interface StructWithRest<
|
|
|
2855
2837
|
Simplify<StructWithRest.Iso<S, Records>>
|
|
2856
2838
|
>
|
|
2857
2839
|
{
|
|
2858
|
-
readonly "~rebuild.out": this
|
|
2859
2840
|
readonly schema: S
|
|
2860
2841
|
readonly records: Records
|
|
2861
2842
|
}
|
|
@@ -2981,7 +2962,7 @@ export declare namespace Tuple {
|
|
|
2981
2962
|
}
|
|
2982
2963
|
|
|
2983
2964
|
/**
|
|
2984
|
-
*
|
|
2965
|
+
* Companion type for a fixed-length tuple. Produced by {@link Tuple}.
|
|
2985
2966
|
*
|
|
2986
2967
|
* @since 4.0.0
|
|
2987
2968
|
*/
|
|
@@ -2997,7 +2978,6 @@ export interface Tuple<Elements extends Tuple.Elements> extends
|
|
|
2997
2978
|
Tuple.Iso<Elements>
|
|
2998
2979
|
>
|
|
2999
2980
|
{
|
|
3000
|
-
readonly "~rebuild.out": this
|
|
3001
2981
|
readonly elements: Elements
|
|
3002
2982
|
/**
|
|
3003
2983
|
* Returns a new tuple with the elements modified by the provided function.
|
|
@@ -3132,7 +3112,7 @@ export declare namespace TupleWithRest {
|
|
|
3132
3112
|
}
|
|
3133
3113
|
|
|
3134
3114
|
/**
|
|
3135
|
-
*
|
|
3115
|
+
* Companion type for a tuple with additional rest elements. Produced by
|
|
3136
3116
|
* {@link TupleWithRest}.
|
|
3137
3117
|
*
|
|
3138
3118
|
* @since 4.0.0
|
|
@@ -3152,7 +3132,6 @@ export interface TupleWithRest<
|
|
|
3152
3132
|
TupleWithRest.Iso<S["Iso"], Rest>
|
|
3153
3133
|
>
|
|
3154
3134
|
{
|
|
3155
|
-
readonly "~rebuild.out": this
|
|
3156
3135
|
readonly schema: S
|
|
3157
3136
|
readonly rest: Rest
|
|
3158
3137
|
}
|
|
@@ -3189,7 +3168,7 @@ export function TupleWithRest<S extends Tuple<Tuple.Elements>, const Rest extend
|
|
|
3189
3168
|
}
|
|
3190
3169
|
|
|
3191
3170
|
/**
|
|
3192
|
-
*
|
|
3171
|
+
* Companion type for a `ReadonlyArray`. Produced by {@link ArraySchema}.
|
|
3193
3172
|
*
|
|
3194
3173
|
* @since 4.0.0
|
|
3195
3174
|
*/
|
|
@@ -3205,7 +3184,6 @@ export interface $Array<S extends Top> extends
|
|
|
3205
3184
|
ReadonlyArray<S["Iso"]>
|
|
3206
3185
|
>
|
|
3207
3186
|
{
|
|
3208
|
-
readonly "~rebuild.out": this
|
|
3209
3187
|
readonly schema: S
|
|
3210
3188
|
}
|
|
3211
3189
|
|
|
@@ -3243,7 +3221,7 @@ export {
|
|
|
3243
3221
|
}
|
|
3244
3222
|
|
|
3245
3223
|
/**
|
|
3246
|
-
*
|
|
3224
|
+
* Companion type for a non-empty `ReadonlyArray`. Produced by {@link NonEmptyArray}.
|
|
3247
3225
|
*
|
|
3248
3226
|
* @since 4.0.0
|
|
3249
3227
|
*/
|
|
@@ -3259,7 +3237,6 @@ export interface NonEmptyArray<S extends Top> extends
|
|
|
3259
3237
|
readonly [S["Iso"], ...Array<S["Iso"]>]
|
|
3260
3238
|
>
|
|
3261
3239
|
{
|
|
3262
|
-
readonly "~rebuild.out": this
|
|
3263
3240
|
readonly schema: S
|
|
3264
3241
|
}
|
|
3265
3242
|
|
|
@@ -3294,7 +3271,9 @@ export const NonEmptyArray = Struct_.lambda<NonEmptyArrayLambda>((schema) =>
|
|
|
3294
3271
|
* @category Arrays
|
|
3295
3272
|
* @since 4.0.0
|
|
3296
3273
|
*/
|
|
3297
|
-
export interface ArrayEnsure<S extends Top> extends decodeTo<$Array<toType<S>>, Union<readonly [S, $Array<S>]>> {
|
|
3274
|
+
export interface ArrayEnsure<S extends Top> extends decodeTo<$Array<toType<S>>, Union<readonly [S, $Array<S>]>> {
|
|
3275
|
+
readonly "~rebuild.out": ArrayEnsure<S>
|
|
3276
|
+
}
|
|
3298
3277
|
|
|
3299
3278
|
/**
|
|
3300
3279
|
* Decodes a single value or an array of values into an array.
|
|
@@ -3321,11 +3300,13 @@ export function ArrayEnsure<S extends Top>(schema: S): ArrayEnsure<S> {
|
|
|
3321
3300
|
}
|
|
3322
3301
|
|
|
3323
3302
|
/**
|
|
3324
|
-
*
|
|
3303
|
+
* Companion type for an array with unique elements. Produced by {@link UniqueArray}.
|
|
3325
3304
|
*
|
|
3326
3305
|
* @since 4.0.0
|
|
3327
3306
|
*/
|
|
3328
|
-
export interface UniqueArray<S extends Top> extends $Array<S> {
|
|
3307
|
+
export interface UniqueArray<S extends Top> extends $Array<S> {
|
|
3308
|
+
readonly "~rebuild.out": UniqueArray<S>
|
|
3309
|
+
}
|
|
3329
3310
|
|
|
3330
3311
|
/**
|
|
3331
3312
|
* Returns a new array schema that ensures all elements are unique.
|
|
@@ -3366,7 +3347,6 @@ export interface mutable<S extends Top & { readonly "ast": AST.Arrays }> extends
|
|
|
3366
3347
|
S["~encoded.optionality"]
|
|
3367
3348
|
>
|
|
3368
3349
|
{
|
|
3369
|
-
readonly "~rebuild.out": this
|
|
3370
3350
|
readonly schema: S
|
|
3371
3351
|
}
|
|
3372
3352
|
|
|
@@ -3397,7 +3377,7 @@ export const mutable = Struct_.lambda<mutableLambda>((schema) => {
|
|
|
3397
3377
|
})
|
|
3398
3378
|
|
|
3399
3379
|
/**
|
|
3400
|
-
*
|
|
3380
|
+
* Companion type for a union of multiple schemas. Produced by {@link Union}.
|
|
3401
3381
|
*
|
|
3402
3382
|
* @since 4.0.0
|
|
3403
3383
|
*/
|
|
@@ -3413,7 +3393,6 @@ export interface Union<Members extends ReadonlyArray<Top>> extends
|
|
|
3413
3393
|
{ [K in keyof Members]: Members[K]["Iso"] }[number]
|
|
3414
3394
|
>
|
|
3415
3395
|
{
|
|
3416
|
-
readonly "~rebuild.out": this
|
|
3417
3396
|
readonly members: Members
|
|
3418
3397
|
/**
|
|
3419
3398
|
* Returns a new union with the members modified by the provided function.
|
|
@@ -3497,7 +3476,6 @@ export function Union<const Members extends ReadonlyArray<Top>>(
|
|
|
3497
3476
|
export interface Literals<L extends ReadonlyArray<AST.LiteralValue>>
|
|
3498
3477
|
extends Bottom<L[number], L[number], never, never, AST.Union<AST.Literal>, Literals<L>>
|
|
3499
3478
|
{
|
|
3500
|
-
readonly "~rebuild.out": this
|
|
3501
3479
|
readonly literals: L
|
|
3502
3480
|
readonly members: { readonly [K in keyof L]: Literal<L[K]> }
|
|
3503
3481
|
/**
|
|
@@ -3550,11 +3528,13 @@ export function Literals<const L extends ReadonlyArray<AST.LiteralValue>>(litera
|
|
|
3550
3528
|
}
|
|
3551
3529
|
|
|
3552
3530
|
/**
|
|
3553
|
-
*
|
|
3531
|
+
* Companion type for `S | null`. Produced by {@link NullOr}.
|
|
3554
3532
|
*
|
|
3555
3533
|
* @since 4.0.0
|
|
3556
3534
|
*/
|
|
3557
|
-
export interface NullOr<S extends Top> extends Union<readonly [S, Null]> {
|
|
3535
|
+
export interface NullOr<S extends Top> extends Union<readonly [S, Null]> {
|
|
3536
|
+
readonly "~rebuild.out": NullOr<S>
|
|
3537
|
+
}
|
|
3558
3538
|
|
|
3559
3539
|
interface NullOrLambda extends Lambda {
|
|
3560
3540
|
<S extends Top>(self: S): NullOr<S>
|
|
@@ -3570,11 +3550,13 @@ interface NullOrLambda extends Lambda {
|
|
|
3570
3550
|
export const NullOr = Struct_.lambda<NullOrLambda>((self) => Union([self, Null]))
|
|
3571
3551
|
|
|
3572
3552
|
/**
|
|
3573
|
-
*
|
|
3553
|
+
* Companion type for `S | undefined`. Produced by {@link UndefinedOr}.
|
|
3574
3554
|
*
|
|
3575
3555
|
* @since 4.0.0
|
|
3576
3556
|
*/
|
|
3577
|
-
export interface UndefinedOr<S extends Top> extends Union<readonly [S, Undefined]> {
|
|
3557
|
+
export interface UndefinedOr<S extends Top> extends Union<readonly [S, Undefined]> {
|
|
3558
|
+
readonly "~rebuild.out": UndefinedOr<S>
|
|
3559
|
+
}
|
|
3578
3560
|
|
|
3579
3561
|
interface UndefinedOrLambda extends Lambda {
|
|
3580
3562
|
<S extends Top>(self: S): UndefinedOr<S>
|
|
@@ -3590,10 +3572,12 @@ interface UndefinedOrLambda extends Lambda {
|
|
|
3590
3572
|
export const UndefinedOr = Struct_.lambda<UndefinedOrLambda>((self) => Union([self, Undefined]))
|
|
3591
3573
|
|
|
3592
3574
|
/**
|
|
3593
|
-
*
|
|
3575
|
+
* Companion type for `S | null | undefined`. Produced by {@link NullishOr}.
|
|
3594
3576
|
* @since 4.0.0
|
|
3595
3577
|
*/
|
|
3596
|
-
export interface NullishOr<S extends Top> extends Union<readonly [S, Null, Undefined]> {
|
|
3578
|
+
export interface NullishOr<S extends Top> extends Union<readonly [S, Null, Undefined]> {
|
|
3579
|
+
readonly "~rebuild.out": NullishOr<S>
|
|
3580
|
+
}
|
|
3597
3581
|
|
|
3598
3582
|
interface NullishOrLambda extends Lambda {
|
|
3599
3583
|
<S extends Top>(self: S): NullishOr<S>
|
|
@@ -3629,9 +3613,7 @@ export interface suspend<S extends Top> extends
|
|
|
3629
3613
|
S["~encoded.mutability"],
|
|
3630
3614
|
S["~encoded.optionality"]
|
|
3631
3615
|
>
|
|
3632
|
-
{
|
|
3633
|
-
readonly "~rebuild.out": this
|
|
3634
|
-
}
|
|
3616
|
+
{}
|
|
3635
3617
|
|
|
3636
3618
|
/**
|
|
3637
3619
|
* Creates a suspended schema that defers evaluation until needed. This is
|
|
@@ -3705,7 +3687,6 @@ export interface refine<T extends S["Type"], S extends Top> extends
|
|
|
3705
3687
|
S["~encoded.optionality"]
|
|
3706
3688
|
>
|
|
3707
3689
|
{
|
|
3708
|
-
readonly "~rebuild.out": this
|
|
3709
3690
|
readonly schema: S
|
|
3710
3691
|
}
|
|
3711
3692
|
|
|
@@ -3751,7 +3732,6 @@ export interface brand<S extends Top, B> extends
|
|
|
3751
3732
|
S["~encoded.optionality"]
|
|
3752
3733
|
>
|
|
3753
3734
|
{
|
|
3754
|
-
readonly "~rebuild.out": this
|
|
3755
3735
|
readonly schema: S
|
|
3756
3736
|
readonly identifier: string
|
|
3757
3737
|
}
|
|
@@ -3811,7 +3791,6 @@ export interface middlewareDecoding<S extends Top, RD> extends
|
|
|
3811
3791
|
S["~encoded.optionality"]
|
|
3812
3792
|
>
|
|
3813
3793
|
{
|
|
3814
|
-
readonly "~rebuild.out": this
|
|
3815
3794
|
readonly schema: S
|
|
3816
3795
|
}
|
|
3817
3796
|
|
|
@@ -3878,7 +3857,6 @@ export interface middlewareEncoding<S extends Top, RE> extends
|
|
|
3878
3857
|
S["~encoded.optionality"]
|
|
3879
3858
|
>
|
|
3880
3859
|
{
|
|
3881
|
-
readonly "~rebuild.out": this
|
|
3882
3860
|
readonly schema: S
|
|
3883
3861
|
}
|
|
3884
3862
|
|
|
@@ -4009,7 +3987,6 @@ export interface decodeTo<To extends Top, From extends Top, RD = never, RE = nev
|
|
|
4009
3987
|
From["~encoded.optionality"]
|
|
4010
3988
|
>
|
|
4011
3989
|
{
|
|
4012
|
-
readonly "~rebuild.out": this
|
|
4013
3990
|
readonly from: From
|
|
4014
3991
|
readonly to: To
|
|
4015
3992
|
}
|
|
@@ -4256,52 +4233,40 @@ export interface withConstructorDefault<S extends Top & WithoutConstructorDefaul
|
|
|
4256
4233
|
S["~encoded.optionality"]
|
|
4257
4234
|
>
|
|
4258
4235
|
{
|
|
4259
|
-
readonly "~rebuild.out": this
|
|
4260
4236
|
readonly schema: S
|
|
4261
4237
|
}
|
|
4262
4238
|
|
|
4263
4239
|
/**
|
|
4264
4240
|
* Attaches a constructor default value to a schema field.
|
|
4265
4241
|
*
|
|
4266
|
-
*
|
|
4267
|
-
*
|
|
4268
|
-
* Return `Option.some(value)` to supply a default, or `Option.none()` to leave the
|
|
4269
|
-
* field required. An `Effect` may be returned for async or service-dependent defaults.
|
|
4270
|
-
*
|
|
4271
|
-
* Constructor defaults are applied only during `makeUnsafe` / `make`, not during
|
|
4272
|
-
* decoding or encoding.
|
|
4242
|
+
* Constructor defaults are applied only during `make*`, not during decoding or
|
|
4243
|
+
* encoding.
|
|
4273
4244
|
*
|
|
4274
4245
|
* **Example** (Optional field with a static default)
|
|
4275
4246
|
*
|
|
4276
4247
|
* ```ts
|
|
4277
|
-
* import {
|
|
4248
|
+
* import { Effect, Schema } from "effect"
|
|
4278
4249
|
*
|
|
4279
4250
|
* const MySchema = Schema.Struct({
|
|
4280
4251
|
* name: Schema.String.pipe(
|
|
4281
4252
|
* Schema.optionalKey,
|
|
4282
|
-
* Schema.withConstructorDefault(
|
|
4253
|
+
* Schema.withConstructorDefault(Effect.succeed("anonymous"))
|
|
4283
4254
|
* )
|
|
4284
4255
|
* })
|
|
4285
4256
|
*
|
|
4286
|
-
* const value = MySchema.
|
|
4257
|
+
* const value = MySchema.make({})
|
|
4287
4258
|
* // value: { name: "anonymous" }
|
|
4288
4259
|
* ```
|
|
4289
4260
|
*
|
|
4290
4261
|
* @since 4.0.0
|
|
4291
4262
|
*/
|
|
4292
4263
|
export function withConstructorDefault<S extends Top & WithoutConstructorDefault>(
|
|
4293
|
-
|
|
4294
|
-
|
|
4295
|
-
|
|
4296
|
-
// it makes easier to define the default value if there are nested defaults
|
|
4297
|
-
) => Option_.Option<S["~type.make.in"]> | Effect.Effect<Option_.Option<S["~type.make.in"]>>
|
|
4264
|
+
// `S["~type.make.in"]` instead of `S["Type"]` is intentional here because
|
|
4265
|
+
// it makes easier to define the default value if there are nested defaults
|
|
4266
|
+
defaultValue: Effect.Effect<S["~type.make.in"]>
|
|
4298
4267
|
) {
|
|
4299
|
-
return (schema: S): withConstructorDefault<S> =>
|
|
4300
|
-
|
|
4301
|
-
AST.withConstructorDefault(schema.ast, defaultValue),
|
|
4302
|
-
{ schema }
|
|
4303
|
-
)
|
|
4304
|
-
}
|
|
4268
|
+
return (schema: S): withConstructorDefault<S> =>
|
|
4269
|
+
make(AST.withConstructorDefault(schema.ast, defaultValue), { schema })
|
|
4305
4270
|
}
|
|
4306
4271
|
|
|
4307
4272
|
/**
|
|
@@ -4310,7 +4275,9 @@ export function withConstructorDefault<S extends Top & WithoutConstructorDefault
|
|
|
4310
4275
|
* @see {@link withDecodingDefaultKey} for the constructor
|
|
4311
4276
|
* @since 4.0.0
|
|
4312
4277
|
*/
|
|
4313
|
-
export interface withDecodingDefaultKey<S extends Top> extends decodeTo<S, optionalKey<toEncoded<S>>> {
|
|
4278
|
+
export interface withDecodingDefaultKey<S extends Top> extends decodeTo<S, optionalKey<toEncoded<S>>> {
|
|
4279
|
+
readonly "~rebuild.out": withDecodingDefaultKey<S>
|
|
4280
|
+
}
|
|
4314
4281
|
|
|
4315
4282
|
/**
|
|
4316
4283
|
* Options for {@link withDecodingDefaultKey} and {@link withDecodingDefault}.
|
|
@@ -4342,10 +4309,10 @@ export type DecodingDefaultOptions = {
|
|
|
4342
4309
|
* **Example** (Default for a missing struct key)
|
|
4343
4310
|
*
|
|
4344
4311
|
* ```ts
|
|
4345
|
-
* import { Schema } from "effect"
|
|
4312
|
+
* import { Effect, Schema } from "effect"
|
|
4346
4313
|
*
|
|
4347
4314
|
* const MySchema = Schema.Struct({
|
|
4348
|
-
* name: Schema.String.pipe(Schema.withDecodingDefaultKey((
|
|
4315
|
+
* name: Schema.String.pipe(Schema.withDecodingDefaultKey(Effect.succeed("anonymous")))
|
|
4349
4316
|
* })
|
|
4350
4317
|
*
|
|
4351
4318
|
* const result = Schema.decodeUnknownSync(MySchema)({})
|
|
@@ -4356,7 +4323,7 @@ export type DecodingDefaultOptions = {
|
|
|
4356
4323
|
* @since 4.0.0
|
|
4357
4324
|
*/
|
|
4358
4325
|
export function withDecodingDefaultKey<S extends Top>(
|
|
4359
|
-
defaultValue:
|
|
4326
|
+
defaultValue: Effect.Effect<S["Encoded"]>,
|
|
4360
4327
|
options?: DecodingDefaultOptions
|
|
4361
4328
|
) {
|
|
4362
4329
|
const encode = options?.encodingStrategy === "omit" ? Getter.omit() : Getter.passthrough()
|
|
@@ -4374,7 +4341,9 @@ export function withDecodingDefaultKey<S extends Top>(
|
|
|
4374
4341
|
* @see {@link withDecodingDefault} for the constructor
|
|
4375
4342
|
* @since 4.0.0
|
|
4376
4343
|
*/
|
|
4377
|
-
export interface withDecodingDefault<S extends Top> extends decodeTo<S, optional<toEncoded<S>>> {
|
|
4344
|
+
export interface withDecodingDefault<S extends Top> extends decodeTo<S, optional<toEncoded<S>>> {
|
|
4345
|
+
readonly "~rebuild.out": withDecodingDefault<S>
|
|
4346
|
+
}
|
|
4378
4347
|
|
|
4379
4348
|
/**
|
|
4380
4349
|
* **Options**
|
|
@@ -4396,10 +4365,10 @@ export interface withDecodingDefault<S extends Top> extends decodeTo<S, optional
|
|
|
4396
4365
|
* **Example** (Default for an optional field value)
|
|
4397
4366
|
*
|
|
4398
4367
|
* ```ts
|
|
4399
|
-
* import { Schema } from "effect"
|
|
4368
|
+
* import { Effect, Schema } from "effect"
|
|
4400
4369
|
*
|
|
4401
4370
|
* const MySchema = Schema.Struct({
|
|
4402
|
-
* name: Schema.String.pipe(Schema.optional, Schema.withDecodingDefault((
|
|
4371
|
+
* name: Schema.String.pipe(Schema.optional, Schema.withDecodingDefault(Effect.succeed("anonymous")))
|
|
4403
4372
|
* })
|
|
4404
4373
|
*
|
|
4405
4374
|
* const result = Schema.decodeUnknownSync(MySchema)({ name: undefined })
|
|
@@ -4410,7 +4379,7 @@ export interface withDecodingDefault<S extends Top> extends decodeTo<S, optional
|
|
|
4410
4379
|
* @since 4.0.0
|
|
4411
4380
|
*/
|
|
4412
4381
|
export function withDecodingDefault<S extends Top>(
|
|
4413
|
-
defaultValue:
|
|
4382
|
+
defaultValue: Effect.Effect<S["Encoded"]>,
|
|
4414
4383
|
options?: DecodingDefaultOptions
|
|
4415
4384
|
) {
|
|
4416
4385
|
const encode = options?.encodingStrategy === "omit" ? Getter.omit() : Getter.passthrough()
|
|
@@ -4434,7 +4403,7 @@ export interface tag<Tag extends AST.LiteralValue> extends withConstructorDefaul
|
|
|
4434
4403
|
|
|
4435
4404
|
/**
|
|
4436
4405
|
* Combines a {@link Literal} schema with {@link withConstructorDefault}, making it ideal
|
|
4437
|
-
* for discriminator fields in tagged unions. When constructing via `
|
|
4406
|
+
* for discriminator fields in tagged unions. When constructing via `make`, the
|
|
4438
4407
|
* `_tag` field can be omitted and will be filled automatically.
|
|
4439
4408
|
*
|
|
4440
4409
|
* **Example** (Discriminated union tag)
|
|
@@ -4444,8 +4413,8 @@ export interface tag<Tag extends AST.LiteralValue> extends withConstructorDefaul
|
|
|
4444
4413
|
*
|
|
4445
4414
|
* const A = Schema.Struct({ _tag: Schema.tag("A"), value: Schema.Number })
|
|
4446
4415
|
*
|
|
4447
|
-
* // _tag is optional in
|
|
4448
|
-
* const a = A.
|
|
4416
|
+
* // _tag is optional in make, auto-filled to "A"
|
|
4417
|
+
* const a = A.make({ value: 42 })
|
|
4449
4418
|
* // a: { _tag: "A", value: 42 }
|
|
4450
4419
|
* ```
|
|
4451
4420
|
*
|
|
@@ -4454,7 +4423,7 @@ export interface tag<Tag extends AST.LiteralValue> extends withConstructorDefaul
|
|
|
4454
4423
|
* @since 4.0.0
|
|
4455
4424
|
*/
|
|
4456
4425
|
export function tag<Tag extends AST.LiteralValue>(literal: Tag): tag<Tag> {
|
|
4457
|
-
return Literal(literal).pipe(withConstructorDefault(
|
|
4426
|
+
return Literal(literal).pipe(withConstructorDefault(Effect.succeed(literal)))
|
|
4458
4427
|
}
|
|
4459
4428
|
|
|
4460
4429
|
/**
|
|
@@ -4481,7 +4450,7 @@ export function tag<Tag extends AST.LiteralValue>(literal: Tag): tag<Tag> {
|
|
|
4481
4450
|
* @since 4.0.0
|
|
4482
4451
|
*/
|
|
4483
4452
|
export function tagDefaultOmit<Tag extends AST.LiteralValue>(literal: Tag) {
|
|
4484
|
-
return tag(literal).pipe(withDecodingDefaultKey(()
|
|
4453
|
+
return tag(literal).pipe(withDecodingDefaultKey(Effect.succeed(literal), { encodingStrategy: "omit" }))
|
|
4485
4454
|
}
|
|
4486
4455
|
|
|
4487
4456
|
/**
|
|
@@ -4499,7 +4468,7 @@ export type TaggedStruct<Tag extends AST.LiteralValue, Fields extends Struct.Fie
|
|
|
4499
4468
|
* to identify the specific variant of the object, which is especially useful
|
|
4500
4469
|
* when working with union types.
|
|
4501
4470
|
*
|
|
4502
|
-
* When using the `
|
|
4471
|
+
* When using the `make` method, the `_tag` field is optional and will be
|
|
4503
4472
|
* added automatically. However, when decoding or encoding, the `_tag` field
|
|
4504
4473
|
* must be present in the input.
|
|
4505
4474
|
*
|
|
@@ -4684,7 +4653,6 @@ export interface TaggedUnion<Cases extends Record<string, Top>> extends
|
|
|
4684
4653
|
{ [K in keyof Cases]: Cases[K]["~type.make"] }[keyof Cases]
|
|
4685
4654
|
>
|
|
4686
4655
|
{
|
|
4687
|
-
readonly "~rebuild.out": this
|
|
4688
4656
|
readonly cases: Cases
|
|
4689
4657
|
readonly isAnyOf: <const Keys>(
|
|
4690
4658
|
keys: ReadonlyArray<Keys>
|
|
@@ -4767,36 +4735,37 @@ export interface Opaque<Self, S extends Top, Brand> extends
|
|
|
4767
4735
|
S["~encoded.optionality"]
|
|
4768
4736
|
>
|
|
4769
4737
|
{
|
|
4770
|
-
// intentionally left without `readonly "~rebuild.out": this`
|
|
4771
4738
|
new(_: never): S["Type"] & Brand
|
|
4772
4739
|
}
|
|
4773
4740
|
|
|
4774
4741
|
/**
|
|
4775
|
-
* Wraps a schema so that its decoded `Type` becomes a nominally distinct type `Self`.
|
|
4776
|
-
* Useful for creating opaque types that are structurally identical to a base
|
|
4742
|
+
* Wraps a struct schema so that its decoded `Type` becomes a nominally distinct type `Self`.
|
|
4743
|
+
* Useful for creating opaque types that are structurally identical to a base struct
|
|
4777
4744
|
* but type-incompatible with it.
|
|
4778
4745
|
*
|
|
4779
|
-
* **Example** (Opaque
|
|
4746
|
+
* **Example** (Opaque struct)
|
|
4780
4747
|
*
|
|
4781
4748
|
* ```ts
|
|
4782
4749
|
* import { Schema } from "effect"
|
|
4783
4750
|
*
|
|
4784
|
-
*
|
|
4785
|
-
*
|
|
4751
|
+
* class Person extends Schema.Opaque<Person>()(
|
|
4752
|
+
* Schema.Struct({
|
|
4753
|
+
* name: Schema.String
|
|
4754
|
+
* })
|
|
4755
|
+
* ) {}
|
|
4786
4756
|
*
|
|
4787
|
-
* // Decoded value is
|
|
4788
|
-
* const
|
|
4789
|
-
* //
|
|
4757
|
+
* // Decoded value is Person, not { name: string }
|
|
4758
|
+
* const person = Schema.decodeUnknownSync(Person)({ name: "Alice" })
|
|
4759
|
+
* // person: Person
|
|
4790
4760
|
* ```
|
|
4791
4761
|
*
|
|
4792
4762
|
* @since 4.0.0
|
|
4793
4763
|
*/
|
|
4794
4764
|
export function Opaque<Self, Brand = {}>() {
|
|
4795
|
-
return <S extends Top>(schema: S): Opaque<Self, S, Brand> & Omit<S,
|
|
4765
|
+
return <S extends Top>(schema: S): Opaque<Self, S, Brand> & Omit<S, keyof Top> => {
|
|
4796
4766
|
// oxlint-disable-next-line @typescript-eslint/no-extraneous-class
|
|
4797
4767
|
class Opaque {}
|
|
4798
|
-
Object.setPrototypeOf(Opaque, schema)
|
|
4799
|
-
return Opaque as any
|
|
4768
|
+
return Object.setPrototypeOf(Opaque, schema)
|
|
4800
4769
|
}
|
|
4801
4770
|
}
|
|
4802
4771
|
|
|
@@ -4807,7 +4776,7 @@ export function Opaque<Self, Brand = {}>() {
|
|
|
4807
4776
|
* @since 4.0.0
|
|
4808
4777
|
*/
|
|
4809
4778
|
export interface instanceOf<T, Iso = T> extends declare<T, Iso> {
|
|
4810
|
-
readonly "~rebuild.out":
|
|
4779
|
+
readonly "~rebuild.out": instanceOf<T, Iso>
|
|
4811
4780
|
}
|
|
4812
4781
|
|
|
4813
4782
|
/**
|
|
@@ -6782,20 +6751,42 @@ export function isUnique<T>(annotations?: Annotations.Filter) {
|
|
|
6782
6751
|
// Built-in Schemas
|
|
6783
6752
|
// -----------------------------------------------------------------------------
|
|
6784
6753
|
|
|
6754
|
+
/**
|
|
6755
|
+
* Companion type for {@link NonEmptyString}.
|
|
6756
|
+
*
|
|
6757
|
+
* @category String
|
|
6758
|
+
* @since 4.0.0
|
|
6759
|
+
*/
|
|
6760
|
+
export interface NonEmptyString extends String {
|
|
6761
|
+
readonly "~rebuild.out": NonEmptyString
|
|
6762
|
+
}
|
|
6763
|
+
|
|
6785
6764
|
/**
|
|
6786
6765
|
* A schema for non-empty strings. Validates that a string has at least one
|
|
6787
6766
|
* character.
|
|
6788
6767
|
*
|
|
6768
|
+
* @category String
|
|
6769
|
+
* @since 4.0.0
|
|
6770
|
+
*/
|
|
6771
|
+
export const NonEmptyString: NonEmptyString = String.check(isNonEmpty())
|
|
6772
|
+
|
|
6773
|
+
/**
|
|
6774
|
+
* Companion type for {@link Char}.
|
|
6775
|
+
*
|
|
6776
|
+
* @category String
|
|
6789
6777
|
* @since 4.0.0
|
|
6790
6778
|
*/
|
|
6791
|
-
export
|
|
6779
|
+
export interface Char extends String {
|
|
6780
|
+
readonly "~rebuild.out": Char
|
|
6781
|
+
}
|
|
6792
6782
|
|
|
6793
6783
|
/**
|
|
6794
6784
|
* A schema representing a single character.
|
|
6795
6785
|
*
|
|
6786
|
+
* @category String
|
|
6796
6787
|
* @since 4.0.0
|
|
6797
6788
|
*/
|
|
6798
|
-
export const Char = String.check(isLengthBetween(1, 1))
|
|
6789
|
+
export const Char: Char = String.check(isLengthBetween(1, 1))
|
|
6799
6790
|
|
|
6800
6791
|
/**
|
|
6801
6792
|
* Schema for the `Option<A>` type, representing an optional value that is
|
|
@@ -6826,6 +6817,7 @@ export interface Option<A extends Top> extends
|
|
|
6826
6817
|
OptionIso<A>
|
|
6827
6818
|
>
|
|
6828
6819
|
{
|
|
6820
|
+
readonly "~rebuild.out": Option<A>
|
|
6829
6821
|
readonly value: A
|
|
6830
6822
|
}
|
|
6831
6823
|
|
|
@@ -6905,12 +6897,14 @@ export function Option<A extends Top>(value: A): Option<A> {
|
|
|
6905
6897
|
}
|
|
6906
6898
|
|
|
6907
6899
|
/**
|
|
6908
|
-
*
|
|
6900
|
+
* Companion type for {@link OptionFromNullOr}.
|
|
6909
6901
|
*
|
|
6910
6902
|
* @category Option
|
|
6911
6903
|
* @since 4.0.0
|
|
6912
6904
|
*/
|
|
6913
|
-
export interface OptionFromNullOr<S extends Top> extends decodeTo<Option<toType<S>>, NullOr<S>> {
|
|
6905
|
+
export interface OptionFromNullOr<S extends Top> extends decodeTo<Option<toType<S>>, NullOr<S>> {
|
|
6906
|
+
readonly "~rebuild.out": OptionFromNullOr<S>
|
|
6907
|
+
}
|
|
6914
6908
|
|
|
6915
6909
|
/**
|
|
6916
6910
|
* Decodes a nullable, required value `T` to a required `Option<T>` value.
|
|
@@ -6934,12 +6928,14 @@ export function OptionFromNullOr<S extends Top>(schema: S): OptionFromNullOr<S>
|
|
|
6934
6928
|
}
|
|
6935
6929
|
|
|
6936
6930
|
/**
|
|
6937
|
-
*
|
|
6931
|
+
* Companion type for {@link OptionFromUndefinedOr}.
|
|
6938
6932
|
*
|
|
6939
6933
|
* @category Option
|
|
6940
6934
|
* @since 4.0.0
|
|
6941
6935
|
*/
|
|
6942
|
-
export interface OptionFromUndefinedOr<S extends Top> extends decodeTo<Option<toType<S>>, UndefinedOr<S>> {
|
|
6936
|
+
export interface OptionFromUndefinedOr<S extends Top> extends decodeTo<Option<toType<S>>, UndefinedOr<S>> {
|
|
6937
|
+
readonly "~rebuild.out": OptionFromUndefinedOr<S>
|
|
6938
|
+
}
|
|
6943
6939
|
|
|
6944
6940
|
/**
|
|
6945
6941
|
* Decodes an undefined-or value `T` to a required `Option<T>` value.
|
|
@@ -6963,12 +6959,14 @@ export function OptionFromUndefinedOr<S extends Top>(schema: S): OptionFromUndef
|
|
|
6963
6959
|
}
|
|
6964
6960
|
|
|
6965
6961
|
/**
|
|
6966
|
-
*
|
|
6962
|
+
* Companion type for {@link OptionFromNullishOr}.
|
|
6967
6963
|
*
|
|
6968
6964
|
* @category Option
|
|
6969
6965
|
* @since 4.0.0
|
|
6970
6966
|
*/
|
|
6971
|
-
export interface OptionFromNullishOr<S extends Top> extends decodeTo<Option<toType<S>>, NullishOr<S>> {
|
|
6967
|
+
export interface OptionFromNullishOr<S extends Top> extends decodeTo<Option<toType<S>>, NullishOr<S>> {
|
|
6968
|
+
readonly "~rebuild.out": OptionFromNullishOr<S>
|
|
6969
|
+
}
|
|
6972
6970
|
|
|
6973
6971
|
/**
|
|
6974
6972
|
* Decodes a nullish value `T` to a required `Option<T>` value.
|
|
@@ -6997,12 +6995,14 @@ export function OptionFromNullishOr<S extends Top>(
|
|
|
6997
6995
|
}
|
|
6998
6996
|
|
|
6999
6997
|
/**
|
|
7000
|
-
*
|
|
6998
|
+
* Companion type for {@link OptionFromOptionalKey}.
|
|
7001
6999
|
*
|
|
7002
7000
|
* @category Option
|
|
7003
7001
|
* @since 4.0.0
|
|
7004
7002
|
*/
|
|
7005
|
-
export interface OptionFromOptionalKey<S extends Top> extends decodeTo<Option<toType<S>>, optionalKey<S>> {
|
|
7003
|
+
export interface OptionFromOptionalKey<S extends Top> extends decodeTo<Option<toType<S>>, optionalKey<S>> {
|
|
7004
|
+
readonly "~rebuild.out": OptionFromOptionalKey<S>
|
|
7005
|
+
}
|
|
7006
7006
|
|
|
7007
7007
|
/**
|
|
7008
7008
|
* Decodes an optional value `A` to a required `Option<A>` value.
|
|
@@ -7026,12 +7026,14 @@ export function OptionFromOptionalKey<S extends Top>(schema: S): OptionFromOptio
|
|
|
7026
7026
|
}
|
|
7027
7027
|
|
|
7028
7028
|
/**
|
|
7029
|
-
*
|
|
7029
|
+
* Companion type for {@link OptionFromOptional}.
|
|
7030
7030
|
*
|
|
7031
7031
|
* @category Option
|
|
7032
7032
|
* @since 4.0.0
|
|
7033
7033
|
*/
|
|
7034
|
-
export interface OptionFromOptional<S extends Top> extends decodeTo<Option<toType<S>>, optional<S>> {
|
|
7034
|
+
export interface OptionFromOptional<S extends Top> extends decodeTo<Option<toType<S>>, optional<S>> {
|
|
7035
|
+
readonly "~rebuild.out": OptionFromOptional<S>
|
|
7036
|
+
}
|
|
7035
7037
|
|
|
7036
7038
|
/**
|
|
7037
7039
|
* Decodes an optional or `undefined` value `A` to an required `Option<A>`
|
|
@@ -7057,12 +7059,14 @@ export function OptionFromOptional<S extends Top>(schema: S): OptionFromOptional
|
|
|
7057
7059
|
}
|
|
7058
7060
|
|
|
7059
7061
|
/**
|
|
7060
|
-
*
|
|
7062
|
+
* Companion type for {@link OptionFromOptionalNullOr}.
|
|
7061
7063
|
*
|
|
7062
7064
|
* @category Option
|
|
7063
7065
|
* @since 4.0.0
|
|
7064
7066
|
*/
|
|
7065
|
-
export interface OptionFromOptionalNullOr<S extends Top> extends decodeTo<Option<toType<S>>, optional<NullOr<S>>> {
|
|
7067
|
+
export interface OptionFromOptionalNullOr<S extends Top> extends decodeTo<Option<toType<S>>, optional<NullOr<S>>> {
|
|
7068
|
+
readonly "~rebuild.out": OptionFromOptionalNullOr<S>
|
|
7069
|
+
}
|
|
7066
7070
|
|
|
7067
7071
|
/**
|
|
7068
7072
|
* Decodes an optional or `null` or `undefined` value `A` to a required `Option<A>`
|
|
@@ -7119,6 +7123,7 @@ export interface Result<A extends Top, E extends Top> extends
|
|
|
7119
7123
|
ResultIso<A, E>
|
|
7120
7124
|
>
|
|
7121
7125
|
{
|
|
7126
|
+
readonly "~rebuild.out": Result<A, E>
|
|
7122
7127
|
readonly success: A
|
|
7123
7128
|
readonly failure: E
|
|
7124
7129
|
}
|
|
@@ -7221,6 +7226,7 @@ export interface Redacted<S extends Top> extends
|
|
|
7221
7226
|
readonly [S]
|
|
7222
7227
|
>
|
|
7223
7228
|
{
|
|
7229
|
+
readonly "~rebuild.out": Redacted<S>
|
|
7224
7230
|
readonly value: S
|
|
7225
7231
|
}
|
|
7226
7232
|
|
|
@@ -7312,14 +7318,16 @@ export function Redacted<S extends Top>(value: S, options?: {
|
|
|
7312
7318
|
}
|
|
7313
7319
|
|
|
7314
7320
|
/**
|
|
7315
|
-
*
|
|
7321
|
+
* Companion type for {@link RedactedFromValue}.
|
|
7316
7322
|
*
|
|
7317
7323
|
* @category Redacted
|
|
7318
7324
|
* @since 4.0.0
|
|
7319
7325
|
*/
|
|
7320
7326
|
export interface RedactedFromValue<S extends Top>
|
|
7321
7327
|
extends decodeTo<Redacted<toType<S>>, middlewareDecoding<S, S["DecodingServices"]>>
|
|
7322
|
-
{
|
|
7328
|
+
{
|
|
7329
|
+
readonly "~rebuild.out": RedactedFromValue<S>
|
|
7330
|
+
}
|
|
7323
7331
|
|
|
7324
7332
|
/**
|
|
7325
7333
|
* Middleware that wraps decoded errors in `Redacted`, preventing sensitive
|
|
@@ -7370,6 +7378,7 @@ export interface CauseReason<E extends Top, D extends Top> extends
|
|
|
7370
7378
|
CauseReasonIso<E, D>
|
|
7371
7379
|
>
|
|
7372
7380
|
{
|
|
7381
|
+
readonly "~rebuild.out": CauseReason<E, D>
|
|
7373
7382
|
readonly error: E
|
|
7374
7383
|
readonly defect: D
|
|
7375
7384
|
}
|
|
@@ -7517,6 +7526,7 @@ export interface Cause<E extends Top, D extends Top> extends
|
|
|
7517
7526
|
CauseIso<E, D>
|
|
7518
7527
|
>
|
|
7519
7528
|
{
|
|
7529
|
+
readonly "~rebuild.out": Cause<E, D>
|
|
7520
7530
|
readonly error: E
|
|
7521
7531
|
readonly defect: D
|
|
7522
7532
|
}
|
|
@@ -7591,12 +7601,14 @@ function causeToFormatter<E>(error: Formatter<E>, defect: Formatter<unknown>) {
|
|
|
7591
7601
|
}
|
|
7592
7602
|
|
|
7593
7603
|
/**
|
|
7594
|
-
*
|
|
7604
|
+
* Companion type for {@link Error}.
|
|
7595
7605
|
*
|
|
7596
|
-
* @category
|
|
7606
|
+
* @category Error
|
|
7597
7607
|
* @since 4.0.0
|
|
7598
7608
|
*/
|
|
7599
|
-
export interface Error extends instanceOf<globalThis.Error> {
|
|
7609
|
+
export interface Error extends instanceOf<globalThis.Error> {
|
|
7610
|
+
readonly "~rebuild.out": Error
|
|
7611
|
+
}
|
|
7600
7612
|
|
|
7601
7613
|
const ErrorJsonEncoded = Struct({
|
|
7602
7614
|
message: String,
|
|
@@ -7655,9 +7667,9 @@ export const ErrorWithStack: Error = instanceOf(globalThis.Error, {
|
|
|
7655
7667
|
})
|
|
7656
7668
|
|
|
7657
7669
|
/**
|
|
7658
|
-
*
|
|
7670
|
+
* Companion type for {@link Defect}.
|
|
7659
7671
|
*
|
|
7660
|
-
* @category
|
|
7672
|
+
* @category Defect
|
|
7661
7673
|
* @since 4.0.0
|
|
7662
7674
|
*/
|
|
7663
7675
|
export interface Defect extends
|
|
@@ -7674,7 +7686,9 @@ export interface Defect extends
|
|
|
7674
7686
|
decodeTo<Unknown, Any>
|
|
7675
7687
|
]
|
|
7676
7688
|
>
|
|
7677
|
-
{
|
|
7689
|
+
{
|
|
7690
|
+
readonly "~rebuild.out": Defect
|
|
7691
|
+
}
|
|
7678
7692
|
|
|
7679
7693
|
const defectTransformation = new Transformation.Transformation(
|
|
7680
7694
|
Getter.passthrough(),
|
|
@@ -7708,7 +7722,7 @@ export const Defect: Defect = Union([
|
|
|
7708
7722
|
* A schema that represents defects, that also includes stack traces in the
|
|
7709
7723
|
* encoded form.
|
|
7710
7724
|
*
|
|
7711
|
-
* @category
|
|
7725
|
+
* @category Defect
|
|
7712
7726
|
* @since 4.0.0
|
|
7713
7727
|
*/
|
|
7714
7728
|
export const DefectWithStack: Defect = Union([
|
|
@@ -7742,6 +7756,7 @@ export interface Exit<A extends Top, E extends Top, D extends Top> extends
|
|
|
7742
7756
|
ExitIso<A, E, D>
|
|
7743
7757
|
>
|
|
7744
7758
|
{
|
|
7759
|
+
readonly "~rebuild.out": Exit<A, E, D>
|
|
7745
7760
|
readonly value: A
|
|
7746
7761
|
readonly error: E
|
|
7747
7762
|
readonly defect: D
|
|
@@ -7860,7 +7875,7 @@ export function Exit<A extends Top, E extends Top, D extends Top>(value: A, erro
|
|
|
7860
7875
|
}
|
|
7861
7876
|
|
|
7862
7877
|
/**
|
|
7863
|
-
*
|
|
7878
|
+
* Companion type for {@link ReadonlyMap}.
|
|
7864
7879
|
*
|
|
7865
7880
|
* @category ReadonlyMap
|
|
7866
7881
|
* @since 4.0.0
|
|
@@ -7873,6 +7888,7 @@ export interface $ReadonlyMap<Key extends Top, Value extends Top> extends
|
|
|
7873
7888
|
ReadonlyMapIso<Key, Value>
|
|
7874
7889
|
>
|
|
7875
7890
|
{
|
|
7891
|
+
readonly "~rebuild.out": $ReadonlyMap<Key, Value>
|
|
7876
7892
|
readonly key: Key
|
|
7877
7893
|
readonly value: Value
|
|
7878
7894
|
}
|
|
@@ -7966,6 +7982,7 @@ export interface HashMap<Key extends Top, Value extends Top> extends
|
|
|
7966
7982
|
HashMapIso<Key, Value>
|
|
7967
7983
|
>
|
|
7968
7984
|
{
|
|
7985
|
+
readonly "~rebuild.out": HashMap<Key, Value>
|
|
7969
7986
|
readonly key: Key
|
|
7970
7987
|
readonly value: Value
|
|
7971
7988
|
}
|
|
@@ -8046,7 +8063,7 @@ export function HashMap<Key extends Top, Value extends Top>(key: Key, value: Val
|
|
|
8046
8063
|
}
|
|
8047
8064
|
|
|
8048
8065
|
/**
|
|
8049
|
-
*
|
|
8066
|
+
* Companion type for {@link ReadonlySet}.
|
|
8050
8067
|
*
|
|
8051
8068
|
* @category ReadonlySet
|
|
8052
8069
|
* @since 4.0.0
|
|
@@ -8059,6 +8076,7 @@ export interface $ReadonlySet<Value extends Top> extends
|
|
|
8059
8076
|
ReadonlySetIso<Value>
|
|
8060
8077
|
>
|
|
8061
8078
|
{
|
|
8079
|
+
readonly "~rebuild.out": $ReadonlySet<Value>
|
|
8062
8080
|
readonly value: Value
|
|
8063
8081
|
}
|
|
8064
8082
|
|
|
@@ -8148,6 +8166,7 @@ export interface HashSet<Value extends Top> extends
|
|
|
8148
8166
|
HashSetIso<Value>
|
|
8149
8167
|
>
|
|
8150
8168
|
{
|
|
8169
|
+
readonly "~rebuild.out": HashSet<Value>
|
|
8151
8170
|
readonly value: Value
|
|
8152
8171
|
}
|
|
8153
8172
|
|
|
@@ -8240,6 +8259,7 @@ export interface Chunk<Value extends Top> extends
|
|
|
8240
8259
|
ChunkIso<Value>
|
|
8241
8260
|
>
|
|
8242
8261
|
{
|
|
8262
|
+
readonly "~rebuild.out": Chunk<Value>
|
|
8243
8263
|
readonly value: Value
|
|
8244
8264
|
}
|
|
8245
8265
|
|
|
@@ -8318,19 +8338,21 @@ export function Chunk<Value extends Top>(value: Value): Chunk<Value> {
|
|
|
8318
8338
|
}
|
|
8319
8339
|
|
|
8320
8340
|
/**
|
|
8321
|
-
*
|
|
8341
|
+
* Companion type for {@link RegExp}.
|
|
8322
8342
|
*
|
|
8323
|
-
* @category
|
|
8343
|
+
* @category RegExp
|
|
8324
8344
|
* @since 4.0.0
|
|
8325
8345
|
*/
|
|
8326
|
-
export interface RegExp extends instanceOf<globalThis.RegExp> {
|
|
8346
|
+
export interface RegExp extends instanceOf<globalThis.RegExp> {
|
|
8347
|
+
readonly "~rebuild.out": RegExp
|
|
8348
|
+
}
|
|
8327
8349
|
|
|
8328
8350
|
/**
|
|
8329
8351
|
* Schema for JavaScript `RegExp` objects.
|
|
8330
8352
|
*
|
|
8331
8353
|
* The default JSON serializer encodes a `RegExp` as `{ source, flags }`.
|
|
8332
8354
|
*
|
|
8333
|
-
* @category
|
|
8355
|
+
* @category RegExp
|
|
8334
8356
|
* @since 4.0.0
|
|
8335
8357
|
*/
|
|
8336
8358
|
export const RegExp: RegExp = instanceOf(
|
|
@@ -8390,12 +8412,16 @@ export const RegExp: RegExp = instanceOf(
|
|
|
8390
8412
|
)
|
|
8391
8413
|
|
|
8392
8414
|
/**
|
|
8393
|
-
*
|
|
8415
|
+
* Companion type for {@link URL}.
|
|
8394
8416
|
*
|
|
8395
8417
|
* @category URL
|
|
8396
8418
|
* @since 4.0.0
|
|
8397
8419
|
*/
|
|
8398
|
-
export interface URL extends instanceOf<globalThis.URL> {
|
|
8420
|
+
export interface URL extends instanceOf<globalThis.URL> {
|
|
8421
|
+
readonly "~rebuild.out": URL
|
|
8422
|
+
}
|
|
8423
|
+
|
|
8424
|
+
const URLString = String.annotate({ expected: "a string that will be decoded as a URL" })
|
|
8399
8425
|
|
|
8400
8426
|
/**
|
|
8401
8427
|
* A schema for JavaScript `URL` objects.
|
|
@@ -8420,7 +8446,7 @@ export const URL: URL = instanceOf(
|
|
|
8420
8446
|
expected: "URL",
|
|
8421
8447
|
toCodecJson: () =>
|
|
8422
8448
|
link<globalThis.URL>()(
|
|
8423
|
-
|
|
8449
|
+
URLString,
|
|
8424
8450
|
Transformation.urlFromString
|
|
8425
8451
|
),
|
|
8426
8452
|
toArbitrary: () => (fc) => fc.webUrl().map((s) => new globalThis.URL(s)),
|
|
@@ -8429,12 +8455,14 @@ export const URL: URL = instanceOf(
|
|
|
8429
8455
|
)
|
|
8430
8456
|
|
|
8431
8457
|
/**
|
|
8432
|
-
*
|
|
8458
|
+
* Companion type for {@link URLFromString}.
|
|
8433
8459
|
*
|
|
8434
8460
|
* @category URL
|
|
8435
8461
|
* @since 4.0.0
|
|
8436
8462
|
*/
|
|
8437
|
-
export interface URLFromString extends decodeTo<URL, String> {
|
|
8463
|
+
export interface URLFromString extends decodeTo<URL, String> {
|
|
8464
|
+
readonly "~rebuild.out": URLFromString
|
|
8465
|
+
}
|
|
8438
8466
|
|
|
8439
8467
|
/**
|
|
8440
8468
|
* A transformation schema that decodes a `string` into a `URL`.
|
|
@@ -8448,16 +8476,19 @@ export interface URLFromString extends decodeTo<URL, String> {}
|
|
|
8448
8476
|
* @category URL
|
|
8449
8477
|
* @since 4.0.0
|
|
8450
8478
|
*/
|
|
8451
|
-
export const URLFromString: URLFromString =
|
|
8452
|
-
.pipe(decodeTo(URL, Transformation.urlFromString)) // TODO: remove duplication with URL schema
|
|
8479
|
+
export const URLFromString: URLFromString = URLString.pipe(decodeTo(URL, Transformation.urlFromString))
|
|
8453
8480
|
|
|
8454
8481
|
/**
|
|
8455
|
-
*
|
|
8482
|
+
* Companion type for {@link Date}.
|
|
8456
8483
|
*
|
|
8457
|
-
* @category
|
|
8484
|
+
* @category Date
|
|
8458
8485
|
* @since 4.0.0
|
|
8459
8486
|
*/
|
|
8460
|
-
export interface Date extends instanceOf<globalThis.Date> {
|
|
8487
|
+
export interface Date extends instanceOf<globalThis.Date> {
|
|
8488
|
+
readonly "~rebuild.out": Date
|
|
8489
|
+
}
|
|
8490
|
+
|
|
8491
|
+
const DateString = String.annotate({ expected: "a string in ISO 8601 format that will be decoded as a Date" })
|
|
8461
8492
|
|
|
8462
8493
|
/**
|
|
8463
8494
|
* A schema for JavaScript `Date` objects.
|
|
@@ -8475,7 +8506,7 @@ export interface Date extends instanceOf<globalThis.Date> {}
|
|
|
8475
8506
|
* // => Date { 2024-01-01T00:00:00.000Z }
|
|
8476
8507
|
* ```
|
|
8477
8508
|
*
|
|
8478
|
-
* @category
|
|
8509
|
+
* @category Date
|
|
8479
8510
|
* @since 4.0.0
|
|
8480
8511
|
*/
|
|
8481
8512
|
export const Date: Date = instanceOf(
|
|
@@ -8491,23 +8522,46 @@ export const Date: Date = instanceOf(
|
|
|
8491
8522
|
expected: "Date",
|
|
8492
8523
|
toCodecJson: () =>
|
|
8493
8524
|
link<globalThis.Date>()(
|
|
8494
|
-
|
|
8495
|
-
Transformation.
|
|
8496
|
-
decode: (s) => new globalThis.Date(s),
|
|
8497
|
-
encode: formatDate
|
|
8498
|
-
})
|
|
8525
|
+
DateString,
|
|
8526
|
+
Transformation.dateFromString
|
|
8499
8527
|
),
|
|
8500
8528
|
toArbitrary: () => (fc, ctx) => fc.date(ctx?.constraints?.date)
|
|
8501
8529
|
}
|
|
8502
8530
|
)
|
|
8503
8531
|
|
|
8504
8532
|
/**
|
|
8505
|
-
*
|
|
8533
|
+
* Companion type for {@link DateFromString}.
|
|
8506
8534
|
*
|
|
8507
|
-
* @category
|
|
8535
|
+
* @category Date
|
|
8536
|
+
* @since 4.0.0
|
|
8537
|
+
*/
|
|
8538
|
+
export interface DateFromString extends decodeTo<Date, String> {
|
|
8539
|
+
readonly "~rebuild.out": DateFromString
|
|
8540
|
+
}
|
|
8541
|
+
|
|
8542
|
+
/**
|
|
8543
|
+
* A transformation schema that parses an ISO 8601 string into a `Date`.
|
|
8544
|
+
*
|
|
8545
|
+
* Decoding:
|
|
8546
|
+
* - A `string` is decoded as a `Date`.
|
|
8547
|
+
*
|
|
8548
|
+
* Encoding:
|
|
8549
|
+
* - A `Date` is encoded as a `string`.
|
|
8550
|
+
*
|
|
8551
|
+
* @category Date
|
|
8508
8552
|
* @since 4.0.0
|
|
8509
8553
|
*/
|
|
8510
|
-
export
|
|
8554
|
+
export const DateFromString: DateFromString = DateString.pipe(decodeTo(Date, Transformation.dateFromString))
|
|
8555
|
+
|
|
8556
|
+
/**
|
|
8557
|
+
* Companion type for {@link DateValid}.
|
|
8558
|
+
*
|
|
8559
|
+
* @category Date
|
|
8560
|
+
* @since 4.0.0
|
|
8561
|
+
*/
|
|
8562
|
+
export interface DateValid extends Date {
|
|
8563
|
+
readonly "~rebuild.out": DateValid
|
|
8564
|
+
}
|
|
8511
8565
|
|
|
8512
8566
|
/**
|
|
8513
8567
|
* A schema for **valid** JavaScript `Date` objects.
|
|
@@ -8515,17 +8569,20 @@ export interface DateValid extends Date {}
|
|
|
8515
8569
|
* This schema accepts `Date` instances but rejects invalid dates (such as `new
|
|
8516
8570
|
* Date("invalid")`).
|
|
8517
8571
|
*
|
|
8572
|
+
* @category Date
|
|
8518
8573
|
* @since 4.0.0
|
|
8519
8574
|
*/
|
|
8520
|
-
export const DateValid = Date.check(isDateValid())
|
|
8575
|
+
export const DateValid: DateValid = Date.check(isDateValid())
|
|
8521
8576
|
|
|
8522
8577
|
/**
|
|
8523
|
-
*
|
|
8578
|
+
* Companion type for {@link Duration}.
|
|
8524
8579
|
*
|
|
8525
8580
|
* @category Duration
|
|
8526
8581
|
* @since 4.0.0
|
|
8527
8582
|
*/
|
|
8528
|
-
export interface Duration extends declare<Duration_.Duration> {
|
|
8583
|
+
export interface Duration extends declare<Duration_.Duration> {
|
|
8584
|
+
readonly "~rebuild.out": Duration
|
|
8585
|
+
}
|
|
8529
8586
|
|
|
8530
8587
|
/**
|
|
8531
8588
|
* A schema for `Duration` values.
|
|
@@ -8607,12 +8664,14 @@ export const Duration: Duration = declare(
|
|
|
8607
8664
|
)
|
|
8608
8665
|
|
|
8609
8666
|
/**
|
|
8610
|
-
*
|
|
8667
|
+
* Companion type for {@link DurationFromNanos}.
|
|
8611
8668
|
*
|
|
8612
8669
|
* @category Duration
|
|
8613
8670
|
* @since 4.0.0
|
|
8614
8671
|
*/
|
|
8615
|
-
export interface DurationFromNanos extends decodeTo<Duration, BigInt> {
|
|
8672
|
+
export interface DurationFromNanos extends decodeTo<Duration, BigInt> {
|
|
8673
|
+
readonly "~rebuild.out": DurationFromNanos
|
|
8674
|
+
}
|
|
8616
8675
|
|
|
8617
8676
|
/**
|
|
8618
8677
|
* A transformation schema that decodes a non-negative `bigint` into a
|
|
@@ -8632,12 +8691,14 @@ export const DurationFromNanos: DurationFromNanos = BigInt.check(isGreaterThanOr
|
|
|
8632
8691
|
)
|
|
8633
8692
|
|
|
8634
8693
|
/**
|
|
8635
|
-
*
|
|
8694
|
+
* Companion type for {@link DurationFromMillis}.
|
|
8636
8695
|
*
|
|
8637
8696
|
* @category Duration
|
|
8638
8697
|
* @since 4.0.0
|
|
8639
8698
|
*/
|
|
8640
|
-
export interface DurationFromMillis extends decodeTo<Duration, Number> {
|
|
8699
|
+
export interface DurationFromMillis extends decodeTo<Duration, Number> {
|
|
8700
|
+
readonly "~rebuild.out": DurationFromMillis
|
|
8701
|
+
}
|
|
8641
8702
|
|
|
8642
8703
|
/**
|
|
8643
8704
|
* A transformation schema that decodes a non-negative (possibly infinite)
|
|
@@ -8660,12 +8721,16 @@ export const DurationFromMillis: DurationFromMillis = Number.check(isGreaterThan
|
|
|
8660
8721
|
)
|
|
8661
8722
|
|
|
8662
8723
|
/**
|
|
8663
|
-
*
|
|
8724
|
+
* Companion type for {@link BigDecimal}.
|
|
8664
8725
|
*
|
|
8665
|
-
* @category
|
|
8726
|
+
* @category BigDecimal
|
|
8666
8727
|
* @since 4.0.0
|
|
8667
8728
|
*/
|
|
8668
|
-
export interface BigDecimal extends declare<BigDecimal_.BigDecimal> {
|
|
8729
|
+
export interface BigDecimal extends declare<BigDecimal_.BigDecimal> {
|
|
8730
|
+
readonly "~rebuild.out": BigDecimal
|
|
8731
|
+
}
|
|
8732
|
+
|
|
8733
|
+
const BigDecimalString = String.annotate({ expected: "a string that will be decoded as a BigDecimal" })
|
|
8669
8734
|
|
|
8670
8735
|
/**
|
|
8671
8736
|
* A schema for `BigDecimal` values.
|
|
@@ -8674,6 +8739,7 @@ export interface BigDecimal extends declare<BigDecimal_.BigDecimal> {}
|
|
|
8674
8739
|
*
|
|
8675
8740
|
* - encodes `BigDecimal` as a `string`
|
|
8676
8741
|
*
|
|
8742
|
+
* @category BigDecimal
|
|
8677
8743
|
* @since 4.0.0
|
|
8678
8744
|
*/
|
|
8679
8745
|
export const BigDecimal: BigDecimal = declare(
|
|
@@ -8690,7 +8756,7 @@ export const BigDecimal: BigDecimal = declare(
|
|
|
8690
8756
|
expected: "BigDecimal",
|
|
8691
8757
|
toCodecJson: () =>
|
|
8692
8758
|
link<BigDecimal_.BigDecimal>()(
|
|
8693
|
-
|
|
8759
|
+
BigDecimalString,
|
|
8694
8760
|
Transformation.bigDecimalFromString
|
|
8695
8761
|
),
|
|
8696
8762
|
toArbitrary: () => (fc) =>
|
|
@@ -8702,12 +8768,40 @@ export const BigDecimal: BigDecimal = declare(
|
|
|
8702
8768
|
)
|
|
8703
8769
|
|
|
8704
8770
|
/**
|
|
8705
|
-
*
|
|
8771
|
+
* Companion type for {@link BigDecimalFromString}.
|
|
8772
|
+
*
|
|
8773
|
+
* @category BigDecimal
|
|
8774
|
+
* @since 4.0.0
|
|
8775
|
+
*/
|
|
8776
|
+
export interface BigDecimalFromString extends decodeTo<BigDecimal, String> {
|
|
8777
|
+
readonly "~rebuild.out": BigDecimalFromString
|
|
8778
|
+
}
|
|
8779
|
+
|
|
8780
|
+
/**
|
|
8781
|
+
* A transformation schema that parses a string into a `BigDecimal`.
|
|
8782
|
+
*
|
|
8783
|
+
* Decoding:
|
|
8784
|
+
* - A `string` is decoded as a `BigDecimal`.
|
|
8785
|
+
*
|
|
8786
|
+
* Encoding:
|
|
8787
|
+
* - A `BigDecimal` is encoded as a `string`.
|
|
8788
|
+
*
|
|
8789
|
+
* @category BigDecimal
|
|
8790
|
+
* @since 4.0.0
|
|
8791
|
+
*/
|
|
8792
|
+
export const BigDecimalFromString: BigDecimalFromString = BigDecimalString.pipe(
|
|
8793
|
+
decodeTo(BigDecimal, Transformation.bigDecimalFromString)
|
|
8794
|
+
)
|
|
8795
|
+
|
|
8796
|
+
/**
|
|
8797
|
+
* Companion type for {@link UnknownFromJsonString}.
|
|
8706
8798
|
*
|
|
8707
8799
|
* @category JSON
|
|
8708
8800
|
* @since 4.0.0
|
|
8709
8801
|
*/
|
|
8710
|
-
export interface UnknownFromJsonString extends fromJsonString<Unknown> {
|
|
8802
|
+
export interface UnknownFromJsonString extends fromJsonString<Unknown> {
|
|
8803
|
+
readonly "~rebuild.out": UnknownFromJsonString
|
|
8804
|
+
}
|
|
8711
8805
|
|
|
8712
8806
|
/**
|
|
8713
8807
|
* A transformation schema that decodes a JSON-encoded string into an `unknown` value.
|
|
@@ -8729,17 +8823,20 @@ export interface UnknownFromJsonString extends fromJsonString<Unknown> {}
|
|
|
8729
8823
|
* // => { a: 1, b: 2 }
|
|
8730
8824
|
* ```
|
|
8731
8825
|
*
|
|
8826
|
+
* @category JSON
|
|
8732
8827
|
* @since 4.0.0
|
|
8733
8828
|
*/
|
|
8734
|
-
export const UnknownFromJsonString = fromJsonString(Unknown)
|
|
8829
|
+
export const UnknownFromJsonString: UnknownFromJsonString = fromJsonString(Unknown)
|
|
8735
8830
|
|
|
8736
8831
|
/**
|
|
8737
|
-
*
|
|
8832
|
+
* Companion type for {@link fromJsonString}.
|
|
8738
8833
|
*
|
|
8739
8834
|
* @category JSON
|
|
8740
8835
|
* @since 4.0.0
|
|
8741
8836
|
*/
|
|
8742
|
-
export interface fromJsonString<S extends Top> extends decodeTo<S, String> {
|
|
8837
|
+
export interface fromJsonString<S extends Top> extends decodeTo<S, String> {
|
|
8838
|
+
readonly "~rebuild.out": fromJsonString<S>
|
|
8839
|
+
}
|
|
8743
8840
|
|
|
8744
8841
|
/**
|
|
8745
8842
|
* Returns a schema that decodes a JSON string and then decodes the parsed value
|
|
@@ -8802,6 +8899,7 @@ export interface fromJsonString<S extends Top> extends decodeTo<S, String> {}
|
|
|
8802
8899
|
* // }
|
|
8803
8900
|
* ```
|
|
8804
8901
|
*
|
|
8902
|
+
* @category JSON
|
|
8805
8903
|
* @since 4.0.0
|
|
8806
8904
|
*/
|
|
8807
8905
|
export function fromJsonString<S extends Top>(schema: S): fromJsonString<S> {
|
|
@@ -8813,12 +8911,14 @@ export function fromJsonString<S extends Top>(schema: S): fromJsonString<S> {
|
|
|
8813
8911
|
}
|
|
8814
8912
|
|
|
8815
8913
|
/**
|
|
8816
|
-
*
|
|
8914
|
+
* Companion type for {@link File}.
|
|
8817
8915
|
*
|
|
8818
|
-
* @category
|
|
8916
|
+
* @category File
|
|
8819
8917
|
* @since 4.0.0
|
|
8820
8918
|
*/
|
|
8821
|
-
export interface File extends instanceOf<globalThis.File> {
|
|
8919
|
+
export interface File extends instanceOf<globalThis.File> {
|
|
8920
|
+
readonly "~rebuild.out": File
|
|
8921
|
+
}
|
|
8822
8922
|
|
|
8823
8923
|
/**
|
|
8824
8924
|
* Schema for JavaScript `File` objects.
|
|
@@ -8826,7 +8926,7 @@ export interface File extends instanceOf<globalThis.File> {}
|
|
|
8826
8926
|
* The default JSON serializer encodes a `File` as `{ data, type, name, lastModified }`
|
|
8827
8927
|
* where `data` is base64-encoded.
|
|
8828
8928
|
*
|
|
8829
|
-
* @category
|
|
8929
|
+
* @category File
|
|
8830
8930
|
* @since 4.0.0
|
|
8831
8931
|
*/
|
|
8832
8932
|
export const File: File = instanceOf(globalThis.File, {
|
|
@@ -8883,12 +8983,14 @@ export const File: File = instanceOf(globalThis.File, {
|
|
|
8883
8983
|
})
|
|
8884
8984
|
|
|
8885
8985
|
/**
|
|
8886
|
-
*
|
|
8986
|
+
* Companion type for {@link FormData}.
|
|
8887
8987
|
*
|
|
8888
|
-
* @category
|
|
8988
|
+
* @category FormData
|
|
8889
8989
|
* @since 4.0.0
|
|
8890
8990
|
*/
|
|
8891
|
-
export interface FormData extends instanceOf<globalThis.FormData> {
|
|
8991
|
+
export interface FormData extends instanceOf<globalThis.FormData> {
|
|
8992
|
+
readonly "~rebuild.out": FormData
|
|
8993
|
+
}
|
|
8892
8994
|
|
|
8893
8995
|
/**
|
|
8894
8996
|
* Schema for JavaScript `FormData` objects.
|
|
@@ -8896,7 +8998,7 @@ export interface FormData extends instanceOf<globalThis.FormData> {}
|
|
|
8896
8998
|
* The default JSON serializer encodes a `FormData` as an array of `[key, entry]`
|
|
8897
8999
|
* pairs where each entry is tagged as `"String"` or `"File"`.
|
|
8898
9000
|
*
|
|
8899
|
-
* @category
|
|
9001
|
+
* @category FormData
|
|
8900
9002
|
* @since 4.0.0
|
|
8901
9003
|
*/
|
|
8902
9004
|
export const FormData: FormData = instanceOf(globalThis.FormData, {
|
|
@@ -8943,12 +9045,14 @@ export const FormData: FormData = instanceOf(globalThis.FormData, {
|
|
|
8943
9045
|
})
|
|
8944
9046
|
|
|
8945
9047
|
/**
|
|
8946
|
-
*
|
|
9048
|
+
* Companion type for {@link fromFormData}.
|
|
8947
9049
|
*
|
|
8948
|
-
* @category
|
|
9050
|
+
* @category FormData
|
|
8949
9051
|
* @since 4.0.0
|
|
8950
9052
|
*/
|
|
8951
|
-
export interface fromFormData<S extends Top> extends decodeTo<S, FormData> {
|
|
9053
|
+
export interface fromFormData<S extends Top> extends decodeTo<S, FormData> {
|
|
9054
|
+
readonly "~rebuild.out": fromFormData<S>
|
|
9055
|
+
}
|
|
8952
9056
|
|
|
8953
9057
|
/**
|
|
8954
9058
|
* `Schema.fromFormData` returns a schema that reads a `FormData` instance,
|
|
@@ -9038,19 +9142,21 @@ export function fromFormData<S extends Top>(schema: S): fromFormData<S> {
|
|
|
9038
9142
|
}
|
|
9039
9143
|
|
|
9040
9144
|
/**
|
|
9041
|
-
*
|
|
9145
|
+
* Companion type for {@link URLSearchParams}.
|
|
9042
9146
|
*
|
|
9043
|
-
* @category
|
|
9147
|
+
* @category URLSearchParams
|
|
9044
9148
|
* @since 4.0.0
|
|
9045
9149
|
*/
|
|
9046
|
-
export interface URLSearchParams extends instanceOf<globalThis.URLSearchParams> {
|
|
9150
|
+
export interface URLSearchParams extends instanceOf<globalThis.URLSearchParams> {
|
|
9151
|
+
readonly "~rebuild.out": URLSearchParams
|
|
9152
|
+
}
|
|
9047
9153
|
|
|
9048
9154
|
/**
|
|
9049
9155
|
* Schema for JavaScript `URLSearchParams` objects.
|
|
9050
9156
|
*
|
|
9051
9157
|
* The default JSON serializer encodes a `URLSearchParams` as a query string.
|
|
9052
9158
|
*
|
|
9053
|
-
* @category
|
|
9159
|
+
* @category URLSearchParams
|
|
9054
9160
|
* @since 4.0.0
|
|
9055
9161
|
*/
|
|
9056
9162
|
export const URLSearchParams: URLSearchParams = instanceOf(globalThis.URLSearchParams, {
|
|
@@ -9073,12 +9179,14 @@ export const URLSearchParams: URLSearchParams = instanceOf(globalThis.URLSearchP
|
|
|
9073
9179
|
})
|
|
9074
9180
|
|
|
9075
9181
|
/**
|
|
9076
|
-
*
|
|
9182
|
+
* Companion type for {@link fromURLSearchParams}.
|
|
9077
9183
|
*
|
|
9078
|
-
* @category
|
|
9184
|
+
* @category URLSearchParams
|
|
9079
9185
|
* @since 4.0.0
|
|
9080
9186
|
*/
|
|
9081
|
-
export interface fromURLSearchParams<S extends Top> extends decodeTo<S, URLSearchParams> {
|
|
9187
|
+
export interface fromURLSearchParams<S extends Top> extends decodeTo<S, URLSearchParams> {
|
|
9188
|
+
readonly "~rebuild.out": fromURLSearchParams<S>
|
|
9189
|
+
}
|
|
9082
9190
|
|
|
9083
9191
|
/**
|
|
9084
9192
|
* `Schema.fromURLSearchParams` returns a schema that reads a `URLSearchParams`
|
|
@@ -9159,42 +9267,50 @@ export function fromURLSearchParams<S extends Top>(schema: S): fromURLSearchPara
|
|
|
9159
9267
|
}
|
|
9160
9268
|
|
|
9161
9269
|
/**
|
|
9162
|
-
*
|
|
9270
|
+
* Companion type for {@link Finite}.
|
|
9163
9271
|
*
|
|
9164
|
-
* @category
|
|
9272
|
+
* @category Number
|
|
9165
9273
|
* @since 4.0.0
|
|
9166
9274
|
*/
|
|
9167
|
-
export interface Finite extends Number {
|
|
9275
|
+
export interface Finite extends Number {
|
|
9276
|
+
readonly "~rebuild.out": Finite
|
|
9277
|
+
}
|
|
9168
9278
|
|
|
9169
9279
|
/**
|
|
9170
9280
|
* A schema for finite numbers, rejecting `NaN`, `Infinity`, and `-Infinity`.
|
|
9171
9281
|
*
|
|
9282
|
+
* @category Number
|
|
9172
9283
|
* @since 4.0.0
|
|
9173
9284
|
*/
|
|
9174
9285
|
export const Finite: Finite = Number.check(isFinite())
|
|
9175
9286
|
|
|
9176
9287
|
/**
|
|
9177
|
-
*
|
|
9288
|
+
* Companion type for {@link Int}.
|
|
9178
9289
|
*
|
|
9179
|
-
* @category
|
|
9290
|
+
* @category Number
|
|
9180
9291
|
* @since 4.0.0
|
|
9181
9292
|
*/
|
|
9182
|
-
export interface Int extends Number {
|
|
9293
|
+
export interface Int extends Number {
|
|
9294
|
+
readonly "~rebuild.out": Int
|
|
9295
|
+
}
|
|
9183
9296
|
|
|
9184
9297
|
/**
|
|
9185
9298
|
* A schema for integers, rejecting `NaN`, `Infinity`, and `-Infinity`.
|
|
9186
9299
|
*
|
|
9300
|
+
* @category Number
|
|
9187
9301
|
* @since 4.0.0
|
|
9188
9302
|
*/
|
|
9189
9303
|
export const Int: Int = Number.check(isInt())
|
|
9190
9304
|
|
|
9191
9305
|
/**
|
|
9192
|
-
*
|
|
9306
|
+
* Companion type for {@link NumberFromString}.
|
|
9193
9307
|
*
|
|
9194
|
-
* @category
|
|
9308
|
+
* @category Number
|
|
9195
9309
|
* @since 4.0.0
|
|
9196
9310
|
*/
|
|
9197
|
-
export interface NumberFromString extends decodeTo<Finite, String> {
|
|
9311
|
+
export interface NumberFromString extends decodeTo<Finite, String> {
|
|
9312
|
+
readonly "~rebuild.out": NumberFromString
|
|
9313
|
+
}
|
|
9198
9314
|
|
|
9199
9315
|
/**
|
|
9200
9316
|
* A transformation schema that parses a string into a number.
|
|
@@ -9205,6 +9321,7 @@ export interface NumberFromString extends decodeTo<Finite, String> {}
|
|
|
9205
9321
|
* Encoding:
|
|
9206
9322
|
* - A number is encoded as a `string`.
|
|
9207
9323
|
*
|
|
9324
|
+
* @category Number
|
|
9208
9325
|
* @since 4.0.0
|
|
9209
9326
|
*/
|
|
9210
9327
|
export const NumberFromString: NumberFromString = String.annotate({
|
|
@@ -9212,12 +9329,14 @@ export const NumberFromString: NumberFromString = String.annotate({
|
|
|
9212
9329
|
}).pipe(decodeTo(Number, Transformation.numberFromString))
|
|
9213
9330
|
|
|
9214
9331
|
/**
|
|
9215
|
-
*
|
|
9332
|
+
* Companion type for {@link FiniteFromString}.
|
|
9216
9333
|
*
|
|
9217
|
-
* @category
|
|
9334
|
+
* @category Number
|
|
9218
9335
|
* @since 4.0.0
|
|
9219
9336
|
*/
|
|
9220
|
-
export interface FiniteFromString extends decodeTo<Finite, String> {
|
|
9337
|
+
export interface FiniteFromString extends decodeTo<Finite, String> {
|
|
9338
|
+
readonly "~rebuild.out": FiniteFromString
|
|
9339
|
+
}
|
|
9221
9340
|
|
|
9222
9341
|
/**
|
|
9223
9342
|
* A transformation schema that parses a string into a finite number.
|
|
@@ -9229,6 +9348,7 @@ export interface FiniteFromString extends decodeTo<Finite, String> {}
|
|
|
9229
9348
|
* Encoding:
|
|
9230
9349
|
* - A finite number is encoded as a `string`.
|
|
9231
9350
|
*
|
|
9351
|
+
* @category Number
|
|
9232
9352
|
* @since 4.0.0
|
|
9233
9353
|
*/
|
|
9234
9354
|
export const FiniteFromString: FiniteFromString = String.annotate({
|
|
@@ -9236,27 +9356,58 @@ export const FiniteFromString: FiniteFromString = String.annotate({
|
|
|
9236
9356
|
}).pipe(decodeTo(Finite, Transformation.numberFromString))
|
|
9237
9357
|
|
|
9238
9358
|
/**
|
|
9239
|
-
*
|
|
9359
|
+
* Companion type for {@link BigIntFromString}.
|
|
9240
9360
|
*
|
|
9241
|
-
* @category
|
|
9361
|
+
* @category BigInt
|
|
9362
|
+
* @since 4.0.0
|
|
9363
|
+
*/
|
|
9364
|
+
export interface BigIntFromString extends decodeTo<BigInt, String> {
|
|
9365
|
+
readonly "~rebuild.out": BigIntFromString
|
|
9366
|
+
}
|
|
9367
|
+
|
|
9368
|
+
/**
|
|
9369
|
+
* A transformation schema that parses a string into a `bigint`.
|
|
9370
|
+
*
|
|
9371
|
+
* Decoding:
|
|
9372
|
+
* - A `string` is decoded as a `bigint`.
|
|
9373
|
+
*
|
|
9374
|
+
* Encoding:
|
|
9375
|
+
* - A `bigint` is encoded as a `string`.
|
|
9376
|
+
*
|
|
9377
|
+
* @category BigInt
|
|
9378
|
+
* @since 4.0.0
|
|
9379
|
+
*/
|
|
9380
|
+
export const BigIntFromString: BigIntFromString = make<String>(AST.bigIntString).pipe(
|
|
9381
|
+
decodeTo(BigInt, Transformation.bigintFromString)
|
|
9382
|
+
)
|
|
9383
|
+
|
|
9384
|
+
/**
|
|
9385
|
+
* Companion type for {@link Trimmed}.
|
|
9386
|
+
*
|
|
9387
|
+
* @category String
|
|
9242
9388
|
* @since 4.0.0
|
|
9243
9389
|
*/
|
|
9244
|
-
export interface Trimmed extends String {
|
|
9390
|
+
export interface Trimmed extends String {
|
|
9391
|
+
readonly "~rebuild.out": Trimmed
|
|
9392
|
+
}
|
|
9245
9393
|
|
|
9246
9394
|
/**
|
|
9247
9395
|
* A schema for strings that contains no leading or trailing whitespaces.
|
|
9248
9396
|
*
|
|
9397
|
+
* @category String
|
|
9249
9398
|
* @since 4.0.0
|
|
9250
9399
|
*/
|
|
9251
9400
|
export const Trimmed: Trimmed = String.check(isTrimmed())
|
|
9252
9401
|
|
|
9253
9402
|
/**
|
|
9254
|
-
*
|
|
9403
|
+
* Companion type for {@link Trim}.
|
|
9255
9404
|
*
|
|
9256
|
-
* @category
|
|
9405
|
+
* @category String
|
|
9257
9406
|
* @since 4.0.0
|
|
9258
9407
|
*/
|
|
9259
|
-
export interface Trim extends decodeTo<Trimmed, String> {
|
|
9408
|
+
export interface Trim extends decodeTo<Trimmed, String> {
|
|
9409
|
+
readonly "~rebuild.out": Trim
|
|
9410
|
+
}
|
|
9260
9411
|
|
|
9261
9412
|
/**
|
|
9262
9413
|
* A transformation schema that trims whitespace from a string.
|
|
@@ -9267,21 +9418,154 @@ export interface Trim extends decodeTo<Trimmed, String> {}
|
|
|
9267
9418
|
* Encoding:
|
|
9268
9419
|
* - The trimmed string is encoded as is.
|
|
9269
9420
|
*
|
|
9421
|
+
* @category String
|
|
9270
9422
|
* @since 4.0.0
|
|
9271
9423
|
*/
|
|
9272
9424
|
export const Trim: Trim = String.annotate({
|
|
9273
9425
|
expected: "a string that will be decoded as a trimmed string"
|
|
9274
9426
|
}).pipe(decodeTo(Trimmed, Transformation.trim()))
|
|
9275
9427
|
|
|
9428
|
+
/**
|
|
9429
|
+
* Companion type for {@link StringFromBase64}.
|
|
9430
|
+
*
|
|
9431
|
+
* @category String
|
|
9432
|
+
* @since 4.0.0
|
|
9433
|
+
*/
|
|
9434
|
+
export interface StringFromBase64 extends decodeTo<String, String> {
|
|
9435
|
+
readonly "~rebuild.out": StringFromBase64
|
|
9436
|
+
}
|
|
9437
|
+
|
|
9438
|
+
/**
|
|
9439
|
+
* Decodes a base64 (RFC4648) encoded string into a UTF-8 string.
|
|
9440
|
+
*
|
|
9441
|
+
* Decoding:
|
|
9442
|
+
* - A **valid** base64 encoded string is decoded as a UTF-8 `string`.
|
|
9443
|
+
*
|
|
9444
|
+
* Encoding:
|
|
9445
|
+
* - A `string` is encoded as a base64-encoded string.
|
|
9446
|
+
*
|
|
9447
|
+
* @category String
|
|
9448
|
+
* @since 4.0.0
|
|
9449
|
+
*/
|
|
9450
|
+
export const StringFromBase64: StringFromBase64 = String.annotate({
|
|
9451
|
+
expected: "a base64 encoded string that will be decoded as a UTF-8 string"
|
|
9452
|
+
}).pipe(
|
|
9453
|
+
decodeTo(String, Transformation.stringFromBase64String)
|
|
9454
|
+
)
|
|
9455
|
+
|
|
9456
|
+
/**
|
|
9457
|
+
* Companion type for {@link StringFromBase64Url}.
|
|
9458
|
+
*
|
|
9459
|
+
* @category String
|
|
9460
|
+
* @since 4.0.0
|
|
9461
|
+
*/
|
|
9462
|
+
export interface StringFromBase64Url extends decodeTo<String, String> {
|
|
9463
|
+
readonly "~rebuild.out": StringFromBase64Url
|
|
9464
|
+
}
|
|
9465
|
+
|
|
9466
|
+
/**
|
|
9467
|
+
* Decodes a base64 (URL) encoded string into a UTF-8 string.
|
|
9468
|
+
*
|
|
9469
|
+
* Decoding:
|
|
9470
|
+
* - A **valid** base64 (URL) encoded string is decoded as a UTF-8 `string`.
|
|
9471
|
+
*
|
|
9472
|
+
* Encoding:
|
|
9473
|
+
* - A `string` is encoded as a base64 (URL) encoded string.
|
|
9474
|
+
*
|
|
9475
|
+
* @category String
|
|
9476
|
+
* @since 4.0.0
|
|
9477
|
+
*/
|
|
9478
|
+
export const StringFromBase64Url: StringFromBase64Url = String.annotate({
|
|
9479
|
+
expected: "a base64 (URL) encoded string that will be decoded as a UTF-8 string"
|
|
9480
|
+
}).pipe(
|
|
9481
|
+
decodeTo(String, Transformation.stringFromBase64UrlString)
|
|
9482
|
+
)
|
|
9483
|
+
|
|
9484
|
+
/**
|
|
9485
|
+
* Companion type for {@link StringFromHex}.
|
|
9486
|
+
*
|
|
9487
|
+
* @category String
|
|
9488
|
+
* @since 4.0.0
|
|
9489
|
+
*/
|
|
9490
|
+
export interface StringFromHex extends decodeTo<String, String> {
|
|
9491
|
+
readonly "~rebuild.out": StringFromHex
|
|
9492
|
+
}
|
|
9493
|
+
|
|
9494
|
+
/**
|
|
9495
|
+
* Decodes a hex encoded string into a UTF-8 string.
|
|
9496
|
+
*
|
|
9497
|
+
* Decoding:
|
|
9498
|
+
* - A **valid** hex encoded string is decoded as a UTF-8 `string`.
|
|
9499
|
+
*
|
|
9500
|
+
* Encoding:
|
|
9501
|
+
* - A `string` is encoded as a hex string.
|
|
9502
|
+
*
|
|
9503
|
+
* @category String
|
|
9504
|
+
* @since 4.0.0
|
|
9505
|
+
*/
|
|
9506
|
+
export const StringFromHex: StringFromHex = String.annotate({
|
|
9507
|
+
expected: "a hex encoded string that will be decoded as a UTF-8 string"
|
|
9508
|
+
}).pipe(
|
|
9509
|
+
decodeTo(String, Transformation.stringFromHexString)
|
|
9510
|
+
)
|
|
9511
|
+
|
|
9512
|
+
/**
|
|
9513
|
+
* Companion type for {@link StringFromUriComponent}.
|
|
9514
|
+
*
|
|
9515
|
+
* @category String
|
|
9516
|
+
* @since 4.0.0
|
|
9517
|
+
*/
|
|
9518
|
+
export interface StringFromUriComponent extends decodeTo<String, String> {
|
|
9519
|
+
readonly "~rebuild.out": StringFromUriComponent
|
|
9520
|
+
}
|
|
9521
|
+
|
|
9522
|
+
/**
|
|
9523
|
+
* Decodes a URI component encoded string into a UTF-8 string.
|
|
9524
|
+
* Can be used to store data in a URL.
|
|
9525
|
+
*
|
|
9526
|
+
* Decoding:
|
|
9527
|
+
* - A **valid** URI component encoded string is decoded as a UTF-8 `string`.
|
|
9528
|
+
*
|
|
9529
|
+
* Encoding:
|
|
9530
|
+
* - A `string` is encoded as a URI component encoded string.
|
|
9531
|
+
*
|
|
9532
|
+
* **Example**
|
|
9533
|
+
*
|
|
9534
|
+
* ```ts
|
|
9535
|
+
* import { Schema } from "effect"
|
|
9536
|
+
*
|
|
9537
|
+
* const PaginationSchema = Schema.Struct({
|
|
9538
|
+
* maxItemPerPage: Schema.Number,
|
|
9539
|
+
* page: Schema.Number
|
|
9540
|
+
* })
|
|
9541
|
+
*
|
|
9542
|
+
* const UrlSchema = Schema.StringFromUriComponent.pipe(
|
|
9543
|
+
* Schema.decodeTo(Schema.fromJsonString(PaginationSchema))
|
|
9544
|
+
* )
|
|
9545
|
+
*
|
|
9546
|
+
* console.log(Schema.encodeSync(UrlSchema)({ maxItemPerPage: 10, page: 1 }))
|
|
9547
|
+
* // %7B%22maxItemPerPage%22%3A10%2C%22page%22%3A1%7D
|
|
9548
|
+
* ```
|
|
9549
|
+
*
|
|
9550
|
+
* @category String
|
|
9551
|
+
* @since 4.0.0
|
|
9552
|
+
*/
|
|
9553
|
+
export const StringFromUriComponent: StringFromUriComponent = String.annotate({
|
|
9554
|
+
expected: "a URI component encoded string that will be decoded as a UTF-8 string"
|
|
9555
|
+
}).pipe(
|
|
9556
|
+
decodeTo(String, Transformation.stringFromUriComponent)
|
|
9557
|
+
)
|
|
9558
|
+
|
|
9276
9559
|
/**
|
|
9277
9560
|
* A union schema for JavaScript property keys: `number | symbol | string`.
|
|
9278
9561
|
*
|
|
9279
|
-
* @category
|
|
9562
|
+
* @category PropertyKey
|
|
9280
9563
|
* @since 4.0.0
|
|
9281
9564
|
*/
|
|
9282
9565
|
export const PropertyKey = Union([Finite, Symbol, String])
|
|
9283
9566
|
|
|
9284
9567
|
/**
|
|
9568
|
+
* @category StandardSchema
|
|
9285
9569
|
* @since 4.0.0
|
|
9286
9570
|
*/
|
|
9287
9571
|
export const StandardSchemaV1FailureResult = Struct({
|
|
@@ -9292,12 +9576,14 @@ export const StandardSchemaV1FailureResult = Struct({
|
|
|
9292
9576
|
})
|
|
9293
9577
|
|
|
9294
9578
|
/**
|
|
9295
|
-
*
|
|
9579
|
+
* Companion type for {@link BooleanFromBit}.
|
|
9296
9580
|
*
|
|
9297
|
-
* @category
|
|
9581
|
+
* @category Boolean
|
|
9298
9582
|
* @since 4.0.0
|
|
9299
9583
|
*/
|
|
9300
|
-
export interface BooleanFromBit extends decodeTo<Boolean, Literals<readonly [0, 1]>> {
|
|
9584
|
+
export interface BooleanFromBit extends decodeTo<Boolean, Literals<readonly [0, 1]>> {
|
|
9585
|
+
readonly "~rebuild.out": BooleanFromBit
|
|
9586
|
+
}
|
|
9301
9587
|
|
|
9302
9588
|
/**
|
|
9303
9589
|
* A boolean parsed from 0 or 1.
|
|
@@ -9316,12 +9602,14 @@ export const BooleanFromBit: BooleanFromBit = Literals([0, 1]).pipe(
|
|
|
9316
9602
|
)
|
|
9317
9603
|
|
|
9318
9604
|
/**
|
|
9319
|
-
*
|
|
9605
|
+
* Companion type for {@link Uint8Array}.
|
|
9320
9606
|
*
|
|
9321
|
-
* @category
|
|
9607
|
+
* @category Uint8Array
|
|
9322
9608
|
* @since 4.0.0
|
|
9323
9609
|
*/
|
|
9324
|
-
export interface Uint8Array extends instanceOf<globalThis.Uint8Array<ArrayBufferLike>> {
|
|
9610
|
+
export interface Uint8Array extends instanceOf<globalThis.Uint8Array<ArrayBufferLike>> {
|
|
9611
|
+
readonly "~rebuild.out": Uint8Array
|
|
9612
|
+
}
|
|
9325
9613
|
|
|
9326
9614
|
const Base64String = String.annotate({
|
|
9327
9615
|
expected: "a base64 encoded string that will be decoded as Uint8Array",
|
|
@@ -9357,12 +9645,14 @@ export const Uint8Array: Uint8Array = instanceOf(globalThis.Uint8Array<ArrayBuff
|
|
|
9357
9645
|
})
|
|
9358
9646
|
|
|
9359
9647
|
/**
|
|
9360
|
-
*
|
|
9648
|
+
* Companion type for {@link Uint8ArrayFromBase64}.
|
|
9361
9649
|
*
|
|
9362
|
-
* @category
|
|
9650
|
+
* @category Uint8Array
|
|
9363
9651
|
* @since 4.0.0
|
|
9364
9652
|
*/
|
|
9365
|
-
export interface Uint8ArrayFromBase64 extends decodeTo<Uint8Array, String> {
|
|
9653
|
+
export interface Uint8ArrayFromBase64 extends decodeTo<Uint8Array, String> {
|
|
9654
|
+
readonly "~rebuild.out": Uint8ArrayFromBase64
|
|
9655
|
+
}
|
|
9366
9656
|
|
|
9367
9657
|
/**
|
|
9368
9658
|
* A transformation schema that decodes a base64 encoded string into a
|
|
@@ -9382,12 +9672,14 @@ export const Uint8ArrayFromBase64: Uint8ArrayFromBase64 = Base64String.pipe(
|
|
|
9382
9672
|
)
|
|
9383
9673
|
|
|
9384
9674
|
/**
|
|
9385
|
-
*
|
|
9675
|
+
* Companion type for {@link Uint8ArrayFromBase64Url}.
|
|
9386
9676
|
*
|
|
9387
|
-
* @category
|
|
9677
|
+
* @category Uint8Array
|
|
9388
9678
|
* @since 4.0.0
|
|
9389
9679
|
*/
|
|
9390
|
-
export interface Uint8ArrayFromBase64Url extends decodeTo<Uint8Array, String> {
|
|
9680
|
+
export interface Uint8ArrayFromBase64Url extends decodeTo<Uint8Array, String> {
|
|
9681
|
+
readonly "~rebuild.out": Uint8ArrayFromBase64Url
|
|
9682
|
+
}
|
|
9391
9683
|
|
|
9392
9684
|
/**
|
|
9393
9685
|
* A transformation schema that decodes a base64 (URL) encoded string into a
|
|
@@ -9412,12 +9704,14 @@ export const Uint8ArrayFromBase64Url: Uint8ArrayFromBase64Url = String.annotate(
|
|
|
9412
9704
|
)
|
|
9413
9705
|
|
|
9414
9706
|
/**
|
|
9415
|
-
*
|
|
9707
|
+
* Companion type for {@link Uint8ArrayFromHex}.
|
|
9416
9708
|
*
|
|
9417
|
-
* @category
|
|
9709
|
+
* @category Uint8Array
|
|
9418
9710
|
* @since 4.0.0
|
|
9419
9711
|
*/
|
|
9420
|
-
export interface Uint8ArrayFromHex extends decodeTo<Uint8Array, String> {
|
|
9712
|
+
export interface Uint8ArrayFromHex extends decodeTo<Uint8Array, String> {
|
|
9713
|
+
readonly "~rebuild.out": Uint8ArrayFromHex
|
|
9714
|
+
}
|
|
9421
9715
|
|
|
9422
9716
|
/**
|
|
9423
9717
|
* A transformation schema that decodes a hex encoded string into a
|
|
@@ -9442,12 +9736,14 @@ export const Uint8ArrayFromHex: Uint8ArrayFromHex = String.annotate({
|
|
|
9442
9736
|
)
|
|
9443
9737
|
|
|
9444
9738
|
/**
|
|
9445
|
-
*
|
|
9739
|
+
* Companion type for {@link DateTimeUtc}.
|
|
9446
9740
|
*
|
|
9447
9741
|
* @category DateTime
|
|
9448
9742
|
* @since 4.0.0
|
|
9449
9743
|
*/
|
|
9450
|
-
export interface DateTimeUtc extends declare<DateTime.Utc> {
|
|
9744
|
+
export interface DateTimeUtc extends declare<DateTime.Utc> {
|
|
9745
|
+
readonly "~rebuild.out": DateTimeUtc
|
|
9746
|
+
}
|
|
9451
9747
|
|
|
9452
9748
|
/**
|
|
9453
9749
|
* A schema for `DateTime.Utc` values.
|
|
@@ -9484,12 +9780,14 @@ export const DateTimeUtc: DateTimeUtc = declare(
|
|
|
9484
9780
|
)
|
|
9485
9781
|
|
|
9486
9782
|
/**
|
|
9487
|
-
*
|
|
9783
|
+
* Companion type for {@link DateTimeUtcFromDate}.
|
|
9488
9784
|
*
|
|
9489
9785
|
* @category DateTime
|
|
9490
9786
|
* @since 4.0.0
|
|
9491
9787
|
*/
|
|
9492
|
-
export interface DateTimeUtcFromDate extends decodeTo<DateTimeUtc, Date> {
|
|
9788
|
+
export interface DateTimeUtcFromDate extends decodeTo<DateTimeUtc, Date> {
|
|
9789
|
+
readonly "~rebuild.out": DateTimeUtcFromDate
|
|
9790
|
+
}
|
|
9493
9791
|
|
|
9494
9792
|
/**
|
|
9495
9793
|
* A transformation schema that decodes a `Date` into a `DateTime.Utc`.
|
|
@@ -9511,12 +9809,14 @@ export const DateTimeUtcFromDate: DateTimeUtcFromDate = DateValid.pipe(
|
|
|
9511
9809
|
)
|
|
9512
9810
|
|
|
9513
9811
|
/**
|
|
9514
|
-
*
|
|
9812
|
+
* Companion type for {@link DateTimeUtcFromString}.
|
|
9515
9813
|
*
|
|
9516
9814
|
* @category DateTime
|
|
9517
9815
|
* @since 4.0.0
|
|
9518
9816
|
*/
|
|
9519
|
-
export interface DateTimeUtcFromString extends decodeTo<DateTimeUtc, String> {
|
|
9817
|
+
export interface DateTimeUtcFromString extends decodeTo<DateTimeUtc, String> {
|
|
9818
|
+
readonly "~rebuild.out": DateTimeUtcFromString
|
|
9819
|
+
}
|
|
9520
9820
|
|
|
9521
9821
|
/**
|
|
9522
9822
|
* A transformation schema that decodes a string into a `DateTime.Utc`.
|
|
@@ -9542,12 +9842,14 @@ export const DateTimeUtcFromString: DateTimeUtcFromString = String.annotate({
|
|
|
9542
9842
|
)
|
|
9543
9843
|
|
|
9544
9844
|
/**
|
|
9545
|
-
*
|
|
9845
|
+
* Companion type for {@link DateTimeUtcFromMillis}.
|
|
9546
9846
|
*
|
|
9547
9847
|
* @category DateTime
|
|
9548
9848
|
* @since 4.0.0
|
|
9549
9849
|
*/
|
|
9550
|
-
export interface DateTimeUtcFromMillis extends decodeTo<instanceOf<DateTime.Utc>, Number> {
|
|
9850
|
+
export interface DateTimeUtcFromMillis extends decodeTo<instanceOf<DateTime.Utc>, Number> {
|
|
9851
|
+
readonly "~rebuild.out": DateTimeUtcFromMillis
|
|
9852
|
+
}
|
|
9551
9853
|
|
|
9552
9854
|
/**
|
|
9553
9855
|
* A transformation schema that decodes a number into a `DateTime.Utc`.
|
|
@@ -9569,12 +9871,14 @@ export const DateTimeUtcFromMillis: DateTimeUtcFromMillis = Number.pipe(
|
|
|
9569
9871
|
)
|
|
9570
9872
|
|
|
9571
9873
|
/**
|
|
9572
|
-
*
|
|
9874
|
+
* Companion type for {@link TimeZoneOffset}.
|
|
9573
9875
|
*
|
|
9574
9876
|
* @category DateTime
|
|
9575
9877
|
* @since 4.0.0
|
|
9576
9878
|
*/
|
|
9577
|
-
export interface TimeZoneOffset extends declare<DateTime.TimeZone.Offset> {
|
|
9879
|
+
export interface TimeZoneOffset extends declare<DateTime.TimeZone.Offset> {
|
|
9880
|
+
readonly "~rebuild.out": TimeZoneOffset
|
|
9881
|
+
}
|
|
9578
9882
|
|
|
9579
9883
|
/**
|
|
9580
9884
|
* A schema for `DateTime.TimeZone.Offset` values.
|
|
@@ -9611,12 +9915,16 @@ export const TimeZoneOffset: TimeZoneOffset = declare(
|
|
|
9611
9915
|
)
|
|
9612
9916
|
|
|
9613
9917
|
/**
|
|
9614
|
-
*
|
|
9918
|
+
* Companion type for {@link TimeZoneNamed}.
|
|
9615
9919
|
*
|
|
9616
9920
|
* @category DateTime
|
|
9617
9921
|
* @since 4.0.0
|
|
9618
9922
|
*/
|
|
9619
|
-
export interface TimeZoneNamed extends declare<DateTime.TimeZone.Named> {
|
|
9923
|
+
export interface TimeZoneNamed extends declare<DateTime.TimeZone.Named> {
|
|
9924
|
+
readonly "~rebuild.out": TimeZoneNamed
|
|
9925
|
+
}
|
|
9926
|
+
|
|
9927
|
+
const TimeZoneNamedString = String.annotate({ expected: "an IANA time zone identifier" })
|
|
9620
9928
|
|
|
9621
9929
|
/**
|
|
9622
9930
|
* A schema for `DateTime.TimeZone.Named` values.
|
|
@@ -9642,7 +9950,7 @@ export const TimeZoneNamed: TimeZoneNamed = declare(
|
|
|
9642
9950
|
expected: "DateTime.TimeZone.Named",
|
|
9643
9951
|
toCodecJson: () =>
|
|
9644
9952
|
link<DateTime.TimeZone.Named>()(
|
|
9645
|
-
|
|
9953
|
+
TimeZoneNamedString,
|
|
9646
9954
|
Transformation.timeZoneNamedFromString
|
|
9647
9955
|
),
|
|
9648
9956
|
toArbitrary: () => (fc) =>
|
|
@@ -9657,12 +9965,44 @@ export const TimeZoneNamed: TimeZoneNamed = declare(
|
|
|
9657
9965
|
)
|
|
9658
9966
|
|
|
9659
9967
|
/**
|
|
9660
|
-
*
|
|
9968
|
+
* Companion type for {@link TimeZoneNamedFromString}.
|
|
9661
9969
|
*
|
|
9662
9970
|
* @category DateTime
|
|
9663
9971
|
* @since 4.0.0
|
|
9664
9972
|
*/
|
|
9665
|
-
export interface
|
|
9973
|
+
export interface TimeZoneNamedFromString extends decodeTo<TimeZoneNamed, String> {
|
|
9974
|
+
readonly "~rebuild.out": TimeZoneNamedFromString
|
|
9975
|
+
}
|
|
9976
|
+
|
|
9977
|
+
/**
|
|
9978
|
+
* A transformation schema that parses an IANA time zone identifier string into a `DateTime.TimeZone.Named`.
|
|
9979
|
+
*
|
|
9980
|
+
* Decoding:
|
|
9981
|
+
* - A `string` is decoded as a `DateTime.TimeZone.Named`.
|
|
9982
|
+
*
|
|
9983
|
+
* Encoding:
|
|
9984
|
+
* - A `DateTime.TimeZone.Named` is encoded as a `string`.
|
|
9985
|
+
*
|
|
9986
|
+
* @category DateTime
|
|
9987
|
+
* @since 4.0.0
|
|
9988
|
+
*/
|
|
9989
|
+
export const TimeZoneNamedFromString: TimeZoneNamedFromString = TimeZoneNamedString.pipe(
|
|
9990
|
+
decodeTo(TimeZoneNamed, Transformation.timeZoneNamedFromString)
|
|
9991
|
+
)
|
|
9992
|
+
|
|
9993
|
+
/**
|
|
9994
|
+
* Companion type for {@link TimeZone}.
|
|
9995
|
+
*
|
|
9996
|
+
* @category DateTime
|
|
9997
|
+
* @since 4.0.0
|
|
9998
|
+
*/
|
|
9999
|
+
export interface TimeZone extends declare<DateTime.TimeZone> {
|
|
10000
|
+
readonly "~rebuild.out": TimeZone
|
|
10001
|
+
}
|
|
10002
|
+
|
|
10003
|
+
const TimeZoneString = String.annotate({
|
|
10004
|
+
expected: "a time zone string (IANA identifier or offset like +03:00)"
|
|
10005
|
+
})
|
|
9666
10006
|
|
|
9667
10007
|
/**
|
|
9668
10008
|
* A schema for `DateTime.TimeZone` values.
|
|
@@ -9689,7 +10029,7 @@ export const TimeZone: TimeZone = declare(
|
|
|
9689
10029
|
expected: "DateTime.TimeZone",
|
|
9690
10030
|
toCodecJson: () =>
|
|
9691
10031
|
link<DateTime.TimeZone>()(
|
|
9692
|
-
|
|
10032
|
+
TimeZoneString,
|
|
9693
10033
|
Transformation.timeZoneFromString
|
|
9694
10034
|
),
|
|
9695
10035
|
toArbitrary: () => (fc) =>
|
|
@@ -9707,12 +10047,44 @@ export const TimeZone: TimeZone = declare(
|
|
|
9707
10047
|
)
|
|
9708
10048
|
|
|
9709
10049
|
/**
|
|
9710
|
-
*
|
|
10050
|
+
* Companion type for {@link TimeZoneFromString}.
|
|
10051
|
+
*
|
|
10052
|
+
* @category DateTime
|
|
10053
|
+
* @since 4.0.0
|
|
10054
|
+
*/
|
|
10055
|
+
export interface TimeZoneFromString extends decodeTo<TimeZone, String> {
|
|
10056
|
+
readonly "~rebuild.out": TimeZoneFromString
|
|
10057
|
+
}
|
|
10058
|
+
|
|
10059
|
+
/**
|
|
10060
|
+
* A transformation schema that parses a time zone string into a `DateTime.TimeZone`.
|
|
10061
|
+
*
|
|
10062
|
+
* Decoding:
|
|
10063
|
+
* - A `string` (IANA identifier or offset like `+03:00`) is decoded as a `DateTime.TimeZone`.
|
|
10064
|
+
*
|
|
10065
|
+
* Encoding:
|
|
10066
|
+
* - A `DateTime.TimeZone` is encoded as a `string`.
|
|
10067
|
+
*
|
|
10068
|
+
* @category DateTime
|
|
10069
|
+
* @since 4.0.0
|
|
10070
|
+
*/
|
|
10071
|
+
export const TimeZoneFromString: TimeZoneFromString = TimeZoneString.pipe(
|
|
10072
|
+
decodeTo(TimeZone, Transformation.timeZoneFromString)
|
|
10073
|
+
)
|
|
10074
|
+
|
|
10075
|
+
/**
|
|
10076
|
+
* Companion type for {@link DateTimeZoned}.
|
|
9711
10077
|
*
|
|
9712
10078
|
* @category DateTime
|
|
9713
10079
|
* @since 4.0.0
|
|
9714
10080
|
*/
|
|
9715
|
-
export interface DateTimeZoned extends declare<DateTime.Zoned> {
|
|
10081
|
+
export interface DateTimeZoned extends declare<DateTime.Zoned> {
|
|
10082
|
+
readonly "~rebuild.out": DateTimeZoned
|
|
10083
|
+
}
|
|
10084
|
+
|
|
10085
|
+
const DateTimeZonedString = String.annotate({
|
|
10086
|
+
expected: "a zoned DateTime string (e.g. 2024-01-01T00:00:00.000+00:00[Europe/London])"
|
|
10087
|
+
})
|
|
9716
10088
|
|
|
9717
10089
|
/**
|
|
9718
10090
|
* A schema for `DateTime.Zoned` values.
|
|
@@ -9739,7 +10111,7 @@ export const DateTimeZoned: DateTimeZoned = declare(
|
|
|
9739
10111
|
expected: "DateTime.Zoned",
|
|
9740
10112
|
toCodecJson: () =>
|
|
9741
10113
|
link<DateTime.Zoned>()(
|
|
9742
|
-
|
|
10114
|
+
DateTimeZonedString,
|
|
9743
10115
|
Transformation.dateTimeZonedFromString
|
|
9744
10116
|
),
|
|
9745
10117
|
toArbitrary: () => (fc, ctx) =>
|
|
@@ -9757,6 +10129,32 @@ export const DateTimeZoned: DateTimeZoned = declare(
|
|
|
9757
10129
|
}
|
|
9758
10130
|
)
|
|
9759
10131
|
|
|
10132
|
+
/**
|
|
10133
|
+
* Companion type for {@link DateTimeZonedFromString}.
|
|
10134
|
+
*
|
|
10135
|
+
* @category DateTime
|
|
10136
|
+
* @since 4.0.0
|
|
10137
|
+
*/
|
|
10138
|
+
export interface DateTimeZonedFromString extends decodeTo<DateTimeZoned, String> {
|
|
10139
|
+
readonly "~rebuild.out": DateTimeZonedFromString
|
|
10140
|
+
}
|
|
10141
|
+
|
|
10142
|
+
/**
|
|
10143
|
+
* A transformation schema that parses a zoned DateTime string into a `DateTime.Zoned`.
|
|
10144
|
+
*
|
|
10145
|
+
* Decoding:
|
|
10146
|
+
* - A `string` (e.g. `2024-01-01T00:00:00.000+00:00[Europe/London]`) is decoded as a `DateTime.Zoned`.
|
|
10147
|
+
*
|
|
10148
|
+
* Encoding:
|
|
10149
|
+
* - A `DateTime.Zoned` is encoded as a `string`.
|
|
10150
|
+
*
|
|
10151
|
+
* @category DateTime
|
|
10152
|
+
* @since 4.0.0
|
|
10153
|
+
*/
|
|
10154
|
+
export const DateTimeZonedFromString: DateTimeZonedFromString = DateTimeZonedString.pipe(
|
|
10155
|
+
decodeTo(DateTimeZoned, Transformation.dateTimeZonedFromString)
|
|
10156
|
+
)
|
|
10157
|
+
|
|
9760
10158
|
// -----------------------------------------------------------------------------
|
|
9761
10159
|
// Class
|
|
9762
10160
|
// -----------------------------------------------------------------------------
|
|
@@ -9791,7 +10189,6 @@ export interface Class<Self, S extends Top & { readonly fields: Struct.Fields },
|
|
|
9791
10189
|
S["~encoded.optionality"]
|
|
9792
10190
|
>
|
|
9793
10191
|
{
|
|
9794
|
-
// intentionally left without `readonly "~rebuild.out": this`
|
|
9795
10192
|
new(
|
|
9796
10193
|
...args: {} extends S["~type.make.in"] ? [props?: S["~type.make.in"], options?: MakeOptions]
|
|
9797
10194
|
: [props: S["~type.make.in"], options?: MakeOptions]
|
|
@@ -9818,31 +10215,22 @@ export interface Class<Self, S extends Top & { readonly fields: Struct.Fields },
|
|
|
9818
10215
|
readonly unsafePreserveChecks?: boolean | undefined
|
|
9819
10216
|
} | undefined
|
|
9820
10217
|
): Struct<Simplify<Readonly<To>>>
|
|
9821
|
-
}
|
|
9822
|
-
|
|
9823
|
-
type AddStaticMembers<C, Static> = C & Pick<Static, Exclude<keyof Static, keyof C>>
|
|
9824
10218
|
|
|
9825
|
-
|
|
9826
|
-
* A {@link Class} that additionally exposes an `extend` method, allowing
|
|
9827
|
-
* subclasses to be derived with extra fields while inheriting all parent
|
|
9828
|
-
* fields and validation.
|
|
9829
|
-
*
|
|
9830
|
-
* @since 4.0.0
|
|
9831
|
-
*/
|
|
9832
|
-
export interface ExtendableClass<Self, S extends Top & { readonly fields: Struct.Fields }, Inherited>
|
|
9833
|
-
extends Class<Self, S, Inherited>
|
|
9834
|
-
{
|
|
9835
|
-
extend<Extended, Static = {}, Brand = {}>(
|
|
10219
|
+
extend<Extended = never, Static = {}, Brand = {}>(
|
|
9836
10220
|
identifier: string
|
|
9837
10221
|
): <NewFields extends Struct.Fields>(
|
|
9838
10222
|
fields: NewFields,
|
|
9839
10223
|
annotations?: Annotations.Declaration<Extended, readonly [Struct<Simplify<Assign<S["fields"], NewFields>>>]>
|
|
9840
|
-
) =>
|
|
9841
|
-
|
|
10224
|
+
) => [Extended] extends [never] ? MissingSelfGeneric<"Base.extend"> : InheritStaticMembers<
|
|
10225
|
+
Class<Extended, Struct<Simplify<Assign<S["fields"], NewFields>>>, Self & Brand>,
|
|
9842
10226
|
Static
|
|
9843
10227
|
>
|
|
9844
10228
|
}
|
|
9845
10229
|
|
|
10230
|
+
// Merges custom static members from a parent class onto the extended class,
|
|
10231
|
+
// giving priority to the extended class's own members (e.g. schema-generated statics).
|
|
10232
|
+
type InheritStaticMembers<C, Static> = C & Pick<Static, Exclude<keyof Static, keyof C>>
|
|
10233
|
+
|
|
9846
10234
|
const immerable: unique symbol = globalThis.Symbol.for("immer-draftable") as any
|
|
9847
10235
|
|
|
9848
10236
|
function makeClass<
|
|
@@ -9853,22 +10241,19 @@ function makeClass<
|
|
|
9853
10241
|
Inherited: Inherited,
|
|
9854
10242
|
identifier: string,
|
|
9855
10243
|
struct: S,
|
|
9856
|
-
annotations
|
|
10244
|
+
annotations: Annotations.Declaration<Self, readonly [S]> | undefined,
|
|
10245
|
+
proto: ((identifier: string) => object) | undefined
|
|
9857
10246
|
): any {
|
|
9858
10247
|
const getClassSchema = getClassSchemaFactory(struct, identifier, annotations)
|
|
9859
10248
|
const ClassTypeId = getClassTypeId(identifier) // HMR support
|
|
9860
10249
|
|
|
9861
|
-
|
|
10250
|
+
const out = class extends Inherited {
|
|
9862
10251
|
constructor(...[input, options]: ReadonlyArray<any>) {
|
|
9863
10252
|
const props = input ?? {}
|
|
9864
|
-
const validated = struct.
|
|
10253
|
+
const validated = struct.make(props, options)
|
|
9865
10254
|
super({ ...props, ...validated }, { ...options, disableChecks: true })
|
|
9866
10255
|
}
|
|
9867
10256
|
|
|
9868
|
-
toString() {
|
|
9869
|
-
return `${identifier}(${format({ ...this })})`
|
|
9870
|
-
}
|
|
9871
|
-
|
|
9872
10257
|
static readonly [TypeId] = TypeId
|
|
9873
10258
|
|
|
9874
10259
|
get [ClassTypeId]() {
|
|
@@ -9878,7 +10263,7 @@ function makeClass<
|
|
|
9878
10263
|
static readonly [immerable] = true
|
|
9879
10264
|
|
|
9880
10265
|
declare static readonly "~rebuild.out": decodeTo<declareConstructor<Self, S["Encoded"], readonly [S], S["Iso"]>, S>
|
|
9881
|
-
declare static readonly "~
|
|
10266
|
+
declare static readonly "~type.parameters": readonly [S]
|
|
9882
10267
|
|
|
9883
10268
|
declare static readonly "Type": Self
|
|
9884
10269
|
declare static readonly "Encoded": S["Encoded"]
|
|
@@ -9907,9 +10292,15 @@ function makeClass<
|
|
|
9907
10292
|
static rebuild(ast: AST.Declaration) {
|
|
9908
10293
|
return getClassSchema(this).rebuild(ast)
|
|
9909
10294
|
}
|
|
9910
|
-
static
|
|
10295
|
+
static make(input: S["~type.make.in"], options?: MakeOptions): Self {
|
|
9911
10296
|
return new this(input, options)
|
|
9912
10297
|
}
|
|
10298
|
+
static makeEffect(input: S["~type.make.in"], options?: MakeOptions): Effect.Effect<Self, SchemaError> {
|
|
10299
|
+
return Effect.mapErrorEager(
|
|
10300
|
+
Parser.makeEffect(getClassSchema(this) as any)(input, options),
|
|
10301
|
+
(issue) => new SchemaError(issue)
|
|
10302
|
+
) as any
|
|
10303
|
+
}
|
|
9913
10304
|
static makeOption(input: S["~type.make.in"], options?: MakeOptions): Option_.Option<Self> {
|
|
9914
10305
|
return Parser.makeOption(getClassSchema(this) as any)(input, options) as any
|
|
9915
10306
|
}
|
|
@@ -9934,7 +10325,8 @@ function makeClass<
|
|
|
9934
10325
|
this,
|
|
9935
10326
|
identifier,
|
|
9936
10327
|
makeStruct(AST.struct(fields, struct.ast.checks, { identifier }), fields),
|
|
9937
|
-
annotations
|
|
10328
|
+
annotations,
|
|
10329
|
+
proto
|
|
9938
10330
|
)
|
|
9939
10331
|
}
|
|
9940
10332
|
}
|
|
@@ -9947,6 +10339,12 @@ function makeClass<
|
|
|
9947
10339
|
return struct.mapFields(f, options)
|
|
9948
10340
|
}
|
|
9949
10341
|
}
|
|
10342
|
+
|
|
10343
|
+
if (proto !== undefined) {
|
|
10344
|
+
Object.assign(out.prototype, proto(identifier))
|
|
10345
|
+
}
|
|
10346
|
+
|
|
10347
|
+
return out
|
|
9950
10348
|
}
|
|
9951
10349
|
|
|
9952
10350
|
function getClassTransformation(self: new(...args: ReadonlyArray<any>) => any) {
|
|
@@ -10002,6 +10400,9 @@ function isStruct(schema: Struct.Fields | Struct<Struct.Fields>): schema is Stru
|
|
|
10002
10400
|
return isSchema(schema)
|
|
10003
10401
|
}
|
|
10004
10402
|
|
|
10403
|
+
type MissingSelfGeneric<Usage extends string> =
|
|
10404
|
+
`Missing \`Self\` generic - use \`class Self extends ${Usage}<Self>(...)\``
|
|
10405
|
+
|
|
10005
10406
|
/**
|
|
10006
10407
|
* Creates a schema-backed class whose constructor validates input against a
|
|
10007
10408
|
* {@link Struct} schema. Construction throws a {@link SchemaError} on invalid
|
|
@@ -10091,7 +10492,7 @@ export const Class: {
|
|
|
10091
10492
|
* @category Constructors
|
|
10092
10493
|
* @since 4.0.0
|
|
10093
10494
|
*/
|
|
10094
|
-
<Self, Brand = {}>(identifier: string): {
|
|
10495
|
+
<Self = never, Brand = {}>(identifier: string): {
|
|
10095
10496
|
/**
|
|
10096
10497
|
* Creates a schema-backed class whose constructor validates input against a
|
|
10097
10498
|
* {@link Struct} schema. Construction throws a {@link SchemaError} on invalid
|
|
@@ -10139,7 +10540,7 @@ export const Class: {
|
|
|
10139
10540
|
<const Fields extends Struct.Fields>(
|
|
10140
10541
|
fields: Fields,
|
|
10141
10542
|
annotations?: Annotations.Declaration<Self, readonly [Struct<Fields>]>
|
|
10142
|
-
):
|
|
10543
|
+
): [Self] extends [never] ? MissingSelfGeneric<"Schema.Class"> : Class<Self, Struct<Fields>, Brand>
|
|
10143
10544
|
/**
|
|
10144
10545
|
* Creates a schema-backed class whose constructor validates input against a
|
|
10145
10546
|
* {@link Struct} schema. Construction throws a {@link SchemaError} on invalid
|
|
@@ -10184,15 +10585,25 @@ export const Class: {
|
|
|
10184
10585
|
* @category Constructors
|
|
10185
10586
|
* @since 4.0.0
|
|
10186
10587
|
*/
|
|
10187
|
-
<S extends Struct<Struct.Fields>>(schema: S, annotations?: Annotations.Declaration<Self, readonly [S]>):
|
|
10588
|
+
<S extends Struct<Struct.Fields>>(schema: S, annotations?: Annotations.Declaration<Self, readonly [S]>): [Self] extends [never] ? MissingSelfGeneric<"Schema.Class"> : Class<Self, S, Brand>
|
|
10188
10589
|
}
|
|
10189
10590
|
} = <Self, Brand = {}>(identifier: string) =>
|
|
10190
10591
|
(
|
|
10191
10592
|
schema: Struct.Fields | Struct<Struct.Fields>,
|
|
10192
10593
|
annotations?: Annotations.Declaration<Self, readonly [Struct<Struct.Fields>]>
|
|
10193
|
-
):
|
|
10594
|
+
): [Self] extends [never] ? MissingSelfGeneric<"Schema.Class"> : Class<Self, Struct<Struct.Fields>, Brand> => {
|
|
10194
10595
|
const struct = isStruct(schema) ? schema : Struct(schema)
|
|
10195
|
-
return makeClass(
|
|
10596
|
+
return makeClass(
|
|
10597
|
+
Data.Class,
|
|
10598
|
+
identifier,
|
|
10599
|
+
struct,
|
|
10600
|
+
annotations,
|
|
10601
|
+
(identifier) => ({
|
|
10602
|
+
toString() {
|
|
10603
|
+
return `${identifier}(${format({ ...this })})`
|
|
10604
|
+
}
|
|
10605
|
+
})
|
|
10606
|
+
)
|
|
10196
10607
|
}
|
|
10197
10608
|
|
|
10198
10609
|
/**
|
|
@@ -10246,7 +10657,7 @@ export const TaggedClass: {
|
|
|
10246
10657
|
* @category Constructors
|
|
10247
10658
|
* @since 4.0.0
|
|
10248
10659
|
*/
|
|
10249
|
-
<Self, Brand = {}>(identifier?: string): {
|
|
10660
|
+
<Self = never, Brand = {}>(identifier?: string): {
|
|
10250
10661
|
/**
|
|
10251
10662
|
* Like {@link Class} but automatically adds a `_tag` literal field set to the
|
|
10252
10663
|
* given `tag` value. This makes instances compatible with tagged union
|
|
@@ -10276,7 +10687,7 @@ export const TaggedClass: {
|
|
|
10276
10687
|
tag: Tag,
|
|
10277
10688
|
fields: Fields,
|
|
10278
10689
|
annotations?: Annotations.Declaration<Self, readonly [TaggedStruct<Tag, Fields>]>
|
|
10279
|
-
):
|
|
10690
|
+
): [Self] extends [never] ? MissingSelfGeneric<"Schema.TaggedClass"> : Class<Self, TaggedStruct<Tag, Fields>, Brand>
|
|
10280
10691
|
/**
|
|
10281
10692
|
* Like {@link Class} but automatically adds a `_tag` literal field set to the
|
|
10282
10693
|
* given `tag` value. This makes instances compatible with tagged union
|
|
@@ -10309,7 +10720,8 @@ export const TaggedClass: {
|
|
|
10309
10720
|
Self,
|
|
10310
10721
|
readonly [Struct<Simplify<{ readonly _tag: tag<Tag> } & S["fields"]>>]
|
|
10311
10722
|
>
|
|
10312
|
-
):
|
|
10723
|
+
): [Self] extends [never] ? MissingSelfGeneric<"Schema.TaggedClass">
|
|
10724
|
+
: Class<Self, Struct<Simplify<{ readonly _tag: tag<Tag> } & S["fields"]>>, Brand>
|
|
10313
10725
|
}
|
|
10314
10726
|
} = (identifier?: string) => {
|
|
10315
10727
|
return (
|
|
@@ -10317,7 +10729,7 @@ export const TaggedClass: {
|
|
|
10317
10729
|
schema: Struct.Fields | Struct<Struct.Fields>,
|
|
10318
10730
|
annotations?: Annotations.Declaration<any, readonly [Struct<Struct.Fields>]>
|
|
10319
10731
|
): any => {
|
|
10320
|
-
return Class(identifier ?? tagValue)(
|
|
10732
|
+
return Class<any, {}>(identifier ?? tagValue)(
|
|
10321
10733
|
isStruct(schema) ?
|
|
10322
10734
|
schema.mapFields((fields) => ({ _tag: tag(tagValue), ...fields }), {
|
|
10323
10735
|
unsafePreserveChecks: true
|
|
@@ -10330,13 +10742,13 @@ export const TaggedClass: {
|
|
|
10330
10742
|
|
|
10331
10743
|
/**
|
|
10332
10744
|
* Interface for schema-backed error classes created with {@link ErrorClass}.
|
|
10333
|
-
* Extends {@link
|
|
10745
|
+
* Extends {@link Class} and is also a `YieldableError`, so instances
|
|
10334
10746
|
* can be yielded inside `Effect.gen` as failures.
|
|
10335
10747
|
*
|
|
10336
10748
|
* @since 4.0.0
|
|
10337
10749
|
*/
|
|
10338
10750
|
export interface ErrorClass<Self, S extends Top & { readonly fields: Struct.Fields }, Inherited>
|
|
10339
|
-
extends
|
|
10751
|
+
extends Class<Self, S, Inherited>
|
|
10340
10752
|
{}
|
|
10341
10753
|
|
|
10342
10754
|
/**
|
|
@@ -10386,7 +10798,7 @@ export const ErrorClass: {
|
|
|
10386
10798
|
* @category Constructors
|
|
10387
10799
|
* @since 4.0.0
|
|
10388
10800
|
*/
|
|
10389
|
-
<Self, Brand = {}>(identifier: string): {
|
|
10801
|
+
<Self = never, Brand = {}>(identifier: string): {
|
|
10390
10802
|
/**
|
|
10391
10803
|
* Creates a schema-backed error class that can be used as a typed,
|
|
10392
10804
|
* yieldable error in Effect programs. Combines {@link Class} validation with
|
|
@@ -10413,7 +10825,8 @@ export const ErrorClass: {
|
|
|
10413
10825
|
<const Fields extends Struct.Fields>(
|
|
10414
10826
|
fields: Fields,
|
|
10415
10827
|
annotations?: Annotations.Declaration<Self, readonly [Struct<Fields>]>
|
|
10416
|
-
):
|
|
10828
|
+
): [Self] extends [never] ? MissingSelfGeneric<"Schema.ErrorClass">
|
|
10829
|
+
: Class<Self, Struct<Fields>, Cause_.YieldableError & Brand>
|
|
10417
10830
|
/**
|
|
10418
10831
|
* Creates a schema-backed error class that can be used as a typed,
|
|
10419
10832
|
* yieldable error in Effect programs. Combines {@link Class} validation with
|
|
@@ -10437,16 +10850,25 @@ export const ErrorClass: {
|
|
|
10437
10850
|
* @category Constructors
|
|
10438
10851
|
* @since 4.0.0
|
|
10439
10852
|
*/
|
|
10440
|
-
<S extends Struct<Struct.Fields>>(schema: S, annotations?: Annotations.Declaration<Self, readonly [S]>): ErrorClass<Self, S, Cause_.YieldableError & Brand>
|
|
10853
|
+
<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>
|
|
10441
10854
|
}
|
|
10442
10855
|
} = <Self, Brand = {}>(identifier: string) =>
|
|
10443
10856
|
(
|
|
10444
10857
|
schema: Struct.Fields | Struct<Struct.Fields>,
|
|
10445
10858
|
annotations?: Annotations.Declaration<Self, readonly [Struct<Struct.Fields>]>
|
|
10446
|
-
):
|
|
10859
|
+
): [Self] extends [never] ? MissingSelfGeneric<"Schema.ErrorClass">
|
|
10860
|
+
: Class<Self, Struct<Struct.Fields>, Cause_.YieldableError & Brand> =>
|
|
10861
|
+
{
|
|
10447
10862
|
const struct = isStruct(schema) ? schema : Struct(schema)
|
|
10448
|
-
const self = makeClass(
|
|
10449
|
-
|
|
10863
|
+
const self = makeClass(
|
|
10864
|
+
core.Error,
|
|
10865
|
+
identifier,
|
|
10866
|
+
struct,
|
|
10867
|
+
annotations,
|
|
10868
|
+
(identifier) => ({
|
|
10869
|
+
name: identifier
|
|
10870
|
+
})
|
|
10871
|
+
)
|
|
10450
10872
|
return self
|
|
10451
10873
|
}
|
|
10452
10874
|
|
|
@@ -10495,7 +10917,7 @@ export const TaggedErrorClass: {
|
|
|
10495
10917
|
* @category Constructors
|
|
10496
10918
|
* @since 4.0.0
|
|
10497
10919
|
*/
|
|
10498
|
-
<Self, Brand = {}>(identifier?: string): {
|
|
10920
|
+
<Self = never, Brand = {}>(identifier?: string): {
|
|
10499
10921
|
/**
|
|
10500
10922
|
* Like {@link ErrorClass} but automatically adds a `_tag` literal field. The
|
|
10501
10923
|
* resulting class is both a schema-validated, yieldable error and a tagged
|
|
@@ -10522,7 +10944,8 @@ export const TaggedErrorClass: {
|
|
|
10522
10944
|
tag: Tag,
|
|
10523
10945
|
fields: Fields,
|
|
10524
10946
|
annotations?: Annotations.Declaration<Self, readonly [TaggedStruct<Tag, Fields>]>
|
|
10525
|
-
):
|
|
10947
|
+
): [Self] extends [never] ? MissingSelfGeneric<"Schema.TaggedErrorClass">
|
|
10948
|
+
: Class<Self, TaggedStruct<Tag, Fields>, Cause_.YieldableError & Brand>
|
|
10526
10949
|
/**
|
|
10527
10950
|
* Like {@link ErrorClass} but automatically adds a `_tag` literal field. The
|
|
10528
10951
|
* resulting class is both a schema-validated, yieldable error and a tagged
|
|
@@ -10552,7 +10975,8 @@ export const TaggedErrorClass: {
|
|
|
10552
10975
|
Self,
|
|
10553
10976
|
readonly [Struct<Simplify<{ readonly _tag: tag<Tag> } & S["fields"]>>]
|
|
10554
10977
|
>
|
|
10555
|
-
):
|
|
10978
|
+
): [Self] extends [never] ? MissingSelfGeneric<"Schema.TaggedErrorClass">
|
|
10979
|
+
: Class<Self, Struct<Simplify<{ readonly _tag: tag<Tag> } & S["fields"]>>, Cause_.YieldableError & Brand>
|
|
10556
10980
|
}
|
|
10557
10981
|
} = (identifier?: string) => {
|
|
10558
10982
|
return (
|
|
@@ -10560,7 +10984,7 @@ export const TaggedErrorClass: {
|
|
|
10560
10984
|
schema: Struct.Fields | Struct<Struct.Fields>,
|
|
10561
10985
|
annotations?: Annotations.Declaration<any, readonly [Struct<Struct.Fields>]>
|
|
10562
10986
|
): any => {
|
|
10563
|
-
return ErrorClass(identifier ?? tagValue)(
|
|
10987
|
+
return ErrorClass<any, {}>(identifier ?? tagValue)(
|
|
10564
10988
|
isStruct(schema) ?
|
|
10565
10989
|
schema.mapFields((fields) => ({ _tag: tag(tagValue), ...fields }), {
|
|
10566
10990
|
unsafePreserveChecks: true
|
|
@@ -11295,7 +11719,6 @@ export interface overrideToCodecIso<S extends Top, Iso> extends
|
|
|
11295
11719
|
S["~encoded.optionality"]
|
|
11296
11720
|
>
|
|
11297
11721
|
{
|
|
11298
|
-
readonly "~rebuild.out": this
|
|
11299
11722
|
readonly schema: S
|
|
11300
11723
|
}
|
|
11301
11724
|
|
|
@@ -11478,21 +11901,38 @@ export const MutableJson: Codec<MutableJson> = make(AST.MutableJson)
|
|
|
11478
11901
|
// -----------------------------------------------------------------------------
|
|
11479
11902
|
|
|
11480
11903
|
/**
|
|
11481
|
-
*
|
|
11904
|
+
* Resolves the typed annotations from a schema. The term "resolve" (rather
|
|
11905
|
+
* than "get") reflects the lookup strategy: if the schema has checks, the
|
|
11906
|
+
* annotations are taken from the last check; otherwise they are taken from
|
|
11907
|
+
* the base schema instance.
|
|
11482
11908
|
*
|
|
11483
11909
|
* @category Schema Resolvers
|
|
11484
11910
|
* @since 4.0.0
|
|
11485
11911
|
*/
|
|
11486
|
-
export function
|
|
11912
|
+
export function resolveAnnotations<S extends Top>(
|
|
11913
|
+
schema: S
|
|
11914
|
+
): Annotations.Bottom<S["Type"], S["~type.parameters"]> | undefined {
|
|
11487
11915
|
return InternalAnnotations.resolve(schema.ast)
|
|
11488
11916
|
}
|
|
11489
11917
|
|
|
11918
|
+
/**
|
|
11919
|
+
* Resolves the context (key-level) annotations from a schema. Context
|
|
11920
|
+
* annotations are those attached via `annotateKey` and live on the AST's
|
|
11921
|
+
* `context` rather than on the schema node itself.
|
|
11922
|
+
*
|
|
11923
|
+
* @category Schema Resolvers
|
|
11924
|
+
* @since 4.0.0
|
|
11925
|
+
*/
|
|
11926
|
+
export function resolveAnnotationsKey<S extends Top>(schema: S): Annotations.Key<S["Type"]> | undefined {
|
|
11927
|
+
return schema.ast.context?.annotations
|
|
11928
|
+
}
|
|
11929
|
+
|
|
11490
11930
|
/**
|
|
11491
11931
|
* The `Annotations` namespace groups all annotation interfaces used to attach
|
|
11492
11932
|
* metadata to schemas. Annotations control documentation, validation messages,
|
|
11493
11933
|
* JSON Schema generation, equivalence, arbitrary generation, and more.
|
|
11494
11934
|
*
|
|
11495
|
-
* Use {@link
|
|
11935
|
+
* Use {@link resolveAnnotations} to read the annotations attached to a schema at
|
|
11496
11936
|
* runtime.
|
|
11497
11937
|
*
|
|
11498
11938
|
* @since 4.0.0
|
|
@@ -11527,7 +11967,7 @@ export declare namespace Annotations {
|
|
|
11527
11967
|
* const schema = Schema.String.annotate({ version: [1, 2, 0] })
|
|
11528
11968
|
*
|
|
11529
11969
|
* // const version: readonly [major: number, minor: number, patch: number] | undefined
|
|
11530
|
-
* const version = Schema.
|
|
11970
|
+
* const version = Schema.resolveAnnotations(schema)?.["version"]
|
|
11531
11971
|
*
|
|
11532
11972
|
* if (version) {
|
|
11533
11973
|
* // Access individual parts of the version
|