feat: events working

This commit is contained in:
Zamitto 2024-05-19 14:15:07 -03:00
parent 3b17953a82
commit 811878e364
12 changed files with 182 additions and 82 deletions

View file

@ -1,9 +1,5 @@
import type { Downloader, GameStatus } from "@shared";
import {
ProgressInfo,
UpdateDownloadedEvent,
UpdateInfo,
} from "electron-updater";
import { ProgressInfo, UpdateInfo } from "electron-updater";
export type GameShop = "steam" | "epic";
export type CatalogueCategory = "recently_added" | "trending";
@ -149,31 +145,11 @@ export interface SteamGame {
clientIcon: string | null;
}
interface ErrorEvent {
error: Error;
message?: string;
}
interface UpdateNotAvailable {
info: UpdateInfo;
}
interface UpdateAvailable {
info: UpdateInfo;
}
interface UpdateDownloaded {
event: UpdateDownloadedEvent;
}
interface DownloadProgress {
info: ProgressInfo;
}
interface UpdateCancelled {
info: UpdateInfo;
}
export type AppUpdaterEvents =
| ErrorEvent
| UpdateNotAvailable
| UpdateAvailable
| UpdateDownloaded
| DownloadProgress
| UpdateCancelled;
| { type: "error" }
| { type: "checking-for-updates" }
| { type: "update-not-available"; info: UpdateInfo }
| { type: "update-available"; info: UpdateInfo }
| { type: "update-downloaded" }
| { type: "download-progress"; info: ProgressInfo }
| { type: "update-cancelled"; info: UpdateInfo };