Variable librariesServiceConst
librariesService: {
initDb: () => Promise<void>;
getGames: () => Promise<Game[]>;
addGame: (
game: {
id: string;
name: string;
platform: string;
coverUrl: string | null;
playtime: number;
userRating: number | null;
status:
| "playing"
| "completed"
| "backlog"
| "abandoned"
| "plan_to_play";
installPath: string
| null;
executablePath: string | null;
launchArgs: string | null;
},
) => Promise<void>;
updateGame: (
game: {
id: string;
name: string;
platform: string;
coverUrl: string | null;
playtime: number;
userRating: number | null;
status:
| "playing"
| "completed"
| "backlog"
| "abandoned"
| "plan_to_play";
installPath: string
| null;
executablePath: string | null;
launchArgs: string | null;
},
) => Promise<void>;
deleteGame: (id: string) => Promise<void>;
toggleFavorite: (id: string) => Promise<void>;
} = ...
Type Declaration
initDb: () => Promise<void>
getGames: () => Promise<Game[]>
addGame: (
game: {
id: string;
name: string;
platform: string;
coverUrl: string | null;
playtime: number;
userRating: number | null;
status: "playing" | "completed" | "backlog" | "abandoned" | "plan_to_play";
installPath: string | null;
executablePath: string | null;
launchArgs: string | null;
},
) => Promise<void>
updateGame: (
game: {
id: string;
name: string;
platform: string;
coverUrl: string | null;
playtime: number;
userRating: number | null;
status: "playing" | "completed" | "backlog" | "abandoned" | "plan_to_play";
installPath: string | null;
executablePath: string | null;
launchArgs: string | null;
},
) => Promise<void>
deleteGame: (id: string) => Promise<void>
toggleFavorite: (id: string) => Promise<void>
Inicializa o banco de dados local (SQLite) se ainda não existir