aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/packages/ui/src/types
diff options
context:
space:
mode:
author苏向夜 <46275354+fu050409@users.noreply.github.com>2026-01-19 14:33:07 +0800
committerGitHub <noreply@github.com>2026-01-19 14:33:07 +0800
commit49545e67ce1ab4ec86248ac6edb07ec89c282eec (patch)
tree50f5fc3ae156cc853660a1aa1556c0bced9054b4 /packages/ui/src/types
parent887e415314014c3da7db3048fa0e724f3078c5cb (diff)
parent91d4590dff7ed3dbce5929926c718ac93aad056a (diff)
downloadDropOut-49545e67ce1ab4ec86248ac6edb07ec89c282eec.tar.gz
DropOut-49545e67ce1ab4ec86248ac6edb07ec89c282eec.zip
chore(ui): refactor workspace to monorepo (#70)
## Summary by Sourcery Refactor the UI project structure into a pnpm monorepo packages layout and align tooling and automation with the new paths. Enhancements: - Reorganize the UI app from the root ui directory into packages/ui within a pnpm workspace. - Update pnpm workspace configuration to include all packages under packages/*. - Adjust paths in changeset configuration so the @dropout/ui package resolves from packages/ui. Build: - Update pre-commit configuration paths and arguments to reflect the new UI location and normalize hook argument formatting. - Update Dependabot configuration so npm updates target /packages/ui instead of /ui. CI: - Update GitHub Actions workflows to watch packages/** instead of ui/** and to run frontend tasks from packages/ui. - Update pnpm cache dependency paths in workflows to use the root pnpm-lock.yaml. - Simplify frontend install steps in test workflows to run from the repository root. Chores: - Add a new index.html under packages/ui and remove the old ui/index.html to match the new project layout.
Diffstat (limited to 'packages/ui/src/types')
-rw-r--r--packages/ui/src/types/index.ts232
1 files changed, 232 insertions, 0 deletions
diff --git a/packages/ui/src/types/index.ts b/packages/ui/src/types/index.ts
new file mode 100644
index 0000000..b4412b8
--- /dev/null
+++ b/packages/ui/src/types/index.ts
@@ -0,0 +1,232 @@
+export type ViewType = "home" | "versions" | "settings" | "guide" | "instances";
+
+export interface Version {
+ id: string;
+ type: string;
+ url: string;
+ time: string;
+ releaseTime: string;
+ javaVersion?: number; // Java major version requirement (e.g., 8, 17, 21)
+ isInstalled?: boolean; // Whether this version is installed locally
+}
+
+export interface Account {
+ type: "Offline" | "Microsoft";
+ username: string;
+ uuid: string;
+ access_token?: string;
+ refresh_token?: string;
+ expires_at?: number; // Unix timestamp for Microsoft accounts
+}
+
+export interface DeviceCodeResponse {
+ user_code: string;
+ device_code: string;
+ verification_uri: string;
+ expires_in: number;
+ interval: number;
+ message?: string;
+}
+
+export interface AssistantConfig {
+ enabled: boolean;
+ llm_provider: "ollama" | "openai";
+ // Ollama settings
+ ollama_endpoint: string;
+ ollama_model: string;
+ // OpenAI settings
+ openai_api_key?: string;
+ openai_endpoint: string;
+ openai_model: string;
+ // Common settings
+ system_prompt: string;
+ response_language: string;
+ // TTS settings
+ tts_enabled: boolean;
+ tts_provider: string;
+}
+
+export interface ModelInfo {
+ id: string;
+ name: string;
+ size?: string;
+ details?: string;
+}
+
+export interface LauncherConfig {
+ min_memory: number;
+ max_memory: number;
+ java_path: string;
+ width: number;
+ height: number;
+ download_threads: number;
+ custom_background_path?: string;
+ enable_gpu_acceleration: boolean;
+ enable_visual_effects: boolean;
+ active_effect: string;
+ theme: string;
+ log_upload_service: "paste.rs" | "pastebin.com";
+ pastebin_api_key?: string;
+ assistant: AssistantConfig;
+ // Storage management
+ use_shared_caches: boolean;
+ keep_legacy_per_instance_storage: boolean;
+ // Feature-gated argument flags
+ feature_flags: FeatureFlags;
+}
+
+export interface FeatureFlags {
+ demo_user: boolean;
+ quick_play_enabled: boolean;
+ quick_play_path?: string;
+ quick_play_singleplayer: boolean;
+ quick_play_multiplayer_server?: string;
+}
+
+export interface JavaInstallation {
+ path: string;
+ version: string;
+ is_64bit: boolean;
+}
+
+export interface JavaDownloadInfo {
+ version: string;
+ release_name: string;
+ download_url: string;
+ file_name: string;
+ file_size: number;
+ checksum: string | null;
+ image_type: string;
+}
+
+export interface JavaReleaseInfo {
+ major_version: number;
+ image_type: string;
+ version: string;
+ release_name: string;
+ release_date: string | null;
+ file_size: number;
+ checksum: string | null;
+ download_url: string;
+ is_lts: boolean;
+ is_available: boolean;
+ architecture: string;
+}
+
+export interface JavaCatalog {
+ releases: JavaReleaseInfo[];
+ available_major_versions: number[];
+ lts_versions: number[];
+ cached_at: number;
+}
+
+export interface JavaDownloadProgress {
+ file_name: string;
+ downloaded_bytes: number;
+ total_bytes: number;
+ speed_bytes_per_sec: number;
+ eta_seconds: number;
+ status: string;
+ percentage: number;
+}
+
+export interface PendingJavaDownload {
+ major_version: number;
+ image_type: string;
+ download_url: string;
+ file_name: string;
+ file_size: number;
+ checksum: string | null;
+ install_path: string;
+ created_at: number;
+}
+
+export type JavaDownloadSource = "adoptium" | "mojang" | "azul";
+
+// ==================== Fabric Types ====================
+
+export interface FabricGameVersion {
+ version: string;
+ stable: boolean;
+}
+
+export interface FabricLoaderVersion {
+ separator: string;
+ build: number;
+ maven: string;
+ version: string;
+ stable: boolean;
+}
+
+export interface FabricLoaderEntry {
+ loader: FabricLoaderVersion;
+ intermediary: {
+ maven: string;
+ version: string;
+ stable: boolean;
+ };
+ launcherMeta: {
+ version: number;
+ mainClass: {
+ client: string;
+ server: string;
+ };
+ };
+}
+
+export interface InstalledFabricVersion {
+ id: string;
+ minecraft_version: string;
+ loader_version: string;
+ path: string;
+}
+
+// ==================== Forge Types ====================
+
+export interface ForgeVersion {
+ version: string;
+ minecraft_version: string;
+ recommended: boolean;
+ latest: boolean;
+}
+
+export interface InstalledForgeVersion {
+ id: string;
+ minecraft_version: string;
+ forge_version: string;
+ path: string;
+}
+
+// ==================== Mod Loader Type ====================
+
+export type ModLoaderType = "vanilla" | "fabric" | "forge";
+
+// ==================== Instance Types ====================
+
+export interface Instance {
+ id: string;
+ name: string;
+ game_dir: string;
+ version_id?: string;
+ created_at: number;
+ last_played?: number;
+ icon_path?: string;
+ notes?: string;
+ mod_loader?: string;
+ mod_loader_version?: string;
+ jvm_args_override?: string;
+ memory_override?: MemoryOverride;
+}
+
+export interface MemoryOverride {
+ min: number; // MB
+ max: number; // MB
+}
+
+export interface FileInfo {
+ name: string;
+ path: string;
+ is_directory: boolean;
+ size: number;
+ modified: number;
+}