Skip to content

CollectionsFieldTypeMap

CollectionsFieldTypeMap = GeneratedVexTypes extends object ? M : Record<string, Record<string, never>>

Defined in: packages/core/src/types/generated.ts:248

Per-collection field-type map. Augmented by vex generate from the user’s collection configs. Powers all per-field-type helper types (RelationshipKeysOf, TextKeysOf, SortableKeysOf, etc.).

Keyed: collection slug → field type → union of field keys with that type.

Empty by default; the user’s vex.types.ts augments it via declare module "@vexcms/core". Helper types in packages/core/src/api/types.ts resolve to never until augmentation runs, which is the intended behaviour for fresh projects (no collections registered yet).

Generated content after running vex generate

declare module "@vexcms/core" {
interface GeneratedVexTypes {
CollectionSlug: "posts" | "authors";
DocumentBySlug: { posts: PostsDocument; authors: AuthorsDocument };
CollectionsFieldTypeMap: {
posts: {
text: "title" | "slug" | "body";
relationship: "author" | "category";
select: "status";
date: "publishedAt";
};
authors: {
text: "name" | "email";
};
};
}
}