| .github | ||
| examples | ||
| src | ||
| tauri@f9c97b7e5b | ||
| tests | ||
| .gitignore | ||
| .gitmodules | ||
| .nojekyll | ||
| Cargo.lock | ||
| Cargo.toml | ||
| LICENSE_APACHE-2.0 | ||
| LICENSE_MIT | ||
| package.json | ||
| pnpm-lock.yaml | ||
| README.md | ||
| renovate.json5 | ||
| typos.toml | ||
tauri-sys
Raw bindings to the Tauri API
for projects using wasm-bindgen
Installation
This crate is not yet published to crates.io, so you need to use it from git. You also need a global installation of esbuild.
tauri-sys = { git = "https://github.com/JonasKruckenberg/tauri-sys" } // tauri v1 api, main repo
// OR
tauri-sys = { git = "https://github.com/JonasKruckenberg/tauri-sys", branch = "v2" } // tauri v2 api
Usage
use serde::{Deserialize, Serialize};
use tauri_sys::tauri;
#[derive(Serialize, Deserialize)]
struct GreetArgs<'a> {
name: &'a str,
}
fn main() {
wasm_bindgen_futures::spawn_local(async move {
let new_msg: String = tauri::invoke("greet", &GreetArgs { name: &name.get() }).await.unwrap();
println!("{}", new_msg);
});
}
Features
All modules are gated by accordingly named Cargo features. It is recommended you keep this synced with the features enabled in your Tauri Allowlist but no automated tool for this exists (yet).
- all: Enables all modules.
- core: Enables the
coremodule. (~70% implmented) - event: Enables the
eventmodule. - menu: Enables the
menumodule. (~20% implemented) - window: Enables the
windowsmodule. (~20% implemented)
Are we Tauri yet?
These API bindings are not completely on-par with @tauri-apps/api yet, but here is the current status-quo:
appcore(partial implementation)dpieventimagemenu(partial implementation)mockspathtraywebviewwebviewWindowwindow(partial implementation)
The current API also very closely mirrors the JS API even though that might not be the most ergonomic choice, ideas for improving the API with quality-of-life features beyond the regular JS API interface are very welcome.
Examples
The [examples/leptos] crate provides examples of how to use most of the implemented functionality.