-
Notifications
You must be signed in to change notification settings - Fork 57
Expand file tree
/
Copy pathstat.d.ts
More file actions
95 lines (85 loc) · 2.2 KB
/
stat.d.ts
File metadata and controls
95 lines (85 loc) · 2.2 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
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 SiteMergeExtend = {
/**
* The merged domains
* Can't be empty if merged
*
* @since 0.1.5
*/
mergedRows?: Omit<timer.stat.SiteRow, 'mergedRows'>[]
}
type DateMergeExtend = {
/**
* The merged dates
*
* @since 2.4.7
*/
mergedDates?: string[]
}
type RemoteExtend = {
/**
* The composition of data when querying remote
*/
composition?: RemoteComposition
}
interface SiteRow extends SiteTarget, DateKey, core.Result, backup.RowExtend, SiteMergeExtend, 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
}
interface CateRow extends CateTarget, DateKey, core.Result, backup.RowExtend, SiteMergeExtend, DateMergeExtend, RemoteExtend {
cateName: string | undefined
}
interface GroupRow extends GroupTarget, DateKey, DateMergeExtend, core.Result {
color: `${chrome.tabGroups.Color}` | undefined
title: string | undefined
}
/**
* 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'
}