-
Notifications
You must be signed in to change notification settings - Fork 6
/
types.ts
128 lines (110 loc) · 2.38 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
116
117
118
119
120
121
122
123
124
125
126
127
128
export type Status =
| 'Product Backlog'
| 'Sprint Backlog'
| 'ToDo'
| 'Doing'
| 'Code Review'
| 'Done'
| 'Done Done';
// Id of a node is optional since the id is created in the database
// so when sent to backend we don't give it any id
export interface INode {
label: string;
status: Status;
priority: string;
id?: number;
x: number;
y: number;
project_id: number;
description: string;
node_type: NodeType | undefined;
}
export interface NodeType {
id: number;
label: string;
color: string;
}
export interface IEdge {
source_id: number;
target_id: number;
project_id: number;
}
export interface IProject {
id: number;
owner_id: number;
name: string;
description: string;
public_view: boolean;
public_edit: boolean;
}
export interface Registration {
username: string;
password: string;
email: string;
}
export interface RegisterFormProps {
createUser: (user: Registration) => Promise<boolean>;
}
export interface Login {
email: string | null;
username: string | null;
password: string;
}
export interface UserToken {
username: string;
email: string;
token: string;
id: number;
}
export interface User {
username: string;
password: string;
email: string;
id: number;
}
export interface UserData {
username: string;
email: string;
id: number;
}
export interface RootState {
project: IProject[];
}
export interface ToolbarProps {
reverseConnectState: () => void;
reverseCreateState: () => void;
layoutWithDagre: (direction: string) => Promise<void>;
setNodeHidden: (value: React.SetStateAction<boolean>) => void;
nodeHidden: boolean;
forceDirected: () => Promise<void>;
setLeavesHighlited: (value: React.SetStateAction<boolean>) => void;
leavesHighlited: boolean;
}
export interface ProjectPermissions {
projectId: number;
view: boolean;
edit: boolean;
}
export interface NoPermission {
projectId: undefined;
view: false;
edit: false;
}
export interface ITag {
id: number;
label: string;
color: string;
project_id: number;
}
export interface ITaggedNode {
node_id: number;
tag_id: number;
project_id: number;
}
export interface Comment {
username: string;
users_id: number;
node_id: number;
created: string;
content: string;
}