effect-io-ai

Package: effect
Module: ChannelSchema

ChannelSchema.decodeUnknown

Creates a decode channel variant for schema-decoding channel boundaries.

When to use

Use when you need an intentionally unknown or untyped encoded input while keeping only the decoded output statically typed according to the schema.

Details

The channel decodes non-empty encoded chunks into schema values, emits SchemaError when decoding fails, and requires the schema’s decoding services.

See

Signature

declare const decodeUnknown: <S extends Schema.Constraint>(schema: S) => <IE = never, Done = unknown>() => Channel.Channel<Arr.NonEmptyReadonlyArray<S["Type"]>, IE | Schema.SchemaError, Done, Arr.NonEmptyReadonlyArray<S["Encoded"]>, IE, Done, S["DecodingServices"]>

Source

Since v4.0.0