From 50de0891a02c5a782efe592cf58508707bffbe56 Mon Sep 17 00:00:00 2001 From: "Begonia, HE" <163421589+BegoniaHe@users.noreply.github.com> Date: Fri, 30 Jan 2026 17:05:22 +0100 Subject: [PATCH 1/3] feat(java): add mise version manager support and refactor detection logic - Add scan_java_dir() helper to filter symlinks and scan directories - Implement find_mise_java() for ~/.local/share/mise/installs/java/ - Refactor find_sdkman_java() to scan candidates dir instead of 'current' - Fix import paths to use absolute crate::core::java:: paths - Add mise detection to Linux and macOS candidates Reviewed-by: Claude Sonnet 4.5 --- src-tauri/src/core/java/detection.rs | 82 +++++++++++++++++++++++--- src-tauri/src/core/java/persistence.rs | 2 +- src-tauri/src/core/java/priority.rs | 2 +- src-tauri/src/core/java/validation.rs | 2 +- 4 files changed, 76 insertions(+), 12 deletions(-) diff --git a/src-tauri/src/core/java/detection.rs b/src-tauri/src/core/java/detection.rs index 95e7803..08dcebb 100644 --- a/src-tauri/src/core/java/detection.rs +++ b/src-tauri/src/core/java/detection.rs @@ -1,4 +1,5 @@ use std::io::Read; +use std::path::Path; use std::path::PathBuf; use std::process::{Command, Stdio}; use std::time::Duration; @@ -6,25 +7,78 @@ use std::time::Duration; #[cfg(target_os = "windows")] use std::os::windows::process::CommandExt; -use super::strip_unc_prefix; +use crate::core::java::strip_unc_prefix; const WHICH_TIMEOUT: Duration = Duration::from_secs(2); +/// Scans a directory for Java installations, filtering out symlinks +/// +/// # Arguments +/// * `base_dir` - Base directory to scan (e.g., mise or SDKMAN java dir) +/// * `should_skip` - Predicate to determine if an entry should be skipped +/// +/// # Returns +/// First valid Java installation found, or `None` +fn scan_java_dir(base_dir: &Path, should_skip: F) -> Option +where + F: Fn(&std::fs::DirEntry) -> bool, +{ + std::fs::read_dir(base_dir) + .ok()? + .flatten() + .filter(|entry| { + let path = entry.path(); + // Only consider real directories, not symlinks + path.is_dir() && !path.is_symlink() && !should_skip(entry) + }) + .find_map(|entry| { + let java_path = entry.path().join("bin/java"); + if java_path.exists() && java_path.is_file() { + Some(java_path) + } else { + None + } + }) +} + /// Finds Java installation from SDKMAN! if available /// -/// Checks the standard SDKMAN! installation path: -/// `~/.sdkman/candidates/java/current/bin/java` +/// Scans the SDKMAN! candidates directory and returns the first valid Java installation found. +/// Skips the 'current' symlink to avoid duplicates. +/// +/// Path: `~/.sdkman/candidates/java/` /// /// # Returns -/// `Some(PathBuf)` if SDKMAN! Java is found and exists, `None` otherwise +/// `Some(PathBuf)` pointing to `bin/java` if found, `None` otherwise pub fn find_sdkman_java() -> Option { let home = std::env::var("HOME").ok()?; - let sdkman_path = PathBuf::from(&home).join(".sdkman/candidates/java/current/bin/java"); - if sdkman_path.exists() { - Some(sdkman_path) - } else { - None + let sdkman_base = PathBuf::from(&home).join(".sdkman/candidates/java/"); + + if !sdkman_base.exists() { + return None; } + + scan_java_dir(&sdkman_base, |entry| entry.file_name() == "current") +} + +/// Finds Java installation from mise if available +/// +/// Scans the mise Java installation directory and returns the first valid installation found. +/// Skips version alias symlinks (e.g., `21`, `21.0`, `latest`, `lts`) to avoid duplicates. +/// +/// Path: `~/.local/share/mise/installs/java/` +/// +/// # Returns +/// `Some(PathBuf)` pointing to `bin/java` if found, `None` otherwise +pub fn find_mise_java() -> Option { + let home = std::env::var("HOME").ok()?; + let mise_base = PathBuf::from(&home).join(".local/share/mise/installs/java/"); + + if !mise_base.exists() { + return None; + } + + scan_java_dir(&mise_base, |_| false) // mise: no additional filtering needed } /// Runs `which` (Unix) or `where` (Windows) command to find Java in PATH with timeout @@ -150,6 +204,11 @@ pub fn get_java_candidates() -> Vec { if let Some(sdkman_java) = find_sdkman_java() { candidates.push(sdkman_java); } + + // Check common mise java candidates + if let Some(mise_java) = find_mise_java() { + candidates.push(mise_java); + } } #[cfg(target_os = "macos")] @@ -196,6 +255,11 @@ pub fn get_java_candidates() -> Vec { if let Some(sdkman_java) = find_sdkman_java() { candidates.push(sdkman_java); } + + // Check common mise java candidates + if let Some(mise_java) = find_mise_java() { + candidates.push(mise_java); + } } #[cfg(target_os = "windows")] diff --git a/src-tauri/src/core/java/persistence.rs b/src-tauri/src/core/java/persistence.rs index d5b446c..6720696 100644 --- a/src-tauri/src/core/java/persistence.rs +++ b/src-tauri/src/core/java/persistence.rs @@ -1,4 +1,4 @@ -use super::error::JavaError; +use crate::core::java::error::JavaError; use serde::{Deserialize, Serialize}; use std::path::PathBuf; use tauri::{AppHandle, Manager}; diff --git a/src-tauri/src/core/java/priority.rs b/src-tauri/src/core/java/priority.rs index e456680..b2e9fb4 100644 --- a/src-tauri/src/core/java/priority.rs +++ b/src-tauri/src/core/java/priority.rs @@ -1,8 +1,8 @@ use tauri::AppHandle; -use super::JavaInstallation; use crate::core::java::persistence; use crate::core::java::validation; +use crate::core::java::JavaInstallation; pub async fn resolve_java_for_launch( app_handle: &AppHandle, diff --git a/src-tauri/src/core/java/validation.rs b/src-tauri/src/core/java/validation.rs index 48782f6..b56ad59 100644 --- a/src-tauri/src/core/java/validation.rs +++ b/src-tauri/src/core/java/validation.rs @@ -5,7 +5,7 @@ use std::process::Command; #[cfg(target_os = "windows")] use std::os::windows::process::CommandExt; -use super::JavaInstallation; +use crate::core::java::JavaInstallation; pub async fn check_java_installation(path: &PathBuf) -> Option { let path = path.clone(); From c075dd83c916bfebe4dd68f6e5c425b45a804305 Mon Sep 17 00:00:00 2001 From: "Begonia, HE" <163421589+BegoniaHe@users.noreply.github.com> Date: Fri, 30 Jan 2026 17:05:49 +0100 Subject: [PATCH 2/3] chore(types): regenerate typescript bindings with compact formatting - Regenerate ts-rs bindings with single-line type definitions - Add new bindings: account_storage.ts, java module types - Update all existing binding files to compact format - Add generated types for old UI package Reviewed-by: Claude Sonnet 4.5 --- .../src/types/bindings/account_storage.ts | 16 +++ .../ui-new/src/types/bindings/assistant.ts | 24 +--- packages/ui-new/src/types/bindings/auth.ts | 31 +---- packages/ui-new/src/types/bindings/config.ts | 77 ++++--------- .../ui-new/src/types/bindings/downloader.ts | 47 +------- packages/ui-new/src/types/bindings/fabric.ts | 45 ++------ packages/ui-new/src/types/bindings/forge.ts | 14 +-- .../ui-new/src/types/bindings/game_version.ts | 108 ++++++------------ .../ui-new/src/types/bindings/instance.ts | 22 +--- .../ui-new/src/types/bindings/java/index.ts | 9 ++ .../src/types/bindings/java/persistence.ts | 3 + .../types/bindings/java/providers/adoptium.ts | 11 ++ .../ui-new/src/types/bindings/manifest.ts | 30 ++--- packages/ui/src/types/generated/downloader.ts | 3 + 14 files changed, 141 insertions(+), 299 deletions(-) create mode 100644 packages/ui-new/src/types/bindings/account_storage.ts create mode 100644 packages/ui-new/src/types/bindings/java/index.ts create mode 100644 packages/ui-new/src/types/bindings/java/persistence.ts create mode 100644 packages/ui-new/src/types/bindings/java/providers/adoptium.ts create mode 100644 packages/ui/src/types/generated/downloader.ts diff --git a/packages/ui-new/src/types/bindings/account_storage.ts b/packages/ui-new/src/types/bindings/account_storage.ts new file mode 100644 index 0000000..53d60d9 --- /dev/null +++ b/packages/ui-new/src/types/bindings/account_storage.ts @@ -0,0 +1,16 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { OfflineAccount } from "./auth"; + +export type AccountStorage = { file_path: string, }; + +/** + * Stored account data for persistence + */ +export type AccountStore = { accounts: Array, active_account_id: string | null, }; + +export type StoredAccount = { "type": "Offline" } & OfflineAccount | { "type": "Microsoft" } & StoredMicrosoftAccount; + +/** + * Microsoft account with refresh token for persistence + */ +export type StoredMicrosoftAccount = { username: string, uuid: string, access_token: string, refresh_token: string | null, ms_refresh_token: string | null, expires_at: bigint, }; diff --git a/packages/ui-new/src/types/bindings/assistant.ts b/packages/ui-new/src/types/bindings/assistant.ts index 827f008..194ec28 100644 --- a/packages/ui-new/src/types/bindings/assistant.ts +++ b/packages/ui-new/src/types/bindings/assistant.ts @@ -1,25 +1,9 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -export type GenerationStats = { - totalDuration: bigint; - loadDuration: bigint; - promptEvalCount: bigint; - promptEvalDuration: bigint; - evalCount: bigint; - evalDuration: bigint; -}; +export type GenerationStats = { totalDuration: bigint, loadDuration: bigint, promptEvalCount: bigint, promptEvalDuration: bigint, evalCount: bigint, evalDuration: bigint, }; -export type Message = { role: string; content: string }; +export type Message = { role: string, content: string, }; -export type ModelInfo = { - id: string; - name: string; - size: string | null; - details: string | null; -}; +export type ModelInfo = { id: string, name: string, size: string | null, details: string | null, }; -export type StreamChunk = { - content: string; - done: boolean; - stats: GenerationStats | null; -}; +export type StreamChunk = { content: string, done: boolean, stats: GenerationStats | null, }; diff --git a/packages/ui-new/src/types/bindings/auth.ts b/packages/ui-new/src/types/bindings/auth.ts index a65f0a4..28c48f9 100644 --- a/packages/ui-new/src/types/bindings/auth.ts +++ b/packages/ui-new/src/types/bindings/auth.ts @@ -1,32 +1,13 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -export type Account = - | ({ type: "offline" } & OfflineAccount) - | ({ type: "microsoft" } & MicrosoftAccount); +export type Account = { "type": "offline" } & OfflineAccount | { "type": "microsoft" } & MicrosoftAccount; -export type DeviceCodeResponse = { - userCode: string; - deviceCode: string; - verificationUri: string; - expiresIn: bigint; - interval: bigint; - message: string | null; -}; +export type DeviceCodeResponse = { userCode: string, deviceCode: string, verificationUri: string, expiresIn: bigint, interval: bigint, message: string | null, }; -export type MicrosoftAccount = { - username: string; - uuid: string; - accessToken: string; - refreshToken: string | null; - expiresAt: bigint; -}; +export type MicrosoftAccount = { username: string, uuid: string, accessToken: string, refreshToken: string | null, expiresAt: bigint, }; -export type MinecraftProfile = { id: string; name: string }; +export type MinecraftProfile = { id: string, name: string, }; -export type OfflineAccount = { username: string; uuid: string }; +export type OfflineAccount = { username: string, uuid: string, }; -export type TokenResponse = { - accessToken: string; - refreshToken: string | null; - expiresIn: bigint; -}; +export type TokenResponse = { accessToken: string, refreshToken: string | null, expiresIn: bigint, }; diff --git a/packages/ui-new/src/types/bindings/config.ts b/packages/ui-new/src/types/bindings/config.ts index e9de4f5..1b8ff48 100644 --- a/packages/ui-new/src/types/bindings/config.ts +++ b/packages/ui-new/src/types/bindings/config.ts @@ -1,61 +1,30 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -export type AssistantConfig = { - enabled: boolean; - llmProvider: string; - ollamaEndpoint: string; - ollamaModel: string; - openaiApiKey: string | null; - openaiEndpoint: string; - openaiModel: string; - systemPrompt: string; - responseLanguage: string; - ttsEnabled: boolean; - ttsProvider: string; -}; +export type AssistantConfig = { enabled: boolean, llmProvider: string, ollamaEndpoint: string, ollamaModel: string, openaiApiKey: string | null, openaiEndpoint: string, openaiModel: string, systemPrompt: string, responseLanguage: string, ttsEnabled: boolean, ttsProvider: string, }; /** * Feature-gated arguments configuration */ -export type FeatureFlags = { - /** - * Demo user: enables demo-related arguments when rules require it - */ - demoUser: boolean; - /** - * Quick Play: enable quick play arguments - */ - quickPlayEnabled: boolean; - /** - * Quick Play singleplayer world path (if provided) - */ - quickPlayPath: string | null; - /** - * Quick Play singleplayer flag - */ - quickPlaySingleplayer: boolean; - /** - * Quick Play multiplayer server address (optional) - */ - quickPlayMultiplayerServer: string | null; -}; +export type FeatureFlags = { +/** + * Demo user: enables demo-related arguments when rules require it + */ +demoUser: boolean, +/** + * Quick Play: enable quick play arguments + */ +quickPlayEnabled: boolean, +/** + * Quick Play singleplayer world path (if provided) + */ +quickPlayPath: string | null, +/** + * Quick Play singleplayer flag + */ +quickPlaySingleplayer: boolean, +/** + * Quick Play multiplayer server address (optional) + */ +quickPlayMultiplayerServer: string | null, }; -export type LauncherConfig = { - minMemory: number; - maxMemory: number; - javaPath: string; - width: number; - height: number; - downloadThreads: number; - customBackgroundPath: string | null; - enableGpuAcceleration: boolean; - enableVisualEffects: boolean; - activeEffect: string; - theme: string; - logUploadService: string; - pastebinApiKey: string | null; - assistant: AssistantConfig; - useSharedCaches: boolean; - keepLegacyPerInstanceStorage: boolean; - featureFlags: FeatureFlags; -}; +export type LauncherConfig = { minMemory: number, maxMemory: number, javaPath: string, width: number, height: number, downloadThreads: number, customBackgroundPath: string | null, enableGpuAcceleration: boolean, enableVisualEffects: boolean, activeEffect: string, theme: string, logUploadService: string, pastebinApiKey: string | null, assistant: AssistantConfig, useSharedCaches: boolean, keepLegacyPerInstanceStorage: boolean, featureFlags: FeatureFlags, }; diff --git a/packages/ui-new/src/types/bindings/downloader.ts b/packages/ui-new/src/types/bindings/downloader.ts index a1734d5..c599015 100644 --- a/packages/ui-new/src/types/bindings/downloader.ts +++ b/packages/ui-new/src/types/bindings/downloader.ts @@ -3,61 +3,26 @@ /** * Metadata for resumable downloads stored in .part.meta file */ -export type DownloadMetadata = { - url: string; - fileName: string; - totalSize: bigint; - downloadedBytes: bigint; - checksum: string | null; - timestamp: bigint; - segments: Array; -}; +export type DownloadMetadata = { url: string, fileName: string, totalSize: bigint, downloadedBytes: bigint, checksum: string | null, timestamp: bigint, segments: Array, }; /** * Download queue for persistence */ -export type DownloadQueue = { pendingDownloads: Array }; +export type DownloadQueue = { pendingDownloads: Array, }; /** * A download segment for multi-segment parallel downloading */ -export type DownloadSegment = { - start: bigint; - end: bigint; - downloaded: bigint; - completed: boolean; -}; +export type DownloadSegment = { start: bigint, end: bigint, downloaded: bigint, completed: boolean, }; -export type DownloadTask = { - url: string; - path: string; - sha1: string | null; - sha256: string | null; -}; +export type DownloadTask = { url: string, path: string, sha1: string | null, sha256: string | null, }; /** * Progress event for Java download */ -export type JavaDownloadProgress = { - fileName: string; - downloadedBytes: bigint; - totalBytes: bigint; - speedBytesPerSec: bigint; - etaSeconds: bigint; - status: string; - percentage: number; -}; +export type JavaDownloadProgress = { fileName: string, downloadedBytes: bigint, totalBytes: bigint, speedBytesPerSec: bigint, etaSeconds: bigint, status: string, percentage: number, }; /** * Pending download task for queue persistence */ -export type PendingJavaDownload = { - majorVersion: number; - imageType: string; - downloadUrl: string; - fileName: string; - fileSize: bigint; - checksum: string | null; - installPath: string; - createdAt: bigint; -}; +export type PendingJavaDownload = { majorVersion: number, imageType: string, downloadUrl: string, fileName: string, fileSize: bigint, checksum: string | null, installPath: string, createdAt: bigint, }; diff --git a/packages/ui-new/src/types/bindings/fabric.ts b/packages/ui-new/src/types/bindings/fabric.ts index 181f8be..91337a0 100644 --- a/packages/ui-new/src/types/bindings/fabric.ts +++ b/packages/ui-new/src/types/bindings/fabric.ts @@ -3,72 +3,45 @@ /** * Represents a Minecraft version supported by Fabric. */ -export type FabricGameVersion = { version: string; stable: boolean }; +export type FabricGameVersion = { version: string, stable: boolean, }; /** * Represents a Fabric intermediary mapping version. */ -export type FabricIntermediaryVersion = { - maven: string; - version: string; - stable: boolean; -}; +export type FabricIntermediaryVersion = { maven: string, version: string, stable: boolean, }; /** * Launcher metadata from Fabric Meta API. */ -export type FabricLauncherMeta = { - version: number; - libraries: FabricLibraries; - mainClass: FabricMainClass; -}; +export type FabricLauncherMeta = { version: number, libraries: FabricLibraries, mainClass: FabricMainClass, }; /** * Libraries required by Fabric loader. */ -export type FabricLibraries = { - client: Array; - common: Array; - server: Array; -}; +export type FabricLibraries = { client: Array, common: Array, server: Array, }; /** * A single Fabric library dependency. */ -export type FabricLibrary = { name: string; url: string | null }; +export type FabricLibrary = { name: string, url: string | null, }; /** * Represents a combined loader + intermediary version entry. */ -export type FabricLoaderEntry = { - loader: FabricLoaderVersion; - intermediary: FabricIntermediaryVersion; - launcherMeta: FabricLauncherMeta; -}; +export type FabricLoaderEntry = { loader: FabricLoaderVersion, intermediary: FabricIntermediaryVersion, launcherMeta: FabricLauncherMeta, }; /** * Represents a Fabric loader version from the Meta API. */ -export type FabricLoaderVersion = { - separator: string; - build: number; - maven: string; - version: string; - stable: boolean; -}; +export type FabricLoaderVersion = { separator: string, build: number, maven: string, version: string, stable: boolean, }; /** * Main class configuration for Fabric. * Can be either a struct with client/server fields or a simple string. */ -export type FabricMainClass = { client: string; server: string } | string; +export type FabricMainClass = { client: string, server: string, } | string; /** * Information about an installed Fabric version. */ -export type InstalledFabricVersion = { - id: string; - minecraftVersion: string; - loaderVersion: string; - path: string; -}; +export type InstalledFabricVersion = { id: string, minecraftVersion: string, loaderVersion: string, path: string, }; diff --git a/packages/ui-new/src/types/bindings/forge.ts b/packages/ui-new/src/types/bindings/forge.ts index a9790e7..9629bdd 100644 --- a/packages/ui-new/src/types/bindings/forge.ts +++ b/packages/ui-new/src/types/bindings/forge.ts @@ -3,19 +3,9 @@ /** * Represents a Forge version entry. */ -export type ForgeVersion = { - version: string; - minecraftVersion: string; - recommended: boolean; - latest: boolean; -}; +export type ForgeVersion = { version: string, minecraftVersion: string, recommended: boolean, latest: boolean, }; /** * Information about an installed Forge version. */ -export type InstalledForgeVersion = { - id: string; - minecraftVersion: string; - forgeVersion: string; - path: string; -}; +export type InstalledForgeVersion = { id: string, minecraftVersion: string, forgeVersion: string, path: string, }; diff --git a/packages/ui-new/src/types/bindings/game_version.ts b/packages/ui-new/src/types/bindings/game_version.ts index 1b1c395..43e88ea 100644 --- a/packages/ui-new/src/types/bindings/game_version.ts +++ b/packages/ui-new/src/types/bindings/game_version.ts @@ -1,89 +1,49 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -export type Arguments = { - game: Record; - jvm: Record; -}; +export type Arguments = { game: Record, jvm: Record, }; -export type AssetIndex = { - id: string; - sha1: string; - size: bigint; - url: string; - totalSize: bigint | null; -}; +export type AssetIndex = { id: string, sha1: string, size: bigint, url: string, totalSize: bigint | null, }; -export type DownloadArtifact = { - sha1: string | null; - size: bigint | null; - url: string; - path: string | null; -}; +export type DownloadArtifact = { sha1: string | null, size: bigint | null, url: string, path: string | null, }; -export type Downloads = { - client: DownloadArtifact; - server: DownloadArtifact | null; -}; +export type Downloads = { client: DownloadArtifact, server: DownloadArtifact | null, }; /** * Represents a Minecraft version JSON, supporting both vanilla and modded (Fabric/Forge) formats. * Modded versions use `inheritsFrom` to reference a parent vanilla version. */ -export type GameVersion = { - id: string; - /** - * Optional for mod loaders that inherit from vanilla - */ - downloads: Downloads | null; - /** - * Optional for mod loaders that inherit from vanilla - */ - assetIndex: AssetIndex | null; - libraries: Array; - mainClass: string; - minecraftArguments: string | null; - arguments: Arguments | null; - javaVersion: JavaVersion | null; - /** - * For mod loaders: the vanilla version this inherits from - */ - inheritsFrom: string | null; - /** - * Fabric/Forge may specify a custom assets version - */ - assets: string | null; - /** - * Release type (release, snapshot, old_beta, etc.) - */ - type: string | null; -}; +export type GameVersion = { id: string, +/** + * Optional for mod loaders that inherit from vanilla + */ +downloads: Downloads | null, +/** + * Optional for mod loaders that inherit from vanilla + */ +assetIndex: AssetIndex | null, libraries: Array, mainClass: string, minecraftArguments: string | null, arguments: Arguments | null, javaVersion: JavaVersion | null, +/** + * For mod loaders: the vanilla version this inherits from + */ +inheritsFrom: string | null, +/** + * Fabric/Forge may specify a custom assets version + */ +assets: string | null, +/** + * Release type (release, snapshot, old_beta, etc.) + */ +type: string | null, }; -export type JavaVersion = { component: string; majorVersion: bigint }; +export type JavaVersion = { component: string, majorVersion: bigint, }; -export type Library = { - downloads: LibraryDownloads | null; - name: string; - rules: Array | null; - natives: Record; - /** - * Maven repository URL for mod loader libraries - */ - url: string | null; -}; +export type Library = { downloads: LibraryDownloads | null, name: string, rules: Array | null, natives: Record, +/** + * Maven repository URL for mod loader libraries + */ +url: string | null, }; -export type LibraryDownloads = { - artifact: DownloadArtifact | null; - classifiers: Record; -}; +export type LibraryDownloads = { artifact: DownloadArtifact | null, classifiers: Record, }; -export type OsRule = { - name: string | null; - version: string | null; - arch: string | null; -}; +export type OsRule = { name: string | null, version: string | null, arch: string | null, }; -export type Rule = { - action: string; - os: OsRule | null; - features: Record; -}; +export type Rule = { action: string, os: OsRule | null, features: Record, }; diff --git a/packages/ui-new/src/types/bindings/instance.ts b/packages/ui-new/src/types/bindings/instance.ts index 079e8f0..cce1f46 100644 --- a/packages/ui-new/src/types/bindings/instance.ts +++ b/packages/ui-new/src/types/bindings/instance.ts @@ -3,30 +3,14 @@ /** * Represents a game instance/profile */ -export type Instance = { - id: string; - name: string; - gameDir: string; - versionId: string | null; - createdAt: bigint; - lastPlayed: bigint | null; - iconPath: string | null; - notes: string | null; - modLoader: string | null; - modLoaderVersion: string | null; - jvmArgsOverride: string | null; - memoryOverride: MemoryOverride | null; -}; +export type Instance = { id: string, name: string, gameDir: string, versionId: string | null, createdAt: bigint, lastPlayed: bigint | null, iconPath: string | null, notes: string | null, modLoader: string | null, modLoaderVersion: string | null, jvmArgsOverride: string | null, memoryOverride: MemoryOverride | null, javaPathOverride: string | null, }; /** * Configuration for all instances */ -export type InstanceConfig = { - instances: Array; - activeInstanceId: string | null; -}; +export type InstanceConfig = { instances: Array, activeInstanceId: string | null, }; /** * Memory settings override for an instance */ -export type MemoryOverride = { min: number; max: number }; +export type MemoryOverride = { min: number, max: number, }; diff --git a/packages/ui-new/src/types/bindings/java/index.ts b/packages/ui-new/src/types/bindings/java/index.ts new file mode 100644 index 0000000..98f9d84 --- /dev/null +++ b/packages/ui-new/src/types/bindings/java/index.ts @@ -0,0 +1,9 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +export type JavaCatalog = { releases: Array, available_major_versions: Array, lts_versions: Array, cached_at: bigint, }; + +export type JavaDownloadInfo = { version: string, release_name: string, download_url: string, file_name: string, file_size: bigint, checksum: string | null, image_type: string, }; + +export type JavaInstallation = { path: string, version: string, arch: string, vendor: string, source: string, is_64bit: boolean, }; + +export type JavaReleaseInfo = { major_version: number, image_type: string, version: string, release_name: string, release_date: string | null, file_size: bigint, checksum: string | null, download_url: string, is_lts: boolean, is_available: boolean, architecture: string, }; diff --git a/packages/ui-new/src/types/bindings/java/persistence.ts b/packages/ui-new/src/types/bindings/java/persistence.ts new file mode 100644 index 0000000..e183f68 --- /dev/null +++ b/packages/ui-new/src/types/bindings/java/persistence.ts @@ -0,0 +1,3 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +export type JavaConfig = { user_defined_paths: Array, preferred_java_path: string | null, last_detection_time: bigint, }; diff --git a/packages/ui-new/src/types/bindings/java/providers/adoptium.ts b/packages/ui-new/src/types/bindings/java/providers/adoptium.ts new file mode 100644 index 0000000..74d8ae2 --- /dev/null +++ b/packages/ui-new/src/types/bindings/java/providers/adoptium.ts @@ -0,0 +1,11 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +export type AdoptiumAsset = { binary: AdoptiumBinary, release_name: string, version: AdoptiumVersionData, }; + +export type AdoptiumBinary = { os: string, architecture: string, image_type: string, package: AdoptiumPackage, updated_at: string | null, }; + +export type AdoptiumPackage = { name: string, link: string, size: bigint, checksum: string | null, }; + +export type AdoptiumVersionData = { major: number, minor: number, security: number, semver: string, openjdk_version: string, }; + +export type AvailableReleases = { available_releases: Array, available_lts_releases: Array, most_recent_lts: number | null, most_recent_feature_release: number | null, }; diff --git a/packages/ui-new/src/types/bindings/manifest.ts b/packages/ui-new/src/types/bindings/manifest.ts index 2180962..e93b6ad 100644 --- a/packages/ui-new/src/types/bindings/manifest.ts +++ b/packages/ui-new/src/types/bindings/manifest.ts @@ -1,22 +1,16 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -export type Latest = { release: string; snapshot: string }; +export type Latest = { release: string, snapshot: string, }; -export type Version = { - id: string; - type: string; - url: string; - time: string; - releaseTime: string; - /** - * Java version requirement (major version number) - * This is populated from the version JSON file if the version is installed locally - */ - javaVersion: bigint | null; - /** - * Whether this version is installed locally - */ - isInstalled: boolean | null; -}; +export type Version = { id: string, type: string, url: string, time: string, releaseTime: string, +/** + * Java version requirement (major version number) + * This is populated from the version JSON file if the version is installed locally + */ +javaVersion: bigint | null, +/** + * Whether this version is installed locally + */ +isInstalled: boolean | null, }; -export type VersionManifest = { latest: Latest; versions: Array }; +export type VersionManifest = { latest: Latest, versions: Array, }; diff --git a/packages/ui/src/types/generated/downloader.ts b/packages/ui/src/types/generated/downloader.ts new file mode 100644 index 0000000..f35b790 --- /dev/null +++ b/packages/ui/src/types/generated/downloader.ts @@ -0,0 +1,3 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +export type ProgressEvent = { file: string, downloaded: bigint, total: bigint, status: string, completedFiles: number, totalFiles: number, totalDownloadedBytes: bigint, }; From 68b20f1b43e081ede86c789ed7f6dd3e6f724c58 Mon Sep 17 00:00:00 2001 From: "Begonia, HE" <163421589+BegoniaHe@users.noreply.github.com> Date: Thu, 5 Feb 2026 00:52:23 +0100 Subject: [PATCH 3/3] Revert "chore(types): regenerate typescript bindings with compact formatting" This reverts commit c075dd83c916bfebe4dd68f6e5c425b45a804305. --- .../src/types/bindings/account_storage.ts | 16 --- .../ui-new/src/types/bindings/assistant.ts | 24 +++- packages/ui-new/src/types/bindings/auth.ts | 31 ++++- packages/ui-new/src/types/bindings/config.ts | 77 +++++++++---- .../ui-new/src/types/bindings/downloader.ts | 47 +++++++- packages/ui-new/src/types/bindings/fabric.ts | 45 ++++++-- packages/ui-new/src/types/bindings/forge.ts | 14 ++- .../ui-new/src/types/bindings/game_version.ts | 108 ++++++++++++------ .../ui-new/src/types/bindings/instance.ts | 22 +++- .../ui-new/src/types/bindings/java/index.ts | 9 -- .../src/types/bindings/java/persistence.ts | 3 - .../types/bindings/java/providers/adoptium.ts | 11 -- .../ui-new/src/types/bindings/manifest.ts | 30 +++-- packages/ui/src/types/generated/downloader.ts | 3 - 14 files changed, 299 insertions(+), 141 deletions(-) delete mode 100644 packages/ui-new/src/types/bindings/account_storage.ts delete mode 100644 packages/ui-new/src/types/bindings/java/index.ts delete mode 100644 packages/ui-new/src/types/bindings/java/persistence.ts delete mode 100644 packages/ui-new/src/types/bindings/java/providers/adoptium.ts delete mode 100644 packages/ui/src/types/generated/downloader.ts diff --git a/packages/ui-new/src/types/bindings/account_storage.ts b/packages/ui-new/src/types/bindings/account_storage.ts deleted file mode 100644 index 53d60d9..0000000 --- a/packages/ui-new/src/types/bindings/account_storage.ts +++ /dev/null @@ -1,16 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { OfflineAccount } from "./auth"; - -export type AccountStorage = { file_path: string, }; - -/** - * Stored account data for persistence - */ -export type AccountStore = { accounts: Array, active_account_id: string | null, }; - -export type StoredAccount = { "type": "Offline" } & OfflineAccount | { "type": "Microsoft" } & StoredMicrosoftAccount; - -/** - * Microsoft account with refresh token for persistence - */ -export type StoredMicrosoftAccount = { username: string, uuid: string, access_token: string, refresh_token: string | null, ms_refresh_token: string | null, expires_at: bigint, }; diff --git a/packages/ui-new/src/types/bindings/assistant.ts b/packages/ui-new/src/types/bindings/assistant.ts index 194ec28..827f008 100644 --- a/packages/ui-new/src/types/bindings/assistant.ts +++ b/packages/ui-new/src/types/bindings/assistant.ts @@ -1,9 +1,25 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -export type GenerationStats = { totalDuration: bigint, loadDuration: bigint, promptEvalCount: bigint, promptEvalDuration: bigint, evalCount: bigint, evalDuration: bigint, }; +export type GenerationStats = { + totalDuration: bigint; + loadDuration: bigint; + promptEvalCount: bigint; + promptEvalDuration: bigint; + evalCount: bigint; + evalDuration: bigint; +}; -export type Message = { role: string, content: string, }; +export type Message = { role: string; content: string }; -export type ModelInfo = { id: string, name: string, size: string | null, details: string | null, }; +export type ModelInfo = { + id: string; + name: string; + size: string | null; + details: string | null; +}; -export type StreamChunk = { content: string, done: boolean, stats: GenerationStats | null, }; +export type StreamChunk = { + content: string; + done: boolean; + stats: GenerationStats | null; +}; diff --git a/packages/ui-new/src/types/bindings/auth.ts b/packages/ui-new/src/types/bindings/auth.ts index 28c48f9..a65f0a4 100644 --- a/packages/ui-new/src/types/bindings/auth.ts +++ b/packages/ui-new/src/types/bindings/auth.ts @@ -1,13 +1,32 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -export type Account = { "type": "offline" } & OfflineAccount | { "type": "microsoft" } & MicrosoftAccount; +export type Account = + | ({ type: "offline" } & OfflineAccount) + | ({ type: "microsoft" } & MicrosoftAccount); -export type DeviceCodeResponse = { userCode: string, deviceCode: string, verificationUri: string, expiresIn: bigint, interval: bigint, message: string | null, }; +export type DeviceCodeResponse = { + userCode: string; + deviceCode: string; + verificationUri: string; + expiresIn: bigint; + interval: bigint; + message: string | null; +}; -export type MicrosoftAccount = { username: string, uuid: string, accessToken: string, refreshToken: string | null, expiresAt: bigint, }; +export type MicrosoftAccount = { + username: string; + uuid: string; + accessToken: string; + refreshToken: string | null; + expiresAt: bigint; +}; -export type MinecraftProfile = { id: string, name: string, }; +export type MinecraftProfile = { id: string; name: string }; -export type OfflineAccount = { username: string, uuid: string, }; +export type OfflineAccount = { username: string; uuid: string }; -export type TokenResponse = { accessToken: string, refreshToken: string | null, expiresIn: bigint, }; +export type TokenResponse = { + accessToken: string; + refreshToken: string | null; + expiresIn: bigint; +}; diff --git a/packages/ui-new/src/types/bindings/config.ts b/packages/ui-new/src/types/bindings/config.ts index 1b8ff48..e9de4f5 100644 --- a/packages/ui-new/src/types/bindings/config.ts +++ b/packages/ui-new/src/types/bindings/config.ts @@ -1,30 +1,61 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -export type AssistantConfig = { enabled: boolean, llmProvider: string, ollamaEndpoint: string, ollamaModel: string, openaiApiKey: string | null, openaiEndpoint: string, openaiModel: string, systemPrompt: string, responseLanguage: string, ttsEnabled: boolean, ttsProvider: string, }; +export type AssistantConfig = { + enabled: boolean; + llmProvider: string; + ollamaEndpoint: string; + ollamaModel: string; + openaiApiKey: string | null; + openaiEndpoint: string; + openaiModel: string; + systemPrompt: string; + responseLanguage: string; + ttsEnabled: boolean; + ttsProvider: string; +}; /** * Feature-gated arguments configuration */ -export type FeatureFlags = { -/** - * Demo user: enables demo-related arguments when rules require it - */ -demoUser: boolean, -/** - * Quick Play: enable quick play arguments - */ -quickPlayEnabled: boolean, -/** - * Quick Play singleplayer world path (if provided) - */ -quickPlayPath: string | null, -/** - * Quick Play singleplayer flag - */ -quickPlaySingleplayer: boolean, -/** - * Quick Play multiplayer server address (optional) - */ -quickPlayMultiplayerServer: string | null, }; +export type FeatureFlags = { + /** + * Demo user: enables demo-related arguments when rules require it + */ + demoUser: boolean; + /** + * Quick Play: enable quick play arguments + */ + quickPlayEnabled: boolean; + /** + * Quick Play singleplayer world path (if provided) + */ + quickPlayPath: string | null; + /** + * Quick Play singleplayer flag + */ + quickPlaySingleplayer: boolean; + /** + * Quick Play multiplayer server address (optional) + */ + quickPlayMultiplayerServer: string | null; +}; -export type LauncherConfig = { minMemory: number, maxMemory: number, javaPath: string, width: number, height: number, downloadThreads: number, customBackgroundPath: string | null, enableGpuAcceleration: boolean, enableVisualEffects: boolean, activeEffect: string, theme: string, logUploadService: string, pastebinApiKey: string | null, assistant: AssistantConfig, useSharedCaches: boolean, keepLegacyPerInstanceStorage: boolean, featureFlags: FeatureFlags, }; +export type LauncherConfig = { + minMemory: number; + maxMemory: number; + javaPath: string; + width: number; + height: number; + downloadThreads: number; + customBackgroundPath: string | null; + enableGpuAcceleration: boolean; + enableVisualEffects: boolean; + activeEffect: string; + theme: string; + logUploadService: string; + pastebinApiKey: string | null; + assistant: AssistantConfig; + useSharedCaches: boolean; + keepLegacyPerInstanceStorage: boolean; + featureFlags: FeatureFlags; +}; diff --git a/packages/ui-new/src/types/bindings/downloader.ts b/packages/ui-new/src/types/bindings/downloader.ts index c599015..a1734d5 100644 --- a/packages/ui-new/src/types/bindings/downloader.ts +++ b/packages/ui-new/src/types/bindings/downloader.ts @@ -3,26 +3,61 @@ /** * Metadata for resumable downloads stored in .part.meta file */ -export type DownloadMetadata = { url: string, fileName: string, totalSize: bigint, downloadedBytes: bigint, checksum: string | null, timestamp: bigint, segments: Array, }; +export type DownloadMetadata = { + url: string; + fileName: string; + totalSize: bigint; + downloadedBytes: bigint; + checksum: string | null; + timestamp: bigint; + segments: Array; +}; /** * Download queue for persistence */ -export type DownloadQueue = { pendingDownloads: Array, }; +export type DownloadQueue = { pendingDownloads: Array }; /** * A download segment for multi-segment parallel downloading */ -export type DownloadSegment = { start: bigint, end: bigint, downloaded: bigint, completed: boolean, }; +export type DownloadSegment = { + start: bigint; + end: bigint; + downloaded: bigint; + completed: boolean; +}; -export type DownloadTask = { url: string, path: string, sha1: string | null, sha256: string | null, }; +export type DownloadTask = { + url: string; + path: string; + sha1: string | null; + sha256: string | null; +}; /** * Progress event for Java download */ -export type JavaDownloadProgress = { fileName: string, downloadedBytes: bigint, totalBytes: bigint, speedBytesPerSec: bigint, etaSeconds: bigint, status: string, percentage: number, }; +export type JavaDownloadProgress = { + fileName: string; + downloadedBytes: bigint; + totalBytes: bigint; + speedBytesPerSec: bigint; + etaSeconds: bigint; + status: string; + percentage: number; +}; /** * Pending download task for queue persistence */ -export type PendingJavaDownload = { majorVersion: number, imageType: string, downloadUrl: string, fileName: string, fileSize: bigint, checksum: string | null, installPath: string, createdAt: bigint, }; +export type PendingJavaDownload = { + majorVersion: number; + imageType: string; + downloadUrl: string; + fileName: string; + fileSize: bigint; + checksum: string | null; + installPath: string; + createdAt: bigint; +}; diff --git a/packages/ui-new/src/types/bindings/fabric.ts b/packages/ui-new/src/types/bindings/fabric.ts index 91337a0..181f8be 100644 --- a/packages/ui-new/src/types/bindings/fabric.ts +++ b/packages/ui-new/src/types/bindings/fabric.ts @@ -3,45 +3,72 @@ /** * Represents a Minecraft version supported by Fabric. */ -export type FabricGameVersion = { version: string, stable: boolean, }; +export type FabricGameVersion = { version: string; stable: boolean }; /** * Represents a Fabric intermediary mapping version. */ -export type FabricIntermediaryVersion = { maven: string, version: string, stable: boolean, }; +export type FabricIntermediaryVersion = { + maven: string; + version: string; + stable: boolean; +}; /** * Launcher metadata from Fabric Meta API. */ -export type FabricLauncherMeta = { version: number, libraries: FabricLibraries, mainClass: FabricMainClass, }; +export type FabricLauncherMeta = { + version: number; + libraries: FabricLibraries; + mainClass: FabricMainClass; +}; /** * Libraries required by Fabric loader. */ -export type FabricLibraries = { client: Array, common: Array, server: Array, }; +export type FabricLibraries = { + client: Array; + common: Array; + server: Array; +}; /** * A single Fabric library dependency. */ -export type FabricLibrary = { name: string, url: string | null, }; +export type FabricLibrary = { name: string; url: string | null }; /** * Represents a combined loader + intermediary version entry. */ -export type FabricLoaderEntry = { loader: FabricLoaderVersion, intermediary: FabricIntermediaryVersion, launcherMeta: FabricLauncherMeta, }; +export type FabricLoaderEntry = { + loader: FabricLoaderVersion; + intermediary: FabricIntermediaryVersion; + launcherMeta: FabricLauncherMeta; +}; /** * Represents a Fabric loader version from the Meta API. */ -export type FabricLoaderVersion = { separator: string, build: number, maven: string, version: string, stable: boolean, }; +export type FabricLoaderVersion = { + separator: string; + build: number; + maven: string; + version: string; + stable: boolean; +}; /** * Main class configuration for Fabric. * Can be either a struct with client/server fields or a simple string. */ -export type FabricMainClass = { client: string, server: string, } | string; +export type FabricMainClass = { client: string; server: string } | string; /** * Information about an installed Fabric version. */ -export type InstalledFabricVersion = { id: string, minecraftVersion: string, loaderVersion: string, path: string, }; +export type InstalledFabricVersion = { + id: string; + minecraftVersion: string; + loaderVersion: string; + path: string; +}; diff --git a/packages/ui-new/src/types/bindings/forge.ts b/packages/ui-new/src/types/bindings/forge.ts index 9629bdd..a9790e7 100644 --- a/packages/ui-new/src/types/bindings/forge.ts +++ b/packages/ui-new/src/types/bindings/forge.ts @@ -3,9 +3,19 @@ /** * Represents a Forge version entry. */ -export type ForgeVersion = { version: string, minecraftVersion: string, recommended: boolean, latest: boolean, }; +export type ForgeVersion = { + version: string; + minecraftVersion: string; + recommended: boolean; + latest: boolean; +}; /** * Information about an installed Forge version. */ -export type InstalledForgeVersion = { id: string, minecraftVersion: string, forgeVersion: string, path: string, }; +export type InstalledForgeVersion = { + id: string; + minecraftVersion: string; + forgeVersion: string; + path: string; +}; diff --git a/packages/ui-new/src/types/bindings/game_version.ts b/packages/ui-new/src/types/bindings/game_version.ts index 43e88ea..1b1c395 100644 --- a/packages/ui-new/src/types/bindings/game_version.ts +++ b/packages/ui-new/src/types/bindings/game_version.ts @@ -1,49 +1,89 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -export type Arguments = { game: Record, jvm: Record, }; +export type Arguments = { + game: Record; + jvm: Record; +}; -export type AssetIndex = { id: string, sha1: string, size: bigint, url: string, totalSize: bigint | null, }; +export type AssetIndex = { + id: string; + sha1: string; + size: bigint; + url: string; + totalSize: bigint | null; +}; -export type DownloadArtifact = { sha1: string | null, size: bigint | null, url: string, path: string | null, }; +export type DownloadArtifact = { + sha1: string | null; + size: bigint | null; + url: string; + path: string | null; +}; -export type Downloads = { client: DownloadArtifact, server: DownloadArtifact | null, }; +export type Downloads = { + client: DownloadArtifact; + server: DownloadArtifact | null; +}; /** * Represents a Minecraft version JSON, supporting both vanilla and modded (Fabric/Forge) formats. * Modded versions use `inheritsFrom` to reference a parent vanilla version. */ -export type GameVersion = { id: string, -/** - * Optional for mod loaders that inherit from vanilla - */ -downloads: Downloads | null, -/** - * Optional for mod loaders that inherit from vanilla - */ -assetIndex: AssetIndex | null, libraries: Array, mainClass: string, minecraftArguments: string | null, arguments: Arguments | null, javaVersion: JavaVersion | null, -/** - * For mod loaders: the vanilla version this inherits from - */ -inheritsFrom: string | null, -/** - * Fabric/Forge may specify a custom assets version - */ -assets: string | null, -/** - * Release type (release, snapshot, old_beta, etc.) - */ -type: string | null, }; +export type GameVersion = { + id: string; + /** + * Optional for mod loaders that inherit from vanilla + */ + downloads: Downloads | null; + /** + * Optional for mod loaders that inherit from vanilla + */ + assetIndex: AssetIndex | null; + libraries: Array; + mainClass: string; + minecraftArguments: string | null; + arguments: Arguments | null; + javaVersion: JavaVersion | null; + /** + * For mod loaders: the vanilla version this inherits from + */ + inheritsFrom: string | null; + /** + * Fabric/Forge may specify a custom assets version + */ + assets: string | null; + /** + * Release type (release, snapshot, old_beta, etc.) + */ + type: string | null; +}; -export type JavaVersion = { component: string, majorVersion: bigint, }; +export type JavaVersion = { component: string; majorVersion: bigint }; -export type Library = { downloads: LibraryDownloads | null, name: string, rules: Array | null, natives: Record, -/** - * Maven repository URL for mod loader libraries - */ -url: string | null, }; +export type Library = { + downloads: LibraryDownloads | null; + name: string; + rules: Array | null; + natives: Record; + /** + * Maven repository URL for mod loader libraries + */ + url: string | null; +}; -export type LibraryDownloads = { artifact: DownloadArtifact | null, classifiers: Record, }; +export type LibraryDownloads = { + artifact: DownloadArtifact | null; + classifiers: Record; +}; -export type OsRule = { name: string | null, version: string | null, arch: string | null, }; +export type OsRule = { + name: string | null; + version: string | null; + arch: string | null; +}; -export type Rule = { action: string, os: OsRule | null, features: Record, }; +export type Rule = { + action: string; + os: OsRule | null; + features: Record; +}; diff --git a/packages/ui-new/src/types/bindings/instance.ts b/packages/ui-new/src/types/bindings/instance.ts index cce1f46..079e8f0 100644 --- a/packages/ui-new/src/types/bindings/instance.ts +++ b/packages/ui-new/src/types/bindings/instance.ts @@ -3,14 +3,30 @@ /** * Represents a game instance/profile */ -export type Instance = { id: string, name: string, gameDir: string, versionId: string | null, createdAt: bigint, lastPlayed: bigint | null, iconPath: string | null, notes: string | null, modLoader: string | null, modLoaderVersion: string | null, jvmArgsOverride: string | null, memoryOverride: MemoryOverride | null, javaPathOverride: string | null, }; +export type Instance = { + id: string; + name: string; + gameDir: string; + versionId: string | null; + createdAt: bigint; + lastPlayed: bigint | null; + iconPath: string | null; + notes: string | null; + modLoader: string | null; + modLoaderVersion: string | null; + jvmArgsOverride: string | null; + memoryOverride: MemoryOverride | null; +}; /** * Configuration for all instances */ -export type InstanceConfig = { instances: Array, activeInstanceId: string | null, }; +export type InstanceConfig = { + instances: Array; + activeInstanceId: string | null; +}; /** * Memory settings override for an instance */ -export type MemoryOverride = { min: number, max: number, }; +export type MemoryOverride = { min: number; max: number }; diff --git a/packages/ui-new/src/types/bindings/java/index.ts b/packages/ui-new/src/types/bindings/java/index.ts deleted file mode 100644 index 98f9d84..0000000 --- a/packages/ui-new/src/types/bindings/java/index.ts +++ /dev/null @@ -1,9 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. - -export type JavaCatalog = { releases: Array, available_major_versions: Array, lts_versions: Array, cached_at: bigint, }; - -export type JavaDownloadInfo = { version: string, release_name: string, download_url: string, file_name: string, file_size: bigint, checksum: string | null, image_type: string, }; - -export type JavaInstallation = { path: string, version: string, arch: string, vendor: string, source: string, is_64bit: boolean, }; - -export type JavaReleaseInfo = { major_version: number, image_type: string, version: string, release_name: string, release_date: string | null, file_size: bigint, checksum: string | null, download_url: string, is_lts: boolean, is_available: boolean, architecture: string, }; diff --git a/packages/ui-new/src/types/bindings/java/persistence.ts b/packages/ui-new/src/types/bindings/java/persistence.ts deleted file mode 100644 index e183f68..0000000 --- a/packages/ui-new/src/types/bindings/java/persistence.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. - -export type JavaConfig = { user_defined_paths: Array, preferred_java_path: string | null, last_detection_time: bigint, }; diff --git a/packages/ui-new/src/types/bindings/java/providers/adoptium.ts b/packages/ui-new/src/types/bindings/java/providers/adoptium.ts deleted file mode 100644 index 74d8ae2..0000000 --- a/packages/ui-new/src/types/bindings/java/providers/adoptium.ts +++ /dev/null @@ -1,11 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. - -export type AdoptiumAsset = { binary: AdoptiumBinary, release_name: string, version: AdoptiumVersionData, }; - -export type AdoptiumBinary = { os: string, architecture: string, image_type: string, package: AdoptiumPackage, updated_at: string | null, }; - -export type AdoptiumPackage = { name: string, link: string, size: bigint, checksum: string | null, }; - -export type AdoptiumVersionData = { major: number, minor: number, security: number, semver: string, openjdk_version: string, }; - -export type AvailableReleases = { available_releases: Array, available_lts_releases: Array, most_recent_lts: number | null, most_recent_feature_release: number | null, }; diff --git a/packages/ui-new/src/types/bindings/manifest.ts b/packages/ui-new/src/types/bindings/manifest.ts index e93b6ad..2180962 100644 --- a/packages/ui-new/src/types/bindings/manifest.ts +++ b/packages/ui-new/src/types/bindings/manifest.ts @@ -1,16 +1,22 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -export type Latest = { release: string, snapshot: string, }; +export type Latest = { release: string; snapshot: string }; -export type Version = { id: string, type: string, url: string, time: string, releaseTime: string, -/** - * Java version requirement (major version number) - * This is populated from the version JSON file if the version is installed locally - */ -javaVersion: bigint | null, -/** - * Whether this version is installed locally - */ -isInstalled: boolean | null, }; +export type Version = { + id: string; + type: string; + url: string; + time: string; + releaseTime: string; + /** + * Java version requirement (major version number) + * This is populated from the version JSON file if the version is installed locally + */ + javaVersion: bigint | null; + /** + * Whether this version is installed locally + */ + isInstalled: boolean | null; +}; -export type VersionManifest = { latest: Latest, versions: Array, }; +export type VersionManifest = { latest: Latest; versions: Array }; diff --git a/packages/ui/src/types/generated/downloader.ts b/packages/ui/src/types/generated/downloader.ts deleted file mode 100644 index f35b790..0000000 --- a/packages/ui/src/types/generated/downloader.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. - -export type ProgressEvent = { file: string, downloaded: bigint, total: bigint, status: string, completedFiles: number, totalFiles: number, totalDownloadedBytes: bigint, };