# Aleph-Alpha/ts-rs

Generate TypeScript bindings from Rust types

Repository: https://github.com/Aleph-Alpha/ts-rs
Canonical: https://ross.abutalabs.com/products/ts-rs
Language: Rust
License: MIT
License Family: permissive
Topics: code-generation, rust, types, rust-to-typescript, binding-generator, bindings, typescript
Last push: 2026-08-11T20:15:07+00:00

## Health v2 (maintenance only)
Score: 79/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 97, release rhythm 44, longevity 100
- inputs: {"age_days": 2087, "days_push": 22, "days_rel": 214, "gap_med": 120.5, "n_releases_24m": 5}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1864, forks 167 (observed 2026-08-28T04:05:46.106311+00:00)

## What it is
ts-rs is a Rust library with a derive macro that generates TypeScript type declarations from Rust structs and enums. It keeps backend and frontend types in sync by exporting bindings during tests, with serde compatibility and multi-file import support.

## Use cases
- generate typescript types from rust structs
- share types between rust backend and typescript frontend
- keep rust and typescript type definitions in sync
- export rust enums as typescript unions
- generate bindings for a wasm project
- generate typescript interfaces compatible with serde

## When to choose
- you build web apps with a Rust backend and TypeScript frontend
- you want types generated automatically from a single source of truth
- you use serde and want bindings to match your serialization
- you need multi-file exports with generated imports

## When to avoid
- your backend is not written in Rust
- you need runtime serialization rather than type declarations
- you want JSON Schema or OpenAPI output instead of TypeScript

## Facets
- artifact type: library
- maturity: stable
- function: serialization, developer-tools
- domain: web-development, developer-tools, apis
- platform: rust, cross-platform
- tags: typescript-bindings, code-generation, derive-macro, serde, wasm

## Member repositories
- Aleph-Alpha/ts-rs (main) score 79

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:05:46.106311+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T03:15:35.682607+00:00, confidence not recorded.
  - readme: https://github.com/Aleph-Alpha/ts-rs (fetched 2026-08-28T04:05:46.106311+00:00, sha db337e1658ab)
  - registry_crates: https://crates.io/api/v1/crates/ts-rs (fetched 2026-08-29T10:54:29.447982+00:00, sha b573b7e87c97)
- Data as of 2026-08-30T08:39:29.467469+00:00.
