Skip to content

Field

Field = All | All

Defined in: node_modules/.pnpm/effect@3.15.2/node_modules/effect/dist/dts/Schema.d.ts:1228

Useful for creating a type that can be used to add custom constraints to the fields of a struct.

import { Schema } from "effect"
const f = <Fields extends Record<"a" | "b", Schema.Struct.Field>>(
schema: Schema.Struct<Fields>
) => {
return schema.omit("a")
}
// ┌─── Schema.Struct<{ b: typeof Schema.Number; }>
// ▼
const result = f(Schema.Struct({ a: Schema.String, b: Schema.Number }))

3.13.11