Skip to content

checkboxValidator

checkboxValidator<TCollectionSlug>(slug, fn): FieldValidate<TCollectionSlug, boolean>

Defined in: packages/core/src/fields/checkbox/validator.ts:53

Types a checkbox() field’s validate() against a real collection and DataModel, with value fixed to boolean.

TCollectionSlug extends string

TCollectionSlug

The owning collection’s slug, used only to infer TCollectionSlug.

FieldValidate<TCollectionSlug, boolean, CheckboxField<string, { }>>

The validate callback, checked against the collection’s real document shape and value type.

FieldValidate<TCollectionSlug, boolean>

The same function, re-typed to the field’s loose public validate signature.

fieldValidator