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
178 lines (155 loc) · 4.04 KB
/
Copy pathstat.d.ts
File metadata and controls
178 lines (155 loc) · 4.04 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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
declare namespace timer.stat {
type SiteTarget = {
siteKey: timer.site.SiteKey
}
type CateTarget = {
cateKey: number
}
type GroupTarget = {
groupKey: number
}
type TargetKey = SiteTarget | CateTarget | GroupTarget
type DateKey = { date: string }
type StatKey = TargetKey & DateKey
type DateMergeExtend = {
/**
* The merged dates
*
* @since 2.4.7
*/
mergedDates?: string[]
}
type RemoteExtend = {
/**
* The composition of data when querying remote
*/
composition?: RemoteComposition
}
/** StatCondition.date fields only (mq / stat-database queries). */
type _BaseQuery = {
date?: string | [string?, string?]
mergeDate?: boolean
}
type SiteQuery =
& _BaseQuery
& {
focusRange?: Vector<2>
timeRange?: [number, number?]
virtual?: boolean
}
& timer.common.SortBy<'date' | 'host' | timer.core.Dimension>
& {
query?: string
host?: string | string[]
mergeHost?: boolean
inclusiveRemote?: boolean
cateIds?: number[]
ignoreSite?: boolean
}
type SiteDeleteQuery = ({
host: string
} | {
groupId: number
}) & {
date?: [start?: string, end?: string] | string
}
type SitePageQuery = SiteQuery & timer.common.PageQuery
type SiteRowFlat = SiteTarget &
DateKey &
core.Result &
backup.RowExtend &
DateMergeExtend &
RemoteExtend & {
/**
* Icon url
*/
iconUrl?: string
/**
* The alias name of this Site, always is the title of its homepage by detected
*/
alias?: string
/**
* @since 3.0.0
*/
cateId?: number
}
type SiteMergeExtend = {
/**
* The merged domains
* Can't be empty if merged
*
* @since 0.1.5
*/
mergedRows?: SiteRowFlat[]
}
type SiteRow = SiteRowFlat & SiteMergeExtend
type CateQuery = _BaseQuery
& timer.common.SortBy<'date' | 'focus' | 'time'>
& {
query?: string
inclusiveRemote?: boolean
cateIds?: number[]
}
type CatePageQuery = CateQuery & timer.common.PageQuery
type CateRowFlat = CateTarget &
DateKey &
core.Result &
backup.RowExtend &
DateMergeExtend &
RemoteExtend & {
cateName: string | undefined
}
type CateMergeExtend = {
mergedRows?: SiteRowFlat[]
}
type CateRow = CateRowFlat & CateMergeExtend
type GroupRowFlat = GroupTarget &
DateKey &
DateMergeExtend &
core.Result & {
color: `${chrome.tabGroups.Color}` | undefined
title: string | undefined
}
type GroupQuery = _BaseQuery
& {
focusRange?: Vector<2>
timeRange?: [number, number?]
}
& timer.common.SortBy<'date' | 'title' | 'focus' | 'time'>
& {
query?: string
groupIds?: number[]
}
type GroupPageQuery = GroupQuery & timer.common.PageQuery
type GroupMergeExtend = {
mergedRows?: GroupRowFlat[]
}
type GroupRow = GroupRowFlat & GroupMergeExtend
/**
* Row of each statistics result
*/
type Row = SiteRow | CateRow | GroupRow
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 core.Dimension]: RemoteCompositionVal[]
}
/**
* @since 3.0.0
*/
type MergeMethod = 'cate' | 'date' | 'domain' | 'group'
}