MCPcopy Index your code
hub / github.com/JonasKruckenberg/tauri-sys

github.com/JonasKruckenberg/tauri-sys @v2-0.2.4

Chat with this repo
repository ↗ · DeepWiki ↗ · release v2-0.2.4 ↗ · + Follow
174 symbols 254 edges 18 files 23 documented · 13%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

tauri-sys

<strong>Raw bindings to the <a href="https://tauri.app/v1/api/js/"><code>Tauri API</code></a>
  for projects using <a href="https://github.com/rustwasm/wasm-bindgen"><code>wasm-bindgen</code></a></strong>

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" } // 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 core module. (~70% implemented)
  • event: Enables the event module.
  • menu: Enables the menu module. (~20% implemented)
  • window: Enables the windows module. (~20% implemented)

  • nightly: Enable nightly only features such as tracker calling for invoke for better error reporting.

Are we Tauri yet?

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

  • [x] app
  • [x] core (partial implementation)
  • [x] dpi
  • [x] event
  • [x] image
  • [x] menu (partial implementation)
  • [ ] mocks
  • [ ] path
  • [ ] tray
  • [ ] webview
  • [ ] webviewWindow
  • [x] window (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.

Extension points exported contracts — how you extend this code

Core symbols most depended-on inside this repo

Shape

Function 70
Method 61
Class 35
Enum 7
Interface 1

Languages

Rust86%
TypeScript14%

Modules by API surface

src/window.rs35 symbols
src/menu.rs30 symbols
src/core.rs17 symbols
src/app.rs16 symbols
src/event.rs14 symbols
examples/leptos/src/app.rs12 symbols
src/dpi.rs11 symbols
src/window.js8 symbols
src/event.js7 symbols
tests/web.rs6 symbols
src/app.js6 symbols
src/core.js4 symbols

For agents

$ claude mcp add tauri-sys \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page