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>; fieldsMetaData: Map<string, any>;
} }
export interface CmsWidgetParam { export interface CmsWidgetParam<T = any> {
name: string; name: string;
controlComponent: CmsWidgetControlProps; controlComponent: CmsWidgetControlProps<T>;
previewComponent?: CmsWidgetPreviewProps; previewComponent?: CmsWidgetPreviewProps<T>;
globalStyles?: any; globalStyles?: any;
} }
export interface CmsWidget { export interface CmsWidget<T = any> {
control: CmsWidgetControlProps; control: CmsWidgetControlProps<T>;
preview?: CmsWidgetPreviewProps; preview?: CmsWidgetPreviewProps<T>;
globalStyles?: any; globalStyles?: any;
} }