diff options
author | metamuffin <yvchraiqi@protonmail.com> | 2022-06-11 14:35:59 +0200 |
---|---|---|
committer | metamuffin <yvchraiqi@protonmail.com> | 2022-06-11 14:35:59 +0200 |
commit | b0346294a25a4e40fb55860f937138c94e15943e (patch) | |
tree | e8074f807843601a46aa3186faac2cece75c220c | |
parent | c2699d114c921ab2ceb1f467b32a26257dddcf3d (diff) | |
download | karlender-b0346294a25a4e40fb55860f937138c94e15943e.tar karlender-b0346294a25a4e40fb55860f937138c94e15943e.tar.bz2 karlender-b0346294a25a4e40fb55860f937138c94e15943e.tar.zst |
update protocol.d.ts
-rw-r--r-- | karld/protocol.d.ts | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/karld/protocol.d.ts b/karld/protocol.d.ts index 2eb1630..f48b283 100644 --- a/karld/protocol.d.ts +++ b/karld/protocol.d.ts @@ -2,40 +2,40 @@ export type ServerboundPacket = Sync | Handshake | ListTasks | ListInstances | UpdateTask | RemoveTask export type ClientboundPacket = Handshake | Error | TaskList | InstanceList | Sync -interface Sync { type: "sync", data: null } -interface Error { type: "error", data: { kind: "unknown_task", details: null } | { kind: "format_error", details: string } } -interface Handshake { type: "handshake", data: { version: string } } -interface ListTasks { type: "list_tasks", data: null } -interface TaskList { type: "task_list", data: Task[] } -interface ListInstances { type: "list_instances", data: { task: number, range: Range } } -interface InstanceList { type: "instance_list", data: Instance[] } -interface UpdateTask { type: "update_task", data: Task } -interface RemoveTask { type: "remove_task", data: number } +export interface Sync { type: "sync", data: null } +export interface Error { type: "error", data: { kind: "unknown_task", details: null } | { kind: "format_error", details: string } } +export interface Handshake { type: "handshake", data: { version: string } } +export interface ListTasks { type: "list_tasks", data: null } +export interface TaskList { type: "task_list", data: Task[] } +export interface ListInstances { type: "list_instances", data: { task: number, range: Range } } +export interface InstanceList { type: "instance_list", data: Instance[] } +export interface UpdateTask { type: "update_task", data: Task } +export interface RemoveTask { type: "remove_task", data: number } -interface Instance { of: number, at: Range } -interface Range { start?: number, end?: number } -interface Task { +export interface Instance { of: number, at: Range } + +export interface Range { start?: number, end?: number } + +export interface Task { id: number name: string, description: string, - tags: string[], - priority: number, - - completed?: number, - scheduled?: number, - - occurence?: Condition, - deadline?: Condition, + schedule: Schedule } +export type Schedule = { type: "never" } + | { type: "static", options: Range } + | { type: "condition", options: Condition } + | { type: "dynamic", options: { priority: number, scheduled?: number, deadline?: Condition } } + export type Condition = { from?: Condition } | { or?: Condition[] } | { and?: Condition[] } | { equal?: { prop: Thing, value: number, mod?: number } } | { range?: { prop: Thing, min: number, max: number, mod?: number } } -type Thing = "year" +export type Thing = "year" | "monthofyear" | "weekofmonth" | "dayofyear" |