effect-io-ai

Package: effect
Module: Schema

Schema.Schema.Type

Extracts the decoded Type from a schema.

Example (Extracting the decoded type)

import { Schema } from "effect"

const Person = Schema.Struct({ name: Schema.String, age: Schema.Number })
type Person = Schema.Schema.Type<typeof Person>
// { readonly name: string; readonly age: number }

Signature

type Type<S> = S extends { readonly "Type": infer T } ? T : never

Source

Since v3.10.0