]> git.r.bdr.sh - rbdr/forum/blob - src/lib/data/types.d.ts
Don't remember what this WIP was about
[rbdr/forum] / src / lib / data / types.d.ts
1 /*
2 * These types are the structures that we can expect
3 * from the API.
4 */
5
6 export type Topic = {
7 id: string;
8 title: string;
9 ttl: number;
10 updated_at: number;
11 forum_id: string;
12 forum?: Forum;
13 posts?: Post[];
14 tags?: Tag[];
15 };
16
17 export type Post = {
18 id: string;
19 created_at: number;
20 title: string;
21 text: string;
22 topic_id: string;
23 topic?: Topic;
24 author_id: string;
25 author?: User;
26 };
27
28 export type Tag = {
29 tag: string;
30 count: number;
31 };
32
33 export type Forum = {
34 id: string;
35 glyph: string;
36 label: string;
37 position: number;
38 topics: Topic[];
39 };
40
41 export type User = {
42 id: string;
43 handle: string;
44 };