Skip to content

fieldsToFieldTypeMap

fieldsToFieldTypeMap(props): string

Defined in: packages/core/src/fields/utils.ts:287

Renders one CollectionsFieldTypeMap / GlobalsFieldTypeMap entry for the generated declare module '@vexcms/core' block: each field type present, mapped to the union of field keys of that type.

No synthetic id: "_id" entry: this is a field-TYPE index, and _id is not a field type (access helpers derive field names from the document itself).

Record<string, AdminField>

The resource’s resolved field map.

string

The map key — the collection or global slug.

string

TypeScript source for one entry, without wrapping braces.

fieldsToFieldTypeMap({ key: "posts", fields: posts.fields });
// → '\tposts: {\n\t\ttext: "title"\n\t\trelationship: "author"\n\t}'