fix: add generic type support for CmsWidget and CmsWidgetParam (#6018)

This commit is contained in:
Lei Chen 2021-12-07 20:50:22 +08:00 committed by GitHub
parent f1e5dbc9ea
commit 83fc5018a5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -462,16 +462,16 @@ declare module 'netlify-cms-core' {
fieldsMetaData: Map<string, any>;
}
export interface CmsWidgetParam {
export interface CmsWidgetParam<T = any> {
name: string;
controlComponent: CmsWidgetControlProps;
previewComponent?: CmsWidgetPreviewProps;
controlComponent: CmsWidgetControlProps<T>;
previewComponent?: CmsWidgetPreviewProps<T>;
globalStyles?: any;
}
export interface CmsWidget {
control: CmsWidgetControlProps;
preview?: CmsWidgetPreviewProps;
export interface CmsWidget<T = any> {
control: CmsWidgetControlProps<T>;
preview?: CmsWidgetPreviewProps<T>;
globalStyles?: any;
}