Registry / utility / ts-rs
library12.0.1rscratesunverified

generate typescript bindings from rust types

# Cargo.toml [dependencies] ts-rs = "12.0.1"
INSTALL
IMPORT
SIG · TS-RS
T
ts-rs
utilityrustv12.0.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

TS
✓ use ts_rs::TS;

Generate TypeScript bindings for a Rust struct

use ts_rs::TS; #[derive(TS)] #[ts(export)] struct User { name: String, age: i32, } fn main() { User::export().unwrap(); }
Debug
Known issues
gotchaRequires the `export` feature to write files; otherwise only generates strings.
fix
Add `features = ["export"]` to the `ts-rs` dependency in Cargo.toml.
affects: >=12.0.0
Upgrade
Version history
12.0.1latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
15 hits · last 30 days
node
14
Amazon
1
Resources
ts-rs — cargo add ts-rs · libregistry