This repository has been archived by the owner on Dec 15, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 77
/
Copy pathteletype-crdt.proto
75 lines (63 loc) · 1.56 KB
/
teletype-crdt.proto
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
syntax = "proto3";
message Operation {
oneof variant {
Splice splice = 1;
Undo undo = 2;
MarkersUpdate markers_update = 3;
}
message Splice {
SpliceId splice_id = 1;
Insertion insertion = 2;
Deletion deletion = 3;
message Insertion {
string text = 2;
SpliceId left_dependency_id = 3;
Point offset_in_left_dependency = 4;
SpliceId right_dependency_id = 5;
Point offset_in_right_dependency = 6;
}
message Deletion {
SpliceId left_dependency_id = 2;
Point offset_in_left_dependency = 3;
SpliceId right_dependency_id = 4;
Point offset_in_right_dependency = 5;
map<uint32, uint32> max_seqs_by_site = 6;
}
}
message Undo {
SpliceId splice_id = 1;
uint32 undo_count = 2;
}
message MarkersUpdate {
uint32 site_id = 1;
map<uint32, LayerOperation> layer_operations = 2;
message LayerOperation {
bool is_deletion = 1;
map<uint32, MarkerOperation> marker_operations = 2;
}
message MarkerOperation {
bool is_deletion = 1;
MarkerUpdate marker_update = 2;
}
message MarkerUpdate {
LogicalRange range = 1;
bool exclusive = 2;
bool reversed = 3;
bool tailed = 4;
}
message LogicalRange {
SpliceId start_dependency_id = 1;
Point offset_in_start_dependency = 2;
SpliceId end_dependency_id = 3;
Point offset_in_end_dependency = 4;
}
}
message SpliceId {
uint32 site = 1;
uint32 seq = 2;
}
message Point {
uint32 row = 1;
uint32 column = 2;
}
}