import { invoke } from "@tauri-apps/api/core"; import type { Settings } from "@/types"; import type { AppType } from "./types"; export const settingsApi = { async get(): Promise { return await invoke("get_settings"); }, async save(settings: Settings): Promise { return await invoke("save_settings", { settings }); }, async restart(): Promise { return await invoke("restart_app"); }, async checkUpdates(): Promise { await invoke("check_for_updates"); }, async isPortable(): Promise { return await invoke("is_portable_mode"); }, async getConfigDir(appType: AppType): Promise { return await invoke("get_config_dir", { app_type: appType, app: appType, }); }, async openConfigFolder(appType: AppType): Promise { await invoke("open_config_folder", { app_type: appType, app: appType }); }, async selectConfigDirectory(defaultPath?: string): Promise { return await invoke("pick_directory", { default_path: defaultPath }); }, async getClaudeCodeConfigPath(): Promise { return await invoke("get_claude_code_config_path"); }, async getAppConfigPath(): Promise { return await invoke("get_app_config_path"); }, async openAppConfigFolder(): Promise { await invoke("open_app_config_folder"); }, };