fix: type for registerFieldPreview

This commit is contained in:
Daniel Lautzenheiser 2023-04-21 13:02:26 -04:00
parent 70a8cf484e
commit fbbbf64f53

View File

@ -140,10 +140,10 @@ export function getPreviewCard(name: string): TemplatePreviewCardComponent<Objec
/** /**
* Field Previews * Field Previews
*/ */
export function registerFieldPreview<T>( export function registerFieldPreview<T, F extends BaseField = UnknownField>(
collectionName: string, collectionName: string,
fieldName: string, fieldName: string,
component: FieldPreviewComponent<T>, component: FieldPreviewComponent<T, F>,
) { ) {
if (!(collectionName in registry.fieldPreviews)) { if (!(collectionName in registry.fieldPreviews)) {
registry.fieldPreviews[collectionName] = {}; registry.fieldPreviews[collectionName] = {};