diff --git a/packages/types/src/shell/type/plugin-config.ts b/packages/types/src/shell/type/plugin-config.ts index e9e65192e..2d841dd80 100644 --- a/packages/types/src/shell/type/plugin-config.ts +++ b/packages/types/src/shell/type/plugin-config.ts @@ -1,5 +1,5 @@ export interface IPublicTypePluginConfig { - init(): Promise; - destroy?(): Promise; + init(): Promise | void; + destroy?(): Promise | void; exports?(): any; } diff --git a/packages/types/src/shell/type/resource-type-config.ts b/packages/types/src/shell/type/resource-type-config.ts index 474987b52..01b49aa2b 100644 --- a/packages/types/src/shell/type/resource-type-config.ts +++ b/packages/types/src/shell/type/resource-type-config.ts @@ -1,3 +1,4 @@ +import React from 'react'; import { IPublicTypeEditorView } from './editor-view'; export interface IPublicResourceTypeConfig { @@ -6,7 +7,7 @@ export interface IPublicResourceTypeConfig { description?: string; /** 资源 icon 标识 */ - icon?: React.ReactElement; + icon?: React.ReactElement | React.FunctionComponent | React.ComponentClass; /** * 默认视图类型 diff --git a/packages/types/src/shell/type/resource-type.ts b/packages/types/src/shell/type/resource-type.ts index 7cfb125aa..7d64a4463 100644 --- a/packages/types/src/shell/type/resource-type.ts +++ b/packages/types/src/shell/type/resource-type.ts @@ -4,7 +4,7 @@ import { IPublicResourceTypeConfig } from './resource-type-config'; export interface IPublicTypeResourceType { resourceName: string; - resourceType: 'editor' | 'webview'; + resourceType: 'editor' | 'webview' | string; (ctx: IPublicModelPluginContext, options: Object): IPublicResourceTypeConfig; } \ No newline at end of file