diff options
Diffstat (limited to 'frontend/src/types')
| -rw-r--r-- | frontend/src/types/Content.tsx | 18 | ||||
| -rw-r--r-- | frontend/src/types/Game.tsx | 37 | ||||
| -rw-r--r-- | frontend/src/types/Map.tsx | 103 | ||||
| -rw-r--r-- | frontend/src/types/Pagination.tsx | 6 | ||||
| -rw-r--r-- | frontend/src/types/Profile.tsx | 63 | ||||
| -rw-r--r-- | frontend/src/types/Search.tsx | 13 |
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 @@ | |||
| 1 | export 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 | |||
| 11 | export interface MapDiscussionContent { | ||
| 12 | title: string; | ||
| 13 | content: string; | ||
| 14 | }; | ||
| 15 | |||
| 16 | export 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 @@ | |||
| 1 | import { Map } from './Map'; | ||
| 2 | |||
| 3 | |||
| 4 | export interface Game { | ||
| 5 | id: number; | ||
| 6 | name: string; | ||
| 7 | image: string; | ||
| 8 | is_coop: boolean; | ||
| 9 | category_portals: GameCategoryPortals[]; | ||
| 10 | }; | ||
| 11 | |||
| 12 | export interface GameChapters { | ||
| 13 | game: Game; | ||
| 14 | chapters: Chapter[]; | ||
| 15 | }; | ||
| 16 | |||
| 17 | export interface GameMaps { | ||
| 18 | game: Game; | ||
| 19 | maps: Map[]; | ||
| 20 | }; | ||
| 21 | |||
| 22 | export interface Category { | ||
| 23 | id: number; | ||
| 24 | name: string; | ||
| 25 | }; | ||
| 26 | |||
| 27 | interface Chapter { | ||
| 28 | id: number; | ||
| 29 | name: string; | ||
| 30 | image: string; | ||
| 31 | is_disabled: boolean; | ||
| 32 | }; | ||
| 33 | |||
| 34 | export 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 @@ | |||
| 1 | import { Category, GameCategoryPortals } from './Game'; | ||
| 2 | import { Pagination } from './Pagination'; | ||
| 3 | import { UserShort } from './Profile'; | ||
| 4 | |||
| 5 | export interface Map { | ||
| 6 | id: number; | ||
| 7 | name: string; | ||
| 8 | image: string; | ||
| 9 | is_disabled: boolean; | ||
| 10 | difficulty: number; | ||
| 11 | category_portals: GameCategoryPortals[]; | ||
| 12 | }; | ||
| 13 | |||
| 14 | export interface MapDiscussion { | ||
| 15 | discussion: MapDiscussionsDetail; | ||
| 16 | }; | ||
| 17 | |||
| 18 | export interface MapDiscussions { | ||
| 19 | discussions: MapDiscussionsDetail[]; | ||
| 20 | }; | ||
| 21 | |||
| 22 | export 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 | |||
| 32 | interface MapDiscussionDetailComment { | ||
| 33 | comment: string; | ||
| 34 | date: string; | ||
| 35 | user: UserShort; | ||
| 36 | }; | ||
| 37 | |||
| 38 | export interface MapLeaderboard { | ||
| 39 | map: MapSummaryMap; | ||
| 40 | records: MapLeaderboardRecordSingleplayer[] | MapLeaderboardRecordMultiplayer[]; | ||
| 41 | pagination: Pagination; | ||
| 42 | }; | ||
| 43 | |||
| 44 | export 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 | |||
| 55 | export 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 | |||
| 69 | export interface MapSummary { | ||
| 70 | map: MapSummaryMap; | ||
| 71 | summary: MapSummaryDetails; | ||
| 72 | }; | ||
| 73 | |||
| 74 | interface 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 | |||
| 84 | interface MapSummaryDetails { | ||
| 85 | routes: MapSummaryDetailsRoute[]; | ||
| 86 | }; | ||
| 87 | |||
| 88 | interface 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 | |||
| 98 | interface 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 @@ | |||
| 1 | export 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 @@ | |||
| 1 | import { Pagination } from "./Pagination"; | ||
| 2 | |||
| 3 | export interface UserShort { | ||
| 4 | steam_id: string; | ||
| 5 | user_name: string; | ||
| 6 | avatar_link: string; | ||
| 7 | }; | ||
| 8 | |||
| 9 | export 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 | |||
| 22 | interface UserProfileTitles { | ||
| 23 | name: string; | ||
| 24 | color: string; | ||
| 25 | }; | ||
| 26 | |||
| 27 | interface UserProfileLinks { | ||
| 28 | p2sr: string; | ||
| 29 | steam: string; | ||
| 30 | youtube: string; | ||
| 31 | twitch: string; | ||
| 32 | }; | ||
| 33 | |||
| 34 | interface UserProfileRankings { | ||
| 35 | overall: UserProfileRankingsDetail; | ||
| 36 | singleplayer: UserProfileRankingsDetail; | ||
| 37 | cooperative: UserProfileRankingsDetail; | ||
| 38 | }; | ||
| 39 | |||
| 40 | interface 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 | |||
| 50 | interface UserProfileRecordsScores { | ||
| 51 | record_id: number; | ||
| 52 | demo_id: string; | ||
| 53 | score_count: number; | ||
| 54 | score_time: number; | ||
| 55 | date: string; | ||
| 56 | }; | ||
| 57 | |||
| 58 | interface 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 @@ | |||
| 1 | import { UserShort } from "./Profile"; | ||
| 2 | |||
| 3 | export interface Search { | ||
| 4 | players: UserShort[]; | ||
| 5 | maps: SearchMap[]; | ||
| 6 | }; | ||
| 7 | |||
| 8 | interface SearchMap { | ||
| 9 | id: number; | ||
| 10 | game: string; | ||
| 11 | chapter: string; | ||
| 12 | map: string; | ||
| 13 | }; | ||