A fork of https://github.com/JonasKruckenberg/tauri-sys that builds for my choices of features
Find a file
2024-03-26 14:36:26 +01:00
.github chore(deps): update actions/deploy-pages action to v3 (#39) 2023-12-14 14:02:40 +01:00
examples/test feat: update dependencies 2023-12-14 11:15:03 +01:00
src fix typos 2023-12-14 13:59:28 +01:00
tauri@f9c97b7e5b feat: update dependencies 2023-12-14 11:15:03 +01:00
tests Fixed bug in tests, unwrapping version result. 2024-03-26 14:36:26 +01:00
.gitignore fix typos 2023-12-14 13:59:28 +01:00
.gitmodules initial commit 2022-11-01 15:19:25 +01:00
.nojekyll Create .nojekyll 2022-11-19 13:15:53 +01:00
Cargo.lock chore(deps): update rust crate wasm-bindgen-test to 0.3.41 2024-02-06 21:48:47 +00:00
Cargo.toml chore(deps): update rust crate wasm-bindgen-test to 0.3.41 2024-02-06 21:48:47 +00:00
LICENSE_APACHE-2.0 add correct licenses 2022-11-01 15:26:42 +01:00
LICENSE_MIT add correct licenses 2022-11-01 15:26:42 +01:00
package.json chore(deps): update dependency esbuild to ^0.19.0 (#34) 2023-12-14 14:02:10 +01:00
pnpm-lock.yaml chore(deps): update dependency esbuild to ^0.19.0 (#34) 2023-12-14 14:02:10 +01:00
README.md Implemented fs module (#19) 2023-09-10 09:24:27 +02:00
renovate.json5 Update renovate.json5 2023-12-14 14:07:59 +01:00
typos.toml fix typos 2023-12-14 13:59:28 +01:00

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

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.
  • app: Enables the app module.
  • clipboard: Enables the clipboard module.
  • dialog: Enables the dialog module.
  • event: Enables the event module.
  • fs: Enables the fs module.
  • mocks: Enables the mocks module.
  • tauri: Enables the tauri module.

Are we Tauri yet?

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

  • app
  • cli
  • clipboard
  • dialog
  • event
  • fs
  • global_shortcut
  • http
  • mocks
  • notification
  • os
  • path
  • process
  • shell
  • tauri
  • updater
  • 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.