-
Notifications
You must be signed in to change notification settings - Fork 51
/
Dreamwriter.elm
75 lines (62 loc) · 1.43 KB
/
Dreamwriter.elm
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
module Dreamwriter where
-- TODO make this a proper ADT once outbound ports can accept them
type alias FullscreenState = Bool
type alias Identifier = String
type alias MsSinceEpoch = Int
type alias HtmlString = String
type alias DownloadOptions =
{ filename : String
, contentType : String
}
type alias Note =
{ id : Identifier
, title : String
, snapshotId : HtmlString
, creationTime : MsSinceEpoch
, lastModifiedTime : MsSinceEpoch
}
type alias Doc =
{
id : Identifier,
title : String,
description : HtmlString,
chapters : List Chapter,
titleWords : Int,
descriptionWords : Int,
creationTime : MsSinceEpoch,
lastModifiedTime : MsSinceEpoch,
dailyWords : List WordsPerDay,
dailyWordsStartsAt : Int
}
emptyDoc =
{
id = "",
title = "",
description = "",
chapters = [],
titleWords = 0,
descriptionWords = 0,
creationTime = 0,
lastModifiedTime = 0,
dailyWords = [],
dailyWordsStartsAt = 0
}
type alias Chapter =
{ id : Identifier
, heading : String
, headingWords : Int
, bodyWords : Int
, creationTime : MsSinceEpoch
, lastModifiedTime : MsSinceEpoch
, snapshotId : Identifier
}
type alias WordsPerDay =
{
day : String,
words : Int
}
type alias Snapshot =
{ id : Identifier
, html : String
, text : String
}