aboutsummaryrefslogtreecommitdiff
path: root/frontend/src/types
diff options
context:
space:
mode:
Diffstat (limited to 'frontend/src/types')
-rw-r--r--frontend/src/types/Content.tsx18
-rw-r--r--frontend/src/types/Game.tsx37
-rw-r--r--frontend/src/types/Map.tsx103
-rw-r--r--frontend/src/types/Pagination.tsx6
-rw-r--r--frontend/src/types/Profile.tsx63
-rw-r--r--frontend/src/types/Search.tsx13
6 files changed, 240 insertions, 0 deletions
diff --git a/frontend/src/types/Content.tsx b/frontend/src/types/Content.tsx
new file mode 100644
index 0000000..e593505
--- /dev/null
+++ b/frontend/src/types/Content.tsx
@@ -0,0 +1,18 @@
1export interface ModMenuContent {
2 id: number;
3 name: string;
4 score: number;
5 date: string;
6 showcase: string;
7 description: string;
8 category_id: number;
9};
10
11export interface MapDiscussionContent {
12 title: string;
13 content: string;
14};
15
16export interface MapDiscussionCommentContent {
17 comment: string;
18};
diff --git a/frontend/src/types/Game.tsx b/frontend/src/types/Game.tsx
new file mode 100644
index 0000000..eb435f6
--- /dev/null
+++ b/frontend/src/types/Game.tsx
@@ -0,0 +1,37 @@
1import { Map } from './Map';
2
3
4export interface Game {
5 id: number;
6 name: string;
7 image: string;
8 is_coop: boolean;
9 category_portals: GameCategoryPortals[];
10};
11
12export interface GameChapters {
13 game: Game;
14 chapters: Chapter[];
15};
16
17export interface GameMaps {
18 game: Game;
19 maps: Map[];
20};
21
22export interface Category {
23 id: number;
24 name: string;
25};
26
27interface Chapter {
28 id: number;
29 name: string;
30 image: string;
31 is_disabled: boolean;
32};
33
34export interface GameCategoryPortals {
35 category: Category;
36 portal_count: number;
37};
diff --git a/frontend/src/types/Map.tsx b/frontend/src/types/Map.tsx
new file mode 100644
index 0000000..4a6b60e
--- /dev/null
+++ b/frontend/src/types/Map.tsx
@@ -0,0 +1,103 @@
1import { Category, GameCategoryPortals } from './Game';
2import { Pagination } from './Pagination';
3import { UserShort } from './Profile';
4
5export interface Map {
6 id: number;
7 name: string;
8 image: string;
9 is_disabled: boolean;
10 difficulty: number;
11 category_portals: GameCategoryPortals[];
12};
13
14export interface MapDiscussion {
15 discussion: MapDiscussionsDetail;
16};
17
18export interface MapDiscussions {
19 discussions: MapDiscussionsDetail[];
20};
21
22export interface MapDiscussionsDetail {
23 id: number;
24 title: string;
25 content: string;
26 creator: UserShort;
27 comments: MapDiscussionDetailComment[];
28 created_at: string;
29 updated_at: string;
30};
31
32interface MapDiscussionDetailComment {
33 comment: string;
34 date: string;
35 user: UserShort;
36};
37
38export interface MapLeaderboard {
39 map: MapSummaryMap;
40 records: MapLeaderboardRecordSingleplayer[] | MapLeaderboardRecordMultiplayer[];
41 pagination: Pagination;
42};
43
44export interface MapLeaderboardRecordSingleplayer {
45 kind: "singleplayer";
46 placement: number;
47 record_id: number;
48 score_count: number;
49 score_time: number;
50 user: UserShort;
51 demo_id: string;
52 record_date: string;
53};
54
55export interface MapLeaderboardRecordMultiplayer {
56 kind: "multiplayer";
57 placement: number;
58 record_id: number;
59 score_count: number;
60 score_time: number;
61 host: UserShort;
62 partner: UserShort;
63 host_demo_id: string;
64 partner_demo_id: string;
65 record_date: string;
66};
67
68
69export interface MapSummary {
70 map: MapSummaryMap;
71 summary: MapSummaryDetails;
72};
73
74interface MapSummaryMap {
75 id: number;
76 image: string;
77 chapter_name: string;
78 game_name: string;
79 map_name: string;
80 is_coop: boolean;
81 is_disabled: boolean;
82};
83
84interface MapSummaryDetails {
85 routes: MapSummaryDetailsRoute[];
86};
87
88interface MapSummaryDetailsRoute {
89 route_id: number;
90 category: Category;
91 history: MapSummaryDetailsRouteHistory;
92 rating: number;
93 completion_count: number;
94 description: string;
95 showcase: string;
96};
97
98interface MapSummaryDetailsRouteHistory {
99 runner_name: string;
100 score_count: number;
101 date: string;
102};
103
diff --git a/frontend/src/types/Pagination.tsx b/frontend/src/types/Pagination.tsx
new file mode 100644
index 0000000..ccff04b
--- /dev/null
+++ b/frontend/src/types/Pagination.tsx
@@ -0,0 +1,6 @@
1export interface Pagination {
2 total_records: number;
3 total_pages: number;
4 current_page: number;
5 page_size: number;
6};
diff --git a/frontend/src/types/Profile.tsx b/frontend/src/types/Profile.tsx
new file mode 100644
index 0000000..2bb037c
--- /dev/null
+++ b/frontend/src/types/Profile.tsx
@@ -0,0 +1,63 @@
1import { Pagination } from "./Pagination";
2
3export interface UserShort {
4 steam_id: string;
5 user_name: string;
6 avatar_link: string;
7};
8
9export interface UserProfile {
10 profile: boolean;
11 steam_id: string;
12 user_name: string;
13 avatar_link: string;
14 country_code: string;
15 titles: UserProfileTitles[];
16 links: UserProfileLinks;
17 rankings: UserProfileRankings;
18 records: UserProfileRecords[];
19 pagination: Pagination;
20};
21
22interface UserProfileTitles {
23 name: string;
24 color: string;
25};
26
27interface UserProfileLinks {
28 p2sr: string;
29 steam: string;
30 youtube: string;
31 twitch: string;
32};
33
34interface UserProfileRankings {
35 overall: UserProfileRankingsDetail;
36 singleplayer: UserProfileRankingsDetail;
37 cooperative: UserProfileRankingsDetail;
38};
39
40interface UserProfileRecords {
41 game_id: number;
42 category_id: number;
43 map_id: number;
44 map_name: string;
45 map_wr_count: number;
46 placement: number;
47 scores: UserProfileRecordsScores[]
48};
49
50interface UserProfileRecordsScores {
51 record_id: number;
52 demo_id: string;
53 score_count: number;
54 score_time: number;
55 date: string;
56};
57
58interface UserProfileRankingsDetail {
59 rank: number;
60 completion_count: number;
61 completion_total: number;
62};
63
diff --git a/frontend/src/types/Search.tsx b/frontend/src/types/Search.tsx
new file mode 100644
index 0000000..766311a
--- /dev/null
+++ b/frontend/src/types/Search.tsx
@@ -0,0 +1,13 @@
1import { UserShort } from "./Profile";
2
3export interface Search {
4 players: UserShort[];
5 maps: SearchMap[];
6};
7
8interface SearchMap {
9 id: number;
10 game: string;
11 chapter: string;
12 map: string;
13};