-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathservice.did
108 lines (108 loc) · 1.57 KB
/
service.did
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
type UserInfo =
record {
textColor:
record { // foreground, background
record { nat; nat; nat; };
record { nat; nat; nat; };
};
userName: text;
};
type Result =
variant {
err: opt text;
ok: Out;
};
type Rect =
record {
dim: Dim;
pos: Pos;
};
type Pos =
record {
x: nat;
y: nat;
};
type Out =
variant {
draw: Elm;
redraw: vec record {
text;
Elm;
};
};
type Node =
record {
elms: Elms;
fill: Fill;
rect: Rect;
};
type KeyInfo =
record {
alt: bool;
ctrl: bool;
key: text;
meta: bool;
shift: bool;
};
type GraphicsRequest =
variant {
all: Dim;
last: Dim;
none;
};
type Graphics = Result;
type Fill =
variant {
closed: Color;
none;
open: record {
Color;
nat;
};
};
type EventInfo_2 =
record {
dateTimeLocal: text;
dateTimeUtc: text;
event: Event;
nonce: opt nat;
userInfo: UserInfo;
};
type EventInfo = EventInfo_2;
type Event =
variant {
clipBoard: text;
fileRead: record {
content: text;
path: text;
};
keyDown: vec KeyInfo;
mouseDown: Pos;
quit;
skip;
windowSize: Dim;
};
type Elms = vec Elm;
type Elm =
variant {
node: Node;
rect: record {
Rect;
Fill;
};
};
type Dim =
record {
height: nat;
width: nat;
};
type Color =
record {
nat;
nat;
nat;
};
service : {
update: (vec EventInfo, GraphicsRequest) -> (vec Graphics);
view: (Dim, vec EventInfo) -> (Graphics) query;
}