hydra/src/types/index.ts

149 lines
2.9 KiB
TypeScript
Raw Normal View History

2024-05-20 01:21:11 +00:00
import type { Downloader } from "@shared";
import type { Aria2Status } from "aria2";
2024-04-18 07:46:06 +00:00
export type GameShop = "steam" | "epic";
export type CatalogueCategory = "recently_added" | "trending";
export interface SteamGenre {
id: string;
name: string;
}
export interface SteamScreenshot {
id: number;
path_thumbnail: string;
path_full: string;
}
2024-05-05 02:37:47 +00:00
export interface SteamVideoSource {
max: string;
"480": string;
2024-05-05 02:37:47 +00:00
}
export interface SteamMovies {
id: number;
mp4: SteamVideoSource;
webm: SteamVideoSource;
thumbnail: string;
name: string;
highlight: boolean;
}
2024-04-18 07:46:06 +00:00
export interface SteamAppDetails {
name: string;
detailed_description: string;
about_the_game: string;
short_description: string;
publishers: string[];
genres: SteamGenre[];
movies?: SteamMovies[];
2024-04-18 07:46:06 +00:00
screenshots: SteamScreenshot[];
pc_requirements: {
minimum: string;
recommended: string;
};
mac_requirements: {
minimum: string;
recommended: string;
};
linux_requirements: {
2024-04-18 07:46:06 +00:00
minimum: string;
recommended: string;
};
release_date: {
coming_soon: boolean;
date: string;
};
}
export interface GameRepack {
id: number;
title: string;
magnet: string;
page: number;
repacker: string;
fileSize: string | null;
uploadDate: Date | string | null;
createdAt: Date;
updatedAt: Date;
}
2024-04-28 18:21:14 +00:00
export type ShopDetails = SteamAppDetails & {
objectID: string;
};
2024-04-18 07:46:06 +00:00
export interface TorrentFile {
path: string;
length: number;
}
/* Used by the catalogue */
export interface CatalogueEntry {
objectID: string;
shop: GameShop;
title: string;
/* Epic Games covers cannot be guessed with objectID */
cover: string;
repacks: GameRepack[];
}
/* Used by the library */
export interface Game extends Omit<CatalogueEntry, "cover"> {
id: number;
title: string;
iconUrl: string;
2024-05-20 01:21:11 +00:00
status: Aria2Status | null;
2024-04-18 07:46:06 +00:00
folderName: string;
downloadPath: string | null;
repacks: GameRepack[];
repack: GameRepack | null;
2024-04-18 07:46:06 +00:00
progress: number;
bytesDownloaded: number;
playTimeInMilliseconds: number;
downloader: Downloader;
2024-04-18 07:46:06 +00:00
executablePath: string | null;
lastTimePlayed: Date | null;
fileSize: number;
createdAt: Date;
updatedAt: Date;
}
2024-05-20 01:21:11 +00:00
export interface DownloadProgress {
2024-04-18 07:46:06 +00:00
downloadSpeed: number;
timeRemaining: number;
numPeers: number;
numSeeds: number;
2024-05-20 01:21:11 +00:00
downloadingMetadata: boolean;
progress: number;
bytesDownloaded: number;
fileSize: number;
2024-04-18 07:46:06 +00:00
game: Omit<Game, "repacks">;
}
export interface UserPreferences {
downloadsPath: string | null;
language: string;
downloadNotificationsEnabled: boolean;
repackUpdatesNotificationsEnabled: boolean;
realDebridApiToken: string | null;
preferQuitInsteadOfHiding: boolean;
2024-05-05 23:11:12 +00:00
runAtStartup: boolean;
2024-04-18 07:46:06 +00:00
}
export interface HowLongToBeatCategory {
title: string;
duration: string;
accuracy: string;
}
export interface Steam250Game {
title: string;
objectID: string;
}
2024-05-18 20:55:12 +00:00
export interface SteamGame {
id: number;
name: string;
clientIcon: string | null;
}