fix; types for custom card and preview
This commit is contained in:
parent
fbbbf64f53
commit
5629a15d3b
@ -118,7 +118,10 @@ export function getPreviewStyles() {
|
||||
/**
|
||||
* Preview Templates
|
||||
*/
|
||||
export function registerPreviewTemplate<T>(name: string, component: TemplatePreviewComponent<T>) {
|
||||
export function registerPreviewTemplate<T, EF extends BaseField = UnknownField>(
|
||||
name: string,
|
||||
component: TemplatePreviewComponent<T, EF>,
|
||||
) {
|
||||
registry.templates[name] = component as TemplatePreviewComponent<ObjectValue>;
|
||||
}
|
||||
|
||||
@ -129,7 +132,10 @@ export function getPreviewTemplate(name: string): TemplatePreviewComponent<Objec
|
||||
/**
|
||||
* Preview Cards
|
||||
*/
|
||||
export function registerPreviewCard<T>(name: string, component: TemplatePreviewCardComponent<T>) {
|
||||
export function registerPreviewCard<T, EF extends BaseField = UnknownField>(
|
||||
name: string,
|
||||
component: TemplatePreviewCardComponent<T, EF>,
|
||||
) {
|
||||
registry.cards[name] = component as TemplatePreviewCardComponent<ObjectValue>;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user