Tyzen ⚡
A lightweight, high-performance tool to generate TypeScript type definitions from Rust structs and enums. Perfect for Tauri apps and full-stack Rust/TypeScript projects.
Features
- 🚀 Lightning Fast: Generates types in milliseconds.
- 📦 Zero Config: Works out of the box with minimal setup.
- 🔌 Tauri Integration: First-class support for Tauri commands.
- 🛠️ Macro-based: Simple
#[derive(Type)]and#[command]attributes. - 🧩 Extensible: Easily supports custom types like
UuidandChrono.
Packages
tyzen: The core crate containing the logic for type generation.tyzen-macro: Procedural macros for deriving types and marking commands.tyzen-tauri: Specialized integration for Tauri applications.
Quick Start
1. Add Dependencies
Add tyzen to your Cargo.toml:
[]
= { = "0.1.6", = "../tyzen/tyzen" }
2. Define Your Types
use Type;
3. Generate TypeScript
Tauri Support
Tyzen provides a seamless experience for Tauri developers. It not only generates TypeScript types but also automatically collects and registers your commands.
1. Mark your commands
2. Register all commands automatically
Forget manual registration. Use tyzen_tauri::handler!() to register all marked commands at once:
default
.invoke_handler // That's it!
.run
.expect;
License
MIT / Apache-2.0