refactor: remove deprecated tauri-api.ts file

- Delete src/lib/tauri-api.ts as event listener has been migrated
- Event listening now uses providersApi.onSwitched from lib/api/providers.ts
- All references to tauriEvents have been removed
- Type checking passes successfully

This completes the API layer cleanup from the refactoring plan (Phase 4).
This commit is contained in:
Jason
2025-10-24 23:47:53 +08:00
parent 28900b8920
commit 7325edff35

View File

@@ -1,17 +0,0 @@
import { listen, type UnlistenFn } from "@tauri-apps/api/event";
import type { AppType } from "@/lib/api";
export interface ProviderSwitchedPayload {
appType: AppType;
providerId: string;
}
export const tauriEvents = {
onProviderSwitched: async (
handler: (payload: ProviderSwitchedPayload) => void,
): Promise<UnlistenFn> => {
return await listen("provider-switched", (event) => {
handler(event.payload as ProviderSwitchedPayload);
});
},
};