/
ui.ts
73 lines (64 loc) · 1.73 KB
/
ui.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
// FIXME For some reason, it only works if I place this Vue.use statement here
import Vue from 'vue';
import VueCompositionApi from '@vue/composition-api';
Vue.use(VueCompositionApi);
import { VueConstructor } from 'vue';
import { Ref, ref } from '@vue/composition-api';
export interface TabAction {
// TODO make none of these REFS
icon: Ref<string>;
tooltip: Ref<string>;
callback: (e: MouseEvent) => void;
props?: { [k: string]: string };
}
export interface ActivityBarItem {
icon: string;
iconProps?: { [k: string]: string };
name: string;
component: VueConstructor;
actions?: TabAction[];
}
export interface PanelItem {
name: string;
component: VueConstructor;
actions?: TabAction[];
}
export interface ToolbarItem {
component: VueConstructor;
position: 'right' | 'left';
order?: number;
}
interface StatusBarItem {
component: VueConstructor;
position: 'right' | 'left';
order?: number;
}
// FIXME(1) add function and that return a dispose function
// This should be added to the base later
const global: VueConstructor[] = [];
const statusBar: StatusBarItem[] = [];
// TODO introduce order
const activityBar: ActivityBarItem[] = [];
const panels: PanelItem[] = [];
const mainSection: VueConstructor[] = [];
const toolbar: ToolbarItem[] = [];
const trackContext: Array<{ text: string; callback: (index: number) => void; }> = [];
const openedSideTab = ref<undefined | string>(undefined);
const openedPanel = ref<undefined | string>(undefined);
const panelsSize = ref(250);
const sideBarSize = ref(250);
const rootClasses: string[] = [];
export const ui = {
global,
trackContext,
statusBar,
activityBar,
panels,
mainSection,
toolbar,
openedSideTab,
openedPanel,
panelsSize,
sideBarSize,
rootClasses,
};