Skip to content

keyValueValidator

keyValueValidator<TCollectionSlug>(slug, fn): FieldValidate<TCollectionSlug, Record<string, unknown>>

Defined in: packages/core/src/fields/keyValue/validator.ts:63

Types a keyValue() field’s validate() against a real collection and DataModel, with value fixed to Record<string, unknown>.

TCollectionSlug extends string

TCollectionSlug

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

FieldValidate<TCollectionSlug, Record<string, unknown>, KeyValueField<string, { }, string>>

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

FieldValidate<TCollectionSlug, Record<string, unknown>>

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

fieldValidator