aboutsummaryrefslogtreecommitdiff
path: root/protocol.d.ts
diff options
context:
space:
mode:
authormetamuffin <yvchraiqi@protonmail.com>2022-06-06 22:29:14 +0200
committermetamuffin <yvchraiqi@protonmail.com>2022-06-06 22:29:14 +0200
commitdf31b14b3736a1e71dd8c08297f84e3fba228e39 (patch)
treed588627928bdb4133a5f6b582d22b500e9e1ad1e /protocol.d.ts
downloadkarlender-df31b14b3736a1e71dd8c08297f84e3fba228e39.tar
karlender-df31b14b3736a1e71dd8c08297f84e3fba228e39.tar.bz2
karlender-df31b14b3736a1e71dd8c08297f84e3fba228e39.tar.zst
a
Diffstat (limited to 'protocol.d.ts')
-rw-r--r--protocol.d.ts66
1 files changed, 66 insertions, 0 deletions
diff --git a/protocol.d.ts b/protocol.d.ts
new file mode 100644
index 0000000..f119045
--- /dev/null
+++ b/protocol.d.ts
@@ -0,0 +1,66 @@
+
+// { type: "handshake", version: "10"}
+// { type: "handshake", data: {version: "10"}}
+// { "handshake": {version: "10"}}
+
+export type ServerboundPacket = null
+export type ClientboundPacket = Handshake
+
+interface Handshake {
+ type: "handshake"
+ version: string
+}
+
+interface Download {
+ type: "download",
+}
+interface DownloadResponse {
+ type: "download_response",
+ entries: TodoEntry[]
+}
+
+
+
+interface TodoEntry {
+ name: string,
+ description: string,
+
+ tags: string[],
+ priority: number,
+
+ completed?: number,
+ scheduled?: number,
+
+ occurence?: Condition,
+ deadline?: Condition,
+}
+
+/*
+ { and: [
+ { or: [{ dayofweak: 0 }, { dayofweak: 1 }] },
+ { weekofmonth: 0 }
+ { hour: [11, 13] }
+ ]}
+*/
+
+// should only have one property
+interface Condition {
+ from: Condition
+ to: Condition
+
+ or: Condition[]
+ and: Condition[]
+
+ year?: [number, number],
+ monthofyear?: [number, number],
+ weekofmonth?: [number, number],
+ dayofyear?: [number, number],
+ dayofmonth?: [number, number],
+ dayofweek?: [number, number],
+
+ hour?: [number, number],
+ minute?: [number, number],
+ second?: [number, number],
+
+ unix?: [number, number],
+}