-
Notifications
You must be signed in to change notification settings - Fork 2
/
types.txt
55 lines (49 loc) · 1.32 KB
/
types.txt
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
type CardID, ColID, TabID = String
type EpochMS = Int -- epoch milliseconds via `new Date().getTime()`
type State = {
cards :: Map[CardID, Card],
columns :: Map[Column, ColID],
-- Note that there may be more tabs than tabOrder contains
tabs :: Map[TabID, Tab],
tabOrder :: List[TabID],
}
type Zettel = {
content, id :: CardID, created, edited
}
type Card : Zettel {
-- core
content :: String,
id :: CardID,
-- timestamps
created :: EpochMS,
edited :: EpochMS,
moved :: EpochMS,
archived :: Maybe EpochMS,
archivedFromColID :: Maybe String,
-- attributes
description :: Maybe String,
time :: Maybe EpochMS, -- due date / event time
ebs :: Maybe { -- evidence based scheduling
estimate :: Seconds,
computed :: Seconds,
elapsed :: Seconds,
done :: Bool,
exact :: Bool,
},
}
type Column = {
id :: ColID,
items :: List[CardID],
name :: String,
created :: EpochMS,
edited :: EpochMS, -- includes changes to the items stored in the list or order, but not
-- changes to the items themselves, traverse the items for this
}
type Tab = {
name :: String,
id :: TabID,
columns :: [ColID],
created :: EpochMS,
edited :: EpochMS, -- same as column edited; accounts for change in list of columns
-- but not changes to the underlying columns
}