diff options
| author | 2026-02-25 02:06:07 +0800 | |
|---|---|---|
| committer | 2026-02-25 02:06:07 +0800 | |
| commit | 78ac61904d78d558d092eff08c9f261cbdb187e8 (patch) | |
| tree | 96f68d1f1554ee3a0532793afaaa52b0c73dcbec /packages/ui/src/lib/modLoaderApi.ts | |
| parent | 8ff3af6cb908fd824b512379dd21ed4f595ab6bb (diff) | |
| parent | 329734b23957b84cde2af459fa61c7385fb5b5f1 (diff) | |
| download | DropOut-78ac61904d78d558d092eff08c9f261cbdb187e8.tar.gz DropOut-78ac61904d78d558d092eff08c9f261cbdb187e8.zip | |
feat(ui): partial react rewrite (#77)
## Summary by Sourcery
Export backend data structures to TypeScript for the new React-based UI
and update CI to build additional targets.
New Features:
- Generate TypeScript definitions for core backend structs and enums
used by the UI.
- Now use our own Azure app(_DropOut_) to finish the authorize process.
Enhancements:
- Annotate existing Rust models with ts-rs metadata to control exported
TypeScript shapes, including tagged enums and opaque JSON fields.
Build:
- Add ts-rs as a dependency for generating TypeScript bindings from Rust
types.
CI:
- Extend the Semifold CI workflow to run on the dev branch and build
additional Linux musl and Windows GNU targets using cross where needed.
Diffstat (limited to 'packages/ui/src/lib/modLoaderApi.ts')
| -rw-r--r-- | packages/ui/src/lib/modLoaderApi.ts | 106 |
1 files changed, 0 insertions, 106 deletions
diff --git a/packages/ui/src/lib/modLoaderApi.ts b/packages/ui/src/lib/modLoaderApi.ts deleted file mode 100644 index 75f404a..0000000 --- a/packages/ui/src/lib/modLoaderApi.ts +++ /dev/null @@ -1,106 +0,0 @@ -/** - * Mod Loader API service for Fabric and Forge integration. - * This module provides functions to interact with the Tauri backend - * for mod loader version management. - */ - -import { invoke } from "@tauri-apps/api/core"; -import type { - FabricGameVersion, - FabricLoaderVersion, - FabricLoaderEntry, - InstalledFabricVersion, - ForgeVersion, - InstalledForgeVersion, -} from "../types"; - -// ==================== Fabric API ==================== - -/** - * Get all Minecraft versions supported by Fabric. - */ -export async function getFabricGameVersions(): Promise<FabricGameVersion[]> { - return invoke<FabricGameVersion[]>("get_fabric_game_versions"); -} - -/** - * Get all available Fabric loader versions. - */ -export async function getFabricLoaderVersions(): Promise<FabricLoaderVersion[]> { - return invoke<FabricLoaderVersion[]>("get_fabric_loader_versions"); -} - -/** - * Get Fabric loaders available for a specific Minecraft version. - */ -export async function getFabricLoadersForVersion( - gameVersion: string, -): Promise<FabricLoaderEntry[]> { - return invoke<FabricLoaderEntry[]>("get_fabric_loaders_for_version", { - gameVersion, - }); -} - -/** - * Install Fabric loader for a specific Minecraft version. - */ -export async function installFabric( - gameVersion: string, - loaderVersion: string, -): Promise<InstalledFabricVersion> { - return invoke<InstalledFabricVersion>("install_fabric", { - gameVersion, - loaderVersion, - }); -} - -/** - * List all installed Fabric versions. - */ -export async function listInstalledFabricVersions(): Promise<string[]> { - return invoke<string[]>("list_installed_fabric_versions"); -} - -/** - * Check if Fabric is installed for a specific version combination. - */ -export async function isFabricInstalled( - gameVersion: string, - loaderVersion: string, -): Promise<boolean> { - return invoke<boolean>("is_fabric_installed", { - gameVersion, - loaderVersion, - }); -} - -// ==================== Forge API ==================== - -/** - * Get all Minecraft versions supported by Forge. - */ -export async function getForgeGameVersions(): Promise<string[]> { - return invoke<string[]>("get_forge_game_versions"); -} - -/** - * Get Forge versions available for a specific Minecraft version. - */ -export async function getForgeVersionsForGame(gameVersion: string): Promise<ForgeVersion[]> { - return invoke<ForgeVersion[]>("get_forge_versions_for_game", { - gameVersion, - }); -} - -/** - * Install Forge for a specific Minecraft version. - */ -export async function installForge( - gameVersion: string, - forgeVersion: string, -): Promise<InstalledForgeVersion> { - return invoke<InstalledForgeVersion>("install_forge", { - gameVersion, - forgeVersion, - }); -} |