feat(workspace): add editorViews to resourceTypeList api

This commit is contained in:
liujuping 2023-06-12 11:29:22 +08:00 committed by 林熠
parent 16f5ee71e4
commit c838dc70eb
4 changed files with 22 additions and 1 deletions

View File

@ -39,12 +39,19 @@ export class Workspace implements IPublicApiWorkspace {
const { name: resourceName, type: resourceType } = d;
const {
description,
editorViews,
} = d.resourceTypeModel({} as any, {});
return {
resourceName,
resourceType,
description,
editorViews: editorViews.map(d => (
{
viewName: d.viewName,
viewType: d.viewType || 'editor',
}
)),
};
});
}

View File

@ -24,4 +24,12 @@ export class EditorView {
},
});
}
get viewName() {
return this[editorViewSymbol].viewName;
}
get viewType() {
return this[editorViewSymbol].viewType;
}
}

View File

@ -1,3 +1,7 @@
import { IPublicModelPluginContext } from './plugin-context';
export interface IPublicModelEditorView extends IPublicModelPluginContext {}
export interface IPublicModelEditorView extends IPublicModelPluginContext {
viewName: string;
viewType: 'editor' | 'webview';
}

View File

@ -10,6 +10,8 @@ export interface IViewContext extends IBasicContext {
editorWindow: IEditorWindow;
viewName: string;
viewType: 'editor' | 'webview';
}
export class Context extends BasicContext implements IViewContext {