Skip to content

DataFieldSlug

DataFieldSlug<TFields> = Extract<{ [K in keyof TFields]: TFields[K] extends { type: “ui” } ? never : TFields[K] extends { type: “tabs” | “row” | “collapsible” } ? HoistedKeysOf<TFields[K]> : K }[keyof TFields], string>

Defined in: packages/core/src/fields/conditions.ts:90

The union of data-field keys a top-level fields record resolves to once getDataFields flattens it — what useAsTitle, indexes[].fields, and every access-field-map key should be typed against instead of keyof TFields (which also contains tabs()/collapsible()/row()/ ui()’s own OWN top-level keys, not data keys).

TFields

type Keys = DataFieldSlug<{
info: { type: "tabs"; tabs: readonly [
{ label: "Content"; fields: { title: TextField } },
{ label: "SEO"; name: "seo"; fields: { metaTitle: TextField } },
] };
published: CheckboxField;
}>;
// "title" | "seo" | "published" — never "info"