Interface PrimitiveFieldDef

A schema field definition for a primitive type ("string", "number", or "boolean").

const schema = {
name: { type: "string" },
age: { type: "number", nullable: true },
active: { type: "boolean" }
} as const satisfies ObjectSchema;
interface PrimitiveFieldDef {
    nullable?: boolean;
    type: keyof PrimitiveTypeMap;
}

Properties

Properties

nullable?: boolean

When true, the field accepts null and becomes optional (T | null | undefined).

type: keyof PrimitiveTypeMap

The primitive type — "string", "number", or "boolean".