import { invoke } from "@tauri-apps/api/tauri"; import { ApiType, CmdType } from "./types"; export async function getProfiles() { return invoke("get_profiles"); } export async function syncProfiles() { return invoke("sync_profiles"); } export async function editProfile(index: number) { return invoke("edit_profile", { index }); } export async function importProfile(url: string) { return invoke("import_profile", { url, withProxy: true }); } export async function updateProfile(index: number, withProxy: boolean) { return invoke("update_profile", { index, withProxy }); } export async function deleteProfile(index: number) { return invoke("delete_profile", { index }); } export async function patchProfile( index: number, profile: CmdType.ProfileItem ) { return invoke("patch_profile", { index, profile }); } export async function selectProfile(index: number) { return invoke("select_profile", { index }); } export async function restartSidecar() { return invoke("restart_sidecar"); } export async function getClashInfo() { return invoke("get_clash_info"); } export async function patchClashConfig(payload: Partial) { return invoke("patch_clash_config", { payload }); } export async function getVergeConfig() { return invoke("get_verge_config"); } export async function patchVergeConfig(payload: CmdType.VergeConfig) { return invoke("patch_verge_config", { payload }); } export async function getSystemProxy() { return invoke("get_sys_proxy"); }