effect-io-ai

Package: effect
Module: ChannelSchema

ChannelSchema.decode

Creates a channel that decodes non-empty chunks from the schema’s encoded representation into schema values.

When to use

Use to validate and decode encoded channel output into typed schema values before application code consumes it.

Details

Decoding failures are emitted as SchemaError, and any decoding services required by the schema become channel requirements.

See

Signature

declare const decode: <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