Skip to content

blocksValidator

blocksValidator<TCollectionSlug>(slug, fn): FieldValidate<TCollectionSlug, GenericBlock[]>

Defined in: packages/core/src/fields/blocks/validator.ts:81

Types a blocks() field’s validate() against a real collection and DataModel, with value fixed to GenericBlock[].

TCollectionSlug extends string

TCollectionSlug

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

FieldValidate<TCollectionSlug, GenericBlock[], BlocksField<string, { }>>

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

FieldValidate<TCollectionSlug, GenericBlock[]>

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

fieldValidator