mirror of
https://github.com/rommapp/romm.git
synced 2026-12-04 21:02:21 +01:00
35 lines
773 B
TypeScript
35 lines
773 B
TypeScript
import api from "@/services/api";
|
|
import type { Platform } from "@/stores/platforms";
|
|
|
|
export type LibraryStructure = "struct_a" | "struct_b" | null;
|
|
|
|
export interface ExistingPlatform {
|
|
fs_slug: string;
|
|
rom_count: number;
|
|
}
|
|
|
|
export interface SetupLibraryInfo {
|
|
detected_structure: LibraryStructure;
|
|
existing_platforms: ExistingPlatform[];
|
|
supported_platforms: Platform[];
|
|
}
|
|
|
|
export interface CreatePlatformsResponse {
|
|
success: boolean;
|
|
created_count: number;
|
|
message: string;
|
|
}
|
|
|
|
export default {
|
|
async getLibraryInfo() {
|
|
return await api.get<SetupLibraryInfo>("/setup/library");
|
|
},
|
|
|
|
async createPlatforms(platformSlugs: string[]) {
|
|
return await api.post<CreatePlatformsResponse>(
|
|
"/setup/platforms",
|
|
platformSlugs,
|
|
);
|
|
},
|
|
};
|