import { invoke } from "@tauri-apps/api/core"; interface ProtonPaths { data: Ref<{ autodiscovered: ProtonPath[]; custom: ProtonPath[]; default?: string; }>; refresh: () => Promise; } const protonPaths = useState( "proton_paths", undefined, ); export const useProtonPaths = async (): Promise => { const refresh = async () => { protonPaths.value = await invoke("fetch_proton_paths"); }; if (protonPaths.value) return { data: protonPaths, refresh, }; await refresh(); return { data: protonPaths, refresh, }; };