forked from open-source-labs/OverVue
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtypes.ts
115 lines (106 loc) · 2.52 KB
/
types.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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
// file created to store all TS types in one file for project
import { NoParamCallback } from "original-fs";
// TS type for State (index.ts) in state folder
export type State = {
clicked: boolean,
icons: any,
htmlElementMap: HtmlElementMap,
componentMap: {
App: RouteComponentMap,
HomeView: RouteComponentMap,
[key: string]: RouteComponentMap | Component,
},
routes: {
[key: string]: Component[],
},
userActions: string[],
userProps: string[],
userState: string[],
imagePath: {
[key: string]: string,
},
componentNameInputValue: string,
projects: Projects[],
activeRoute: string,
activeComponent: string,
activeComponentObj: null | Component,
activeHTML: string,
activeLayer: {
id: string,
lineage: [],
},
selectedProps: [],
selectedState: [],
selectedActions: [],
selectedElementList: [],
selectedIdDrag: string,
selectedIdDrop: string,
projectNumber: number,
activeTab: number,
componentChildrenMultiselectValue: [],
modalOpen: boolean,
noteModalOpen: boolean,
noteAttributeOpen: boolean,
colorModalOpen: boolean,
parentSelected: any, // need to look deeper into parentSelected - it seems to take many data types
copiedComponent: Component | {},
copyNumber: number,
pastedComponent: {},
exportAsTypescript: 'off' | 'on',
showTutorial: true,
tutorialFirstOpen: true,
pasteTimer: number,
gridLayout: [number, number],
containerH: number,
containerW: number,
importLibraries: string[],
displaylibComponent: boolean,
exportOauth: 'off' | 'on',
};
// Type for HTML Element Map that used in multiple files
export type HtmlElementMap = {
[key: string]: [string, string],
};
// Type for saved projects obj
export type Projects = {
filename: string,
lastSavedLocation: string,
};
export type RouteComponentMap = {
children: string[],
componentName: string,
htmlList: [],
};
// Type for generic component used in userCreateComponent.js
export type Component = {
componentName: string;
x: number,
y: number,
z: number,
w: number,
h: number,
id: number,
// look into html List any create type
htmlList: any,
noteList: [],
children: [],
actions: [],
props: [],
state: [],
parent: {},
isActive: false,
idDrag: string,
idDrop: string,
color: string,
htmlAttributes: {
class: string,
id: string,
gridArea: [number, number, number, number],
},
};
export type Icons = {
[type: string]: string | string[];
};
export type StyleClassMap = {
// insert here for style class map when implenting more
};