-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtypes.d.ts
115 lines (97 loc) · 1.82 KB
/
types.d.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
interface ITableRow {
long_url: string;
short_url: string;
last_visited: string;
id: number;
mutate: KeyedMutator<IUserLinks>;
// setLink: React.Dispatch<React.SetStateAction<IUserLink>>
}
interface IReferrer{
[key: string]: number
}
interface IDevice {
// "PC": 2
[key: string]: number
}
interface IUser {
email: string,
password: string,
confirm_password: string
}
interface SignUpResponse {
email: string
id: number
}
interface IUserLinks {
count: number,
next: null | number,
prev: null | number,
results: IUserLink[]
}
interface IUserLink {
// url: string,
id: number,
short_link: string,
long_link: string,
date_created: string,
last_visited_date: string,
visit_count: number,
analytic: {
date_time_anaylytic:IDateTimeAnalytics
// today_total: [],
// "today_by_hour": [],
// "this_week_by_day": [],
other_analytic: IOtherAnalytics
},
user_current_month: string,
user_current_day: string,
user_current_date: string
}
type CurrentMonth = {
date: string,
count__sum: number
}
interface IChartConfig {
canvasElement: HTMLCanvasElement,
chartType: ChartType,
labels: string[],
data: number[],
backgroundColor: string[];
axes: boolean,
legend: boolean,
selectedForDateTimeAnalytics?: number
}
interface IOtherAnalytics{
Browser: {
[key: string]: number
// "Firefox": 2
},
OS: {
// "Windows 10": 2
[key: string]: number
},
Device: IDevice,
Referer: IReferrer,
Country: {
[key: string]: number
}
}
interface IDateTimeAnalytics{
current_month: {
date: string,
count__sum: number
}[]
today_count: {
date: string,
count__sum: number
}[]
this_week_by_day: {
date: string,
count__sum: number
}[]
today_by_hour:
{
time__hour: number,
count__sum: number
}[]
}