effect-io-ai

Package: effect
Module: Schema

Schema.Record.Encoded

Computes the encoded object type for a record schema from the key and value schemas’ encoded types.

Details

Encoded-side optionality and mutability on the value schema determine whether the encoded record properties are optional or writable.

Signature

type Encoded<Key, Value> = Value extends
    { readonly "~encoded.optionality": "optional" } ?
    Value extends { readonly "~encoded.mutability": "mutable" } ? { [P in Key["Encoded"]]?: Value["Encoded"] }
    : { readonly [P in Key["Encoded"]]?: Value["Encoded"] }
    : Value extends { readonly "~encoded.mutability": "mutable" } ? { [P in Key["Encoded"]]: Value["Encoded"] }
    : { readonly [P in Key["Encoded"]]: Value["Encoded"] }

Source

Since v3.10.0