import { invoke } from "@tauri-apps/api/core";
import type { Settings } from "@/lib/types";
import { SettingsSchema } from "@/lib/schemas";

export async function getSettings(): Promise<Settings> {
  const result = await invoke<Settings>("get_settings");
  return SettingsSchema.parse(result);
}

export async function updateSettings(settings: Settings): Promise<void> {
  await invoke("update_settings", { settings });
}
