-
Notifications
You must be signed in to change notification settings - Fork 0
/
globalData.ts
38 lines (31 loc) · 849 Bytes
/
globalData.ts
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
import { ProjectType } from './ProjectType';
export class GlobalData {
private static get hash() {
let key = "localData";
let value: any = {};
if (!Reflect.has(global, key)) {
Reflect.set(global, key, value);
} else {
value = Reflect.get(global, key);
}
return value;
}
public static get projectName(): string {
return this.hash.projectName;
}
public static set projectName(name: string) {
this.hash.projectName = name;
}
public static get projectType(): ProjectType {
return this.hash.projectType;
}
public static set projectType(type: ProjectType) {
this.hash.projectType = type;
}
public static get projectRootPath(): string {
return this.hash.projectRootPath;
}
public static set projectRootPath(path: string) {
this.hash.projectRootPath = path;
}
}