]>
Commit | Line | Data |
---|---|---|
d197e31b RBR |
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; | |
6ccc6f60 RBR |
11 | forum_id: string; |
12 | forum?: Forum; | |
13 | posts?: Post[]; | |
14 | tags?: Tag[]; | |
d197e31b RBR |
15 | }; |
16 | ||
17 | export type Post = { | |
18 | id: string; | |
19 | created_at: number; | |
20 | title: string; | |
21 | text: string; | |
852ee620 RBR |
22 | topic_id: string; |
23 | topic?: Topic; | |
6ccc6f60 RBR |
24 | author_id: string; |
25 | author?: User; | |
d197e31b RBR |
26 | }; |
27 | ||
28 | export type Tag = { | |
852ee620 RBR |
29 | tag: string; |
30 | count: number; | |
d197e31b RBR |
31 | }; |
32 | ||
33 | export type Forum = { | |
34 | id: string; | |
35 | glyph: string; | |
36 | label: string; | |
37 | position: number; | |
38 | topics: Topic[]; | |
39 | }; | |
40 | ||
852ee620 | 41 | export type User = { |
d197e31b RBR |
42 | id: string; |
43 | handle: string; | |
44 | }; |