mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-08-29 06:37:12 +02:00
Add a typed platform package to decouple the frontend from Tauri (#539)
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
0068be9ffc
commit
2383f06e71
@@ -1,8 +1,8 @@
|
||||
import { invoke } from "@tauri-apps/api/core";
|
||||
import { platform } from "@yaakapp-internal/platform";
|
||||
import { WebsocketConnection } from "@yaakapp-internal/models";
|
||||
|
||||
export function deleteWebsocketConnections(requestId: string) {
|
||||
return invoke("cmd_ws_delete_connections", {
|
||||
return platform.rpc("cmd_ws_delete_connections", {
|
||||
requestId,
|
||||
});
|
||||
}
|
||||
@@ -16,7 +16,7 @@ export function connectWebsocket({
|
||||
environmentId: string | null;
|
||||
cookieJarId: string | null;
|
||||
}) {
|
||||
return invoke("cmd_ws_connect", {
|
||||
return platform.rpc("cmd_ws_connect", {
|
||||
requestId,
|
||||
environmentId,
|
||||
cookieJarId,
|
||||
@@ -24,7 +24,7 @@ export function connectWebsocket({
|
||||
}
|
||||
|
||||
export function closeWebsocket({ connectionId }: { connectionId: string }) {
|
||||
return invoke("cmd_ws_close", {
|
||||
return platform.rpc("cmd_ws_close", {
|
||||
connectionId,
|
||||
});
|
||||
}
|
||||
@@ -36,7 +36,7 @@ export function sendWebsocket({
|
||||
connectionId: string;
|
||||
environmentId: string | null;
|
||||
}) {
|
||||
return invoke("cmd_ws_send", {
|
||||
return platform.rpc("cmd_ws_send", {
|
||||
connectionId,
|
||||
environmentId,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user