Skip to content
 
 

Repository files navigation

tauri-sys

Raw bindings to the Tauri API for projects using wasm-bindgen

Documentation master MIT licensed

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" }

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);
    });
}

Plugins

Some plugins are now separated from the Tauri core. https://github.com/tauri-apps/plugins-workspace

app, event, mocks, path and tauri are still part of the core.

Features

Bindings are behind features. Use all to enable all features or use the name of the plugin as the feature to enable it.

Are we Tauri v2 yet?

These API bindings are not completely on-par with @tauri-apps/api and the rest of the plugins yet, but here is the current status-quo:

  • app
  • cli
  • clipboard
  • dialog
  • event
  • fs
  • global_shortcut
  • http
  • mocks
  • notification
  • os
  • path
  • positioner
  • process
  • shell
  • sql
  • store
  • stronghold
  • tauri
  • upload
  • updater
  • websocket
  • window-state
  • window

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.

About

Bindings to the Tauri API for projects using wasm-bindgen

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages