<S extends ConstraintDecoder<unknown>>(
schema: S,
options?: SchemaAST.ParseOptions
): (
input: S["Encoded"],
options?: SchemaAST.ParseOptions
) => Option_.Option<S["Type"]>Decodes a typed input (the schema's Encoded type) against a schema,
returning an Option that is Some with the decoded value on success or
None for schema mismatches.
When to use
Use when you already have input typed as the schema's Encoded type and
only need to know whether decoding succeeded.
Details
For unknown input use decodeUnknownOption.
Options may be provided either when creating the decoder or when applying it;
application options override creation options.
Gotchas
Only causes made entirely of schema issues are converted to None. Causes
that contain defects, interruptions, or other non-schema reasons throw
instead.
export const const decodeOption: <
S extends ConstraintDecoder<unknown>
>(
schema: S,
options?: SchemaAST.ParseOptions
) => (
input: S["Encoded"],
options?: SchemaAST.ParseOptions
) => Option_.Option<S["Type"]>
Decodes a typed input (the schema's Encoded type) against a schema,
returning an Option that is Some with the decoded value on success or
None for schema mismatches.
When to use
Use when you already have input typed as the schema's Encoded type and
only need to know whether decoding succeeded.
Details
For unknown input use
decodeUnknownOption
.
Options may be provided either when creating the decoder or when applying it;
application options override creation options.
Gotchas
Only causes made entirely of schema issues are converted to None. Causes
that contain defects, interruptions, or other non-schema reasons throw
instead.
decodeOption: <function (type parameter) S in <S extends ConstraintDecoder<unknown>>(schema: S, options?: SchemaAST.ParseOptions): (input: S["Encoded"], options?: SchemaAST.ParseOptions) => Option_.Option<S["Type"]>S extends interface ConstraintDecoder<out T, out RD = never>Lightweight structural constraint for APIs that need decoder type views but
do not need the full schema protocol.
When to use
Use when you need to preserve a schema's decoded type and decoding services,
but the API does not constrain the encoded type, encoding services, or call
schema methods such as annotate, check, rebuild, make, or
makeEffect.
ConstraintDecoder<unknown>>(
schema: S extends ConstraintDecoder<unknown>schema: function (type parameter) S in <S extends ConstraintDecoder<unknown>>(schema: S, options?: SchemaAST.ParseOptions): (input: S["Encoded"], options?: SchemaAST.ParseOptions) => Option_.Option<S["Type"]>S,
options: SchemaAST.ParseOptionsoptions?: import SchemaASTSchemaAST.ParseOptions
) => (input: S["Encoded"]input: function (type parameter) S in <S extends ConstraintDecoder<unknown>>(schema: S, options?: SchemaAST.ParseOptions): (input: S["Encoded"], options?: SchemaAST.ParseOptions) => Option_.Option<S["Type"]>S["Encoded"], options: SchemaAST.ParseOptionsoptions?: import SchemaASTSchemaAST.ParseOptions) => import Option_Option_.type Option_.Option = /*unresolved*/ anyOption<function (type parameter) S in <S extends ConstraintDecoder<unknown>>(schema: S, options?: SchemaAST.ParseOptions): (input: S["Encoded"], options?: SchemaAST.ParseOptions) => Option_.Option<S["Type"]>S["Type"]> = import SchemaParserSchemaParser.const decodeOption: <
S extends Schema.ConstraintDecoder<unknown>
>(
schema: S,
options?: SchemaAST.ParseOptions
) => (
input: S["Encoded"],
options?: SchemaAST.ParseOptions
) => Option.Option<S["Type"]>
decodeOption