OneLauncher-Cracked/apps/onelauncher/desktop/src/api/commands.rs
2025-06-02 19:29:55 +02:00

27 lines
710 B
Rust

use onelauncher_core::error::{DaoError, LauncherResult};
use tauri::Runtime;
#[taurpc::procedures(path = "onelauncher", export_to = "../frontend/src/bindings.gen.ts")]
pub trait OneLauncherApi {
async fn return_error() -> LauncherResult<()>;
async fn open_dev_tools<R: Runtime>(webview_window: tauri::WebviewWindow<R>);
}
#[taurpc::ipc_type]
pub struct OneLauncherApiImpl;
#[taurpc::resolvers]
impl OneLauncherApi for OneLauncherApiImpl {
async fn return_error(self) -> LauncherResult<()> {
let err = DaoError::NotFound.into();
Err(err)
}
async fn open_dev_tools<R: Runtime>(self, webview_window: tauri::WebviewWindow<R>) {
#[cfg(feature = "devtools")]
webview_window.open_devtools();
}
}