forked from sheepzh/time-tracker-4-browser
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstat.d.ts
More file actions
112 lines (103 loc) · 2.16 KB
/
stat.d.ts
File metadata and controls
112 lines (103 loc) · 2.16 KB
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
declare namespace timer.stat {
type Event = {
start: number
end: number
url: string
ignoreTabCheck: boolean
}
/**
* The dimension to statistics
*/
type Dimension =
// Focus time
| 'focus'
// Visit count
| 'time'
/**
* The stat result of host
*
* @since 0.0.1
*/
type Result = {
[item in Dimension]: number
}
/**
* A set of results
*
* @since 0.3.3
*/
type ResultSet = { [host: string]: Result }
/**
* The unique key of each data row
*/
type RowKey = {
host: string
// Absent if date merged
date?: string
}
type RowBase = RowKey & Result
/**
* Row of each statistics result
*/
type Row = RowBase & {
/**
* The merged domains
* Can't be empty if merged
*
* @since 0.1.5
*/
mergedHosts: Row[]
/**
* The merged dates
*
* @since 2.4.7
*/
mergedDates?: string[]
/**
* Whether virtual host
*
* @since 1.6.0
*/
virtual: boolean
/**
* The composition of data when querying remote
*/
composition?: RemoteComposition
/**
* Icon url
* Must be undefined if merged
*/
iconUrl?: string
/**
* The alias name of this Site, always is the title of its homepage by detected
*/
alias?: string
/**
* The id of client where the remote data is stored
*/
cid?: string
/**
* The name of client where the remote data is stored
*/
cname?: string
}
type RemoteCompositionVal =
// Means local data
number | {
/**
* Client's id
*/
cid: string
/**
* Client's name
*/
cname?: string
value: number
}
/**
* @since 1.4.7
*/
type RemoteComposition = {
[item in Dimension]: RemoteCompositionVal[]
}
}