]> git.r.bdr.sh - rbdr/forum/blob - src/lib/data/types.d.ts
2498bf793d90021d5d8dbd7f4150a92a4c4646a1
[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 tags: Tag[];
12 posts: Post[];
13 forum: Forum;
14 };
15
16 export type Post = {
17 id: string;
18 created_at: number;
19 title: string;
20 text: string;
21 topic: Topic;
22 author: Author;
23 };
24
25 export type Tag = {
26 id: string;
27 weight: number;
28 topics: Topic[];
29 };
30
31 export type Forum = {
32 id: string;
33 glyph: string;
34 label: string;
35 position: number;
36 topics: Topic[];
37 };
38
39 export type Author = {
40 id: string;
41 handle: string;
42 };