summaryrefslogtreecommitdiff
path: root/src/types.ts
diff options
context:
space:
mode:
authorSam Nystrom <sam@samnystrom.dev>2024-03-16 21:07:09 +0000
committerSam Nystrom <sam@samnystrom.dev>2024-03-16 17:10:20 -0400
commitf8c78e5335d389420beb1ca90a1c778568830d8a (patch)
tree322117479169eec68428d434b49c967f07f459d2 /src/types.ts
parent42654fad0fa97b2bced528ed35d15eae91a210d4 (diff)
fix: finish DB type definitions
Diffstat (limited to 'src/types.ts')
-rw-r--r--src/types.ts30
1 files changed, 23 insertions, 7 deletions
diff --git a/src/types.ts b/src/types.ts
index 29d14a3..b045a10 100644
--- a/src/types.ts
+++ b/src/types.ts
@@ -1,18 +1,34 @@
+export type Id = string;
+
+export type Relation<T> = Id | T;
+
+export interface User {
+ id: Id;
+ username: string;
+ email: string;
+}
+
export interface Project {
- id: string;
- owner: string;
+ id: Id;
+ owner: Relation<User>;
name: string;
+ public: boolean;
}
export interface Node {
- id: string;
+ id: Id;
+ project: Relation<Project>;
+ type: string;
x: number;
y: number;
- name: string;
+ collapsed: boolean;
}
export interface Link {
- id: string;
- from: string;
- to: string;
+ id: Id;
+ project: Relation<Project>;
+ from: Relation<Node>;
+ fromSocket: string;
+ to: Relation<Node>;
+ toSocket: string;
}