FieldKeysOfType
FieldKeysOfType<
TCollectionSlug,TType> =TCollectionSlugextends keyofCollectionsFieldTypeMap?TTypeextends keyofCollectionsFieldTypeMap[TCollectionSlug] ?CollectionsFieldTypeMap[TCollectionSlug][TType] &string:never:never
Defined in: packages/core/src/api/types.ts:308
Returns the union of field keys on TCollectionSlug that have field type TType.
Reads the CollectionsFieldTypeMap property on the augmented GeneratedVexTypes
registry — populated by vex generate from the user’s collection configs.
Returns never when the slug has no fields of that type, or when the
registry hasn’t been augmented yet (fresh project).
Type Parameters
Section titled “Type Parameters”TCollectionSlug
Section titled “TCollectionSlug”TCollectionSlug extends CollectionSlug
The collection slug.
TType extends AdminFieldType
The field type literal (e.g., "text", "relationship").
Example
Section titled “Example”type AuthorRelationships = FieldKeysOfType<"posts", "relationship">;// → "author" | "category"