import { invoke } from "@tauri-apps/api/core"; import type { RpcSchema } from "../../crates-proxy/yaak-proxy-lib/bindings/gen_rpc"; type Req = RpcSchema[K][0]; type Res = RpcSchema[K][1]; export async function rpc( cmd: K, payload: Req, ): Promise> { return invoke("rpc", { cmd, payload }) as Promise>; }