From a65d6d9127c3fa7f6a8ecaec5d1ffd1f47c2bc98 Mon Sep 17 00:00:00 2001
From: Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com>
Date: Tue, 3 Sep 2024 00:08:53 +0300
Subject: refactor: port to typescript

---
 frontend/src/types/Map.tsx | 103 +++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 103 insertions(+)
 create mode 100644 frontend/src/types/Map.tsx

(limited to 'frontend/src/types/Map.tsx')

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 @@
+import { Category, GameCategoryPortals } from './Game';
+import { Pagination } from './Pagination';
+import { UserShort } from './Profile';
+
+export interface Map {
+  id: number;
+  name: string;
+  image: string;
+  is_disabled: boolean;
+  difficulty: number;
+  category_portals: GameCategoryPortals[];
+};
+
+export interface MapDiscussion {
+  discussion: MapDiscussionsDetail;
+};
+
+export interface MapDiscussions {
+  discussions: MapDiscussionsDetail[];
+};
+
+export interface MapDiscussionsDetail {
+  id: number;
+  title: string;
+  content: string;
+  creator: UserShort;
+  comments: MapDiscussionDetailComment[];
+  created_at: string;
+  updated_at: string;
+};
+
+interface MapDiscussionDetailComment {
+  comment: string;
+  date: string;
+  user: UserShort;
+};
+
+export interface MapLeaderboard {
+  map: MapSummaryMap;
+  records: MapLeaderboardRecordSingleplayer[] | MapLeaderboardRecordMultiplayer[];
+  pagination: Pagination;
+};
+
+export interface MapLeaderboardRecordSingleplayer {
+  kind: "singleplayer";
+  placement: number;
+  record_id: number;
+  score_count: number;
+  score_time: number;
+  user: UserShort;
+  demo_id: string;
+  record_date: string;
+};
+
+export interface MapLeaderboardRecordMultiplayer {
+  kind: "multiplayer";
+  placement: number;
+  record_id: number;
+  score_count: number;
+  score_time: number;
+  host: UserShort;
+  partner: UserShort;
+  host_demo_id: string;
+  partner_demo_id: string;
+  record_date: string;
+};
+
+
+export interface MapSummary {
+  map: MapSummaryMap;
+  summary: MapSummaryDetails;
+};
+
+interface MapSummaryMap {
+  id: number;
+  image: string;
+  chapter_name: string;
+  game_name: string;
+  map_name: string;
+  is_coop: boolean;
+  is_disabled: boolean;
+};
+
+interface MapSummaryDetails {
+  routes: MapSummaryDetailsRoute[];
+};
+
+interface MapSummaryDetailsRoute {
+  route_id: number;
+  category: Category;
+  history: MapSummaryDetailsRouteHistory;
+  rating: number;
+  completion_count: number;
+  description: string;
+  showcase: string;
+};
+
+interface MapSummaryDetailsRouteHistory {
+  runner_name: string;
+  score_count: number;
+  date: string;
+};
+
-- 
cgit v1.2.3

