fix: type for registerFieldPreview
This commit is contained in:
parent
70a8cf484e
commit
fbbbf64f53
@ -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] = {};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user