drop/desktop/main/types.ts

124 lines
2.4 KiB
TypeScript
Raw Permalink Normal View History

2024-10-17 21:05:25 +11:00
import type { Component } from "vue";
2024-10-15 20:05:13 +11:00
export type NavigationItem = {
2024-10-17 21:05:25 +11:00
prefix: string;
route: string;
label: string;
};
2024-10-15 20:05:13 +11:00
export type QuickActionNav = {
2024-10-17 21:05:25 +11:00
icon: Component;
notifications?: number;
action: () => Promise<void>;
};
export type User = {
id: string;
username: string;
admin: boolean;
displayName: string;
profilePictureObjectId: string;
};
type UmuState = "Installed" | "NotInstalled" | "NotNeeded";
export type AppState = {
status: AppStatus;
umuState: UmuState;
user?: User;
};
export type Game = {
id: string;
type: "Game" | "Executor" | "Redist";
mName: string;
mShortDescription: string;
mDescription: string;
mIconObjectId: string;
mBannerObjectId: string;
mCoverObjectId: string;
mImageLibraryObjectIds: string[];
mImageCarouselObjectIds: string[];
};
export type Collection = {
id: string;
name: string;
isDefault: boolean;
isTools?: boolean;
entries: Array<{ gameId: string; game: Game }>;
};
2025-04-27 21:07:39 +10:00
export type GameVersion = {
userConfiguration: {
launchTemplate: string;
overrideProtonPath: string;
overrideHandler: string | undefined;
enableUpdates: boolean
};
setups: Array<{ platform: string }>;
launches: Array<{ platform: string }>;
2025-04-27 21:07:39 +10:00
};
2024-10-08 13:17:06 +11:00
export enum AppStatus {
NotConfigured = "NotConfigured",
Offline = "Offline",
SignedOut = "SignedOut",
SignedIn = "SignedIn",
SignedInNeedsReauth = "SignedInNeedsReauth",
ServerUnavailable = "ServerUnavailable",
2024-10-17 21:05:25 +11:00
}
export type EmptyGameStatusEnum =
| "Remote"
| "Queued"
| "Downloading"
| "Validating"
| "Updating"
| "Uninstalling"
| "Running";
export enum InstalledType {
PartiallyInstalled = "PartiallyInstalled",
SetupRequired = "SetupRequired",
Installed = "Installed",
2024-10-17 21:05:25 +11:00
}
export interface InstalledGameStatusData {
install_type: { type: InstalledType };
version_id: string;
install_dir: string;
update_available: boolean;
}
export type GameStatus =
| {
type: EmptyGameStatusEnum;
}
| ({
type: "Installed";
} & InstalledGameStatusData);
export type GameStatusEnum = GameStatus["type"];
export type RawGameStatus = [GameStatus | null, GameStatus | null];
export enum DownloadableType {
Game = "Game",
Tool = "Tool",
DLC = "DLC",
2025-04-27 21:07:39 +10:00
Mod = "Mod",
}
export type DownloadableMetadata = {
2025-04-27 21:07:39 +10:00
id: string;
version: string;
downloadType: DownloadableType;
};
export type Settings = {
2025-04-27 21:07:39 +10:00
autostart: boolean;
maxDownloadThreads: number;
forceOffline: boolean;
};