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).
Parameters
Section titled “Parameters”fields
Section titled “fields”Record<string, AdminField>
The resource’s resolved field map.
string
The map key — the collection or global slug.
Returns
Section titled “Returns”string
TypeScript source for one entry, without wrapping braces.
Example
Section titled “Example”fieldsToFieldTypeMap({ key: "posts", fields: posts.fields });// → '\tposts: {\n\t\ttext: "title"\n\t\trelationship: "author"\n\t}'