Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/JonasKruckenberg/tauri-sys
Bindings to the Tauri API for projects using wasm-bindgen
https://github.com/JonasKruckenberg/tauri-sys
rust tauri wasm wasm-bindgen webassembly
Last synced: 3 months ago
JSON representation
Bindings to the Tauri API for projects using wasm-bindgen
- Host: GitHub
- URL: https://github.com/JonasKruckenberg/tauri-sys
- Owner: JonasKruckenberg
- License: apache-2.0
- Created: 2022-11-01T14:19:04.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-08-02T13:31:56.000Z (3 months ago)
- Last Synced: 2024-08-02T15:11:31.196Z (3 months ago)
- Topics: rust, tauri, wasm, wasm-bindgen, webassembly
- Language: Rust
- Homepage:
- Size: 1.86 MB
- Stars: 84
- Watchers: 6
- Forks: 21
- Open Issues: 15
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE_APACHE-2.0
Awesome Lists containing this project
- awesome-yew - tauri-sys - Raw bindings to the Tauri API for projects using wasm-bindgen. (Crates / Wasm)
README
[![Documentation master][docs-badge]][docs-url]
[![MIT licensed][mit-badge]][mit-url][docs-badge]: https://img.shields.io/badge/docs-main-blue
[docs-url]: https://jonaskruckenberg.github.io/tauri-sys/tauri_sys
[mit-badge]: https://img.shields.io/badge/license-MIT-blue.svg
[mit-url]: LICENSE## 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`].
```toml
tauri-sys = { git = "https://github.com/JonasKruckenberg/tauri-sys" } // Tauri v1
// OR
tauri-sys = { git = "https://github.com/JonasKruckenberg/tauri-sys", branch = "v2" } // Tauri v2
```## Usage
```rust
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:
- [x] `app`
- [ ] `cli`
- [x] `clipboard`
- [x] `dialog`
- [x] `event`
- [x] `fs`
- [x] `global_shortcut`
- [ ] `http`
- [x] `mocks`
- [x] `notification`
- [x] `os`
- [x] `path`
- [x] `process`
- [ ] `shell`
- [x] `tauri`
- [ ] `updater`
- [x] `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.
[wasm-bindgen]: https://github.com/rustwasm/wasm-bindgen
[tauri allowlist]: https://tauri.app/v1/api/config#allowlistconfig
[`esbuild`]: https://esbuild.github.io/getting-started/#install-esbuild