forked from alibaba/lowcode-engine
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwindow.ts
More file actions
44 lines (34 loc) · 1.08 KB
/
Copy pathwindow.ts
File metadata and controls
44 lines (34 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import { windowSymbol } from '../symbols';
import { IPublicModelResource, IPublicModelWindow, IPublicTypeDisposable } from '@alilc/lowcode-types';
import { IEditorWindow } from '@alilc/lowcode-workspace';
import { Resource as ShellResource } from './resource';
export class Window implements IPublicModelWindow {
private readonly [windowSymbol]: IEditorWindow;
get id() {
return this[windowSymbol]?.id;
}
get title() {
return this[windowSymbol].title;
}
get icon() {
return this[windowSymbol].icon;
}
get resource(): IPublicModelResource {
return new ShellResource(this[windowSymbol].resource);
}
constructor(editorWindow: IEditorWindow) {
this[windowSymbol] = editorWindow;
}
importSchema(schema: any): any {
this[windowSymbol].importSchema(schema);
}
changeViewType(viewName: string) {
this[windowSymbol].changeViewType(viewName, false);
}
onChangeViewType(fun: (viewName: string) => void): IPublicTypeDisposable {
return this[windowSymbol].onChangeViewType(fun);
}
async save() {
return await this[windowSymbol].save();
}
}