diff --git a/src/main/declaration.d.ts b/src/main/declaration.d.ts deleted file mode 100644 index aa778c59..00000000 --- a/src/main/declaration.d.ts +++ /dev/null @@ -1,80 +0,0 @@ -declare module "aria2" { - export type Aria2Status = - | "active" - | "waiting" - | "paused" - | "error" - | "complete" - | "removed"; - - export interface StatusResponse { - gid: string; - status: Aria2Status; - totalLength: string; - completedLength: string; - uploadLength: string; - bitfield: string; - downloadSpeed: string; - uploadSpeed: string; - infoHash?: string; - numSeeds?: string; - seeder?: boolean; - pieceLength: string; - numPieces: string; - connections: string; - errorCode?: string; - errorMessage?: string; - followedBy?: string[]; - following: string; - belongsTo: string; - dir: string; - files: { - path: string; - length: string; - completedLength: string; - selected: string; - }[]; - bittorrent?: { - announceList: string[][]; - comment: string; - creationDate: string; - mode: "single" | "multi"; - info: { - name: string; - verifiedLength: string; - verifyIntegrityPending: string; - }; - }; - } - - export default class Aria2 { - constructor(options: any); - open: () => Promise; - call( - method: "addUri", - uris: string[], - options: { dir: string } - ): Promise; - call( - method: "tellStatus", - gid: string, - keys?: string[] - ): Promise; - call(method: "pause", gid: string): Promise; - call(method: "forcePause", gid: string): Promise; - call(method: "unpause", gid: string): Promise; - call(method: "remove", gid: string): Promise; - call(method: "forceRemove", gid: string): Promise; - call(method: "pauseAll"): Promise; - call(method: "forcePauseAll"): Promise; - listNotifications: () => [ - "onDownloadStart", - "onDownloadPause", - "onDownloadStop", - "onDownloadComplete", - "onDownloadError", - "onBtDownloadComplete", - ]; - on: (event: string, callback: (params: any) => void) => void; - } -} diff --git a/src/main/entity/game.entity.ts b/src/main/entity/game.entity.ts index b8607b73..190e7470 100644 --- a/src/main/entity/game.entity.ts +++ b/src/main/entity/game.entity.ts @@ -9,9 +9,8 @@ import { } from "typeorm"; import { Repack } from "./repack.entity"; -import type { GameShop } from "@types"; +import type { GameShop, GameStatus } from "@types"; import { Downloader } from "@shared"; -import type { Aria2Status } from "aria2"; import type { DownloadQueue } from "./download-queue.entity"; @Entity("game") @@ -47,7 +46,7 @@ export class Game { shop: GameShop; @Column("text", { nullable: true }) - status: Aria2Status | null; + status: GameStatus | null; @Column("int", { default: Downloader.Torrent }) downloader: Downloader; diff --git a/src/types/index.ts b/src/types/index.ts index 915e4ae7..ff3ad898 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -1,6 +1,13 @@ -import type { Aria2Status } from "aria2"; import type { DownloadSourceStatus, Downloader } from "@shared"; +export type GameStatus = + | "active" + | "waiting" + | "paused" + | "error" + | "complete" + | "removed"; + export type GameShop = "steam" | "epic"; export interface SteamGenre { @@ -106,7 +113,7 @@ export interface Game { id: number; title: string; iconUrl: string; - status: Aria2Status | null; + status: GameStatus | null; folderName: string; downloadPath: string | null; repacks: GameRepack[];