@@ -22,7 +22,7 @@ const CHANGE_EVENT = 'resource.list.change';
2222export interface IWorkspace extends Omit < IPublicApiWorkspace <
2323 LowCodePluginManager ,
2424 IEditorWindow
25- > , 'resourceList' | 'plugins' > {
25+ > , 'resourceList' | 'plugins' | 'openEditorWindow' | 'removeEditorWindow' > {
2626 readonly registryInnerPlugin : ( designer : IDesigner , editor : Editor , plugins : IPublicApiPlugins ) => Promise < IPublicTypeDisposable > ;
2727
2828 readonly shellModelFactory : IShellModelFactory ;
@@ -52,6 +52,18 @@ export interface IWorkspace extends Omit<IPublicApiWorkspace<
5252 emitChangeActiveEditorView ( ) : void ;
5353
5454 openEditorWindowByResource ( resource : IResource , sleep : boolean ) : Promise < void > ;
55+
56+ /**
57+ * @deprecated
58+ */
59+ removeEditorWindow ( resourceName : string , id : string ) : void ;
60+
61+ removeEditorWindowByResource ( resource : IResource ) : void ;
62+
63+ /**
64+ * @deprecated
65+ */
66+ openEditorWindow ( name : string , title : string , options : Object , viewName ?: string , sleep ?: boolean ) : Promise < void > ;
5567}
5668
5769export class Workspace implements IWorkspace {
@@ -213,7 +225,12 @@ export class Workspace implements IWorkspace {
213225 }
214226
215227 removeEditorWindow ( resourceName : string , id : string ) {
216- const index = this . windows . findIndex ( d => ( d . resource ?. name === resourceName && d . title === id ) ) ;
228+ const index = this . windows . findIndex ( d => ( d . resource ?. name === resourceName && ( d . title === id || d . resource . id === id ) ) ) ;
229+ this . remove ( index ) ;
230+ }
231+
232+ removeEditorWindowByResource ( resource : IResource ) {
233+ const index = this . windows . findIndex ( d => ( d . resource ?. id === resource . id ) ) ;
217234 this . remove ( index ) ;
218235 }
219236
0 commit comments